* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #02040f;
    color: #fff;
    font-family: 'Rajdhani', 'Trebuchet MS', Arial, sans-serif;
}

.hidden {
    display: none !important;
}

/* ─── TELA DE ABERTURA ──────────────────────────────────────── */
.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-screen video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 800ms ease;
}

.intro-overlay.fading {
    background: #000;
    opacity: 1;
    animation: fadeToBlack 800ms ease forwards;
}

.skip-intro-btn {
    position: absolute;
    bottom: 32px;
    right: 32px;
    z-index: 10;
    padding: 10px 24px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.85);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 200ms, border-color 200ms;
}

.skip-intro-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.6);
}

@keyframes fadeToBlack {
    from { background: transparent; opacity: 0; }
    to   { background: #000; opacity: 1; }
}

/* ─── FUNDO COM ESTRELAS ─────────────────────────────────────── */
#game-root {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 0%,   rgba(255,174,54,0.18)  0%, transparent 50%),
        radial-gradient(ellipse at 80% 0%,   rgba(232,61,255,0.15)  0%, transparent 50%),
        radial-gradient(ellipse at 50% 30%,  rgba(40,208,255,0.22)  0%, transparent 55%),
        linear-gradient(160deg, #030518 0%, #081840 50%, #04000e 100%);
    display: grid;
    place-items: center;
    padding: 10px;
}

.stars-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.stars-slow {
    background-image:
        radial-gradient(1.5px 1.5px at 10% 15%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 40% 60%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px   at 70% 30%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 90% 80%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px   at 25% 75%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(2px 2px   at 55% 5%,  rgba(255,228,94,0.6)  0%, transparent 100%),
        radial-gradient(1px 1px   at 85% 45%, rgba(255,255,255,0.5) 0%, transparent 100%);
    background-size: 600px 600px;
    animation: starDrift 60s linear infinite;
}

.stars-mid {
    background-image:
        radial-gradient(1px 1px at 15% 40%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 60% 20%, rgba(54,220,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 65%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 90%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(2px 2px at 95% 10%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 5%  55%, rgba(255,255,255,0.4) 0%, transparent 100%);
    background-size: 400px 400px;
    animation: starDrift 38s linear infinite reverse;
}

.stars-fast {
    background-image:
        radial-gradient(1px 1px at 22% 22%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 55%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 82%, rgba(232,61,255,0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 12% 70%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 68% 8%,  rgba(255,255,255,0.35) 0%, transparent 100%);
    background-size: 250px 250px;
    animation: starDrift 22s linear infinite;
}

@keyframes starDrift {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    to   { background-position: 600px 600px, 400px 400px, 600px 600px, 400px 400px, 600px 600px, 400px 400px, 250px 250px; }
}

/* ─── PAINEL INICIAL ─────────────────────────────────────────── */
.start-panel {
    position: relative;
    z-index: 1;
    width: min(580px, 100%);
    padding: 36px 40px 32px;
    border: 1px solid rgba(54,220,255,0.25);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(4,14,40,0.97) 0%, rgba(2,6,22,0.97) 100%);
    box-shadow:
        0 0 60px rgba(40,208,255,0.08),
        0 30px 90px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.06);
    text-align: center;
    animation: panelIn 700ms cubic-bezier(0.34,1.56,0.64,1) both;
}

.logo-wrapper {
    display: block;
    margin: 0 auto 8px;
    text-align: center;
}


.start-logo {
    display: block;
    width: min(100%, 260px);
    margin: 0 auto;
    filter:
        drop-shadow(0 0 14px rgba(255,220,80,0.5))
        drop-shadow(0 0 30px rgba(255,180,40,0.25));
    animation: logoPulse 2.4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255,220,80,0.4)) drop-shadow(0 0 24px rgba(255,180,40,0.2)); }
    50%       { filter: drop-shadow(0 0 20px rgba(255,220,80,0.75)) drop-shadow(0 0 44px rgba(255,180,40,0.4)); }
}

