/* ==================================================================
   PLANTÃO — sistema visual do Código Cuidado (GAT8)
   Tokens + componentes utilitários. Linkar DEPOIS dos CSS existentes.
   Referência: GUIA_UI_PLANTAO.md (Fase A).
   ================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Roboto:wght@400;500;700;900&family=Pixelify+Sans:wght@500;700&display=swap');

:root {
    /* ---- Cores ---- */
    --cc-ink: #004357;
    --cc-ink-deep: #002A37;
    --cc-action: #007BA3;
    --cc-action-edge: #005F80;
    --cc-upa: #00ACDE;
    --cc-upa-edge: #0090BC;
    --cc-sky: #B9EFFF;
    --cc-sky-line: #9ED9EA;
    --cc-mint: #E0FFF0;
    --cc-paper: #F1FFF8;
    --cc-bg: #F4FBFD;
    --cc-grid: #E3F1F5;
    --cc-track: #E3F4F9;
    --cc-muted: #3D6470;
    --cc-gold: #FFC83D;
    --cc-gold-bg: #FFF5D6;
    --cc-ok: #1F8A5B;
    --cc-ok-ink: #1B6B45;
    --cc-ok-bg: #DDF5E8;
    --cc-bad: #C8384A;
    --cc-bad-ink: #A32637;
    --cc-bad-bg: #FCE3E6;
    --cc-off: #EEF3F5;
    --cc-off-line: #B7C7CD;
    --cc-off-ink: #6A848C;
    --cc-scrim: rgba(0, 48, 63, .55);

    /* ---- Tipografia ---- */
    --cc-font-title: 'Fredoka', 'Roboto', system-ui, sans-serif;
    --cc-font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --cc-font-hud: 'Pixelify Sans', ui-monospace, 'Courier New', monospace;

    /* ---- Forma ---- */
    --cc-line: 3px;
    --cc-radius: 22px;
    --cc-radius-btn: 16px;
    --cc-shadow: 0 6px 0 var(--cc-ink);
    --cc-shadow-sm: 0 4px 0 var(--cc-ink);
    --cc-ease-pop: cubic-bezier(.34, 1.56, .64, 1);

    /* ---- Ícones (máscaras SVG de traço; cor vem de background-color) ---- */
    --cc-ico-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.5v15l13-7.5z'/%3E%3C/svg%3E");
    --cc-ico-pause: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='5' width='4' height='14' rx='1'/%3E%3Crect x='14' y='5' width='4' height='14' rx='1'/%3E%3C/svg%3E");
    --cc-ico-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v4l2.5 2M9 2h6'/%3E%3C/svg%3E");
    --cc-ico-sound: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E");
    --cc-ico-mute: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M17 9.5l5 5M22 9.5l-5 5'/%3E%3C/svg%3E");
    --cc-ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    --cc-ico-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E");
    --cc-ico-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E");
    --cc-ico-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.9 6 6.6.8-4.9 4.5 1.3 6.5L12 17l-5.9 3.3 1.3-6.5L2.5 9.3l6.6-.8z'/%3E%3C/svg%3E");
    --cc-ico-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
    --cc-ico-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --cc-ico-trophy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M17 5h3v2a3 3 0 0 1-3 3M7 5H4v2a3 3 0 0 0 3 3'/%3E%3C/svg%3E");
    --cc-ico-timeplus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='13' r='7.5'/%3E%3Cpath d='M11 9.5V13l2 2M8.5 2.5h5M19 3v5M16.5 5.5h5'/%3E%3C/svg%3E");
}

/* Compatibilidade: variáveis antigas apontam para os tokens novos */
:root {
    --idv-dark-blue: var(--cc-ink);
    --idv-light-blue: var(--cc-upa);
    --idv-pale-blue: var(--cc-sky);
    --idv-mint: var(--cc-mint);
    --idv-white: var(--cc-paper);
}

/* ================= COMPONENTES ================= */
.cc-panel {
    background: #fff;
    border: var(--cc-line) solid var(--cc-ink);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    color: var(--cc-ink);
}
.cc-panel--paper { background: var(--cc-paper); }

