@charset "UTF-8";
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    src: url('assets/fonts/PressStart2P-Regular.ttf') format('truetype');
    font-display: block;
}

:root {
    --bg: #0b0f17;
    --surface: #111827;
    --panel: #111827;
    --panel-soft: #1e293b;
    --primary: #07ebce;
    --primary-strong: #1ac1eb;
    --accent: #2f4feb;
    --accent-strong: #1c80eb;
    --danger: #ff5f6d;
    --warning: #ffb454;
    --success: #2feb93;
    --muted: #a9deeb;
    --text: #e5e7eb;
    --text-weak: #cbd5e1;
    --page-bg: #f1f5ba;
    --menu-bg: #e69617;
    --menu-text: #000;
    --menu-active: #fa3605;
    --border: #fff;
    --shadow-strong: 0 10px 40px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.25);
    --radius: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ============================================================ */
/* BODY E LAYOUT PRINCIPAL */
/* ============================================================ */

body {
    background: var(--page-bg);
    color: var(--text);
    font-family: "Press Start 2P", monospace;
    font-size: 10.4px;
    letter-spacing: 0.4px;
    margin: 0;
    padding: 0 20px 20px 20px; /* Sem padding-top - HUD fixo no topo */
    overflow: hidden;
    text-transform: uppercase;

    /* CENTRALIZAÇÃO */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
}

.case-exempt {
    text-transform: none;
}

/* ============================================================ */
/* HUD */
/* ============================================================ */

#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--menu-bg);
    border: none; /* SEM STROKE */
    padding: 12px 16px;
    border-radius: 0; /* RETO - colado no topo */
    box-shadow: var(--shadow-soft);
    width: 100%;
    color: var(--menu-text);
    z-index: 900;
}

.hud-pill {
    background: var(--menu-bg);
    border: 1px solid var(--border);
    border-radius: 4px; /* SUTIL - era var(--radius) */
    padding: 8px 14px;
    color: var(--menu-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9.6px;
    white-space: nowrap;
}

.hud-pill .value {
    color: #fff;
}

/* ============================================================ */
/* GAME CONTAINER */
/* ============================================================ */

#game-container {
    position: relative;
    display: inline-block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(145deg, #0d111c, #0b0f17);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
}

#game-container.portrait-mode {
    transform: rotate(90deg);
    transform-origin: center center;
}

canvas {
    background: #0d111c;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
}

/* COMPENSA HUD FIXO NO TOPO */
#game-ui {
    padding-top: 70px;
    width: 100%;
}

/* Overlay de GIF animado para tile bônus */
#bonus-gif-overlay {
    position: absolute;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    object-fit: contain;
    pointer-events: none;
    z-index: 10;
}

/* ============================================================ */
/* BOTÕES */
/* ============================================================ */

.ds-btn {
    font-family: inherit;
    font-size: 8.8px;
    padding: 8px 12px;
    border-radius: 4px; /* Sutil - era 10px */
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
    white-space: nowrap;
}

.ds-btn:active {
    transform: translateY(1px);
}

.ds-btn.primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 8px 22px rgba(7, 235, 206, 0.25);
    border-color: var(--border);
}

.ds-btn.primary:hover {
    background: var(--primary-strong);
    box-shadow: 0 10px 28px rgba(7, 235, 206, 0.32);
}

.ds-btn.ghost {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--border);
}

.ds-btn.ghost:hover {
    border-color: var(--border);
    color: var(--primary-strong);
}

#hud .ds-btn.ghost {
    background: var(--menu-bg);
    color: var(--menu-text);
    border-color: var(--border);
}

#hud .ds-btn.ghost:hover,
#hud .ds-btn.ghost:active {
    background: var(--menu-active);
    color: var(--menu-text);
}

/* Valores de modo e dificuldade em branco */
#hud .ds-btn.ghost .case-exempt {
    color: #fff;
}

#modeToggle,
#diffToggle {
    background: var(--menu-active);
    color: var(--menu-text);
    border-color: var(--border);
}

