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

body {
    background: #000;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#canvas-background { z-index: 1; }
#canvas-terrain { z-index: 2; }
#canvas-entities { z-index: 3; }
#canvas-effects { z-index: 4; }
#canvas-ui { z-index: 5; }

#ingame-hud {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

#menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#menu-overlay.hidden {
    display: none;
    pointer-events: none;
}

#menu-screen,
#setup-screen,
#gameover-screen,
#auth-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Menu styling */
.menu-title {
    font-size: 72px;
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 20px rgba(255, 100, 0, 0.8),
        0 0 40px rgba(255, 50, 0, 0.6),
        3px 3px 0 #000;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.menu-subtitle {
    font-size: 28px;
    color: #ffa500;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 50px;
}

.menu-btn {
    display: block;
    width: 280px;
    padding: 15px 30px;
    margin: 8px 0;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #4a7c2e 0%, #2d5016 100%);
    border: 3px solid #6aaa3a;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: all 0.15s ease;
}

.menu-btn:hover {
    background: linear-gradient(180deg, #5a9c3e 0%, #3d6026 100%);
    border-color: #8aca5a;
    transform: scale(1.05);
}

.menu-btn:active {
    transform: scale(0.98);
}

/* Setup screen */
.setup-root {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse at 18% 8%, rgba(40, 90, 160, 0.28), transparent 48%),
        radial-gradient(ellipse at 82% 88%, rgba(200, 40, 30, 0.22), transparent 46%),
        repeating-linear-gradient(115deg, transparent 0 18px, rgba(0,0,0,0.08) 18px 22px),
        #12151f;
}

.setup-board {
    position: relative;
    z-index: 1;
    width: min(980px, 96vw);
    height: min(680px, 96vh);
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 12px;
    padding: 16px 20px 14px;
    background:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,0.04) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 70%, rgba(255,255,255,0.03) 0 3px, transparent 4px),
        rgba(10, 14, 24, 0.82);
    border: 2px solid rgba(140, 190, 230, 0.28);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
    animation: lobbyIn 0.4s ease;
    min-height: 0;
}

.setup-title {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 800;
    font-style: italic;
    color: #fff;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 3px 0 #000, 0 0 18px rgba(80, 140, 220, 0.35);
    line-height: 1;
}

.setup-mid {
    display: grid;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 14px;
    min-height: 0;
}

.setup-panel {
    background: rgba(6, 10, 18, 0.72);
    border: 1px solid rgba(150, 190, 230, 0.22);
    border-radius: 10px;
    padding: 12px 14px 14px;
    min-height: 0;
}

.setup-panel-title {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 2px 0 #000;
    line-height: 1;
    margin-bottom: 4px;
}

.setup-panel-sub {
    color: rgba(255,255,255,0.78);
    font-size: 13px;
    margin-bottom: 10px;
}

.setup-teams {
    overflow: auto;
}

.setup-types {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setup-type,
.setup-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: #fff;
}

.setup-type input,
.setup-opt-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.setup-check-ui {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 3px;
    border: 2px solid rgba(220, 230, 245, 0.7);
    background: rgba(8, 12, 20, 0.9);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    position: relative;
}

.setup-type input:checked + .setup-check-ui,
.setup-opt-input:checked + .setup-check-ui {
    background: #0d1420;
    border-color: #fff;
}

.setup-type input:checked + .setup-check-ui::after,
.setup-opt-input:checked + .setup-check-ui::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.setup-type-label {
    font-size: 16px;
    font-weight: 600;
}

.setup-options {
    overflow: auto;
}

.setup-pro-note {
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    font-style: italic;
    margin: 0 0 8px;
}

.setup-opt {
    align-items: flex-start;
    padding: 5px 0;
}

.setup-opt-ico,
.setup-opt-badge {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(20, 32, 52, 0.9);
    border: 1px solid rgba(160, 200, 240, 0.25);
    color: #dcecff;
}

.setup-opt-ico .btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.setup-opt-badge {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.setup-opt-badge.is-pro {
    background: linear-gradient(180deg, #ff6b5a, #c0392b);
    border-color: #7a1510;
    color: #fff;
    font-size: 11px;
}

.setup-opt-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 1px;
}

.setup-opt-text b {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.15;
}

.setup-opt-text small {
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    font-weight: 500;
}

.setup-pro-block {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 8px;
    margin-top: 4px;
}

.setup-pro-rail {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0c12;
    color: rgba(255,255,255,0.72);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    border-radius: 4px;
    padding: 8px 0;
}

.setup-terrain {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.setup-map-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 96px;
    gap: 10px;
    align-items: center;
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
}

.setup-map-arrow {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 3px solid #08356e;
    background: linear-gradient(180deg, #7ec8ff 0%, #3b8dff 42%, #1d6fd4 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 3px 0 #072a58;
}

.setup-map-arrow:hover { filter: brightness(1.08); }
.setup-map-arrow:active { transform: translateY(2px); box-shadow: 0 1px 0 #072a58; }
.setup-map-arrow .btn-icon {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.setup-map-name {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 8, 16, 0.88);
    border: 1px solid rgba(150, 190, 230, 0.22);
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 2px 0 #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 12px;
}

.setup-map-thumb {
    width: 96px;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(180, 210, 240, 0.35);
    background: #1a2438;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.setup-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 2px;
}

.setup-nav .lobby-btn {
    min-width: 140px;
    height: 48px;
}

.setup-go {
    min-width: 168px !important;
    height: 54px !important;
    font-size: 18px !important;
}

@media (max-width: 820px) {
    .setup-board {
        height: auto;
        max-height: 96vh;
        overflow: auto;
        grid-template-rows: auto auto auto auto;
    }
    .setup-mid {
        grid-template-columns: 1fr;
    }
    .setup-map-row {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        grid-template-rows: auto auto;
    }
    .setup-map-thumb {
        grid-column: 1 / -1;
        justify-self: center;
        width: 160px;
        height: 100px;
    }
}

/* Weapon panel */
.weapon-panel {
    position: absolute;
    z-index: 20;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #666;
    border-radius: 8px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(7, 48px);
    gap: 4px;
}

.weapon-panel.hidden {
    display: none;
}

.weapon-slot {
    width: 48px;
    height: 48px;
    background: #222;
    border: 2px solid #444;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 10px;
    color: #aaa;
}

.weapon-slot:hover {
    border-color: #6aaa3a;
    background: #333;
}

.weapon-slot.selected {
    border-color: #ffcc00;
    background: #443300;
}

.weapon-slot .ammo {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 9px;
    color: #ff0;
}

/* Game over */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

#gameover-screen {
    background: rgba(8, 4, 0, 0.58);
    animation: modalDimIn 0.22s ease forwards;
}

.go-confetti {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.go-card {
    position: relative;
    z-index: 1;
    width: min(480px, 92vw);
    padding: 22px 22px 18px;
    border-radius: 18px;
    text-align: center;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    color: #fff8e8;
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,0.2) 0 3px, transparent 4px),
        linear-gradient(180deg, #7a3a1c 0%, #4a1e10 55%, #2c1208 100%);
    border: 3px solid #7a1510;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.22),
        0 8px 0 #4a0e0a,
        0 18px 32px rgba(0,0,0,0.45);
}

.go-card.go-win {
    border-color: #145a18;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.22),
        0 8px 0 #0e4a14,
        0 18px 32px rgba(0,0,0,0.45);
}

.go-card.go-lose {
    border-color: #7a1510;
}

.go-card.go-draw {
    border-color: #8a6a00;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.22),
        0 8px 0 #6a5000,
        0 18px 32px rgba(0,0,0,0.45);
}

.go-kicker {
    display: inline-block;
    margin-bottom: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.35);
    color: #ffe56a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 0 1px 0 #000;
}

.go-title {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 42px;
    font-weight: 800;
    font-style: italic;
    line-height: 1;
    color: #ffe56a;
    text-shadow: 0 3px 0 #000, 0 0 18px rgba(245, 208, 0, 0.35);
    animation: bounceIn 0.55s ease-out;
}

.go-card.go-win .go-title { color: #9aee86; text-shadow: 0 3px 0 #000, 0 0 18px rgba(60, 181, 74, 0.45); }
.go-card.go-lose .go-title { color: #ff8a7a; text-shadow: 0 3px 0 #000, 0 0 18px rgba(192, 57, 43, 0.45); }

.go-sub {
    margin: 6px 0 14px;
    color: #ffe0c0;
    font-weight: 700;
    text-shadow: 0 1px 0 #000;
}

.go-teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    text-align: left;
}

.go-team {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 42%, #120808) 0%, #120808 78%);
    border: 2px solid color-mix(in srgb, var(--ink) 50%, #2a1410);
}

.go-team.is-winner {
    box-shadow: inset 0 0 0 2px rgba(245, 208, 0, 0.35);
}

.go-team .tomato-char.sm {
    width: 42px;
    height: auto;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.6));
}

.go-team-text {
    min-width: 0;
    flex: 1;
}

.go-team-text b {
    display: block;
    color: #fff;
    font-size: 15px;
    text-shadow: 0 1px 0 #000;
}

.go-team-text em {
    font-style: normal;
    color: #ffe56a;
    font-size: 11px;
}

.go-team-text span {
    display: block;
    color: #ffe0c0;
    font-size: 12px;
    font-weight: 700;
}

.go-pills {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.go-pills i {
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    color: #fff8e8;
    background: rgba(0,0,0,0.35);
    border-radius: 999px;
    padding: 2px 7px;
}

.go-pills i.is-gold {
    background: #f5d000;
    color: #3a2808;
}

.go-actions {
    display: grid;
    gap: 8px;
}

.go-actions .lobby-btn {
    width: 100%;
    height: 46px;
}

.go-rematch {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.go-rematch-title {
    color: #ffe56a;
    font-weight: 800;
    text-shadow: 0 1px 0 #000;
    min-height: 22px;
}

.go-ready-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.go-ready {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(8, 4, 4, 0.45);
    border: 2px solid rgba(230, 140, 120, 0.22);
}

.go-ready.is-wait {
    animation: goWaitPulse 1.1s ease-in-out infinite;
}

.go-ready.is-on {
    border-color: #145a18;
    background: rgba(20, 90, 24, 0.28);
}

.go-ready .tomato-char.sm {
    width: 36px;
    height: auto;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.55));
}

.go-ready-text {
    flex: 1;
    min-width: 0;
}

.go-ready-text b {
    display: block;
    color: #fff;
    text-shadow: 0 1px 0 #000;
}

.go-ready-text em {
    font-style: normal;
    color: #ffe56a;
    font-size: 11px;
}

.go-ready-text span {
    font-size: 12px;
    font-weight: 800;
    color: #ffe0c0;
}

.go-ready.is-on .go-ready-text span { color: #9aee86; }
.go-ready.is-wait .go-ready-text span { color: #ffe56a; }

.go-ready-mark {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffe56a;
}

.go-ready.is-on .go-ready-mark { color: #9aee86; }

.go-ready-mark .btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@keyframes goWaitPulse {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-2px); opacity: 0.78; }
}

.go-rematch .lobby-btn {
    width: 100%;
    height: 42px;
    margin-top: 4px;
}

/* Shared pixel panel leftover for older screens */
.px-panel {
    background: #3a3a3a;
    border: 4px solid #111;
    box-shadow:
        inset 0 0 0 2px #5e5e5e,
        6px 6px 0 #000;
    padding: 22px 24px;
    image-rendering: pixelated;
    position: relative;
}

.px-panel::before,
.px-panel::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #222;
    box-shadow: inset 0 0 0 2px #111, 0 0 0 1px #777;
}

.px-panel::before { top: 6px; left: 6px; }
.px-panel::after { top: 6px; right: 6px; }

.px-panel-title {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 12px;
    color: #fff;
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 2px 2px 0 #000;
}

.px-input {
    width: 100%;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    color: #fff;
    background: #1a1a1a;
    border: 3px solid #111;
    box-shadow: inset 2px 2px 0 #000;
    padding: 10px 8px;
    outline: none;
    border-radius: 0;
    user-select: text;
    -webkit-user-select: text;
    pointer-events: auto;
}

.px-input:focus {
    border-color: #eee;
}

.px-btn {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 11px;
    color: #fff;
    background: #2a2a2a;
    border: 4px solid #111;
    box-shadow: inset 0 0 0 2px #555, 4px 4px 0 #000;
    padding: 12px 16px;
    cursor: pointer;
    image-rendering: pixelated;
    text-shadow: 2px 2px 0 #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.px-btn:hover {
    background: #4a4a4a;
    color: #fff;
}

.px-btn:active {
    transform: translate(2px, 2px);
    box-shadow: inset 0 0 0 2px #555, 2px 2px 0 #000;
}

.px-btn-wide {
    width: 100%;
    margin-top: 10px;
}

.px-btn-ghost {
    background: #1f1f1f;
    color: #bbb;
    font-size: 8px;
}

.px-error {
    min-height: 16px;
    margin-top: 8px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 8px;
    color: #e74c3c;
    line-height: 1.5;
}

/* Title / login splash — Bad Tomatoes */
.auth-splash {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(200, 40, 30, 0.28), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(20, 80, 30, 0.4), transparent 45%),
        repeating-linear-gradient(115deg, transparent 0 18px, rgba(0,0,0,0.08) 18px 22px),
        #1a0808;
}