.cc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 0 22px; box-sizing: border-box;
    font-family: var(--cc-font-title); font-weight: 600; font-size: 19px; line-height: 1.1;
    color: var(--cc-ink); background: #fff;
    border: var(--cc-line) solid var(--cc-ink); border-radius: var(--cc-radius-btn);
    box-shadow: 0 5px 0 var(--cc-ink);
    cursor: pointer; text-decoration: none; text-transform: none; letter-spacing: 0;
    transition: transform .08s ease, box-shadow .08s ease, background-color .15s;
    -webkit-tap-highlight-color: transparent;
}
.cc-btn:hover { background: var(--cc-mint); }
.cc-btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--cc-ink); }
.cc-btn--primary {
    color: #fff; background: var(--cc-action); font-weight: 700; font-size: 22px; min-height: 60px;
    box-shadow: inset 0 -5px 0 var(--cc-action-edge), 0 5px 0 var(--cc-ink);
}
.cc-btn--primary:hover { background: #0A86AF; }
.cc-btn--primary:active { box-shadow: inset 0 -2px 0 var(--cc-action-edge), 0 0 0 var(--cc-ink); }
.cc-btn--ghost { background: transparent; border-color: transparent; box-shadow: none; text-decoration: underline; }
.cc-btn--ghost:hover { background: transparent; color: var(--cc-bad-ink); }
.cc-btn--ghost:active { transform: none; box-shadow: none; }
.cc-btn[disabled], .cc-btn.is-off {
    color: var(--cc-off-ink); background: var(--cc-off); border-color: var(--cc-off-line);
    box-shadow: 0 5px 0 var(--cc-off-line); cursor: not-allowed;
}

.cc-btn-icon {
    width: 54px; height: 54px; flex-shrink: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--cc-ink);
    border: var(--cc-line) solid var(--cc-ink); border-radius: 50%;
    box-shadow: var(--cc-shadow-sm); cursor: pointer;
    transition: transform .08s ease, box-shadow .08s ease;
}
.cc-btn-icon:active { transform: translateY(4px); box-shadow: 0 0 0 var(--cc-ink); }
.cc-btn-icon svg { width: 24px; height: 24px; }

/* Ícone por máscara: <span class="cc-ico" style="--cc-ico: var(--cc-ico-star)"></span> */
.cc-ico {
    display: inline-block; width: 1em; height: 1em; flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: var(--cc-ico) center / contain no-repeat;
            mask: var(--cc-ico) center / contain no-repeat;
}