#modeToggle:hover,
#diffToggle:hover,
#modeToggle:active,
#diffToggle:active {
    background: var(--menu-active);
    color: var(--menu-text);
}

#modeToggle .case-exempt,
#diffToggle .case-exempt {
    color: #fff;
}

#hud #resetBtn {
    background: var(--menu-bg);
    color: var(--menu-text);
    border-color: var(--border);
    box-shadow: none;
}

#hud #resetBtn:hover,
#hud #resetBtn:active {
    background: var(--menu-active);
    color: var(--menu-text);
}

/* ============================================================ */
/* CONTROLES MOBILE */
/* ============================================================ */

#controls {
    margin-top: 16px;
    display: none; /* ESCONDIDO POR PADRÃO (DESKTOP) */
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(2, 64px);
    gap: 6px;
}

/* APENAS MOBILE */
@media (max-width: 768px) {
    #controls {
        display: grid;
    }
}

.ctrl {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14.4px;
    border-radius: var(--radius);
    cursor: pointer;
}

.ctrl:active {
    background: var(--panel-soft);
}

#controls .ctrl[data-dir="up"] { grid-column: 2; grid-row: 1; }
#controls .ctrl[data-dir="left"] { grid-column: 1; grid-row: 2; }
#controls .ctrl[data-dir="down"] { grid-column: 2; grid-row: 2; }
#controls .ctrl[data-dir="right"] { grid-column: 3; grid-row: 2; }

/* ============================================================ */
/* CONTROLES LANDSCAPE MOBILE */
/* ============================================================ */

#landscape-controls {
    display: none; /* ESCONDIDO POR PADRÃO */
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 800;
}

/* APENAS LANDSCAPE MOBILE */
@media (orientation: landscape) and (max-width: 1024px) {
    /* Remover padding do body para HUD full width */
    body {
        padding: 0;
        gap: 0;
    }

    /* Esconder controles portrait */
    #controls {
        display: none !important;
    }

    /* Mostrar controles landscape */
    #landscape-controls {
        display: block;
    }

    /* HUD OTIMIZADO PARA 1 LINHA - FULL WIDTH - FIXO NO TOPO */
    #hud {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 8px 16px; /* Padding interno mantido */
        gap: 8px;
        font-size: 7.8px;
        border-radius: 0;
        z-index: 900;
    }

    #hud .ds-btn {
        font-size: 6.6px; /* -25% de 8.8px */
        padding: 5px 7px; /* -20% de 8px 12px */
        border-radius: 4px; /* Sutil */
    }

    #hud .hud-pill {
        padding: 6px 10px; /* Reduzido */
        font-size: 7.2px; /* -25% de 9.6px */
        gap: 4px;
    }

    /* Textos curtos para botões - esconde texto completo */
    #modeToggle .full-text,
    #diffToggle .full-text {
        display: none;
    }

    /* Mostra texto curto via data-attribute */
    #modeToggle::before {
        content: attr(data-mobile-text);
    }

    #diffToggle::before {
        content: attr(data-mobile-text);
    }

    /* CANVAS E GAME CONTAINER - AJUSTE PARA LANDSCAPE */
    #game-ui {
        gap: 0 !important;
        padding-top: 45px; /* Compensa HUD fixo */
        min-height: 100vh;
        justify-content: center;
    }

    #game-container {
        max-width: calc(100vw - 136px); /* Desconta botões (48px) + margens (10px) x2 = 116px + 20px padding = 136px */
        max-height: calc(100vh - 50px);
        margin: 0 auto;
    }

    #gameCanvas {
        width: 100% !important;
        height: auto !important;
        max-height: calc(100vh - 55px);
        object-fit: contain;
    }

    /* OVERLAYS - FONTE -20% E SCROLL */
    #ranking-section {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        font-size: 7px; /* -20% de 8.8px */
    }

    #ranking-section .msg-header {
        font-size: 12.8px; /* -20% de 16px */
    }

    #ranking-section .msg-body {
        font-size: 7.68px; /* -20% de 9.6px */
    }

    #ranking-section li {
        font-size: 7px; /* -20% de 8.8px */
    }

    #ranking-section .ds-btn {
        font-size: 7px; /* -20% de 8.8px */
        padding: 6px 10px; /* -20% */
    }

    #ranking-section .ds-input {
        font-size: 7.68px; /* -20% de 9.6px */
        padding: 8px 10px; /* -20% */
    }

    #ranking-section .ranking-mode-toggle {
        font-size: 7.68px; /* -20% de 9.6px */
        padding: 8px 10px; /* -20% */
    }

    /* Modal de instruções na splash */
    .splash-modal-content {
        max-height: 70vh;
        overflow-y: auto;
    }

    #splash-modal-text {
        font-size: 8px; /* -20% de 10px */
    }

    .splash-modal-content .ds-btn {
        font-size: 7px; /* -20% de 8.8px */
    }
}