.start-subtitle {
    color: rgba(180,210,255,0.75);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 14px 0 0;
}

#player-name {
    width: 100%;
    padding: 15px 18px;
    border-radius: 10px;
    border: 1.5px solid rgba(54,220,255,0.3);
    background: rgba(4,18,50,0.8);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 16px 0 14px;
    outline: none;
    transition: border-color 200ms, box-shadow 200ms;
    letter-spacing: 0.5px;
}

#player-name:focus {
    border-color: rgba(54,220,255,0.75);
    box-shadow: 0 0 0 3px rgba(54,220,255,0.12), 0 0 20px rgba(54,220,255,0.08);
}

#player-name::placeholder {
    color: rgba(150,180,220,0.4);
    font-weight: 500;
}

.tema-label,
.difficulty-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(180,210,255,0.5);
    margin-bottom: 8px;
}

.tema-dropdown {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid rgba(54,220,255,0.28);
    background: rgba(4,18,50,0.85);
    color: #e0f0ff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    outline: none;
    cursor: pointer;
    transition: border-color 200ms, box-shadow 200ms;
    appearance: auto;
}

.tema-dropdown:focus {
    border-color: rgba(54,220,255,0.7);
    box-shadow: 0 0 0 3px rgba(54,220,255,0.1);
}

.tema-dropdown option {
    background: #040e2a;
    color: #e0f0ff;
}

/* ─── BOTÕES DE DIFICULDADE ──────────────────────────────────── */
.difficulty-select {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 20px;
}

.difficulty-select input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.difficulty-select label span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border: 1.5px solid currentColor;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 200ms, box-shadow 200ms, transform 150ms;
    opacity: 0.55;
}

.difficulty-select label span:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.diff-icon {
    font-style: normal;
    font-size: 1.1rem;
    line-height: 1;
}

