:root {
            font-family: system-ui, -apple-system, Segoe UI, sans-serif;
            color: #eaf2ff;
            background: #0b1425
        }

        * {
            box-sizing: border-box
        }

        body {
            margin: 0
        }

        main {
            max-width: 1150px;
            margin: auto;
            padding: 20px
        }

        h1 {
            margin: 0 0 6px;
            font-size: clamp(26px, 4vw, 40px)
        }

        p {
            color: #b9c8dd
        }

        .panel {
            background: #14233b;
            border: 1px solid #2b4162;
            border-radius: 18px;
            padding: 20px;
            margin: 14px 0
        }

        .row {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
            justify-content: space-between
        }

        .actions-row {
            justify-content: flex-start
        }

        .leaderboard-section {
            margin-top: 24px;
            padding-top: 8px;
            border-top: 1px solid #354b67
        }

        .leaderboard-table-wrap {
            overflow-x: auto
        }

        .grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px
        }

        .player-field {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 64px;
            gap: 10px;
            align-items: end
        }

        .player-field label {
            display: block;
            font-weight: 700
        }

        .player-field input[type="text"] {
            margin-top: 6px
        }

        .color-picker {
            position: relative
        }

        .color-swatch {
            width: 30px;
            height: 30px;
            padding: 0;
            border: 3px solid transparent;
            border-radius: 6px;
            cursor: pointer
        }

        .color-picker-toggle {
            display: block;
            width: 48px;
            height: 48px;
            margin-top: 6px;
            padding: 6px;
            background: #0b172a;
            border: 1px solid #4b6384
        }

        .color-picker-toggle .color-swatch {
            display: block;
            width: 100%;
            height: 100%;
            pointer-events: none
        }

        .color-palette {
            position: absolute;
            z-index: 5;
            top: calc(100% + 6px);
            right: 0;
            display: grid;
            grid-template-columns: repeat(4, 36px);
            gap: 6px;
            padding: 10px;
            background: #0b172a;
            border: 1px solid #4b6384;
            border-radius: 10px;
            box-shadow: 0 8px 20px #0008
        }

        .color-swatch[aria-pressed="true"] {
            border-color: white;
            box-shadow: 0 0 0 2px #14233b, 0 0 0 4px #fff
        }

        .color-swatch:focus-visible {
            outline: 3px solid white;
            outline-offset: 3px
        }

        input {
            width: 100%;
            background: #0b172a;
            color: white;
            border: 1px solid #4b6384;
            border-radius: 10px;
            padding: 13px;
            font-size: 16px
        }

        .setup-select {
            margin: 8px 0 16px;
            padding: 12px;
            background: #0b172a;
            color: white;
            border: 1px solid #4b6384;
            border-radius: 10px;
            font-size: 16px
        }

        button {
            background: #60d5d0;
            color: #08202c;
            border: 0;
            border-radius: 11px;
            padding: 13px 19px;
            font-size: 16px;
            font-weight: 750;
            cursor: pointer
        }

        button:disabled {
            opacity: .45;
            cursor: not-allowed
        }

        .secondary {
            background: #273b59;
            color: white
        }

        .secondary-link,
        .button-link {
            display: inline-block;
            padding: 10px 14px;
            border-radius: 10px;
            background: #273b59;
            color: white;
            font-weight: 700;
            text-decoration: none
        }

        .secondary-link:hover,
        .button-link:hover {
            background: #354d70
        }

        .secondary-link:focus-visible,
        .button-link:focus-visible {
            outline: 3px solid white;
            outline-offset: 3px
        }

        input + label,
        .panel > label {
            display: block;
            margin-top: 16px;
            font-weight: 700
        }

        #joinCode {
            text-transform: uppercase;
            letter-spacing: 3px
        }

        #lobbyPlayers {
            display: grid;
            gap: 8px;
            padding-left: 22px;
            color: #b9c8dd
        }

        .hidden {
            display: none !important
        }

        .eyebrow {
            color: #83dfda;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-weight: 700
        }

        .map-prompt {
            margin-top: 18px
        }

        .big {
            font-size: clamp(25px, 4vw, 42px);
            font-weight: 800;
            margin: 10px 0
        }

        .muted {
            color: #b9c8dd
        }

        .map-wrap {
            position: relative;
            background: #c9e5f0;
            border-radius: 14px;
            overflow: hidden;
            border: 2px solid #415e76;
            max-width: 850px;
            margin: 15px auto
        }

        .map-wrap svg {
            display: block;
            width: 100%;
            height: auto;
            cursor: crosshair
        }

        .map-wrap svg.disabled {
            cursor: default
        }

        .badge {
            display: inline-block;
            padding: 6px 11px;
            background: #2c4565;
            border-radius: 30px;
            font-weight: 700
        }

        .stop-game-button {
            align-self: flex-start;
            min-width: 190px;
            min-height: 58px;
            background: #c62828;
            color: white;
            border: 2px solid #ffcdd2;
            font-size: 19px;
            box-shadow: 0 4px 14px #0008
        }

        .stop-game-button:hover {
            background: #a71919
        }

        .turn-badge {
            border: 2px solid var(--player-color);
            color: var(--player-color);
            font-size: 18px;
            font-weight: 850;
            text-shadow: 0 1px 3px #000
        }

        .score {
            font-variant-numeric: tabular-nums
        }

        table {
            border-collapse: collapse;
            width: 100%
        }

        td,
        th {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #354b67
        }

        th {
            color: #9ddbdc
        }

        .map-hint {
            font-size: 13px;
            text-align: center
        }

        .legend {
            display: flex;
            gap: 15px;
            flex-wrap: wrap
        }

        .dot {
            display: inline-block;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            vertical-align: middle;
            margin-right: 5px
        }

        .notice {
            padding: 10px 14px;
            border-radius: 10px;
            background: #213a51
        }

        .map-label {
            font-size: 10px;
            fill: #41627b;
            pointer-events: none
        }

        .city-label {
            font-size: 12px;
            fill: #102139;
            stroke: #f1fcff;
            stroke-width: 3;
            paint-order: stroke;
            pointer-events: none;
            font-weight: bold
        }

        @media(max-width:600px) {
            main {
                padding: 12px
            }

            .stop-game-button {
                top: max(10px, env(safe-area-inset-top));
                right: max(10px, env(safe-area-inset-right));
                min-width: 130px;
                min-height: 50px;
                padding: 10px;
                font-size: 14px
            }

            .panel {
                padding: 14px
            }

            .grid {
                grid-template-columns: 1fr
            }
        }