#landscape-left,
#landscape-right {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 11px; /* -30% de 16px = 11.2px arredondado para 11px */
    pointer-events: auto;
}

/* Esquerda: posicionado no terço inferior */
#landscape-left {
    left: 10px;
    bottom: 60px;
}

/* Direita: posicionado no terço inferior */
#landscape-right {
    right: 10px;
    bottom: 60px;
}

.landscape-btn {
    width: 48px;  /* -20% de 60px */
    height: 48px; /* -20% de 60px */
    background: rgba(17, 24, 39, 0.75); /* 75% opacidade */
    border: 2px solid #ff5500; /* Stroke laranja */
    color: #ff5500; /* Ícones laranja */
    font-size: 20px; /* Ajustado proporcionalmente */
    border-radius: 4px; /* Sutil - era 10px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 120ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px); /* Efeito glassmorphism */
}

.landscape-btn:active {
    background: rgba(255, 85, 0, 0.3); /* Laranja com opacidade ao pressionar */
    transform: scale(0.95);
    border-color: #ffd55c;
    color: #ffd55c;
}

/* ============================================================ */
/* OVERLAYS E MENSAGENS */
/* ============================================================ */

#message {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8); /* Fundo escuro igual à splash screen */
    z-index: 1000;
    cursor: pointer; /* Permite click fora para fechar */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#message.visible {
    opacity: 1;
    pointer-events: auto;
}

#message-text {
    white-space: pre-line;
    text-align: center;
    font-size: 11.2px;
    color: #ffffff; /* Texto branco */
    width: 100%;
}

.msg-header {
    font-size: 16px;
    color: #ffffff; /* Branco */
    margin-bottom: 8px;
    text-transform: uppercase;
}

.msg-score {
    font-size: 12.8px;
    color: #ff5500; /* Laranja para destaque */
    margin-top: 8px;
}

.msg-share {
    font-size: 14px;
    color: #fa3605;
    line-height: 1.6;
    text-align: center;
}

#shareMessage {
    display: none;
}

.msg-body {
    font-size: 9.6px;
    line-height: 1.8;
    color: #ffffff; /* Texto branco */
    text-align: left;
    max-width: 600px;
}

/* ============================================================ */
/* RANKING MODAL */
/* ============================================================ */

#ranking-section {
    display: none;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 500px;
    background: var(--panel); /* Fundo escuro */
    border: 2px solid #ffd55c; /* Borda amarela */
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(255, 213, 92, 0.3);
    cursor: auto; /* Previne propagação do click */
}

/* Toggle de modo do ranking */
.ranking-mode-toggle {
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffd55c;
    color: #ffd55c;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 9.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 213, 92, 0.3);
    position: relative;
}

.ranking-mode-toggle::after {
    content: ' ↻';
    margin-left: 6px;
    font-size: 14px;
}

.ranking-mode-toggle:hover {
    background: rgba(255, 85, 0, 0.2);
    border-color: #ff5500;
    box-shadow: 0 6px 16px rgba(255, 85, 0, 0.5);
    transform: translateY(-1px);
}