/* Mista — ciano */
.diff-mista span { color: #36dcff; background: rgba(54,220,255,0.07); }
/* Fácil — verde */
.diff-facil span { color: #00e676; background: rgba(0,230,118,0.07); }
/* Média — laranja */
.diff-media span { color: #ff8d31; background: rgba(255,141,49,0.07); }
/* Difícil — vermelho */
.diff-dificil span { color: #ff3d71; background: rgba(255,61,113,0.07); }

.difficulty-select input:checked + span {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 0 18px currentColor, 0 4px 14px rgba(0,0,0,0.3);
}

.diff-mista   input:checked + span { background: rgba(54,220,255,0.15); }
.diff-facil   input:checked + span { background: rgba(0,230,118,0.15); }
.diff-media   input:checked + span { background: rgba(255,141,49,0.15); }
.diff-dificil input:checked + span { background: rgba(255,61,113,0.15); }

/* ─── BOTÃO JOGAR ────────────────────────────────────────────── */
.btn-play {
    position: relative;
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f9d030 0%, #f4860a 60%, #e05a00 100%);
    color: #0e0600;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 150ms, box-shadow 200ms;
    box-shadow: 0 0 28px rgba(255,180,0,0.35), 0 8px 24px rgba(0,0,0,0.4);
}

.btn-play:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 44px rgba(255,180,0,0.55), 0 12px 30px rgba(0,0,0,0.45);
}

.btn-play:active {
    transform: translateY(0) scale(0.98);
}

.btn-play-text {
    position: relative;
    z-index: 1;
}

.btn-play-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: btnShine 2.8s ease-in-out infinite 0.5s;
}

@keyframes btnShine {
    0%, 100% { transform: translateX(-100%); }
    40%, 60%  { transform: translateX(100%); }
}

.btn-ranking {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 13px 18px;
    border: 1.5px solid rgba(54,220,255,0.3);
    border-radius: 10px;
    background: rgba(4,18,50,0.7);
    color: #9bf7ff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 200ms, border-color 200ms, transform 150ms;
}

.btn-ranking:hover {
    background: rgba(54,220,255,0.1);
    border-color: rgba(54,220,255,0.6);
    transform: translateY(-1px);
}

/* Validação de nome */
.name-error {
    color: #ff3d71;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 4px;
    padding: 0 2px;
    text-align: left;
    animation: panelIn 300ms ease both;
}

#player-name.input-error {
    border-color: rgba(255,61,113,0.8) !important;
    box-shadow: 0 0 0 3px rgba(255,61,113,0.15) !important;
}

.bottom-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.admin-link {
    color: rgba(120,160,220,0.45);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: color 200ms;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: 'Rajdhani', sans-serif;
}

.admin-link:hover { color: rgba(120,160,220,0.85); }

.fullscreen-link {
    color: rgba(54,220,255,0.45);
}
.fullscreen-link:hover { color: rgba(54,220,255,0.85); }

/* ─── GAME STAGE — ocupa 100% do viewport, sem margens ──────── */
.game-stage {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: transparent;
}

.phaser-container {
    position: absolute;
    inset: 0;
}

.phaser-container canvas {
    display: block;
    background: transparent !important;
    /* Phaser Scale.FIT controla width/height mantendo 16:9 */
}

/* ─── PAINEL WEBCAM ──────────────────────────────────────────── */
.webcam-panel {
    position: absolute;
    top: 0; right: 0;
    width: 40%;           /* 40% — complementa os 60% da esquerda */
    height: 100%;
    z-index: 5;
    overflow: hidden;
    /* sem borda, sem fundo — transparente sobre o canvas Phaser */
}

/* ─── LOGO OVERLAY NO JOGO ───────────────────────────────────── */
.game-logo-overlay {
    position: absolute;
    top: 10px;
    left: 18px;
    width: 27%;
    z-index: 20;
    pointer-events: none;
}

.game-logo-img {
    display: block;
    width: 100%;
    max-height: 154px;
    object-fit: contain;
    object-position: left center;
    filter:
        drop-shadow(0 0 14px rgba(255,220,80,0.60))
        drop-shadow(0 0 34px rgba(255,180,40,0.30));
    animation: logoPulse 2.4s ease-in-out infinite;
}

/* ─── PAINEL WEBCAM — sem moldura, 40% da tela ───────────────── */
#participant-webcam {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;          /* sempre visível — placeholder (z-index 2) cobre quando necessário */
    transform: scale(var(--camera-zoom, 1));
    transform-origin: center center;
    transition: transform 180ms ease;
    will-change: transform;
}

.camera-zoom-control {
    position: absolute;
    right: 10px;
    top: 68%;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(0, 6, 20, 0.34);
    border: 1px solid rgba(54, 220, 255, 0.18);
    backdrop-filter: blur(6px);
    transform: translateY(-50%);
    opacity: 0.62;
    transition: opacity 160ms, background 160ms;
}

.camera-zoom-control:hover,
.camera-zoom-control:focus-within {
    opacity: 1;
    background: rgba(0, 6, 20, 0.58);
}

.camera-zoom-control button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    background: rgba(4,18,50,0.74);
    color: rgba(232,244,255,0.9);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background 160ms, border-color 160ms, color 160ms, transform 120ms;
}

.camera-zoom-control button:hover {
    background: rgba(54,220,255,0.18);
    border-color: rgba(54,220,255,0.55);
    color: #fff;
    transform: scale(1.05);
}

.camera-zoom-control button:active {
    transform: scale(0.96);
}

/* ─── BOTÃO MUTE (DESKTOP) ───────────────────────────────────── */
.mute-btn-webcam {
    position: absolute;
    right: 10px;
    top: calc(68% + 72px);
    z-index: 6;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(54,220,255,0.18);
    border-radius: 50%;
    background: rgba(0,6,20,0.34);
    backdrop-filter: blur(6px);
    color: rgba(232,244,255,0.9);
    font-size: 1.05rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0.62;
    transition: opacity 160ms, background 160ms;
}

