/* Slime Volley - Stylesheet */
:root {
    --bg-dark: #0a0a1a;
    --bg-panel: #1a1a2e;
    --bg-input: #16213e;
    --border: #2a2a4e;
    --text: #e0e0e0;
    --text-dim: #888;
    --primary: #4FC3F7;
    --primary-dark: #0288D1;
    --secondary: #b366ff;
    --secondary-dark: #7b2fff;
    --danger: #EF5350;
    --success: #66BB6A;
    --team-a: #4FC3F7;
    --team-b: #EF5350;
}

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

html, body {
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
}

body {
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Segoe UI', Arial, sans-serif;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
}

/* Header */
#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(26, 26, 46, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

#game-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}

.back-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 1.5rem;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}
.back-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.icon-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.icon-btn.muted { color: var(--danger); border-color: var(--danger); }

/* Screens */
.screen {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
}
.screen.active {
    display: flex;
}

/* Error Toast */
#error-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--danger);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s;
    z-index: 200;
    pointer-events: none;
}
#error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Archerlab Link */
.archerlab-link {
    display: inline-block;
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 16px;
    transition: opacity 0.2s;
}
.archerlab-link:hover {
    opacity: 1;
}

/* Menu */
.menu-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.game-logo {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    height: 80px;
}

.logo-slime {
    width: 60px;
    height: 30px;
    border-radius: 60px 60px 0 0;
    position: relative;
}
.logo-slime.blue { background: var(--team-a); }
.logo-slime.red { background: var(--team-b); }
.logo-slime::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    top: 8px;
}
.logo-slime.blue::after { right: 12px; }
.logo-slime.red::after { left: 12px; }

.logo-ball {
    width: 28px;
    height: 28px;
    background: #FFEB3B;
    border-radius: 50%;
    margin-bottom: 20px;
    animation: logoBounce 2s ease-in-out infinite;
}

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

.menu-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(79, 195, 247, 0.4);
    margin-bottom: 4px;
}

.menu-subtitle {
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

/* Buttons */
.btn {
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    position: relative;
}

.btn-large {
    padding: 16px 28px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    font-size: 1.4rem;
    width: 32px;
    text-align: center;
}

.btn-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    position: absolute;
    right: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    font-weight: bold;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(79, 195, 247, 0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-secondary:hover { border-color: var(--primary); background: rgba(79, 195, 247, 0.1); }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); }

.btn-small {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
}
.btn-small:hover { border-color: var(--primary); color: var(--primary); }

.btn-small-primary {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
}
.btn-small-primary:hover { box-shadow: 0 2px 12px rgba(79, 195, 247, 0.3); }

/* Controls Guide */
.controls-guide {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.8;
}

kbd {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: var(--text);
}

/* Panel */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
}
.panel-wide { max-width: 600px; }

.panel h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-inline label {
    margin-bottom: 0;
    white-space: nowrap;
}
.form-inline .input-text {
    flex: 1;
}

.input-text, .input-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.input-text:focus, .input-select:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.form-actions .btn { flex: 1; }

/* Lobby Top */
.lobby-top {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}
.lobby-top .form-group {
    flex: 1;
    margin-bottom: 0;
}
.lobby-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Room List */
.room-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-dark);
}