.ranking-mode-toggle:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(255, 213, 92, 0.3);
}

.ranking-mode-toggle .case-exempt {
    color: #ffffff;
    font-weight: bold;
    text-decoration: underline;
}

#ranking-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

#ranking-section li {
    display: flex;
    justify-content: space-between;
    font-size: 8.8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #ffd55c;
    color: #ffffff;
    transition: all 120ms ease;
}

#ranking-section li:hover {
    background: rgba(255, 85, 0, 0.3);
    border-color: #ff5500;
    color: #ffffff;
}

/* Ações do ranking - 3 botões na mesma linha */
.ranking-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
}

/* Botões dentro do ranking */
#ranking-section .ds-btn.primary {
    background: rgba(255, 85, 0, 0.9);
    color: #fff;
    border: 2px solid #ff5500;
    box-shadow: 0 8px 22px rgba(255, 85, 0, 0.35);
    flex: 1;
    min-width: 100px;
}

#ranking-section .ds-btn.primary:hover {
    background: rgba(255, 85, 0, 1);
    box-shadow: 0 10px 28px rgba(255, 85, 0, 0.45);
}

#ranking-section .ds-btn.ghost {
    background: rgba(0, 0, 0, 0.7);
    color: #ffd55c;
    border: 2px solid #ffd55c;
    box-shadow: 0 4px 12px rgba(255, 213, 92, 0.3);
    flex: 1;
    min-width: 100px;
}

#ranking-section .ds-btn.ghost:hover {
    background: rgba(255, 85, 0, 0.2);
    color: #ff5500;
    border-color: #ff5500;
    box-shadow: 0 6px 16px rgba(255, 85, 0, 0.5);
}

/* Input dentro do ranking */
#ranking-section .ds-input {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffd55c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 213, 92, 0.3);
}

#ranking-section .ds-input:focus {
    border-color: #ff5500;
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.4);
}

#ranking-section .ds-input::placeholder {
    color: rgba(255, 213, 92, 0.6);
}

.list-compact {
    /* Estilos já aplicados acima */
}

/* ============================================================ */
/* INPUTS */
/* ============================================================ */

.ds-input {
    width: 100%;
    background: var(--menu-bg); /* Laranja */
    border: 2px solid var(--border);
    color: #fff; /* Branco */
    padding: 10px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 9.6px;
    text-transform: uppercase; /* CAIXA ALTA */
    transition: border 120ms ease, box-shadow 120ms ease;
}

.ds-input:focus {
    outline: none;
    border-color: var(--border);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.ds-input::placeholder {
    color: rgba(255, 255, 255, 0.6); /* Branco com transparência */
    text-transform: uppercase; /* CAIXA ALTA */
}


/* ============================================================ */
/* COUNTDOWN CENTRAL */
/* ============================================================ */

#centerCountdown {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    font-size: 19.2px;
    font-weight: bold;
    color: var(--menu-active); /* Vermelho/laranja */
    text-shadow: 0 0 10px rgba(250, 54, 5, 0.8), 0 0 20px rgba(250, 54, 5, 0.5);
    pointer-events: none;
    white-space: pre-line;
    text-align: center;
    z-index: 100;
    transition: font-size 0.3s ease, color 0.3s ease;
}

.countdown-block {
    display: block;
    opacity: 0;
    transform: translateY(6px);
    animation: countdownFade 0.5s ease forwards;
    line-height: 1.4;
}

@keyframes countdownFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Background escurecido para countdown overlay */
#game-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    pointer-events: none;
    z-index: 99;
    transition: opacity 0.3s ease;
}

#game-container.countdown-active::before {
    opacity: 1;
}

/* ============================================================ */
/* DROPDOWNS */
/* ============================================================ */