.mute-btn-webcam:hover {
    opacity: 1;
    background: rgba(0,6,20,0.58);
}

.mute-btn-webcam[data-muted="1"] {
    opacity: 0.9;
    border-color: rgba(255,61,113,0.4);
    color: rgba(255,100,130,0.9);
}

/* Cor do botão mute na barra mobile */
.help-mute { background: #7b8cde; }

.webcam-placeholder {
    position: absolute;
    inset: 0;
    z-index: 2;          /* acima do vídeo; some quando câmera ativa */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(54,220,255,0.4);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Nome do participante — na base da imagem da câmera */
.player-name-display {
    position: absolute;
    bottom: 86px;        /* acima dos botões de ajuda */
    left: 0; right: 0;
    z-index: 4;
    padding: 8px 14px 7px;
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(54,220,255,0.6), 0 1px 4px rgba(0,0,0,0.9);
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(2,8,24,0.80) 18%,
        rgba(2,8,24,0.90) 50%,
        rgba(2,8,24,0.80) 82%,
        transparent 100%);
    border-top: 1px solid rgba(54,220,255,0.2);
    border-bottom: 1px solid rgba(54,220,255,0.2);
}

/* ─── TRILHA DE PONTOS ───────────────────────────────────────── */
.trail-panel {
    position: absolute;
    right: 10px;
    top: 8%;
    z-index: 5;
    width: 152px;
    padding: 10px 9px;
    border-radius: 10px;
    border: 1px solid rgba(54,220,255,0.14);
    background: rgba(0,6,20,0.38);
    backdrop-filter: blur(6px);
}

.trail-title {
    color: #ffe45e;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.score-trail {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.score-step {
    padding: 6px 10px;
    border-radius: 7px;
    border: 1px solid rgba(54,220,255,0.12);
    color: rgba(140,185,220,0.55);
    background: rgba(4,16,40,0.45);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    transition: all 280ms ease;
}

.score-step.milestone {
    border-color: rgba(255,228,94,0.25);
    color: rgba(255,228,94,0.6);
}

.score-step.active {
    color: #07111f;
    background: linear-gradient(135deg, #ffe45e, #ff8d31);
    border-color: transparent;
    box-shadow: 0 0 14px rgba(255,174,54,0.5);
    transform: scaleX(1.05);
    font-size: 0.8rem;
}

/* ─── BOTÕES DE AJUDA ────────────────────────────────────────── */
.side-help {
    position: absolute;
    left: calc(60% + 10px);
    right: 10px;
    bottom: 18px;
    display: flex;
    gap: 6px;
    z-index: 15;
}

.help-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border-radius: 12px;
    padding: 10px 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 160ms, box-shadow 160ms, opacity 200ms, filter 160ms;
    border: 1.5px solid rgba(255,255,255,0.36);
    color: #07111f;
    box-shadow: 0 6px 14px rgba(0,0,0,0.22);
}

.help-btn span { line-height: 1; }

.help-btn > :first-child { font-size: 1.2rem; line-height: 1; }

.help-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 8px 18px rgba(0,0,0,0.30);
}

.help-btn:active { transform: translateY(0); }

.help-btn.used {
    opacity: 0.3;
    pointer-events: none;
}

.help-eliminate {
    background: #ff8d31;
}

.help-skip {
    background: #36dcff;
}

.help-hint {
    background: #ffe45e;
}

/* ─── MODAL DE RANKING ───────────────────────────────────────── */
.public-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
}