.auth-splash::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 12% 30%, rgba(180, 210, 255, 0.12) 0 2px, transparent 3px),
        radial-gradient(circle at 70% 18%, rgba(255,255,255,0.08) 0 40px, transparent 70px),
        radial-gradient(circle at 30% 78%, rgba(0,0,0,0.35) 0 80px, transparent 140px);
    pointer-events: none;
}

.splash-version {
    position: absolute;
    top: 12px;
    right: 16px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    z-index: 2;
}

.splash-board {
    position: relative;
    overflow: hidden;
    width: min(880px, 94vw);
    background:
        radial-gradient(circle at 8% 12%, rgba(255, 180, 120, 0.1) 0 60px, transparent 120px),
        radial-gradient(circle at 92% 88%, rgba(180, 30, 20, 0.14) 0 80px, transparent 160px),
        radial-gradient(circle at 12% 18%, rgba(255,255,255,0.05) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 70%, rgba(255,255,255,0.04) 0 3px, transparent 4px),
        repeating-linear-gradient(115deg, transparent 0 18px, rgba(0,0,0,0.05) 18px 20px),
        repeating-linear-gradient(0deg, transparent 0 5px, rgba(0,0,0,0.03) 5px 6px),
        linear-gradient(160deg, rgba(52, 14, 12, 0.94) 0%, rgba(24, 6, 6, 0.9) 50%, rgba(36, 10, 8, 0.92) 100%);
    border: 2px solid rgba(230, 140, 120, 0.28);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.55),
        inset 0 0 70px rgba(0,0,0,0.28),
        inset 0 1px 0 rgba(255, 200, 180, 0.1);
    padding: 18px 22px 22px;
    z-index: 1;
    border-radius: 16px;
}

.splash-board::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    mix-blend-mode: soft-light;
}

.splash-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.splash-hero {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 18px;
}

.splash-logo-wrap {
    position: relative;
    display: inline-block;
    padding: 28px 52px 16px;
    overflow: hidden;
    isolation: isolate;
}

.splash-cinema {
    position: absolute;
    inset: -40% -30%;
    z-index: 0;
    pointer-events: none;
}

.splash-cinema-rays {
    position: absolute;
    inset: -20%;
    background: repeating-conic-gradient(
        from 0deg at 50% 50%,
        rgba(255, 210, 140, 0) 0deg 14deg,
        rgba(255, 90, 40, 0.16) 15deg 17deg,
        rgba(255, 240, 200, 0.08) 18deg 20deg,
        transparent 21deg 36deg
    );
    animation: cinemaSpin 22s linear infinite;
}

.splash-cinema-spot {
    position: absolute;
    inset: 8% 12%;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 220, 160, 0.45) 0 18%, rgba(255, 80, 40, 0.18) 38%, transparent 68%);
    animation: cinemaPulse 3.4s ease-in-out infinite;
}

.splash-cinema-sweep {
    position: absolute;
    inset: -30%;
    background: conic-gradient(
        from 200deg,
        transparent 0 68%,
        rgba(255, 255, 255, 0.28) 76%,
        transparent 84%
    );
    animation: cinemaSweep 6s ease-in-out infinite;
}

.splash-cinema-flare {
    position: absolute;
    top: 12%;
    left: -30%;
    width: 28%;
    height: 76%;
    background: linear-gradient(90deg, transparent, rgba(255, 245, 210, 0.55), transparent);
    filter: blur(8px);
    mix-blend-mode: screen;
    animation: cinemaFlare 4.8s ease-in-out infinite;
}

.splash-splat {
    position: absolute;
    inset: 10px 18px 18px;
    background:
        radial-gradient(ellipse at 50% 50%, #e74c3c 0 42%, transparent 58%),
        radial-gradient(circle at 18% 40%, #ff6b5a 0 18%, transparent 32%),
        radial-gradient(circle at 82% 55%, #c0392b 0 16%, transparent 30%);
    filter: contrast(1.15) brightness(0.92);
    z-index: 0;
    transform: rotate(-3deg);
}

.splash-logo {
    position: relative;
    z-index: 1;
    font-family: Impact, Haettenschweiler, 'Arial Black', sans-serif;
    font-size: clamp(32px, 6.2vw, 58px);
    letter-spacing: 2px;
    color: #fff;
    -webkit-text-stroke: 4px #111;
    paint-order: stroke fill;
    text-shadow: 4px 4px 0 #000, 0 0 18px rgba(255, 90, 40, 0.55);
    line-height: 1;
    animation: titleCardGlow 3.2s ease-in-out infinite;
}

.splash-online {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 5px;
    color: #ffd56a;
    text-shadow: 2px 2px 0 #000, 0 0 12px rgba(255, 190, 60, 0.55);
    animation: betaShimmer 2.8s ease-in-out infinite;
}

.splash-mascot-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 6px auto 0;
    min-height: 160px;
}

.splash-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 88px;
    flex-shrink: 0;
}

.tomato-char.splash-float {
    width: 64px;
    height: auto;
    margin: 0;
    animation: tomatoBreathe 4s ease-in-out infinite;
    transform-origin: center center;
}

.splash-side-left .tomato-char:nth-child(1) { animation-duration: 3.6s; }
.splash-side-left .tomato-char:nth-child(2) { animation-duration: 4.4s; animation-delay: 0.9s; }
.splash-side-right .tomato-char:nth-child(1) { animation-duration: 3.9s; animation-delay: 0.4s; }
.splash-side-right .tomato-char:nth-child(2) { animation-duration: 4.8s; animation-delay: 1.3s; }

.splash-mascot {
    display: flex;
    justify-content: center;
    margin: 0;
}

.splash-mascot .tomato-char.lg {
    width: 148px;
    height: auto;
}

.splash-eggs {
    display: none;
}

@keyframes cinemaSpin {
    to { transform: rotate(360deg); }
}

@keyframes cinemaPulse {
    0%, 100% { opacity: 0.7; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes cinemaSweep {
    0%, 100% { transform: rotate(-22deg); }
    50% { transform: rotate(26deg); }
}

@keyframes cinemaFlare {
    0% { transform: translateX(0) skewX(-18deg); opacity: 0; }
    18% { opacity: 0.9; }
    100% { transform: translateX(420%) skewX(-18deg); opacity: 0; }
}

@keyframes titleCardGlow {
    0%, 100% { text-shadow: 4px 4px 0 #000, 0 0 12px rgba(255, 80, 40, 0.4); }
    50% { text-shadow: 4px 4px 0 #000, 0 0 28px rgba(255, 180, 80, 0.85), 0 0 48px rgba(255, 60, 40, 0.5); }
}

@keyframes betaShimmer {
    0%, 100% { letter-spacing: 5px; opacity: 0.88; }
    50% { letter-spacing: 7px; opacity: 1; }
}

@keyframes tomatoBreathe {
    0%, 100% { transform: scale(0.78); }
    50% { transform: scale(1.18); }
}

.tomato-char {
    display: block;
    width: 120px;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(3px 5px 0 rgba(0,0,0,0.32));
    flex-shrink: 0;
}

.tomato-char.sm {
    width: 44px;
    height: auto;
}

.tomato-char.md {
    width: 86px;
    height: auto;
    margin-bottom: 10px;
    animation: loginEggBounce 0.7s ease-in-out infinite;
}

.tomato-char.lg {
    width: 168px;
    height: auto;
}

.tomato-leaf {
    position: absolute;
    top: -8px;
    left: 50%;
    width: 16px;
    height: 12px;
    background: #2ea44f;
    border: 2px solid #145a18;
    border-radius: 50% 40% 50% 40%;
    transform: translateX(-50%) rotate(-18deg);
    z-index: 2;
}

.tomato-char.sm .tomato-leaf {
    top: -6px;
    width: 10px;
    height: 7px;
    border-width: 1px;
}

.tomato-leaf::before,
.tomato-leaf::after {
    content: '';
    position: absolute;
    top: 0;
    width: 11px;
    height: 8px;
    background: #27ae60;
    border: 2px solid #145a18;
    border-radius: 50%;
}

.tomato-leaf::before { left: -8px; transform: rotate(-40deg); }
.tomato-leaf::after { right: -8px; transform: rotate(40deg); }
.tomato-char.sm .tomato-leaf::before,
.tomato-char.sm .tomato-leaf::after {
    width: 7px;
    height: 5px;
    border-width: 1px;
}
.tomato-char.sm .tomato-leaf::before { left: -5px; }
.tomato-char.sm .tomato-leaf::after { right: -5px; }

.tomato-eyes {
    position: absolute;
    top: 30%;
    left: 46%;
    transform: translateX(-50%);
    display: flex;
    z-index: 1;
}

.tomato-eye {
    width: 22px;
    height: 28px;
    background: #fff;
    border: 2px solid #111;
    border-radius: 50%;
    margin: 0 -3px;
    position: relative;
}

.tomato-char.sm .tomato-eye {
    width: 9px;
    height: 11px;
    border-width: 1px;
    margin: 0 -1px;
}

.tomato-char.md .tomato-eye {
    width: 16px;
    height: 20px;
}

.tomato-eye i {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #111;
    border-radius: 50%;
    left: 3px;
    top: 10px;
}

.tomato-char.sm .tomato-eye i {
    width: 3px;
    height: 3px;
    left: 1px;
    top: 4px;
}

.tomato-char.md .tomato-eye i {
    width: 5px;
    height: 5px;
    left: 2px;
    top: 7px;
}

.tomato-brow {
    position: absolute;
    top: 26%;
    width: 16px;
    height: 4px;
    background: #111;
    border-radius: 3px;
    z-index: 2;
}

.tomato-brow.l { left: 26%; transform: rotate(-8deg); }
.tomato-brow.r { right: 22%; transform: rotate(8deg); }

.tomato-char.sm .tomato-brow {
    width: 7px;
    height: 2px;
    top: 24%;
}

.tomato-nose {
    position: absolute;
    left: 22%;
    top: 52%;
    width: 12px;
    height: 10px;
    border: 2px solid #111;
    border-radius: 50%;
    background: rgba(255,255,255,0.28);
    z-index: 2;
}

.tomato-char.sm .tomato-nose {
    width: 5px;
    height: 4px;
    border-width: 1px;
    left: 18%;
}

.tomato-mouth {
    position: absolute;
    left: 50%;
    bottom: 22%;
    width: 22px;
    height: 10px;
    border: 2px solid #111;
    border-top: 0;
    border-radius: 0 0 14px 14px;
    transform: translateX(-40%);
}

.tomato-char.sm .tomato-mouth {
    width: 9px;
    height: 4px;
    border-width: 1px;
    bottom: 20%;
}

.splash-egg,
.splash-egg-hat,
.login-seq-egg,
.login-seq-helm,
.lobby-egg,
.lobby-helm {
    display: none;
}

.splash-form-wrap {
    display: flex;
    justify-content: center;
}

.splash-form {
    width: min(360px, 100%);
    display: flex;
    flex-direction: column;
}

.splash-split {
    display: none;
}

.splash-col-title {
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-align: center;
}

.splash-guest-box {
    background: #0a0a0a;
    color: #fff;
    padding: 10px 12px;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-bottom: 12px;
    border: 1px solid #222;
}

.splash-blurb {
    color: #e8e8e8;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 18px;
}

.splash-label {
    display: block;
    color: #fff;
    font-size: 14px;
    margin: 10px 0 4px;
}

.splash-pw-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.splash-hint {
    color: #bbb;
    font-size: 11px;
}

.splash-input {
    width: 100%;
    background: #0a0a0a;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 10px;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.4px;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
}

.splash-input::placeholder {
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-weight: 500;
    color: #8a8a8a;
}

.splash-input:focus {
    border-color: #5aa0e6;
}

.splash-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.splash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    color: #fff;
    border: 3px solid #08356e;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 0 rgba(0,0,0,0.35);
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.55) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 62%, rgba(255,255,255,0.22) 0 3px, transparent 4px),
        linear-gradient(180deg, #7ec8ff 0%, #3b8dff 42%, #1d6fd4 58%, #1557b0 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.45),
        inset 0 -4px 0 rgba(0, 40, 90, 0.35),
        0 4px 0 #072a58,
        0 8px 16px rgba(0,0,0,0.28);
}

.splash-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.splash-btn:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        inset 0 -2px 0 rgba(0, 40, 90, 0.35),
        0 2px 0 #072a58;
}

.splash-btn-ghost {
    margin-top: 8px;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.2) 0 2px, transparent 3px),
        linear-gradient(180deg, #6a7fa8 0%, #3d4e6e 55%, #2a3a55 100%);
    border-color: #1a2438;
    font-size: 15px;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.25),
        0 4px 0 #121826;
}