.dropdown-panel {
    position: fixed;
    display: none;
    background: var(--menu-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    z-index: 900;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.dropdown-panel.open {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dropdown-option {
    background: var(--page-bg);
    border: 1px solid var(--border);
    color: var(--menu-text);
    padding: 8px 12px;
    border-radius: var(--radius);
    text-align: left;
    cursor: pointer;
    transition: border 120ms ease, color 120ms ease, background 120ms ease;
    font-family: inherit;
    font-size: 8.8px;
}

.dropdown-option:hover,
.dropdown-option:active,
.dropdown-option.active {
    border-color: var(--border);
    color: var(--menu-text);
    background: var(--menu-active);
}

/* ============================================================ */
/* RESPONSIVE */
/* ============================================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
        gap: 12px;
    }

    #hud {
        font-size: 8px;
        padding: 10px 12px;
        gap: 8px;
    }

    .hud-pill {
        padding: 6px 10px;
        font-size: 8px;
    }

    .ds-btn {
        font-size: 8px;
        padding: 6px 10px;
    }
}

/* ============================================================ */
/* SPLASH SCREEN */
/* ============================================================ */

#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('assets/img/mm.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: opacity 0.5s ease-out;
}

#splash-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0.75;
    transition: opacity 1s ease-out;
}

#splash-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

#splash-title {
    font-family: "Press Start 2P", monospace;
    font-size: 32px;
    color: #ff5500;
    text-align: center;
    text-shadow:
        2px 2px 0 #000,
        4px 4px 8px rgba(0,0,0,0.8);
    margin: 0;
    line-height: 1.4;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Menu Principal */
#start-menu {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.start-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.start-btn {
    font-family: "Press Start 2P", monospace;
    font-size: 14px;
    color: #ffd55c;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffd55c;
    border-radius: var(--radius);
    padding: 16px 24px;
    cursor: pointer;
    width: 100%;
    max-width: 400px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 213, 92, 0.3);
}

.start-btn:hover {
    background: #ffd55c;
    border-color: rgba(0, 0, 0, 0.7);
    color: rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn .arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Opções de Modo */
.start-mode-options {
    display: none;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}

.start-option-btn {
    font-family: "Press Start 2P", monospace;
    font-size: 12px;
    color: #ffd55c;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ffd55c;
    border-radius: var(--radius);
    padding: 12px 20px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    text-align: center;
}

.start-option-btn:hover {
    background: #ffd55c;
    border-color: rgba(0, 0, 0, 0.6);
    color: rgba(0, 0, 0, 0.6);
    transform: translateX(4px);
}

.start-option-btn:active {
    transform: translateX(0);
}

/* Rodapé */
.start-footer {
    margin-top: 20px;
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    color: var(--text-weak);
    text-align: center;
}

.start-footer a {
    color: #ff5500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.start-footer a:hover {
    color: #ffd55c;
}

/* Mobile */
@media (max-width: 768px) {
    #splash-title {
        font-size: 24px;
    }

    .start-btn {
        font-size: 12px;
        padding: 14px 20px;
    }

    .start-option-btn {
        font-size: 10px;
        padding: 10px 16px;
    }

    .start-footer {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    #splash-title {
        font-size: 18px;
    }

    .start-btn {
        font-size: 10px;
        padding: 12px 16px;
    }

    .start-option-btn {
        font-size: 9px;
        padding: 10px 14px;
    }
}

/* ============================================================ */
/* SPLASH MODAL OVERLAY */
/* ============================================================ */

.splash-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
}

.splash-modal-overlay.active {
    display: flex;
}

.splash-modal-content {
    background: var(--panel);
    border: 2px solid #ffd55c;
    border-radius: var(--radius);
    padding: 32px 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(255, 213, 92, 0.3);
    cursor: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#splash-modal-text {
    color: #ffffff;
    line-height: 1.8;
    text-align: left;
    font-size: 10px;
}

#splash-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Botões dentro do modal da splash */
.splash-modal-content .ds-btn.ghost {
    background: rgba(0, 0, 0, 0.7);
    color: #ffd55c;
    border: 2px solid #ffd55c;
    box-shadow: 0 4px 12px rgba(255, 213, 92, 0.3);
}