.public-modal-box {
    position: relative;
    width: min(720px, calc(100vw - 28px));
    max-height: min(720px, calc(100vh - 28px));
    overflow: auto;
    padding: 32px;
    border-radius: 16px;
    border: 1px solid rgba(54,220,255,0.3);
    background: linear-gradient(160deg, rgba(2,10,30,0.98), rgba(1,4,16,0.98));
    box-shadow: 0 0 60px rgba(40,208,255,0.1), 0 30px 80px rgba(0,0,0,0.65);
    animation: panelIn 400ms cubic-bezier(0.34,1.56,0.64,1) both;
}

.public-modal-box h2 {
    margin: 0 0 18px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: #ffe45e;
    text-align: center;
    letter-spacing: 2px;
}

.modal-close {
    position: absolute;
    top: 14px; right: 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 32px; height: 32px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 200ms, color 200ms;
}

.modal-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.ranking-list {
    max-height: 320px;
    overflow: auto;
}

.ranking-list table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-list th,
.ranking-list td {
    padding: 10px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #d0e8ff;
}

.ranking-list th {
    color: rgba(54,220,255,0.7);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.ranking-list tr:first-child td { color: #ffe45e; }
.ranking-list tr:nth-child(2) td { color: #c0c8d8; }
.ranking-list tr:nth-child(3) td { color: #d48060; }

.muted {
    color: rgba(180,210,255,0.4);
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    padding: 24px;
}

/* ─── RANKING PANEL (INLINE) ─────────────────────────────────── */
.ranking-panel {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    padding: 32px;
    border: 1px solid rgba(54,220,255,0.25);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(4,14,40,0.97), rgba(2,6,22,0.97));
    box-shadow: 0 30px 90px rgba(0,0,0,0.6);
    animation: panelIn 700ms cubic-bezier(0.34,1.56,0.64,1) both;
}

.ranking-panel table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
}

.ranking-panel th,
.ranking-panel td {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
}

/* ─── ANIMAÇÕES GERAIS ───────────────────────────────────────── */
@keyframes panelIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── AVISO DE ORIENTAÇÃO ────────────────────────────────────── */
.portrait-warning {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #02040f;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    gap: 16px;
}

.portrait-warning-icon {
    font-size: 3rem;
    animation: rotateTip 2s ease-in-out infinite;
}

.portrait-warning p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(180,210,255,0.8);
    max-width: 260px;
    margin: 0;
}

@keyframes rotateTip {
    0%, 40%, 100% { transform: rotate(0deg); }
    70%           { transform: rotate(90deg); }
}

/* ─── RESPONSIVO ─────────────────────────────────────────────── */
@media (max-width: 800px) {

    .difficulty-select {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .webcam-panel,
    .trail-panel {
        display: none;
    }

    .start-panel {
        padding: 28px 24px;
    }

    /* Ajuda — barra fixa no rodapé */
    .side-help {
        position: fixed;
        left: 0; right: 0;
        bottom: 0;
        padding: 8px 12px;
        background: rgba(0,4,16,0.90);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(54,220,255,0.18);
        z-index: 30;
    }

    .help-btn {
        padding: 6px 4px;
        font-size: 0.7rem;
        border-radius: 8px;
    }

    .help-btn > :first-child { font-size: 1rem; }

    /* Logo bem menor para não sobrepor a pergunta */
    .game-logo-overlay {
        width: 11%;
        top: 4px;
        left: 4px;
    }

    .game-logo-img { max-height: 36px; }

    /* Ranking modal menos invasivo */
    .public-modal-box {
        padding: 18px 16px;
    }
}

@media (max-width: 480px) {
    .start-panel { padding: 18px 16px; }
    .start-logo  { width: min(100%, 180px); }

    #player-name {
        font-size: 1rem;
        padding: 12px 14px;
    }

    .btn-play {
        padding: 14px 20px;
        font-size: 1.1rem;
    }

    .difficulty-select label span {
        padding: 8px 4px;
        font-size: 0.82rem;
    }

    .diff-icon { font-size: 0.95rem; }
}

@media (orientation: portrait) and (max-width: 799px) {
    .portrait-warning { display: flex; }
}