.room-list-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.room-item:last-child { border-bottom: none; }
.room-item.room-waiting:hover {
    background: rgba(79, 195, 247, 0.08);
}
.room-item.room-playing {
    opacity: 0.5;
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.room-host {
    font-weight: bold;
    font-size: 0.95rem;
}
.room-detail {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.room-status {
    display: flex;
    align-items: center;
    gap: 10px;
}
.room-status-badge {
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.status-waiting {
    background: rgba(102, 187, 106, 0.2);
    color: var(--success);
}
.status-playing {
    background: rgba(239, 83, 80, 0.2);
    color: var(--danger);
}
.room-code-small {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Room Screen */
.room-code-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: 10px;
}

.room-code-label {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.room-code {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 4px;
}

.room-meta {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.room-meta span {
    color: var(--primary);
    font-weight: bold;
}

/* Player List */
.player-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.team-group {
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 12px;
}

.team-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid;
}
.team-0 .team-label { color: var(--team-a); border-color: var(--team-a); }
.team-1 .team-label { color: var(--team-b); border-color: var(--team-b); }

.player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.player-item.ready { background: rgba(102, 187, 106, 0.1); }
.player-item.empty { opacity: 0.3; }

.player-name { flex: 1; }
.empty-slot { font-style: italic; color: var(--text-dim); }

.player-badge {
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.host-badge { background: rgba(255, 193, 7, 0.2); color: #FFC107; }
.ready-badge { background: rgba(102, 187, 106, 0.2); color: var(--success); }
.bot-badge { background: rgba(179, 102, 255, 0.2); color: var(--secondary); }

.btn-ready.active {
    background: var(--success);
    color: white;
}

/* Chat */
.chat-section {
    margin-top: 12px;
    margin-bottom: 8px;
}
.chat-messages {
    height: 100px;
    overflow-y: auto;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.8rem;
    margin-bottom: 6px;
}
.chat-msg {
    margin-bottom: 3px;
    word-break: break-word;
}
.chat-name {
    color: var(--primary);
    font-weight: bold;
    margin-right: 4px;
}
.chat-input-row {
    display: flex;
    gap: 6px;
}
.chat-input-field {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Kick Button */
/* Ping Display */
.player-ping {
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    margin-right: 4px;
    min-width: 42px;
    text-align: center;
}
.ping-good {
    background: rgba(102, 187, 106, 0.2);
    color: #66BB6A;
}
.ping-ok {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}
.ping-bad {
    background: rgba(239, 83, 80, 0.2);
    color: #EF5350;
}

.btn-kick {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-kick:hover { opacity: 1; }

.player-item.me {
    background: rgba(79, 195, 247, 0.08);
}

/* Game Screen Layout */
#game-screen.screen {
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px;
    overflow: hidden;
}

/* Game Canvas */
.game-canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 800px;
    flex: 1 1 0;
    min-height: 0;
}

.game-canvas-container canvas {
    display: block;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.1);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Mobile Controls - 화면 좌우 분할 오버레이 */
.mobile-controls {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
}

.touch-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.touch-zone-left {
    left: 0;
    width: 50%;
}

.touch-zone-right {
    right: 0;
    width: 50%;
}

/* 조이스틱 비주얼 - 캔버스 바깥 사이드 */
.joystick-visual {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 11;
}

.joystick-visual-left {
    left: 12px;
}

.joystick-visual-right {
    right: 12px;
}

.joystick-base {
    width: 100px;
    height: 50px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    position: relative;
}

.joystick-knob {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transition: transform 0.1s;
    flex-shrink: 0;
}

.joystick-arrow {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.jump-btn-visual {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    font-weight: bold;
}

/* 터치 활성화 시 */
.touch-zone-left.active .joystick-base {
    border-color: rgba(79, 195, 247, 0.3);
}
.touch-zone-left.active .joystick-knob {
    background: rgba(79, 195, 247, 0.3);
    border-color: rgba(79, 195, 247, 0.5);
}
.touch-zone-right.active .jump-btn-visual {
    background: rgba(79, 195, 247, 0.15);
    border-color: rgba(79, 195, 247, 0.4);
    color: rgba(79, 195, 247, 0.6);
}

@media (max-width: 768px) {
    .mobile-controls { display: block !important; }
    .controls-guide { display: none !important; }
    .lobby-top { flex-direction: column; align-items: stretch; }
    .lobby-actions { justify-content: flex-end; }
}

@media (hover: none) and (pointer: coarse) {
    .mobile-controls { display: block !important; }
    .controls-guide { display: none !important; }
}

@media (any-pointer: coarse) {
    .mobile-controls { display: block !important; }
    .controls-guide { display: none !important; }
}

/* 모바일 가로 모드: 높이 부족 시 UI 압축 */
@media (max-height: 450px) {
    #game-header {
        padding: 2px 10px;
    }
    #game-header h1 {
        font-size: 0.9rem;
    }
    .icon-btn {
        padding: 2px 8px;
        font-size: 0.75rem;
    }
    .back-link {
        font-size: 1.1rem;
        padding: 2px 6px;
    }
    /* 스크롤 방지 - 로비/방 화면은 패널 내부 스크롤 허용 */
    .screen {
        padding: 8px;
        overflow: hidden;
    }
    #multiplayer-lobby.screen,
    #room-screen.screen {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* 메뉴 압축 */
    .archerlab-link {
        display: none;
    }
    .game-logo {
        height: 36px;
        margin-bottom: 4px;
        gap: 10px;
    }
    .logo-slime {
        width: 32px;
        height: 16px;
    }
    .logo-ball {
        width: 16px;
        height: 16px;
        margin-bottom: 8px;
    }
    .menu-title {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
    .menu-subtitle {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    .menu-buttons {
        gap: 6px;
        margin-bottom: 0;
    }
    .btn-large {
        padding: 8px 16px;
    }
    .btn-icon {
        font-size: 1rem;
        width: 22px;
    }
    .btn-desc {
        font-size: 0.6rem;
    }
    /* 패널 압축 */
    .panel {
        padding: 10px 14px;
        border-radius: 10px;
    }
    .panel h2 {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    .form-group {
        margin-bottom: 4px;
    }
    .form-group label {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }
    .input-text, .input-select {
        padding: 6px 10px;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    .form-actions {
        margin-top: 6px;
        gap: 8px;
    }
    .form-actions .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    /* 로비/방 화면: 패널이 뷰포트에 맞게 축소 */
    #multiplayer-lobby.screen,
    #room-screen.screen,
    #create-room.screen,
    #practice-setup.screen {
        align-items: stretch;
        justify-content: center;
        padding: 4px 8px;
    }
    #multiplayer-lobby .panel-wide,
    #room-screen .panel-wide {
        max-height: 100%;
        display: flex;
        flex-direction: column;
        margin: 0 auto;
    }
    #multiplayer-lobby .room-list,
    #room-screen .player-list {
        flex-shrink: 1;
        min-height: 0;
    }
    /* 로비 화면 압축 */
    .panel-wide {
        padding: 8px 12px;
        max-width: 95vw;
    }
    .panel-wide h2 {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    .lobby-top {
        flex-direction: row !important;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }
    .lobby-top .form-group {
        margin-bottom: 0;
    }
    .lobby-top .form-inline {
        gap: 6px;
    }
    .lobby-top .input-text {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    .lobby-actions {
        gap: 4px;
    }
    .room-list {
        max-height: 35vh;
    }
    .room-list-empty {
        padding: 16px 10px;
    }
    .room-item {
        padding: 6px 10px;
    }
    /* 방 화면 압축 */
    .room-code-section {
        padding: 6px 10px;
        margin-bottom: 4px;
        gap: 8px;
    }
    .room-code {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
    .room-code-label {
        font-size: 0.75rem;
    }
    .room-meta {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    .player-list {
        gap: 8px;
        margin-bottom: 4px;
    }
    .team-group {
        padding: 6px 8px;
    }
    .team-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
        padding-bottom: 3px;
    }
    .player-item {
        padding: 3px 6px;
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    .chat-section {
        margin-top: 4px;
        margin-bottom: 4px;
    }
    .chat-messages {
        height: 48px;
        padding: 4px 6px;
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    .chat-input-field {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
    .btn-small, .btn-small-primary {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    /* checkbox 압축 */
    .checkbox-label {
        font-size: 0.8rem;
    }
    .checkbox-label input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
    /* 게임 화면 */
    #game-screen.screen {
        padding: 0 2px;
    }
    .joystick-base {
        width: 80px;
        height: 40px;
    }
    .joystick-knob {
        width: 22px;
        height: 22px;
    }
    .jump-btn-visual {
        width: 55px;
        height: 55px;
        font-size: 0.65rem;
    }
}

/* 극단적으로 낮은 높이 (300px 이하) */
@media (max-height: 300px) {
    #game-header {
        display: none;
    }
    .panel-wide {
        padding: 6px 10px;
    }
    .panel-wide h2 {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    .room-list {
        max-height: 25vh;
    }
    .room-code-section {
        padding: 4px 8px;
        margin-bottom: 2px;
    }
    .room-code {
        font-size: 1rem;
    }
    /* 극소 화면 채팅: 한 줄 인라인 */
    .chat-section {
        margin: 2px 0;
        display: flex;
        gap: 4px;
        align-items: center;
    }
    .chat-messages {
        height: 20px;
        flex: 1;
        overflow: hidden;
        border: none;
        background: transparent;
        padding: 0 4px;
        font-size: 0.65rem;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        border-radius: 4px;
        background: rgba(255,255,255,0.03);
    }
    .chat-input-row {
        flex-shrink: 0;
        gap: 3px;
    }
    .chat-input-field {
        width: 90px;
        padding: 2px 6px;
        font-size: 0.65rem;
    }
    .chat-input-row .btn-small {
        padding: 2px 6px;
        font-size: 0.6rem;
    }
    .player-list {
        gap: 4px;
        margin-bottom: 2px;
    }
    .team-group {
        padding: 4px 6px;
    }
    .form-actions {
        margin-top: 4px;
    }
    .form-actions .btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    #game-screen.screen {
        padding: 0;
    }
    .joystick-base {
        width: 70px;
        height: 36px;
    }
    .joystick-knob {
        width: 20px;
        height: 20px;
    }
    .jump-btn-visual {
        width: 48px;
        height: 48px;
        font-size: 0.6rem;
    }
}

/* Game Over */
.game-over-panel { text-align: center; }

.game-over-score {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    margin: 24px 0;
    color: var(--text);
}

.game-over-sets {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-dim);
}
.set-score {
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 6px;
}

#game-over-title.victory {
    color: #FFD700;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

#game-over-title.defeat {
    color: var(--text-dim);
    font-size: 2rem;
}

.game-over-mvp {
    margin: 16px 0;
    text-align: center;
}
.mvp-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 6px;
}
.mvp-names {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}
.mvp-stats {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Rotate Overlay (portrait warning) */
#rotate-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    background: #0a0a1a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #fff;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
}
#rotate-overlay .rotate-icon {
    font-size: 4rem;
    animation: rotatePhone 2s ease-in-out infinite;
}
#rotate-overlay .rotate-sub {
    font-size: 0.8rem;
    color: #888;
    font-family: sans-serif;
}
@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(90deg); }
    75% { transform: rotate(0deg); }
}
@media (max-width: 768px) and (orientation: portrait),
       (hover: none) and (pointer: coarse) and (orientation: portrait) {
    #rotate-overlay { display: flex; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen.active {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