.splash-tab-hint {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(255, 248, 232, 0.55);
    text-align: center;
}

.splash-tab-hint b {
    color: rgba(255, 248, 232, 0.85);
}

.splash-btn-red {
    margin-top: 0;
    padding: 6px 12px;
    width: auto;
    flex-shrink: 0;
    color: #fff;
    border: 2px solid #7a1510;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 0 2px, transparent 3px),
        linear-gradient(180deg, #ff8a7a 0%, #e74c3c 45%, #c0392b 100%);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.35),
        0 3px 0 #6a120e;
}

.splash-btn-red:hover {
    filter: brightness(1.08);
}

.btn-icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    display: block;
    fill: currentColor;
    stroke: none;
    pointer-events: none;
}

.splash-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    margin-top: 0;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.splash-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.splash-check-ui {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 3px solid #f5d000;
    background:
        radial-gradient(circle at 30% 28%, rgba(255,255,255,0.7) 0 3px, transparent 4px),
        linear-gradient(180deg, #3d4a66 0%, #1b2438 100%);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.2),
        0 2px 0 #0a1020;
    position: relative;
}

.splash-check:checked + .splash-check-ui {
    background:
        radial-gradient(circle at 30% 28%, rgba(255,255,255,0.8) 0 3px, transparent 4px),
        linear-gradient(180deg, #ffe56a 0%, #f5d000 55%, #d4a017 100%);
    border-color: #fff3a0;
}

.splash-check:checked + .splash-check-ui::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #3d2b00;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.splash-check:focus-visible + .splash-check-ui {
    outline: 2px solid #7ec8ff;
    outline-offset: 2px;
}

.splash-error {
    min-height: 18px;
    margin-top: 8px;
    text-align: center;
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 1px 0 #000;
}

#menu-screen,
#setup-screen {
    align-items: stretch;
    justify-content: stretch;
}

/* Login sequence overlay */
.auth-splash.is-logging .splash-board {
    filter: blur(2px) brightness(0.55);
    pointer-events: none;
}

.login-seq {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(4, 10, 24, 0.72);
    animation: loginSeqIn 0.28s ease;
}

.login-seq.login-seq-out {
    animation: loginSeqOut 0.26s ease forwards;
}

@keyframes loginSeqIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes loginSeqOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.login-seq-egg {
    width: 72px;
    height: 88px;
    border-radius: 50% 50% 46% 46%;
    background:
        radial-gradient(circle at 32% 28%, #fff 0 4px, transparent 5px),
        linear-gradient(180deg, #fff6d8 0%, #f4d9a0 100%);
    border: 3px solid #2a1c10;
    position: relative;
    animation: loginEggBounce 0.7s ease-in-out infinite;
    box-shadow: 0 10px 0 rgba(0,0,0,0.25);
    margin-bottom: 22px;
}

.login-seq-egg::before,
.login-seq-egg::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #2a1c10;
    border-radius: 50%;
    top: 34px;
}

.login-seq-egg::before { left: 18px; }
.login-seq-egg::after { right: 18px; }

.login-seq-helm {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 24px;
    background: linear-gradient(180deg, #e8eef4 0%, #9aa8b8 100%);
    border: 3px solid #333;
    border-radius: 18px 18px 6px 6px;
}

.login-seq-helm::before,
.login-seq-helm::after {
    content: '';
    position: absolute;
    top: -10px;
    width: 12px;
    height: 22px;
    background: #f4f7fb;
    border: 3px solid #333;
    border-radius: 10px 10px 4px 4px;
}

.login-seq-helm::before { left: -8px; transform: rotate(-22deg); }
.login-seq-helm::after { right: -8px; transform: rotate(22deg); }

@keyframes loginEggBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-seq-title {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #000;
    margin-bottom: 8px;
}

.login-seq-status {
    color: #f5d000;
    font-size: 15px;
    font-weight: 700;
    min-height: 22px;
    margin-bottom: 16px;
    text-shadow: 0 1px 0 #000;
}

.login-seq-bar {
    width: min(280px, 70vw);
    height: 16px;
    background: #0a1428;
    border: 3px solid #f5d000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 0 rgba(0,0,0,0.4), 0 3px 0 #000;
}

.login-seq-fill {
    height: 100%;
    width: 0;
    background:
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.25) 0 8px, transparent 8px 16px),
        linear-gradient(180deg, #ffe56a 0%, #f5d000 50%, #c9a000 100%);
    transition: width 0.32s ease;
}

/* Lobby */
.lobby-root {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(200, 40, 30, 0.28), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(20, 80, 30, 0.4), transparent 45%),
        repeating-linear-gradient(115deg, transparent 0 18px, rgba(0,0,0,0.08) 18px 22px),
        #1a0808;
}

.lobby-board {
    position: relative;
    z-index: 1;
    overflow: hidden;
    width: min(1080px, 96vw);
    height: min(640px, 94vh);
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 16px;
    padding: 18px 20px;
    background:
        radial-gradient(circle at 8% 12%, rgba(255, 180, 120, 0.1) 0 60px, transparent 120px),
        radial-gradient(circle at 92% 88%, rgba(180, 30, 20, 0.14) 0 80px, transparent 160px),
        radial-gradient(circle at 12% 18%, rgba(255,255,255,0.05) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 70%, rgba(255,255,255,0.04) 0 3px, transparent 4px),
        repeating-linear-gradient(115deg, transparent 0 18px, rgba(0,0,0,0.05) 18px 20px),
        repeating-linear-gradient(0deg, transparent 0 5px, rgba(0,0,0,0.03) 5px 6px),
        linear-gradient(160deg, rgba(52, 14, 12, 0.94) 0%, rgba(24, 6, 6, 0.9) 50%, rgba(36, 10, 8, 0.92) 100%);
    border: 2px solid rgba(230, 140, 120, 0.28);
    border-radius: 16px;
    box-shadow:
        0 12px 40px rgba(0,0,0,0.55),
        inset 0 0 70px rgba(0,0,0,0.28),
        inset 0 1px 0 rgba(255, 200, 180, 0.1);
    animation: lobbyIn 0.4s ease;
}

.lobby-board::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    mix-blend-mode: soft-light;
}

.lobby-board > * {
    position: relative;
    z-index: 1;
}

@keyframes lobbyIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.lobby-title {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: 46px;
    font-weight: 800;
    font-style: italic;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #000, 0 0 18px rgba(230, 60, 40, 0.4);
    margin-bottom: 12px;
    line-height: 1;
}

.lobby-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lobby-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-nav-play,
.lobby-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lobby-nav .lobby-btn {
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.lobby-nav-play .lobby-btn {
    height: 54px;
    min-height: 54px;
    font-size: 15px;
}

.lobby-nav-grid .lobby-btn {
    font-size: 13px;
}

.lobby-nav .lobby-btn-logout {
    height: 42px;
    min-height: 42px;
    font-size: 14px;
}

.lobby-btn .btn-icon,
.lobby-btn > span {
    pointer-events: none;
}

.lobby-btn .btn-icon {
    width: 1.2em;
    height: 1.2em;
}

.lobby-btn {
    color: #fff;
    border-radius: 12px;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 0 rgba(0,0,0,0.35);
    padding: 10px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.5) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 62%, rgba(255,255,255,0.18) 0 3px, transparent 4px),
        linear-gradient(180deg, #7ec8ff 0%, #3b8dff 42%, #1d6fd4 58%, #1557b0 100%);
    border: 3px solid #08356e;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.4),
        inset 0 -4px 0 rgba(0, 40, 90, 0.35),
        0 4px 0 #072a58;
}

.lobby-btn:hover { filter: brightness(1.08); }
.lobby-btn:active {
    filter: brightness(0.96);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.3),
        0 2px 0 #072a58;
}

.lobby-btn-lg {
    font-size: 15px;
    padding: 13px 8px;
}

.lobby-btn-sm {
    font-size: 12px;
    padding: 8px 12px;
    width: auto;
}