.cc-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    background: var(--cc-sky); color: var(--cc-ink);
    font-family: var(--cc-font-body); font-weight: 700; font-size: 13px;
}
.cc-chip--gold { background: var(--cc-gold); border: 2px solid var(--cc-ink); }
.cc-chip--ink { background: var(--cc-ink); color: #fff; }

.cc-label {
    font-family: var(--cc-font-hud); font-weight: 700; font-size: 13px;
    letter-spacing: 2px; text-transform: uppercase; color: var(--cc-action);
}

.cc-progress {
    position: relative; height: 22px; overflow: hidden; box-sizing: border-box;
    background: var(--cc-track); border: var(--cc-line) solid var(--cc-ink); border-radius: 999px;
}
.cc-progress__fill {
    height: 100%; width: 0; background: var(--cc-upa);
    box-shadow: inset 0 -5px 0 var(--cc-upa-edge);
    transition: width .3s ease;
}

.cc-star {
    display: inline-block; width: 40px; height: 40px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.9 6 6.6.8-4.9 4.5 1.3 6.5L12 17l-5.9 3.3 1.3-6.5L2.5 9.3l6.6-.8z' fill='%23FFC83D' stroke='%23004357' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cc-star--empty {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.9 6 6.6.8-4.9 4.5 1.3 6.5L12 17l-5.9 3.3 1.3-6.5L2.5 9.3l6.6-.8z' fill='%23E3F4F9' stroke='%23004357' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.cc-toast {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: var(--cc-line) solid var(--cc-ink); border-radius: 18px;
    box-shadow: 0 5px 0 var(--cc-ink); padding: 12px 22px 12px 14px;
    font-family: var(--cc-font-title); font-weight: 600; color: var(--cc-ink);
}
.cc-toast--ok { border-color: var(--cc-ok); box-shadow: 0 5px 0 var(--cc-ok); color: var(--cc-ok-ink); }
.cc-toast--bad { border-color: var(--cc-bad); box-shadow: 0 5px 0 var(--cc-bad); color: var(--cc-bad-ink); }

.cc-scrim { position: fixed; inset: 0; background: var(--cc-scrim); }

.cc-key {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 6px; box-sizing: border-box;
    background: var(--cc-upa); color: #fff;
    border: var(--cc-line) solid var(--cc-ink); border-radius: 9px;
    box-shadow: inset 0 -4px 0 var(--cc-upa-edge), 0 3px 0 var(--cc-ink);
    font-family: var(--cc-font-hud); font-weight: 700; font-size: 18px;
}

.cc-focus:focus-visible,
.cc-btn:focus-visible, .cc-btn-icon:focus-visible {
    outline: 4px solid var(--cc-upa); outline-offset: 3px;
}

@keyframes cc-pop-in { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cc-pop { animation: cc-pop-in .18s var(--cc-ease-pop) both; }

@keyframes cc-flutuar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cc-ecg { from { stroke-dashoffset: 300; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================= CORTINA 3D ⇄ 2D (Fase E · prancheta 01) =================
   Marcação criada pelo WebInterface.jslib (#minijogo-carregando / #minijogo-voltando). */
.cc-cortina {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box;
    background: repeating-linear-gradient(90deg, var(--cc-mint) 0 56px, #fff 56px 112px);
    font-family: var(--cc-font-body); color: var(--cc-ink);
    animation: cc-cortina-entra .22s ease-out both;
}
#minijogo-voltando.cc-cortina { position: fixed; z-index: 2147483000; animation: cc-cortina-sai 1.1s ease-in both; }
@keyframes cc-cortina-entra { from { opacity: 0; } to { opacity: 1; } }
@keyframes cc-cortina-sai { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.cc-cortina__painel {
    width: min(520px, 100%); box-sizing: border-box; padding: 28px 30px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    background: #fff; border: 3px solid var(--cc-ink); border-radius: 28px; box-shadow: 0 10px 0 var(--cc-ink);
    animation: cc-pop-in .18s var(--cc-ease-pop) both;
}
.cc-cortina__rotulo { font-family: var(--cc-font-hud); font-weight: 700; font-size: 14px; letter-spacing: 3px; color: var(--cc-action); }
.cc-cortina__nome { font-family: var(--cc-font-title); font-weight: 700; font-size: clamp(30px, 6vw, 48px); line-height: 1.05; }
.cc-cortina__ecg { width: 260px; max-width: 100%; height: 42px; fill: none; stroke: var(--cc-action); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cc-cortina__ecg path { stroke-dasharray: 300; animation: cc-ecg 1.6s linear infinite; }
.cc-cortina__barra { width: 100%; height: 20px; box-sizing: border-box; overflow: hidden; background: var(--cc-track); border: 3px solid var(--cc-ink); border-radius: 999px; }
.cc-cortina__barra > div { width: 40%; height: 100%; background: var(--cc-upa); box-shadow: inset 0 -4px 0 var(--cc-upa-edge); border-radius: 999px; animation: cc-indeterminada 1.3s ease-in-out infinite; }
@keyframes cc-indeterminada { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.cc-cortina__dica { margin: 6px 0 0; padding: 10px 14px; font-size: 15px; line-height: 1.45; background: var(--cc-gold-bg); border: 2px solid var(--cc-ink); border-radius: 14px; text-align: left; }
@media (prefers-reduced-motion: reduce) {
    .cc-cortina__barra > div { width: 100%; animation: none; }
}

/* ==================================================================
   Tela de carregamento pós-JOGAR (#tela-carregando, prancheta 01)
   IDs tc-barra / tc-texto / tc-voltar continuam iguais para o JS.
   ================================================================== */
#tela-carregando {
    display: none; position: fixed; inset: 0; z-index: 100000;
    flex-direction: column; align-items: center; justify-content: center;
    padding: 24px; box-sizing: border-box; overflow: hidden;
    font-family: var(--cc-font-body); color: var(--cc-ink); text-align: center;
    background: repeating-linear-gradient(90deg, var(--cc-mint) 0 12.5%, #fff 12.5% 25%);
}
.cc-carregando__chip {
    position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; white-space: nowrap;
    background: #fff; border: 3px solid var(--cc-ink); border-radius: 999px;
    padding: 6px 16px 6px 8px; box-shadow: 0 4px 0 var(--cc-ink);
    font-family: var(--cc-font-hud); font-weight: 700; font-size: 14px; letter-spacing: 2px;
}
.cc-carregando__cruz {
    width: 28px; height: 28px; border-radius: 50%; background: var(--cc-action);
    display: flex; align-items: center; justify-content: center;
}
.cc-carregando__cruz svg { width: 16px; height: 16px; fill: #fff; }
.cc-carregando__painel {
    width: min(640px, 100%); box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    background: #fff; border: 3px solid var(--cc-ink); border-radius: 28px;
    box-shadow: 0 8px 0 var(--cc-ink); padding: 32px 40px 30px;
    animation: cc-pop-in .22s var(--cc-ease-pop) both;
}
.cc-carregando__rotulo { font-family: var(--cc-font-hud); font-weight: 700; font-size: 14px; letter-spacing: 3px; color: var(--cc-action); }
.cc-carregando__logo { width: min(300px, 70%); height: auto; display: block; margin-top: -4px; }
.cc-carregando__ecg { width: min(520px, 100%); height: 56px; display: block; fill: none; stroke: var(--cc-upa); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.cc-carregando__ecg path { stroke-dasharray: 900; animation: cc-ecg-longo 1.8s linear infinite; }
@keyframes cc-ecg-longo { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
#tela-carregando .tc-barra-vazia {
    width: 100%; height: 22px; box-sizing: border-box; overflow: hidden;
    background: var(--cc-track); border: 3px solid var(--cc-ink); border-radius: 999px;
}
#tela-carregando .tc-barra {
    width: 0%; height: 100%; background: var(--cc-upa); box-shadow: inset 0 -5px 0 var(--cc-upa-edge);
    border-radius: 999px; transition: width .25s ease;
}
#tela-carregando .tc-barra.tc-final { animation: cc-tc-pulso 1.1s ease-in-out infinite; }
@keyframes cc-tc-pulso { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
#tela-carregando .tc-texto { margin-top: -4px; font-family: var(--cc-font-title); font-weight: 600; font-size: 18px; }
.cc-carregando__dica {
    width: 100%; box-sizing: border-box; display: flex; gap: 14px; align-items: flex-start; text-align: left;
    background: var(--cc-paper); border: 2px dashed #7FCBE2; border-radius: 16px; padding: 14px 16px;
}
.cc-carregando__dica svg { width: 28px; height: 28px; flex-shrink: 0; fill: none; stroke: var(--cc-action); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cc-carregando__dica b { display: block; font-family: var(--cc-font-title); font-size: 17px; font-weight: 600; }
.cc-carregando__dica span { display: block; font-size: 15px; line-height: 1.45; color: var(--cc-feedback-text, #23505E); min-height: 2.9em; transition: opacity .3s; }
#tela-carregando .tc-voltar {
    position: absolute; top: 20px; left: 22px; width: 54px; height: 54px; padding: 0;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background: #fff; color: var(--cc-ink); border: 3px solid var(--cc-ink); border-radius: 50%;
    box-shadow: 0 4px 0 var(--cc-ink); transition: transform .08s ease, box-shadow .08s ease, background-color .15s;
}
#tela-carregando .tc-voltar:hover { background: var(--cc-mint); }
#tela-carregando .tc-voltar:active { transform: translateY(4px); box-shadow: 0 0 0 var(--cc-ink); }
#tela-carregando .tc-voltar:focus-visible { outline: 4px solid var(--cc-upa); outline-offset: 3px; }
#tela-carregando .tc-voltar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-height: 560px) {
    .cc-carregando__chip { display: none; }
    /* mais estreito para não cobrir o botão de voltar no canto */
    .cc-carregando__painel { gap: 10px; padding: 18px 26px; border-radius: 22px; width: min(560px, calc(100% - 170px)); }
    #tela-carregando .tc-voltar { z-index: 2; }
    .cc-carregando__logo { width: 190px; }
    .cc-carregando__ecg { height: 36px; }
    .cc-carregando__dica { padding: 10px 12px; }
    .cc-carregando__dica span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .cc-carregando__ecg path, .cc-carregando__painel, #tela-carregando .tc-barra.tc-final { animation: none; }
}

/* Aviso de girar o aparelho e pedido de captura do mouse */
#aviso-rotacao { background: var(--cc-mint) !important; color: var(--cc-ink) !important; font-family: var(--cc-font-body) !important; gap: 14px; }
#aviso-rotacao h2 { margin: 0; font-family: var(--cc-font-title); font-weight: 700; font-size: 26px; }
#aviso-rotacao p { font-size: 16px; }
.cc-girar { width: 96px; height: 96px; border-radius: 50%; background: #fff; border: 3px solid var(--cc-ink); box-shadow: 0 5px 0 var(--cc-ink); display: flex; align-items: center; justify-content: center; }
.cc-girar svg { width: 54px; height: 54px; fill: none; stroke: var(--cc-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; animation: cc-girar 2.4s ease-in-out infinite; }
@keyframes cc-girar { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { .cc-girar svg { animation: none; } }
#modal-pointer-lock { background: var(--cc-scrim) !important; font-family: var(--cc-font-body) !important; }
#modal-pointer-lock > div { background: #fff !important; border: 3px solid var(--cc-ink) !important; border-radius: 28px !important; box-shadow: 0 8px 0 var(--cc-ink); padding: 32px 36px !important; }
#modal-pointer-lock h3 { font-family: var(--cc-font-title); font-weight: 700 !important; font-size: 26px; }
#modal-pointer-lock p { font-weight: 400 !important; color: var(--cc-muted); }
#modal-pointer-lock button { font-family: var(--cc-font-title) !important; font-weight: 700 !important; font-size: 20px !important; min-height: 52px; padding: 0 28px !important; background: var(--cc-action) !important; border: 3px solid var(--cc-ink) !important; border-radius: 16px !important; box-shadow: inset 0 -5px 0 var(--cc-action-edge), 0 5px 0 var(--cc-ink); }

/* Menu inicial ocupa a tela toda (sem faixas brancas em celulares 19,5:9).
   Os minijogos continuam em 16:9. */
#minijogo-container iframe[src*="menu_inicial"] {
    aspect-ratio: auto; width: 100%; height: 100%; max-width: none; max-height: none; box-shadow: none;
}

/* ---------- Hub de fases no celular deitado: uma fileira de cards com rolagem lateral ----------
   Cabeçalho compacto + cards em carrossel + barra "Próxima fase" fina: tudo cabe sem rolar a página. */
@media screen and (max-height: 600px) and (orientation: landscape) {
    body:has(#lista-fases) { padding-bottom: 0; overflow-y: hidden; }
    body:has(#lista-fases) header { margin-top: max(6px, env(safe-area-inset-top)); padding: 0 calc(10px + env(safe-area-inset-right)) 0 calc(10px + env(safe-area-inset-left)); gap: 8px; }
    body:has(#lista-fases) .hub-barra { min-height: 0; padding: 6px 12px; gap: 12px; flex-direction: row; align-items: center; }
    body:has(#lista-fases) .perfil-label { display: none; }
    body:has(#lista-fases) .perfil-tipo { font-size: 18px; }
    body:has(#lista-fases) .btn-trocar-perfil { min-height: 40px; padding: 0 12px; font-size: 14px; }
    body:has(#lista-fases) .btn-icone { width: 42px; height: 42px; }
    #lista-fases.container-fases {
        display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
        margin: 14px 0 0; padding: 12px calc(14px + env(safe-area-inset-left)) 10px; max-width: none;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    #lista-fases.container-fases::-webkit-scrollbar { display: none; }
    #lista-fases .level-wrap { flex: 0 0 118px; scroll-snap-align: start; padding-top: 0 !important; }
    #lista-fases .level-card { height: calc(100dvh - 190px); min-height: 118px; max-height: 170px; }
    .hub-proxima { padding: 6px 8px 6px 16px; bottom: max(8px, env(safe-area-inset-bottom)); }
    .hub-proxima .cc-btn { min-height: 44px; }
    /* vale também abaixo de 720px de largura (iPhone SE deitado) */
    body:has(#lista-fases) .hub-barra { flex-wrap: nowrap; }
    body:has(#lista-fases) .hub-metas { width: auto; flex: 1; justify-content: flex-end; }
    body:has(#lista-fases) .hub-progresso { flex: 0 1 220px; }
    .hub-proxima { flex-direction: row; align-items: center; gap: 12px; }
    .hub-proxima .cc-btn { width: auto; }
}

/* Alvos de toque mínimos no celular (≥ 40 px) */
@media (pointer: coarse) {
    button.btn-audio-config { height: 36px; font-size: 16px; }
    body:has(#lista-fases) .btn-trocar-perfil { min-height: 40px; padding: 0 14px; }
}

/* Celular deitado (19,5:9): minijogos ocupam a tela toda em vez da caixa 16:9 com faixas
   (os minijogos já se adaptam à largura). No PC continua 16:9. */
@media screen and (max-height: 600px) and (orientation: landscape) {
    #minijogo-container iframe#iframe-principal {
        aspect-ratio: auto; width: 100%; height: 100%; max-width: none; max-height: none; box-shadow: none;
    }
}