.splash-modal-content .ds-btn.ghost:hover {
    background: rgba(255, 85, 0, 0.2);
    color: #ff5500;
    border-color: #ff5500;
    box-shadow: 0 6px 16px rgba(255, 85, 0, 0.5);
}

/* Toggle de modo do ranking dentro do modal da splash */
.splash-modal-content .ranking-mode-toggle {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffd55c;
    color: #ffd55c;
    box-shadow: 0 4px 12px rgba(255, 213, 92, 0.3);
}

.splash-modal-content .ranking-mode-toggle:hover {
    background: rgba(255, 85, 0, 0.2);
    border-color: #ff5500;
    box-shadow: 0 6px 16px rgba(255, 85, 0, 0.5);
}

.splash-modal-content .ranking-mode-toggle .case-exempt {
    color: #ffffff;
}

/* Itens da lista do ranking dentro do modal da splash */
.splash-modal-content .ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #ffd55c;
    border-radius: var(--radius);
    gap: 12px;
    transition: all 120ms ease;
    color: #ffffff;
}

.splash-modal-content .ranking-item:hover {
    background: rgba(255, 85, 0, 0.3);
    border-color: #ff5500;
}

.splash-modal-content .ranking-item .rank {
    font-size: 9px;
    color: #ffd55c;
    min-width: 24px;
}

.splash-modal-content .ranking-item .name {
    flex: 1;
    text-align: left;
    font-size: 9px;
    color: #ffffff;
}

.splash-modal-content .ranking-item .score {
    font-size: 9px;
    color: #ff5500;
    font-weight: bold;
}

/* Forçar texto das instruções em BRANCO dentro do modal da splash */
.splash-modal-content .msg-header {
    color: #ffffff !important;
}

.splash-modal-content .msg-body {
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .splash-modal-content {
        padding: 24px 20px;
        max-height: 70vh;
    }

    #splash-modal-text {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .splash-modal-content {
        padding: 20px 16px;
    }

    #splash-modal-text {
        font-size: 8px;
    }
}

/* ============================================================ */
/* OVERLAY "VIRE O CELULAR" */
/* ============================================================ */

#rotate-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

#rotate-overlay.show {
    display: flex;
    opacity: 1;
}

#rotate-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: rotateContentFadeIn 0.6s ease-out;
}

#rotate-icon {
    font-size: 80px;
    animation: rotateIconSpin 1.5s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes rotateIconSpin {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-90deg) scale(1.1);
    }
    50% {
        transform: rotate(-90deg) scale(1);
    }
    75% {
        transform: rotate(0deg) scale(1.1);
    }
}

@keyframes rotateContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#rotate-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rotate-title {
    font-family: "Press Start 2P", monospace;
    font-size: 18px;
    color: #ffd55c;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 213, 92, 0.6);
    animation: rotateTitlePulse 2s ease-in-out infinite;
}

@keyframes rotateTitlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.rotate-subtitle {
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    color: #cbd5e1;
    text-align: center;
    line-height: 1.6;
}

.rotate-confirm {
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    background: #ff5500;
    color: #ffffff;
    border: 2px solid #ffd55c;
    border-radius: var(--radius);
    padding: 10px 16px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255, 85, 0, 0.45);
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.rotate-confirm:hover {
    background: #ff6a1a;
    box-shadow: 0 8px 18px rgba(255, 85, 0, 0.55);
    transform: translateY(-1px);
}

.rotate-confirm:active {
    transform: translateY(1px);
}

/* Esconder overlay em landscape ou desktop */
@media (orientation: landscape), (min-width: 1025px) {
    #rotate-overlay.show {
        display: none !important;
        opacity: 0 !important;
    }
}

@media (max-width: 480px) {
    .rotate-title {
        font-size: 14px;
    }

    .rotate-subtitle {
        font-size: 8px;
    }

    #rotate-icon {
        font-size: 60px;
    }
}