.lobby-btn-red {
    border-color: #7a1510;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 0 2px, transparent 3px),
        linear-gradient(180deg, #ff8a7a 0%, #e74c3c 45%, #c0392b 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 4px 0 #6a120e;
}

.lobby-btn-green {
    border-color: #145a18;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 0 2px, transparent 3px),
        linear-gradient(180deg, #8be07a 0%, #3cb54a 45%, #1e8a2c 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 4px 0 #0e4a14;
}

.lobby-btn-yellow {
    color: #3a2808;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
    border-color: #c9a227;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.7) 0 2px, transparent 3px),
        linear-gradient(180deg, #fff6b0 0%, #ffe56a 42%, #f3d24a 62%, #e8c63c 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.6),
        inset 0 -4px 0 rgba(160, 120, 20, 0.22),
        0 4px 0 #b89620;
}

.lobby-btn-yellow:active {
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.45),
        0 2px 0 #b89620;
}

.lobby-btn-purple {
    border-color: #4a156e;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 0 2px, transparent 3px),
        linear-gradient(180deg, #d08aff 0%, #9b4ecf 45%, #7a2fb0 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 4px 0 #4a0e6a;
}

.lobby-btn-blue {
    border-color: #08356e;
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.5) 0 2px, transparent 3px),
        linear-gradient(180deg, #7ec8ff 0%, #3b8dff 42%, #1d6fd4 58%, #1557b0 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.4),
        0 4px 0 #072a58;
}

.lobby-btn-cyan {
    border-color: #0a5a52;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 2px, transparent 3px),
        linear-gradient(180deg, #7ef0de 0%, #1abc9c 45%, #0e8a74 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 4px 0 #0a4a44;
}

.lobby-btn-orange {
    border-color: #8a3a08;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 2px, transparent 3px),
        linear-gradient(180deg, #ffc078 0%, #e67e22 45%, #c45c10 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 4px 0 #7a3208;
}

.lobby-btn-pink {
    border-color: #7a1548;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 2px, transparent 3px),
        linear-gradient(180deg, #ff9ec4 0%, #ff6b9d 45%, #d44a78 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 4px 0 #6a103c;
}

.inv-panel {
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 18px;
    overflow: hidden;
}

.inv-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 4px 6px 8px;
}

.inv-back {
    align-self: flex-start;
    margin-bottom: 10px;
}

.inv-stage {
    position: relative;
    flex: 1;
    min-height: 380px;
    overflow: hidden;
    border-radius: 16px;
    border: 3px solid #1a0c08;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.18);
    background: linear-gradient(180deg, #6eb6e8 0%, #9fd0f2 38%, #c8e8fb 68%, #dff3c8 100%);
}

.inv-stage .tomato-char.lg,
.inv-stage .inv-tomato {
    position: absolute;
    left: 50%;
    bottom: 6%;
    width: 150px;
    height: auto;
    transform: translateX(-50%);
    z-index: 5;
    filter: drop-shadow(3px 7px 0 rgba(20, 40, 12, 0.28));
}

.inv-stage.is-team .tomato-char.lg,
.inv-stage.is-team .inv-tomato {
    animation: teamGlow 1.8s ease-in-out infinite;
}

@keyframes teamGlow {
    0%, 100% {
        filter:
            drop-shadow(0 0 8px #7ef6ff)
            drop-shadow(0 0 18px #2ee0f0)
            drop-shadow(3px 7px 0 rgba(20, 40, 12, 0.24));
    }
    50% {
        filter:
            drop-shadow(0 0 14px #b8ffff)
            drop-shadow(0 0 28px #3ad4ea)
            drop-shadow(3px 7px 0 rgba(20, 40, 12, 0.24));
    }
}

.inv-garden {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.inv-sun {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, #fff6c8 0 28%, #ffe56a 40%, #f5c400 72%, rgba(245, 196, 0, 0) 73%);
    box-shadow: 0 0 24px rgba(255, 220, 80, 0.55);
}

.inv-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 40px;
    filter: blur(0.2px);
}

.inv-cloud::before,
.inv-cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.inv-cloud-a {
    top: 28px;
    left: 16px;
    width: 54px;
    height: 18px;
}

.inv-cloud-a::before {
    width: 26px;
    height: 26px;
    left: 8px;
    top: -14px;
}

.inv-cloud-a::after {
    width: 20px;
    height: 20px;
    right: 8px;
    top: -10px;
}

.inv-cloud-b {
    top: 48px;
    right: 58px;
    width: 40px;
    height: 14px;
    opacity: 0.7;
}

.inv-cloud-b::before {
    width: 18px;
    height: 18px;
    left: 6px;
    top: -10px;
}

.inv-cloud-b::after {
    width: 14px;
    height: 14px;
    right: 6px;
    top: -7px;
}

.inv-hill {
    position: absolute;
    left: -10%;
    right: -10%;
    border-radius: 50% 50% 0 0;
}

.inv-hill-far {
    bottom: 26%;
    height: 34%;
    background: linear-gradient(180deg, #8fd18a 0%, #5aaa5a 100%);
    opacity: 0.85;
}

.inv-hill-mid {
    bottom: 18%;
    height: 28%;
    left: -18%;
    right: -4%;
    background: linear-gradient(180deg, #6fbf68 0%, #3f9448 100%);
}

.inv-lawn {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 22%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.18) 0 18%, transparent 42%),
        radial-gradient(ellipse at 70% 20%, rgba(255,255,255,0.12) 0 16%, transparent 40%),
        linear-gradient(180deg, #57c45a 0%, #3aa944 38%, #2f8f3a 100%);
    box-shadow: inset 0 8px 12px rgba(255,255,255,0.12);
}

.inv-lawn::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 16px;
    background:
        radial-gradient(circle at 8% 100%, #57c45a 0 7px, transparent 8px),
        radial-gradient(circle at 18% 100%, #3aa944 0 6px, transparent 7px),
        radial-gradient(circle at 28% 100%, #6fd45a 0 8px, transparent 9px),
        radial-gradient(circle at 40% 100%, #3aa944 0 6px, transparent 7px),
        radial-gradient(circle at 52% 100%, #57c45a 0 7px, transparent 8px),
        radial-gradient(circle at 64% 100%, #6fd45a 0 8px, transparent 9px),
        radial-gradient(circle at 76% 100%, #3aa944 0 6px, transparent 7px),
        radial-gradient(circle at 88% 100%, #57c45a 0 7px, transparent 8px),
        radial-gradient(circle at 96% 100%, #6fd45a 0 6px, transparent 7px);
}

.inv-bush {
    position: absolute;
    bottom: 16%;
    width: 54px;
    height: 36px;
    border-radius: 50% 50% 42% 42%;
    background:
        radial-gradient(circle at 30% 40%, #7ee06a 0 28%, transparent 30%),
        radial-gradient(circle at 70% 35%, #4cb84a 0 30%, transparent 32%),
        linear-gradient(180deg, #4db84a 0%, #2f8a38 100%);
    box-shadow: 0 3px 0 rgba(20, 60, 20, 0.18);
}

.inv-bush-l { left: 6%; }
.inv-bush-r { right: 4%; width: 48px; height: 32px; bottom: 17%; }

.inv-bloom {
    position: absolute;
    bottom: 19%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow:
        7px 0 0 currentColor,
        -7px 0 0 currentColor,
        0 7px 0 currentColor,
        0 -7px 0 currentColor;
}

.inv-bloom::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #ffe56a;
}

.inv-bloom-a { left: 28%; color: #ff6b9d; }
.inv-bloom-b { left: 48%; bottom: 21%; color: #ff9f43; transform: scale(0.85); }
.inv-bloom-c { right: 30%; color: #7ec8ff; transform: scale(0.9); }

.inv-who {
    text-align: center;
    margin-top: 10px;
}

.inv-name {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    text-shadow: 0 2px 0 #000;
}

.inv-rank {
    color: #f5d000;
    font-size: 13px;
    font-weight: 700;
}

.inv-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: auto;
}

.inv-title {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: 36px;
    font-weight: 800;
    font-style: italic;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #000, 0 0 18px rgba(230, 60, 40, 0.4);
    line-height: 1;
    margin-bottom: 10px;
}

.inv-block {
    background: rgba(10, 6, 8, 0.38);
    border: 2px solid rgba(230, 140, 120, 0.2);
    border-radius: 12px;
    padding: 12px 14px 14px;
    margin-bottom: 12px;
}

.inv-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.inv-block-head span {
    color: #fff8e8;
    font-size: 18px;
    font-weight: 800;
    text-shadow: 0 2px 0 #000;
}

.inv-block-head em {
    color: #f5d000;
    font-style: normal;
    font-size: 13px;
    font-weight: 700;
}

.inv-skins-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.inv-current-col {
    flex: 0 0 auto;
}

.inv-select-col {
    flex: 1;
    min-width: 0;
}

.inv-skins {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inv-skin {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid #1a0c08;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.28);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.inv-skin-now {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    cursor: default;
}

.inv-skin:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.inv-skin-now:hover {
    filter: none;
    transform: none;
}

.inv-skin.is-on {
    border-color: #f5d000;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.3),
        0 0 0 2px rgba(245, 208, 0, 0.4);
}

.inv-skin-team {
    background: linear-gradient(180deg, #f4ffff 0%, #8ceeff 38%, #2eb8ea 100%) !important;
    color: #111;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.45);
}

.inv-skin-now.inv-skin-team {
    font-size: 15px;
    letter-spacing: 0.8px;
}

.inv-hint {
    margin: 10px 0 0;
    color: #c9d7ee;
    font-size: 12px;
}

.inv-outfit .inv-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.inv-outfit b {
    width: 52px;
    flex-shrink: 0;
    color: #fff8e8;
    font-size: 13px;
    text-shadow: 0 1px 0 #000;
}

.inv-unequip,
.inv-lock {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inv-unequip {
    border: 3px solid #7a1510;
    background: linear-gradient(180deg, #ff8a7a 0%, #c0392b 100%);
    color: #fff;
    opacity: 0.55;
    cursor: not-allowed;
}

.inv-unequip .btn-icon,
.inv-unequip svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.inv-lock {
    border: 3px solid #2a1812;
    background: rgba(12, 8, 8, 0.7);
    color: #8a7468;
}

.inv-lock svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.inv-unequip:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

.inv-unequip:not(:disabled):hover {
    filter: brightness(1.08);
}

.inv-hat {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    border: 3px solid #1a0c08;
    background: #2a140f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.18);
}

.inv-hat .hat-icon {
    width: 28px;
    height: 28px;
    display: block;
    filter: drop-shadow(1px 2px 0 rgba(0,0,0,0.35));
}

.inv-hat:hover {
    filter: brightness(1.08);
}

.inv-hat.is-on {
    border-color: #f5d000;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.22),
        0 0 0 2px rgba(245, 208, 0, 0.4);
}

.chat-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 12px;
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-title {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: 36px;
    font-weight: 800;
    font-style: italic;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #000, 0 0 18px rgba(230, 60, 40, 0.4);
    line-height: 1;
}

.chat-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 32%);
    gap: 10px;
    min-height: 0;
    align-items: stretch;
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: rgba(8, 6, 10, 0.55);
    border: 3px solid rgba(230, 140, 120, 0.28);
    border-radius: 12px;
    overflow: hidden;
}

.chat-log {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 14px 16px 18px;
    font-family: 'Press Start 2P', 'Fredoka', monospace;
    font-size: 9px;
    line-height: 1.85;
    color: #b8fff4;
    text-shadow: 0 2px 0 #000;
}

.chat-log::before,
.chat-log::after {
    content: '';
    position: absolute;
    width: 88px;
    height: 72px;
    border: 6px solid rgba(255, 255, 255, 0.05);
    border-radius: 22px;
    pointer-events: none;
}

.chat-log::before {
    right: 28px;
    top: 24px;
    border-bottom-left-radius: 6px;
}

.chat-log::after {
    right: 120px;
    bottom: 36px;
    width: 70px;
    height: 56px;
    border-bottom-right-radius: 6px;
}

.chat-line {
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
    word-break: break-word;
}

.chat-line b {
    font-weight: 700;
    margin-right: 6px;
}

.chat-line.is-sys {
    color: #f5d000;
}

.chat-line.is-me span {
    color: #fff8e8;
}

.chat-line.is-team,
.chat-line.is-team b,
.chat-line.is-team span,
.chat-line.is-me.is-team span {
    color: #8ecfff;
}

.chat-line.is-welcome {
    color: #7bed9f;
    font-size: 10px;
    letter-spacing: 0.4px;
    text-shadow: 0 2px 0 #000, 0 0 12px rgba(123, 237, 159, 0.45);
}

.chat-compose {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 3px solid rgba(230, 140, 120, 0.22);
    background: rgba(20, 10, 10, 0.45);
}

.chat-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    border: 3px solid #7a1510;
    background: #140806;
    color: #fff8e8;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
}

.chat-input:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25);
}

.chat-send {
    height: 42px;
    min-width: 108px;
    padding: 0 14px;
}

.chat-error {
    min-height: 16px;
    padding: 0 12px 8px;
    color: #ff8a7a;
    font-size: 12px;
    font-weight: 700;
}

.chat-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: rgba(8, 6, 10, 0.55);
    border: 3px solid rgba(230, 140, 120, 0.28);
    border-radius: 12px;
    overflow: hidden;
}

.chat-online {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-shadow: 0 2px 0 #000;
    border-bottom: 2px solid rgba(46, 204, 113, 0.35);
    background: rgba(0, 0, 0, 0.28);
}

.chat-online b {
    color: #7bed9f;
    font-size: 16px;
}

.chat-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.75);
    animation: chatPulse 1.6s ease-out infinite;
    flex-shrink: 0;
}

@keyframes chatPulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.75); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.chat-side-title {
    padding: 10px 12px 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-shadow: 0 2px 0 #000;
    border-bottom: 2px solid rgba(230, 140, 120, 0.22);
    background: rgba(0, 0, 0, 0.28);
}

.chat-people {
    flex: 1;
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-person {
    --ink: #e74c3c;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 6px 3px 10px;
    border-radius: 6px;
    border: 2px solid color-mix(in srgb, var(--ink) 55%, #1a0808);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--ink) 55%, #fff) 0%,
        var(--ink) 42%,
        color-mix(in srgb, var(--ink) 78%, #1a0808) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.chat-person.is-me {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent);
}

.chat-person.is-team {
    --ink: #4de8f5;
    background: linear-gradient(180deg, #ffffff 0%, #8af3ff 45%, #3ad4ea 100%);
    border-color: #7ef6ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 0 12px #4defff,
        0 6px 18px rgba(40, 200, 230, 0.45);
}

.chat-team-tag {
    text-align: right;
    line-height: 1.05;
    flex-shrink: 0;
}

.chat-team-tag b,
.chat-team-tag em {
    display: block;
    color: #111;
    font-style: normal;
    font-weight: 800;
    font-size: 11px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chat-person-text {
    flex: 1;
    min-width: 0;
}

.chat-person-text strong {
    display: block;
    color: #1a0c08;
    font-size: 13px;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-skin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-left: auto;
    background: none;
}

.chat-person .tomato-char.sm {
    width: 38px;
    height: auto;
    opacity: 1;
    filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.72));
}

.chat-person.is-team .tomato-char.sm {
    filter:
        drop-shadow(0 0 6px #7ef6ff)
        drop-shadow(0 0 12px #2ee0f0)
        drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.55));
}

.chat-empty {
    color: #c9d7ee;
    font-size: 12px;
    padding: 8px;
}

.ach-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 12px;
    overflow: hidden;
}

.ach-head-meta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff8e8;
    font-weight: 800;
    text-shadow: 0 2px 0 #000;
}

.ach-head-meta .coin-spin {
    width: 18px;
    height: 18px;
}

.ach-xp-chip {
    color: #7ec8ff;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.ach-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    overflow: auto;
    padding: 4px 8px 8px 2px;
    min-height: 0;
    scrollbar-width: auto;
    scrollbar-color: #f5d000 #2a0c08;
}

.ach-grid::-webkit-scrollbar { width: 14px; }
.ach-grid::-webkit-scrollbar-track {
    margin: 6px 2px;
    background: linear-gradient(180deg, #3a120e 0%, #1a0806 100%);
    border: 3px solid #5a100c;
    border-radius: 10px;
}
.ach-grid::-webkit-scrollbar-thumb {
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,0.55) 0 3px, transparent 4px),
        linear-gradient(180deg, #ffe56a 0%, #f5d000 45%, #c9a000 100%);
    border: 3px solid #8a6a00;
    border-radius: 10px;
}

.ach-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 10px 8px;
    border-radius: 12px;
    border: 3px solid #3a2418;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,0.12) 0 3px, transparent 4px),
        linear-gradient(180deg, rgba(40, 20, 16, 0.9), rgba(12, 6, 6, 0.92));
    color: #c9d7ee;
    min-height: 128px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.08), 0 3px 0 #1a0a08;
}

.ach-card.is-on {
    color: #fff8e8;
    filter: none;
}

.ach-badge {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    flex-shrink: 0;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.45));
}

.ach-card:not(.is-on) .ach-badge {
    filter: grayscale(0.35) drop-shadow(2px 3px 0 rgba(0,0,0,0.45));
}

.ach-tone-red.is-on { border-color: #7a1510; background: linear-gradient(180deg, rgba(231,76,60,0.35), rgba(20,8,6,0.88)); }
.ach-tone-gold.is-on { border-color: #c9a000; background: linear-gradient(180deg, rgba(245,208,0,0.32), rgba(28,18,4,0.88)); }
.ach-tone-green.is-on { border-color: #1e8a2c; background: linear-gradient(180deg, rgba(60,181,74,0.32), rgba(8,20,8,0.88)); }
.ach-tone-blue.is-on { border-color: #1557b0; background: linear-gradient(180deg, rgba(59,141,255,0.32), rgba(6,12,28,0.88)); }
.ach-tone-purple.is-on { border-color: #7d3cb5; background: linear-gradient(180deg, rgba(155,89,182,0.32), rgba(18,8,28,0.88)); }
.ach-tone-pink.is-on { border-color: #c0396b; background: linear-gradient(180deg, rgba(255,107,157,0.32), rgba(28,8,16,0.88)); }
.ach-tone-cyan.is-on { border-color: #1abc9c; background: linear-gradient(180deg, rgba(26,188,156,0.32), rgba(6,22,20,0.88)); }
.ach-tone-orange.is-on { border-color: #e67e22; background: linear-gradient(180deg, rgba(230,126,34,0.32), rgba(28,14,4,0.88)); }

.ach-ico {
    width: 22px;
    height: 22px;
    color: #8a7468;
}

.ach-card.is-on .ach-ico {
    color: #f5d000;
}

.ach-ico .btn-icon {
    width: 22px;
    height: 22px;
}

.ach-card strong {
    font-size: 13px;
    font-weight: 800;
    text-shadow: 0 1px 0 #000;
}

.ach-card em {
    font-style: normal;
    font-size: 11px;
    line-height: 1.3;
    color: #d7c4a8;
    flex: 1;
}

.ach-rewards {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
}

.ach-card b,
.ach-rewards b {
    color: #f5d000;
    font-size: 12px;
}

.ach-rewards i {
    font-style: normal;
    color: #7ec8ff;
}

.shop-modal {
    z-index: 12;
    overflow: hidden;
}

.shop-modal-card {
    position: relative;
    width: min(680px, 92vw);
    max-height: min(90vh, 680px);
    overflow: hidden;
    padding: 22px 22px 18px;
    border-radius: 18px;
    color: #fff8e8;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    text-align: center;
    transform-origin: center center;
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,0.2) 0 3px, transparent 4px),
        linear-gradient(180deg, #7a3a1c 0%, #4a1e10 55%, #2c1208 100%);
    border: 3px solid #7a1510;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.22),
        0 8px 0 #4a0e0a,
        0 18px 32px rgba(0,0,0,0.45);
}

.shop-modal-card.shop-pop {
    animation: shopPopIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes shopPopIn {
    0% { opacity: 0; transform: scale(0.84) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.shop-modal-card::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.shop-modal-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0 28px 8px;
}

.shop-modal-head .ingame-leave-title {
    margin-bottom: 0;
}

.shop-modal-head .lobby-btn {
    align-self: flex-start;
}

.shop-modal-coins {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #ffe56a;
    font-weight: 800;
    text-shadow: 0 2px 0 #000;
}

.shop-hub,
.shop-room {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    overflow: hidden;
}

.shop-hub.hidden,
.shop-room.hidden {
    display: none;
}

.shop-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 6px 2px 4px;
}

.shop-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 188px;
    padding: 16px 12px;
    border-radius: 16px;
    cursor: pointer;
    color: #fff8e8;
    text-shadow: 0 2px 0 rgba(0,0,0,0.35);
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
}

.shop-tile.is-normal {
    border: 4px solid #8a6a00;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,0.45) 0 4px, transparent 5px),
        radial-gradient(circle at 82% 70%, rgba(255,255,255,0.18) 0 5px, transparent 6px),
        linear-gradient(180deg, #ffe56a 0%, #f5d000 42%, #c9a000 100%);
    box-shadow:
        inset 0 4px 0 rgba(255,255,255,0.4),
        inset 0 -5px 0 rgba(120, 80, 0, 0.28),
        0 6px 0 #6a5000,
        0 12px 20px rgba(0,0,0,0.28);
    color: #3a2808;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.shop-tile.is-premium {
    border: 4px solid #0a4a5a;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,0.4) 0 4px, transparent 5px),
        radial-gradient(circle at 78% 68%, rgba(255,255,255,0.16) 0 5px, transparent 6px),
        linear-gradient(180deg, #7ef0e0 0%, #1abc9c 42%, #0e8a78 100%);
    box-shadow:
        inset 0 4px 0 rgba(255,255,255,0.35),
        inset 0 -5px 0 rgba(0, 50, 48, 0.28),
        0 6px 0 #074a42,
        0 12px 20px rgba(0,0,0,0.28);
}

.shop-tile:hover {
    filter: brightness(1.06);
    transform: translateY(-3px);
}

.shop-tile:active {
    transform: translateY(3px);
}

.shop-tile strong {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.shop-tile em {
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.85;
    text-align: center;
}

.shop-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(0,0,0,0.28);
    box-shadow: inset 0 3px 0 rgba(255,255,255,0.4), 0 4px 0 rgba(0,0,0,0.2);
}

.shop-badge-coin {
    background: radial-gradient(circle at 32% 28%, #fffbe6, #ffe56a 42%, #c9a000 100%);
}

.shop-badge-coin .coin-spin {
    width: 42px;
    height: 42px;
    border-width: 3px;
}

.shop-badge-gem {
    background: radial-gradient(circle at 32% 28%, #e8fff8, #7ef0e0 40%, #128f7c 100%);
    color: #083028;
}

.shop-badge-gem .btn-icon {
    width: 38px;
    height: 38px;
}

.shop-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 4px 8px;
}

.shop-soon-hero .tomato-char.lg {
    width: 88px;
    height: auto;
}

.shop-soon-banner {
    margin-top: 6px;
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 32px;
    font-weight: 800;
    font-style: italic;
    color: #ffe56a;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #5a100c, 0 0 14px rgba(245, 208, 0, 0.4);
}

.shop-soon-copy {
    margin: 6px 0 16px;
    color: #fff8e8;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 0 #000;
}

.shop-shelf {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.shop-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    border-radius: 12px;
    border: 3px solid #5a100c;
    background: linear-gradient(180deg, rgba(40, 14, 12, 0.85), rgba(12, 6, 6, 0.92));
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.08), 0 3px 0 #2a0a08;
    color: #c9b8a4;
}

.shop-slot-lock .btn-icon {
    width: 22px;
    height: 22px;
    opacity: 0.7;
}

.shop-slot em {
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
}

.shop-room-body {
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
}

.shop-room-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.shop-stock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 2px 2px 6px;
}

.shop-stock-hero .tomato-char.lg {
    width: 92px;
    height: auto;
}

.shop-stock-copy {
    margin: 0 8px 6px;
    color: #fff8e8;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 0 #000;
}

.shop-stock-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.shop-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px 12px;
    border-radius: 14px;
    border: 3px solid #5a100c;
    background: linear-gradient(180deg, rgba(62, 24, 16, 0.95), rgba(18, 8, 8, 0.96));
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.1), 0 3px 0 #2a0a08;
    color: #fff8e8;
    cursor: pointer;
    font-family: inherit;
}

.shop-item:hover {
    filter: brightness(1.06);
}

.shop-item:active {
    transform: translateY(1px);
}

.shop-item-art .hat-icon {
    width: 84px;
    height: 84px;
    display: block;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.35));
}

.shop-item strong {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
}

.shop-item em {
    min-height: 2.2em;
    color: #f0d8b8;
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.shop-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.shop-item-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffe56a;
    font-weight: 800;
}

.shop-item-price .coin-spin {
    width: 16px;
    height: 16px;
}

.shop-item-cta,
.shop-item-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.shop-item-cta {
    background: linear-gradient(180deg, #7dff8a, #2ecc71);
    color: #083018;
    border: 2px solid #145a18;
}

.shop-item-state {
    background: rgba(255, 248, 232, 0.12);
    color: #fff8e8;
    border: 2px solid #5a100c;
}

.shop-item.is-owned .shop-item-state {
    background: linear-gradient(180deg, #ffe56a, #f5d000);
    color: #3a2208;
    border-color: #7a4a00;
}

.shop-item.is-equipped {
    border-color: #f5d000;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.12),
        0 0 0 2px rgba(245, 208, 0, 0.35),
        0 3px 0 #2a0a08;
}

.shop-item.is-equipped .shop-item-state {
    background: linear-gradient(180deg, #7ef0e0, #1abc9c);
    color: #083028;
    border-color: #0e6655;
}

.shop-item.is-broke {
    opacity: 0.78;
}

.lobby-hero {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex: 1;
    margin-top: 8px;
    min-height: 88px;
}

.lobby-item-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lobby-stat {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 0 #000;
    padding: 4px 6px;
    border-radius: 4px;
    border: 2px solid rgba(0,0,0,0.45);
}

.lobby-stat-kd { background: #2ea44f; }
.lobby-stat-wins { background: #c0392b; }
.lobby-stat-pct { background: #2470c9; }

.lobby-tomato-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    max-height: 280px;
    overflow: visible;
}

.lobby-tomato-stage .tomato-char.lg {
    width: 168px;
    height: auto;
}

.login-seq-tomato {
    display: flex;
    justify-content: center;
}

.lobby-egg {
    width: 108px;
    height: 128px;
    border-radius: 50% 50% 46% 46%;
    background:
        radial-gradient(circle at 32% 28%, rgba(255,255,255,0.85) 0 8px, transparent 10px),
        linear-gradient(180deg, #fff6d8 0%, var(--egg) 100%);
    border: 3px solid #2a1c10;
    position: relative;
    box-shadow: 0 8px 0 rgba(0,0,0,0.25);
}

.lobby-egg .lobby-eye {
    position: absolute;
    width: 10px;
    height: 12px;
    background: #1a120c;
    border-radius: 50%;
    top: 58px;
}

.lobby-egg .lobby-eye.l { left: 30px; }
.lobby-egg .lobby-eye.r { right: 30px; }

.lobby-smile {
    position: absolute;
    left: 50%;
    bottom: 34px;
    width: 28px;
    height: 14px;
    border: 3px solid #1a120c;
    border-top: 0;
    border-radius: 0 0 16px 16px;
    transform: translateX(-50%);
}

.lobby-helm {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 78px;
    height: 32px;
    background: linear-gradient(180deg, #e8eef4 0%, #8a9aaa 100%);
    border: 3px solid #333;
    border-radius: 22px 22px 8px 8px;
    z-index: 1;
}

.lobby-helm::before,
.lobby-helm::after {
    content: '';
    position: absolute;
    top: -14px;
    width: 16px;
    height: 28px;
    background: #f4f7fb;
    border: 3px solid #333;
    border-radius: 12px 12px 5px 5px;
}

.lobby-helm::before { left: -10px; transform: rotate(-24deg); }
.lobby-helm::after { right: -10px; transform: rotate(24deg); }

.lobby-identity {
    margin-top: 10px;
}

.lobby-profile-card {
    --skin: #e74c3c;
    position: relative;
    overflow: hidden;
    display: block;
    margin-top: 10px;
    padding: 8px 10px 10px;
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.14) 0 2px, transparent 3px),
        radial-gradient(circle at 72% 68%, rgba(0,0,0,0.12) 0 3px, transparent 4px),
        repeating-linear-gradient(-16deg, transparent 0 9px, rgba(0,0,0,0.05) 9px 10px),
        linear-gradient(165deg, rgba(10, 6, 8, 0.58), rgba(6, 4, 6, 0.74)),
        var(--skin);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--skin) 28%, transparent),
        inset 0 -8px 16px rgba(0,0,0,0.12);
}

.lobby-profile-card.is-team {
    background: linear-gradient(180deg, #ffffff 0%, #9aefff 42%, #3ad4ea 100%);
    border: 2px solid #4ecfff;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 0 16px rgba(80, 230, 255, 0.55);
}

.lobby-profile-card.is-team::before {
    content: 'BAD TOMATOES\A TEAM';
    white-space: pre;
    position: absolute;
    inset: -6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Baloo 2', Fredoka, Impact, sans-serif;
    font-size: 34px;
    font-weight: 900;
    font-style: italic;
    line-height: 0.88;
    letter-spacing: 0.4px;
    color: #083848;
    opacity: 0.16;
    pointer-events: none;
    z-index: 0;
}

.lobby-profile-card.is-team .lobby-name {
    color: #111;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.lobby-profile-card.is-team .lobby-rank {
    color: #1a3a48;
}

.lobby-profile-card.is-team .lobby-team-tag {
    color: inherit;
    font-size: inherit;
    font-weight: 800;
    margin-top: 0;
    letter-spacing: 0;
    text-shadow: none;
}

.lobby-profile-card.is-team .lobby-coin-stat b {
    color: #111;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.lobby-profile-card.is-team .lobby-stat-row span {
    color: #111;
    text-shadow: none;
}

.lobby-profile-card.is-team .lobby-stat-row b {
    color: #111;
    text-shadow: none;
}

.lobby-profile-main {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lobby-profile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.lobby-profile-who {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    padding-top: 2px;
}

.lobby-profile-who .tomato-char.sm {
    width: 40px;
    height: auto;
}

.lobby-profile-text {
    min-width: 0;
}

.lobby-name {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 2px 0 #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-rank {
    color: #e8eef8;
    font-size: 12px;
    margin: 1px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-team-tag {
    margin: 0;
    font-size: inherit;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: none;
}

.lobby-coin-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 2px 2px 2px 6px;
}

.lobby-coin-stat b {
    color: #fff8e8;
    font-size: 16px;
    font-weight: 800;
    text-shadow: 0 2px 0 #000, 0 0 10px rgba(245, 208, 0, 0.45);
    line-height: 1;
}

.lobby-coin-stat .coin-spin {
    width: 22px;
    height: 22px;
    border-width: 2px;
}

.lobby-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lobby-stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-height: 18px;
}

.lobby-stat-row span {
    color: #ffe56a;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 0 #000;
}

.lobby-stat-row b {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-shadow: 0 1px 0 #000, 0 0 8px rgba(123, 237, 159, 0.35);
    line-height: 1;
}

.lobby-plate {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.35);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.lobby-plate span { opacity: 0.95; }
.lobby-plate b {
    margin-left: auto;
    font-weight: 800;
}

.lobby-plate .btn-icon {
    width: 13px;
    height: 13px;
    margin-left: 0;
}

.lobby-plate-lv {
    position: relative;
    overflow: hidden;
    background: #163d72;
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

.lobby-lv-meter span,
.lobby-lv-meter b {
    position: relative;
    z-index: 1;
}

.lobby-lv-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 0;
    background: linear-gradient(180deg, #5aa8f5 0%, #2f78d4 55%, #1f5fba 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.lobby-lv-minus {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(180deg, #5aa8f5, #1f5fba);
    border: 1px solid #163d72;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.lobby-lv-minus .btn-icon {
    width: 14px;
    height: 14px;
}

.lobby-plate-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.lobby-plate-coins {
    background: linear-gradient(180deg, #ffe56a 0%, #f5d000 48%, #c9a000 100%);
    color: #3a2808;
    text-shadow: 0 1px 0 rgba(255,255,255,0.45);
    margin-bottom: 4px;
}

.lobby-plate-coins .coin-spin {
    width: 16px;
    height: 16px;
}

.coin-spin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 32% 28%, #fffbe6 0 18%, #ffe56a 28%, #f5d000 58%, #c9a000 100%);
    border: 2px solid #8a6a00;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 0 #6a5000;
    transform-style: preserve-3d;
    animation: coinSpin 1.35s linear infinite;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.lobby-bar-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 6px;
    align-items: center;
    margin: 4px 0;
}

.lobby-bar-label {
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.lobby-bar {
    position: relative;
    height: 16px;
    background: #0a1428;
    border: 2px solid #111;
    border-radius: 3px;
    overflow: hidden;
}

.lobby-bar i {
    display: block;
    height: 100%;
}

.lobby-bar b {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-shadow: 0 1px 0 #000;
}

.lobby-bar-lv i { background: linear-gradient(180deg, #6cb6ff, #2470c9); }
.lobby-bar-xp i { background: linear-gradient(180deg, #ffe56a, #d4a017); }
.lobby-bar-rep i { background: linear-gradient(180deg, #8be07a, #2ea44f); }

.lobby-coin {
    width: 18px;
    height: 18px;
    margin-top: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3a0, #f5d000 45%, #b8860b);
    border: 2px solid #8a6a00;
}

.lobby-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.lobby-games-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
    padding-bottom: 8px;
}

.lobby-games-tools {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
    width: min(300px, 58%);
}

.lobby-games-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lobby-games-actions .lobby-btn,
.lobby-games-actions .lobby-btn.lobby-btn-sm {
    width: 100%;
    min-width: 0;
    height: 38px;
    min-height: 38px;
    font-size: 12px;
    padding: 0 8px;
}

.lobby-type-dd {
    position: relative;
    width: 100%;
}

.lobby-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    color: #3a2808;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.45);
    border: 3px solid #145a18;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.5) 0 2px, transparent 3px),
        linear-gradient(180deg, #8be07a 0%, #3cb54a 45%, #1e8a2c 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 4px 0 #0e4a14;
}

.lobby-type-btn .btn-icon:last-child {
    margin-left: auto;
    width: 1em;
    height: 1em;
    transition: transform 0.15s ease;
}

.lobby-type-dd.is-open .lobby-type-btn .btn-icon:last-child {
    transform: rotate(180deg);
}

.lobby-type-btn:hover { filter: brightness(1.08); }

.lobby-type-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 8;
    min-width: 100%;
    padding: 6px;
    background: linear-gradient(180deg, #2a120e 0%, #140806 100%);
    border: 3px solid #7a1510;
    border-radius: 12px;
    box-shadow: 0 8px 0 #4a0c0a, 0 12px 20px rgba(0,0,0,0.45);
}

.lobby-type-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin: 2px 0;
    color: #fff;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.lobby-type-opt:hover {
    background: rgba(231, 76, 60, 0.35);
}

.lobby-type-opt.is-on {
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.25);
}

.lobby-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 10px 0 12px;
}

.lobby-games-title {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: 38px;
    font-weight: 800;
    font-style: italic;
    color: #fff8e8;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #5a100c, 0 0 14px rgba(231, 76, 60, 0.35);
    line-height: 1;
    padding-bottom: 4px;
}

.lobby-live-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: 'Fredoka', sans-serif;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    vertical-align: middle;
    letter-spacing: 0;
    text-shadow: none;
    border: 2px solid #1a0c08;
}

.lobby-live-badge.online {
    background: #2ecc71;
    color: #0d2818;
}

.lobby-live-badge.offline {
    background: #ff6b5a;
    color: #fff;
}

.lobby-live-err p {
    margin: 6px 0;
}

.lobby-live-hint {
    font-size: 12px;
    color: #c8b090;
    margin-top: 8px;
}

.lobby-live-hint code {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
}

.lobby-live-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    background: #2ecc71;
    color: #0d2818;
    border: 1px solid #1a0c08;
    vertical-align: middle;
}

.lobby-games-sub {
    font-family: 'Fredoka', sans-serif;
    color: #f3d7a0;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.lobby-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 10px 0 12px;
}

.lobby-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff8e8;
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.lobby-filter input {
    width: 16px;
    height: 16px;
    accent-color: #3b8dff;
}

.lobby-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(52, 16, 12, 0.72) 0%, rgba(14, 6, 4, 0.88) 100%);
    border: 3px solid #7a1510;
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 180, 140, 0.18),
        0 5px 0 #3a0c08;
    position: relative;
    z-index: 1;
    min-height: 0;
    scrollbar-width: auto;
    scrollbar-color: #e74c3c #2a0c08;
}

.lobby-list::-webkit-scrollbar {
    width: 18px;
}

.lobby-list::-webkit-scrollbar-track {
    margin: 8px 3px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 180, 140, 0.12) 0 2px, transparent 3px),
        linear-gradient(180deg, #3a120e 0%, #1a0806 100%);
    border: 3px solid #5a100c;
    border-radius: 12px;
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.45);
}

.lobby-list::-webkit-scrollbar-thumb {
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.55) 0 3px, transparent 4px),
        linear-gradient(180deg, #ff8a7a 0%, #e74c3c 42%, #c0392b 100%);
    border: 3px solid #7a1510;
    border-radius: 12px;
    box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.35),
        inset 0 -3px 0 rgba(80, 10, 8, 0.35),
        0 2px 0 #4a0c0a;
}

.lobby-list::-webkit-scrollbar-thumb:hover {
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.65) 0 3px, transparent 4px),
        linear-gradient(180deg, #ffb0a4 0%, #ff6b5a 42%, #e74c3c 100%);
}

.lobby-list::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #c0392b 0%, #8a1a12 100%);
}

.lobby-list::-webkit-scrollbar-corner {
    background: transparent;
}

.lobby-game {
    width: 100%;
    display: grid;
    grid-template-columns: 92px minmax(118px, 138px) 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 9px 12px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid rgba(122, 21, 16, 0.45);
    color: #fff8e8;
    font-family: 'Fredoka', sans-serif;
    text-align: left;
    cursor: pointer;
}

.lobby-game:hover {
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.32), rgba(192, 57, 43, 0.1));
}

.lobby-game-map {
    width: 86px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #7a3d00;
    background: #2a1408;
    box-shadow:
        inset 0 0 0 1px rgba(255, 220, 140, 0.25),
        0 2px 0 #3a1a00;
}

.lobby-game-map img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.lobby-game-face {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #1a2438;
    border: 2px solid #4a5a78;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #9ab;
}

.lobby-open,
.lobby-players {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    color: #fff;
    border-radius: 12px;
    white-space: nowrap;
}

.lobby-open {
    flex-direction: row;
    gap: 5px;
    font-size: 12px;
    padding: 8px 8px;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}

.lobby-open .btn-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.lobby-players {
    flex-direction: column;
}

.lobby-open.yes {
    color: #1a3a10;
    border: 3px solid #145a18;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 2px, transparent 3px),
        linear-gradient(180deg, #8be07a 0%, #3cb54a 45%, #1e8a2c 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 3px 0 #0e4a14;
}

.lobby-open.no {
    color: #3a2808;
    border: 3px solid #8a4a10;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.5) 0 2px, transparent 3px),
        linear-gradient(180deg, #ffd27a 0%, #f0a030 45%, #c46a10 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 3px 0 #7a3d00;
}

.lobby-game-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lobby-game-meta strong {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 0 #3a0c08;
}

.lobby-game-meta em {
    font-family: 'Fredoka', sans-serif;
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
    color: #f3d7a0;
}

.lobby-players {
    min-width: 72px;
    padding: 5px 10px 6px;
}

.lobby-players small {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    opacity: 0.92;
}

.lobby-players b {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.lobby-players.open {
    color: #1a3a10;
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
    border: 3px solid #145a18;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 2px, transparent 3px),
        linear-gradient(180deg, #8be07a 0%, #3cb54a 45%, #1e8a2c 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.35),
        0 3px 0 #0e4a14;
}

.lobby-players.full {
    color: #fff8e8;
    text-shadow: 0 1px 0 rgba(0,0,0,0.35);
    border: 3px solid #7a1510;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.35) 0 2px, transparent 3px),
        linear-gradient(180deg, #ff8a7a 0%, #e74c3c 45%, #c0392b 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.28),
        0 3px 0 #6a120e;
}

.lobby-empty {
    color: #f3d7a0;
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 24px;
    text-align: center;
}

#lobby-refresh.is-loading {
    pointer-events: none;
    opacity: 0.88;
}

#lobby-refresh.is-loading .btn-icon {
    animation: lobbySpin 0.65s linear infinite;
}

#lobby-refresh:disabled {
    color: #fff;
    filter: none;
}

.lobby-list-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px 12px;
    gap: 8px;
    animation: lobbyLoadIn 0.18s ease;
}

.lobby-list-loading-orb {
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lobbyBob 0.85s ease-in-out infinite;
}

.lobby-list-loading-orb .tomato-char.md {
    margin-bottom: 0;
    animation: loadTomatoSpin 0.75s linear infinite;
    filter: drop-shadow(0 6px 0 rgba(0,0,0,0.28));
}

.lobby-list-loading-text {
    color: #fff8e8;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 0 #3a0c08;
    min-height: 18px;
}

.lobby-skel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.lobby-skel i {
    display: block;
    height: 46px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 0%,
        rgba(255,255,255,0.16) 50%,
        rgba(255,255,255,0.05) 100%
    );
    background-size: 220% 100%;
    animation: lobbyShimmer 1.05s ease-in-out infinite;
}

.lobby-skel i:nth-child(2) { animation-delay: 0.08s; }
.lobby-skel i:nth-child(3) { animation-delay: 0.16s; }
.lobby-skel i:nth-child(4) { animation-delay: 0.24s; }

.lobby-list.is-fresh .lobby-game,
.lobby-list.is-fresh .lobby-empty {
    animation: lobbyRowIn 0.32s ease both;
    animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes lobbySpin {
    to { transform: rotate(360deg); }
}

@keyframes lobbyBob {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-9px) rotate(8deg); }
}

@keyframes lobbyShimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

@keyframes lobbyLoadIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes lobbyRowIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.lobby-btn.is-fired {
    animation: btnFire 0.22s ease;
}

@keyframes btnFire {
    0% { transform: scale(1); }
    40% { transform: scale(0.9) translateY(2px); }
    100% { transform: scale(1); }
}

.lobby-game.is-fired {
    animation: btnFire 0.22s ease;
}

.lobby-modal {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 10, 24, 0);
    opacity: 0;
    pointer-events: none;
}

.lobby-modal.is-in {
    pointer-events: auto;
    animation: modalDimIn 0.22s ease forwards;
}

.lobby-modal.is-out {
    pointer-events: none;
    animation: modalDimOut 0.2s ease forwards;
}

.lobby-modal.hidden { display: none !important; }

@keyframes modalDimIn {
    from { opacity: 0; background: rgba(4, 10, 24, 0); }
    to { opacity: 1; background: rgba(4, 10, 24, 0.62); }
}

@keyframes modalDimOut {
    from { opacity: 1; background: rgba(4, 10, 24, 0.62); }
    to { opacity: 0; background: rgba(4, 10, 24, 0); }
}

.lobby-modal-card {
    width: min(420px, 90vw);
    background: rgba(10, 22, 48, 0.96);
    border: 2px solid rgba(180, 200, 230, 0.3);
    border-radius: 14px;
    padding: 18px;
    color: #fff;
    transform-origin: center center;
}

.lobby-modal-card.pop-in {
    animation: uiPopIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lobby-modal-card.pop-out {
    animation: uiPopOut 0.2s ease forwards;
}

.ui-pop {
    animation: uiPopIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes uiPopIn {
    0% { opacity: 0; transform: scale(0.84) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes uiPopOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.86) translateY(12px); }
}

.lobby-action-msg {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 0 6px;
}

.lobby-modal-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 2px 0 #000;
}

.lobby-modal-body p { margin: 8px 0; line-height: 1.45; }
.lobby-modal-hint {
    color: #f3d7a0;
    font-family: 'Fredoka', sans-serif;
    font-size: 13px;
    font-weight: 600;
}
.lobby-modal-body .px-error {
    font-family: 'Fredoka', sans-serif;
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
}

.lobby-code-input {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    border-radius: 10px;
    border: 3px solid #7a1510;
    background: #140806;
    color: #fff8e8;
}

.lobby-code-input:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25);
}

.lobby-code-input.is-wrong {
    border-color: #e74c3c;
    animation: lobbyShake 0.32s ease;
}

@keyframes lobbyShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#lobby-invite-go,
#lobby-friend-join { width: 100%; margin-top: 10px; }
.lobby-chat-log {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.6;
}
.lobby-chat-log b { color: #f5d000; }
#lobby-modal-close { width: 100%; margin-top: 12px; }
#lobby-friend-cpu { width: 100%; margin-top: 10px; }
#lobby-profile-save { width: 100%; margin-top: 10px; }

.lobby-profile-handle {
    color: #c9d7ee;
    font-weight: 800;
    margin-bottom: 8px;
}

.lobby-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 8px 0 12px;
}

.lobby-swatch {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 3px solid #0a1428;
    cursor: pointer;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.25);
}

.lobby-swatch:hover { filter: brightness(1.1); }

.lobby-toast-host {
    position: fixed;
    top: 16px;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.lobby-toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 11px;
    color: #163a12;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    border: 3px solid #145a18;
    border-radius: 18px;
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.55) 0 2px, transparent 3px),
        linear-gradient(180deg, #9aee86 0%, #3cb54a 48%, #1e8a2c 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.4),
        0 5px 0 #0e4a14,
        0 12px 22px rgba(0,0,0,0.28);
    opacity: 0;
    transform: translateY(-130%) scale(0.86);
}

.lobby-toast.is-in {
    animation: toastDropIn 0.55s cubic-bezier(0.22, 1.25, 0.36, 1) forwards;
}

.lobby-toast.is-out {
    animation: toastFadeAway 0.42s ease forwards;
}

.lobby-toast-tick {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    flex-shrink: 0;
}

.lobby-toast-tick .btn-icon {
    width: 16px;
    height: 16px;
}

.lobby-toast.is-in .lobby-toast-tick {
    animation: toastTickPop 0.45s 0.18s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

@keyframes toastDropIn {
    0% { opacity: 0; transform: translateY(-130%) scale(0.86); }
    62% { opacity: 1; transform: translateY(8px) scale(1.05); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastFadeAway {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-18px) scale(0.94); }
}

@keyframes toastTickPop {
    0% { transform: scale(0.4) rotate(-20deg); }
    70% { transform: scale(1.18) rotate(8deg); }
    100% { transform: scale(1) rotate(0deg); }
}

#level-up-host {
    position: fixed;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 80;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.level-up-banner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px 13px;
    color: #3a2808;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    border: 3px solid #8a6a00;
    border-radius: 20px;
    background:
        radial-gradient(circle at 16% 24%, rgba(255,255,255,0.7) 0 3px, transparent 4px),
        linear-gradient(180deg, #fff6b0 0%, #ffe56a 42%, #f5d000 70%, #c9a000 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.55),
        0 6px 0 #6a5000,
        0 16px 28px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(-140%) scale(0.82);
}

.level-up-banner.is-in {
    animation: toastDropIn 0.58s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}

.level-up-banner.is-out {
    animation: toastFadeAway 0.42s ease forwards;
}

.level-up-star {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fff 0%, #ffe56a 100%);
    border: 2px solid #6a5000;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.8), 0 2px 0 rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.level-up-star .btn-icon {
    width: 20px;
    height: 20px;
    fill: #c0392b;
}

.level-up-banner.is-in .level-up-star {
    animation: toastTickPop 0.5s 0.16s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.level-up-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.1;
}

.level-up-copy b {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-shadow: 0 2px 0 rgba(255,255,255,0.45);
}

.level-up-copy em {
    font-style: normal;
    font-size: 13px;
    font-weight: 700;
    color: #5a3a08;
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}

@media (max-width: 820px) {
    .lobby-board {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 94vh;
        overflow: auto;
    }
    .inv-panel {
        grid-template-columns: 1fr;
    }
    .inv-stage {
        min-height: 300px;
    }
    .inv-stage .tomato-char.lg,
    .inv-stage .inv-tomato {
        width: 112px;
        height: auto;
        bottom: 5%;
    }
    .lobby-list { min-height: 180px; }
    .chat-body {
        grid-template-columns: 1fr;
    }
    .chat-side {
        max-height: 150px;
    }
    .chat-title {
        font-size: 28px;
    }
    .ach-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .shop-picker {
        grid-template-columns: 1fr;
        align-content: start;
    }
    .shop-tile {
        min-height: 160px;
    }
    .shop-shelf {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .shop-stock-grid {
        grid-template-columns: 1fr;
    }
    .lobby-games-tools {
        width: 100%;
    }
    .splash-logo-wrap {
        padding: 18px 22px 10px;
    }
    .splash-mascot-row {
        min-height: 120px;
        gap: 4px;
    }
    .splash-side {
        width: 56px;
    }
    .tomato-char.splash-float {
        width: 46px;
        height: auto;
    }
    .splash-mascot .tomato-char.lg {
        width: 110px;
        height: auto;
    }
    .splash-online {
        font-size: 13px;
        letter-spacing: 3px;
    }
}

#ingame-hud.hidden { display: none !important; }

.ingame-bar {
    pointer-events: auto;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 8px 14px;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    color: #fff8e8;
    background:
        radial-gradient(circle at 12% 70%, rgba(255,180,80,0.18) 0 18px, transparent 19px),
        radial-gradient(circle at 88% 40%, rgba(0,0,0,0.12) 0 22px, transparent 23px),
        linear-gradient(180deg, #6a3a1c 0%, #4a2610 48%, #2e170a 100%);
    border-top: 3px solid #145a18;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.12),
        0 -6px 16px rgba(0,0,0,0.28);
}

.ingame-bar-grass {
    position: absolute;
    left: 0;
    right: 0;
    top: -7px;
    height: 10px;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, #3cb54a 0 7px, #2f9a3a 7px 10px, #6fd45a 10px 14px, #3cb54a 14px 18px);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 0 #145a18;
}

.ingame-bar-teams {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
}

.ingame-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px 0 7px;
    border-radius: 16px;
    background: rgba(0,0,0,0.28);
    border: 2px solid #1a0c08;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.12);
    white-space: nowrap;
}

.ingame-chip i {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--chip, #e74c3c);
    border: 2px solid #111;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.35);
    flex: 0 0 14px;
}

.ingame-chip b {
    font-size: 13px;
    font-weight: 700;
    text-shadow: 0 1px 0 #000;
}

.ingame-chip em {
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    color: #c8f7a8;
    text-shadow: 0 1px 0 #000;
}

.ingame-chip.is-on {
    border-color: #ffe56a;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.2),
        0 0 0 2px rgba(255,229,106,0.35);
}

.ingame-chip.is-out {
    opacity: 0.4;
    filter: grayscale(0.5);
}

.ingame-bar-status {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 0 #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ingame-mods {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
}

.ingame-mod {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    border: 2px solid #1a0c08;
    text-shadow: 0 1px 0 rgba(0,0,0,0.35);
    white-space: nowrap;
}

.ingame-mod.is-speed { background: #ff6b5a; color: #fff; }
.ingame-mod.is-wind { background: #6a7a88; color: #fff; }
.ingame-mod.is-bounce { background: #7ef0e0; color: #083830; }
.ingame-mod.is-nade { background: #2ecc71; color: #083018; }
.ingame-mod.is-hp { background: #ff8a7a; color: #3a0808; }
.ingame-mod.is-roll { background: #9b59b6; color: #fff; }
.ingame-mod.is-pro { background: #c0392b; color: #fff; }
.ingame-mod.is-invite { background: #ffe56a; color: #3a2808; }

.lobby-pro-tag {
    display: inline-flex;
    margin-left: 6px;
    padding: 0 5px;
    height: 16px;
    align-items: center;
    border-radius: 4px;
    background: #c0392b;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.4px;
}

.ingame-walk {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 10px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #163a12;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 2px, transparent 3px),
        linear-gradient(180deg, #9aee86 0%, #3cb54a 55%, #1e8a2c 100%);
    border: 2px solid #145a18;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.3);
}

.ingame-walk b {
    font-variant-numeric: tabular-nums;
}

.ingame-walk.is-low {
    color: #fff8e8;
    text-shadow: 0 1px 0 #000;
    border-color: #7a1510;
    background:
        linear-gradient(180deg, #ff8a7a 0%, #e74c3c 50%, #c0392b 100%);
}

.ingame-leave-btn {
    flex: 0 0 auto;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    font-size: 14px !important;
}

.ingame-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

.ingame-controls-card {
    position: relative;
    width: min(520px, 92vw);
    padding: 22px 22px 16px;
    border-radius: 16px;
    color: #fff;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    text-align: left;
    background: rgba(8, 8, 10, 0.94);
    border: 2px solid rgba(230, 230, 235, 0.85);
    box-shadow: 0 16px 36px rgba(0,0,0,0.5);
    animation: uiPopIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ingame-controls-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ingame-controls-close:hover { background: rgba(255,255,255,0.12); }
.ingame-controls-close .btn-icon {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.ingame-controls-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.ingame-controls-row p {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    color: #fff;
}

.ingame-controls-hint {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-align: center;
}

.ctrl-keys {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ctrl-keys-stack {
    flex-direction: column;
    gap: 4px;
}

.ctrl-key {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #111;
    border-radius: 6px;
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 2px 0 #bbb;
}

.ctrl-key-wide {
    min-width: 78px;
    font-size: 11px;
    letter-spacing: 0.6px;
}

.ctrl-mouse {
    width: 42px;
    height: 62px;
    margin: 0 auto;
    position: relative;
    background: #fff;
    border-radius: 14px 14px 18px 18px;
    box-shadow: 0 2px 0 #bbb;
}

.ctrl-mouse-left,
.ctrl-mouse-right {
    position: absolute;
    top: 3px;
    width: 16px;
    height: 18px;
    border-radius: 8px 4px 3px 3px;
}

.ctrl-mouse-left {
    left: 4px;
    background: #e74c3c;
}

.ctrl-mouse-right {
    right: 4px;
    background: #ececec;
}

.ctrl-mouse-wheel {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 10px;
    margin-left: -2px;
    border-radius: 2px;
    background: #c8c8c8;
}

.ingame-leave-modal {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 4, 0, 0);
    opacity: 0;
}

.ingame-leave-modal.is-in {
    pointer-events: auto;
    animation: modalDimIn 0.22s ease forwards;
}

.ingame-leave-modal.hidden { display: none !important; }

.lobby-logout-modal {
    z-index: 12;
}

.ingame-leave-card {
    width: min(420px, 90vw);
    padding: 22px 22px 18px;
    border-radius: 18px;
    color: #fff8e8;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    text-align: center;
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,0.2) 0 3px, transparent 4px),
        linear-gradient(180deg, #7a3a1c 0%, #4a1e10 55%, #2c1208 100%);
    border: 3px solid #7a1510;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.22),
        0 8px 0 #4a0e0a,
        0 18px 32px rgba(0,0,0,0.45);
    animation: uiPopIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ingame-leave-title {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 3px 0 #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ingame-leave-title .btn-icon {
    width: 1.1em;
    height: 1.1em;
    fill: #ffe56a;
    filter: drop-shadow(0 2px 0 #000);
}

.ingame-leave-copy {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.45;
    color: #ffe0c0;
    text-shadow: 0 1px 0 #000;
}

.ingame-leave-copy b { color: #ffe56a; }

.ingame-leave-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ingame-leave-actions .lobby-btn {
    width: 100%;
    height: 46px;
    min-height: 46px;
}

.ingame-leave-actions .lobby-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.2) brightness(0.72);
    transform: none !important;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,0.15),
        0 3px 0 #4a0e0a;
}

/* Boot / first-load screen */
#boot-stage {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow: hidden;
}

#boot-stage.is-out .boot-backdrop,
#boot-stage.is-out .boot-overlay {
    opacity: 0;
    transition: opacity 0.28s ease;
}

.boot-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 1;
}

#boot-fallback.boot-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: rgba(8, 16, 28, 0.22);
    color: #fff8e8;
    opacity: 1;
    transition: opacity 0.28s ease;
    animation: bootFadeIn 0.42s ease both;
    pointer-events: none;
}

#boot-fallback.is-out {
    opacity: 0;
}

.boot-title {
    margin: 0;
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.05;
    color: #fff8e8;
    text-shadow:
        0 3px 0 #3a0c08,
        0 6px 0 rgba(0,0,0,0.28);
}

.boot-tomato {
    width: 104px;
    height: 104px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boot-tomato-spin {
    width: 104px;
    height: 104px;
    animation: lobbyBob 0.85s ease-in-out infinite;
}

.boot-tomato-spin .tomato-char.md {
    width: 86px;
    margin-bottom: 0;
    animation: loadTomatoSpin 0.75s linear infinite;
    filter: drop-shadow(0 6px 0 rgba(0,0,0,0.28));
}

.boot-tomato-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ff8a7a 0%, #e74c3c 48%, #c0392b 100%);
    box-shadow: 0 6px 0 rgba(0,0,0,0.28);
    animation: loadTomatoSpin 0.75s linear infinite;
}

.boot-tomato:has(canvas) .boot-tomato-fallback {
    display: none;
}

.boot-bar {
    width: min(320px, 80vw);
    height: 14px;
    margin: 0;
    border-radius: 999px;
    border: 3px solid #5a100c;
    background: linear-gradient(180deg, #2a0c08 0%, #1a0806 100%);
    box-shadow: inset 0 2px 0 rgba(0,0,0,0.45);
    overflow: hidden;
}

.boot-bar-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background:
        linear-gradient(90deg, #ff8a7a 0%, #e74c3c 45%, #c0392b 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.35);
    transition: width 0.32s ease;
}

.boot-msg {
    margin: 0;
    min-height: 22px;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff8e8;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 0 #3a0c08;
}

@keyframes bootFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.load-veil {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.load-veil.is-on { opacity: 1; }
.load-veil.is-out { opacity: 0; }
.load-veil.hidden { display: none !important; }

.load-veil-spin {
    width: 104px;
    height: 104px;
    animation: loadTomatoSpin 0.7s linear infinite;
    filter: drop-shadow(0 8px 0 rgba(0,0,0,0.28));
}

.load-veil-spin .tomato-char {
    width: 104px;
    height: auto;
    margin: 0;
    animation: none;
}

.load-veil-title {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #fff8e8;
    text-shadow: 0 3px 0 #000;
    line-height: 1;
}

.load-veil-text {
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff6d8;
    text-shadow: 0 2px 0 #000;
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
}

.load-veil-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}

.load-veil-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffe56a;
    box-shadow: 0 1px 0 #000;
    animation: loadDot 0.72s ease-in-out infinite;
}

.load-veil-dots i:nth-child(2) { animation-delay: 0.12s; }
.load-veil-dots i:nth-child(3) { animation-delay: 0.24s; }

@keyframes loadTomatoSpin {
    to { transform: rotate(360deg); }
}

@keyframes loadDot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

/* Room lobby — inside main lobby-board */
.lobby-board.room-lobby-board {
    animation: lobbyIn 0.35s ease;
}

.room-lobby-aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.room-lobby-aside .room-back {
    align-self: flex-start;
}

.room-status-pill {
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, #2ea44f 0%, #1a6b32 100%);
    border: 2px solid rgba(111, 220, 140, 0.45);
    font-weight: 800;
    font-size: 13px;
    line-height: 1.35;
    color: #fff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.room-match-card {
    display: flex;
    gap: 12px;
    align-items: stretch;
    padding: 10px 12px;
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(42, 18, 14, 0.96), rgba(22, 8, 6, 0.98));
    border: 2px solid rgba(230, 140, 120, 0.32);
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.room-match-visual {
    position: relative;
    flex-shrink: 0;
    width: 104px;
    height: 76px;
    border-radius: 11px;
    overflow: hidden;
    border: 3px solid #7a3d00;
    background: #1a0c08;
    box-shadow:
        inset 0 0 0 1px rgba(255, 220, 140, 0.22),
        0 3px 0 #3a1a00;
}

.room-match-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.room-match-mode-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.3px;
    background: linear-gradient(180deg, #ffe56a 0%, #d4a017 100%);
    color: #2a1c10;
    border: 2px solid #6b4a08;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
    line-height: 1.1;
}

.room-match-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.room-match-map-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 248, 232, 0.45);
}

.room-match-map-name {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: 21px;
    font-weight: 800;
    font-style: italic;
    color: #fff8e8;
    line-height: 1.1;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.room-match-mode-line {
    margin-top: 4px;
}

.room-match-mode-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 800;
    color: #8ad4f8;
}

.room-match-mode-tag .btn-icon {
    width: 14px;
    height: 14px;
    opacity: 0.9;
}

.room-match-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.room-match-chip {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(46, 164, 79, 0.18);
    border: 1px solid rgba(111, 220, 140, 0.32);
    color: rgba(255, 248, 232, 0.88);
}

.room-invite-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 12px;
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(32, 14, 10, 0.92), rgba(18, 8, 6, 0.95));
    border: 2px solid rgba(245, 208, 0, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    gap: 8px;
}

.room-invite-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(255, 248, 232, 0.75);
    letter-spacing: 0.5px;
}

.room-invite-title .btn-icon {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.room-invite-code {
    font-family: 'Baloo 2', 'Fredoka', sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #f5d000;
    text-shadow: 0 2px 0 #000, 0 0 20px rgba(245, 208, 0, 0.35);
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px dashed rgba(245, 208, 0, 0.45);
    user-select: all;
}

.room-wait-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 12px;
    border-radius: 14px;
    background: rgba(8, 6, 10, 0.45);
    border: 2px solid rgba(230, 140, 120, 0.22);
    gap: 8px;
}

.room-wait-pulse {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(46, 164, 79, 0.15);
    border: 3px solid rgba(111, 220, 140, 0.4);
    animation: roomWaitPulse 1.6s ease-in-out infinite;
}

@keyframes roomWaitPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
}

.room-wait-text {
    font-weight: 800;
    font-size: 14px;
    color: #fff8e8;
    margin: 0;
}

.room-wait-sub {
    font-size: 12px;
    color: rgba(255, 248, 232, 0.6);
    margin: 0;
    line-height: 1.4;
}

.room-aside-note {
    font-size: 11px;
    line-height: 1.4;
    color: rgba(255, 248, 232, 0.5);
    margin: 0;
    text-align: center;
}

.room-leave-nav {
    margin-top: auto;
}

.room-lobby-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
}

.room-lobby-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 10px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    transition: grid-template-columns 0.44s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-lobby-grid.is-chat-collapsed {
    grid-template-columns: minmax(0, 1fr) 0fr;
}

.room-lobby-head-main {
    min-width: 0;
}

.room-show-chat-btn {
    flex-shrink: 0;
    height: 34px;
    min-height: 34px;
    font-size: 12px;
    padding: 0 12px;
}

.room-players-list {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
    background: rgba(8, 6, 10, 0.5);
    border: 2px solid rgba(230, 140, 120, 0.22);
    border-radius: 12px;
    transition: flex 0.44s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-chat-panel {
    grid-column: 2;
    min-height: 0;
    max-height: 100%;
    min-width: 0;
    opacity: 1;
    transform: translateX(0);
    transition:
        opacity 0.34s ease,
        transform 0.44s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-lobby-grid.is-chat-collapsed .room-chat-panel {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    overflow: hidden;
}

.room-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 0;
    flex-shrink: 0;
}

.room-chat-min-btn {
    flex-shrink: 0;
    height: 34px;
    min-height: 34px;
    font-size: 12px;
    padding: 0 10px;
}

.room-chat-min-btn .btn-icon {
    width: 1em;
    height: 1em;
    transition: transform 0.44s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-lobby-grid.is-chat-collapsed .room-chat-min-btn .btn-icon {
    transform: rotate(180deg);
}

.room-lobby-grid.is-chat-collapsed .room-chat-min-btn .btn-icon {
    transform: rotate(180deg);
}

.room-lobby-grid.is-chat-collapsed .room-players-list {
    animation: roomPlayersExpand 0.44s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes roomPlayersExpand {
    from { opacity: 0.9; transform: scale(0.98); }
    to { opacity: 1; transform: none; }
}

.room-lobby-grid.is-chat-collapsed .room-player {
    padding: 14px 14px;
}

.room-lobby-grid.is-chat-collapsed .room-player-face {
    width: 52px;
    height: 52px;
}

.room-lobby-grid.is-chat-collapsed .room-player-body strong {
    font-size: 16px;
}

.room-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(28, 10, 10, 0.88);
    border: 2px solid rgba(230, 140, 120, 0.22);
}

.room-player.is-ready {
    border-color: rgba(46, 164, 79, 0.55);
    box-shadow: inset 0 0 16px rgba(46, 164, 79, 0.08);
}

.room-player.is-me {
    border-color: var(--skin, #e74c3c);
}

.room-player.is-empty {
    opacity: 0.55;
}

.room-player-face {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-player-face.is-empty-face {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    opacity: 0.6;
}

.room-player-face.is-empty-face .btn-icon {
    width: 22px;
    height: 22px;
}

.room-player-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.room-player-body strong {
    font-size: 15px;
    font-weight: 800;
    color: #fff8e8;
}

.room-player-body span {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 248, 232, 0.65);
}

.room-player-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.room-player-mark.is-on {
    background: linear-gradient(180deg, #3d9e4a, #1f6b32);
}

.room-player-mark .btn-icon {
    width: 18px;
    height: 18px;
}

.room-add-bot {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #6cb6ff 0%, #2470c9 100%);
    border: 2px solid #072a58;
    box-shadow: 0 3px 0 #072a58;
    color: #fff;
}

.room-add-bot:hover {
    filter: brightness(1.08);
}

.room-add-bot:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #072a58;
}

.room-add-bot .btn-icon {
    width: 22px;
    height: 22px;
}

.room-player.is-bot {
    border-color: rgba(36, 112, 201, 0.45);
}

.room-player-face.is-bot-face {
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(36, 112, 201, 0.35), rgba(8, 24, 48, 0.6));
    border: 2px solid rgba(111, 180, 248, 0.35);
}

.room-player-face.is-bot-face .btn-icon {
    width: 24px;
    height: 24px;
    opacity: 0.9;
}

.room-chat-panel .chat-log {
    min-height: 100px;
    flex: 1 1 auto;
}

.room-chat-panel .chat-compose {
    flex-shrink: 0;
}

.room-chat-panel .chat-input {
    pointer-events: auto;
}

.room-chat-label {
    font-family: 'Baloo 2', 'Fredoka', Impact, sans-serif;
    font-size: 20px;
    font-weight: 800;
    font-style: italic;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 0 #000;
    padding: 0;
    margin: 0;
}

.room-chat-line b {
    color: #f5d000;
}

.room-chat-line em {
    color: rgba(184, 255, 244, 0.7);
    font-style: normal;
}

.room-lobby-actions {
    flex-shrink: 0;
}

.room-action-btn {
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 800;
}

.room-action-btn.is-on {
    background: linear-gradient(180deg, #ffe56a 0%, #c9a020 100%);
    color: #2a1c10;
}

#room-lobby-err {
    text-align: center;
    font-weight: 800;
    font-size: 13px;
}

@media (max-width: 900px) {
    .room-lobby-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    .room-players-list {
        grid-column: auto;
        grid-row: 1;
    }
    .room-chat-panel {
        grid-column: auto;
        grid-row: 2;
    }
    .room-lobby-grid.is-chat-collapsed {
        grid-template-rows: 1fr 0fr;
    }
    .room-lobby-grid.is-chat-collapsed .room-chat-panel {
        display: none;
    }
    .room-chat-min-btn {
        display: inline-flex;
    }
    .room-show-chat-btn {
        align-self: center;
    }
}
