 * {
            box-sizing: border-box;
            margin: 0;
            padding: 0
        }

        body {
            background: #1a1a2e;
            color: #eee;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            min-height: 100vh
        }

        body.upload-mode {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: center;
            overflow-x: hidden;
            overflow-y: auto
        }

        body.game-mode {
            overflow: hidden
        }

        #upload-screen {
            text-align: center;
            padding: 2em 1.25em;
            max-width: 600px;
            width: min(600px, 100%);
            min-height: 100vh;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            justify-content: center
        }

        #upload-screen h1 {
            font-size: 1.8em;
            margin-bottom: .35em;
            color: #4ecca3
        }

        #upload-screen h1 a {
            color: inherit;
            text-decoration: none
        }

        #upload-screen h1 a:hover {
            text-decoration: underline
        }

        #project-links {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: .9em;
            font-size: .9em;
            margin-bottom: .75em
        }

        #project-links a {
            color: #4ecca3;
            text-decoration: underline
        }

        #upload-screen p {
            margin: .5em 0;
            line-height: 1.5;
            color: #bbb
        }

        #upload-screen .note {
            font-size: .85em;
            color: #888;
            margin-top: 1em
        }

        #drop-zone {
            border: 2px dashed #4ecca3;
            border-radius: 12px;
            padding: 2em;
            margin: 1.5em 0;
            transition: background .3s, border-color .3s, transform .2s
        }

        #drop-zone.dragover,
        #drop-zone:hover {
            background: rgba(78, 204, 163, .1)
        }

        #drop-zone.ready {
            border-style: solid;
            border-color: #4ecca3;
            background: rgba(78, 204, 163, .08);
            cursor: pointer
        }

        #drop-zone.ready:hover {
            background: rgba(78, 204, 163, .18);
            transform: translateY(-1px)
        }

        #drop-zone input {
            display: none
        }

        #drop-zone-title {
            margin: 0 0 .4em;
            color: #eee
        }

        #drop-zone-subtitle {
            font-size: .85em;
            color: #888;
            margin: 0 0 1.2em
        }

        #drop-zone.loading #drop-zone-subtitle,
        #drop-zone.loading #drop-zone-title,
        #drop-zone.loading #resource-split-actions,
        #drop-zone.ready #drop-zone-subtitle,
        #drop-zone.ready #drop-zone-title,
        #drop-zone.ready #resource-split-actions {
            display: none
        }

        #drop-zone-ready-title {
            display: none;
            font-size: 1.35em;
            font-weight: 700;
            color: #4ecca3;
            margin: .3em 0
        }

        #drop-zone-ready-subtitle {
            display: none;
            font-size: .85em;
            color: #bbb;
            margin: .2em 0 .6em
        }

        #drop-zone-reselect {
            display: none;
            font-size: .8em;
            color: #888;
            margin-top: .5em
        }

        #drop-zone-reselect a {
            color: #4ecca3;
            text-decoration: underline
        }

        #drop-zone.ready #drop-zone-ready-subtitle,
        #drop-zone.ready #drop-zone-ready-title,
        #drop-zone.ready #drop-zone-reselect,
        #drop-zone.ready #file-list {
            display: block
        }

        #drop-zone.ready #file-list div {
            display: inline-block
        }

        #drop-zone.loading #loading-drop-zone {
            display: block
        }

        #drop-zone.loading #drop-zone-ready-subtitle,
        #drop-zone.loading #drop-zone-ready-title,
        #drop-zone.loading #drop-zone-reselect,
        #drop-zone.loading #file-list {
            display: none
        }

        #resource-split-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: .9em
        }

        .resource-action {
            appearance: none;
            background: rgba(43, 43, 64, .85);
            color: #eee;
            border: 1px solid rgba(78, 204, 163, .55);
            border-radius: 10px;
            padding: 1.15em 1em;
            cursor: pointer;
            text-align: center;
            transition: transform .18s, background .18s, border-color .18s
        }

        .resource-action:hover {
            background: rgba(78, 204, 163, .12);
            border-color: #4ecca3;
            transform: translateY(-1px)
        }

        .resource-action strong {
            display: block;
            font-size: 1.02em;
            color: #4ecca3;
            margin-bottom: .35em
        }

        .resource-action span {
            display: block;
            font-size: .85em;
            line-height: 1.4;
            color: #bbb
        }

        #file-list {
            text-align: center;
            margin: .5em 0 0;
            font-size: .85em;
            display: none
        }

        #file-list.has-items {
            display: block
        }

        #file-list div {
            padding: 2px 0;
            color: #aaa;
            display: inline-block;
            margin: 0 .5em
        }

        #file-list div.ok {
            color: #4ecca3
        }

        #file-list div.missing {
            color: #e74c3c
        }

        #loading-drop-zone {
            display: none;
            margin-top: .6em;
            color: #4ecca3;
            font-size: .9em
        }

        #loading-drop-zone.has-error {
            display: block;
            color: #e74c3c
        }

        #upload-save-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: .6em;
            margin-top: .75em
        }

        #upload-save-actions button {
            background: #2b2b40;
            color: #4ecca3;
            border: 1px solid #4ecca3;
            border-radius: 8px;
            padding: .6em 1em;
            cursor: pointer
        }

        #upload-save-actions button:hover {
            background: rgba(78, 204, 163, .12)
        }

        #upload-save-actions button:disabled {
            opacity: .4;
            cursor: default
        }

        #canvas-container {
            display: none;
            width: 100vw;
            height: 100vh;
            position: fixed;
            inset: 0;
            justify-content: center;
            align-items: center;
            background: #000;
            overflow: hidden
        }

        #canvas-container:fullscreen {
            width: 100%;
            height: 100%
        }

        canvas#canvas {
            display: block;
            background: #000;
            outline: 0
        }

        #pvz-soft-keyboard {
            position: fixed;
            top: 0;
            left: 0;
            width: 1px;
            height: 1px;
            padding: 0;
            border: 0;
            opacity: 0;
            resize: none;
            pointer-events: none;
            font-size: 16px
        }

        #save-toolbar {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 6px;
            z-index: 10;
            flex-wrap: wrap;
            justify-content: flex-end;
            max-width: calc(100vw - 16px)
        }

        #save-toolbar button {
            background: rgba(30, 30, 50, .75);
            color: #4ecca3;
            border: 1px solid #4ecca3;
            border-radius: 6px;
            padding: .35em .8em;
            font-size: .85em;
            cursor: pointer;
            backdrop-filter: blur(4px);
            transition: background .2s
        }

        #save-toolbar button:hover {
            background: rgba(78, 204, 163, .2)
        }

        #save-toolbar button:disabled {
            opacity: .4;
            cursor: default
        }

        @media (max-height:760px),
        (max-width:640px) {
            body.upload-mode {
                justify-content: flex-start
            }

            #upload-screen {
                padding: 1.25em 1em 2em;
                justify-content: flex-start
            }

            #drop-zone {
                padding: 1.25em;
                margin: 1em 0
            }

            #resource-split-actions {
                grid-template-columns: 1fr
            }
        }