@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&family=Inter:wght@500;600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: #12003a;
    overflow: hidden;
}

/* ── FONDO ────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(120,40,255,0.55) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255,40,160,0.3) 0%, transparent 60%);
    pointer-events: none;
}

/* ── ESTADO (ya jugó / sin preguntas) ────── */
.estado-card {
    position: relative;
    z-index: 1;
    max-width: 380px;
    margin: 10vh auto 0;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 2.5rem 1.75rem;
    text-align: center;
    color: white;
}
.estado-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.estado-card h2 { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.6rem; margin-bottom: .5rem; }
.estado-card p  { color: rgba(255,255,255,.6); margin-bottom: 1.25rem; }
.countdown {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 2.2rem;
    color: #c084fc;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}
.btn-ranking {
    display: inline-block;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    font-weight: 700;
    padding: .9rem 2.25rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: .95rem;
    box-shadow: 0 4px 20px rgba(124,58,237,.5);
}

/* Login modal */
.login-card { max-width: 360px; }

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    background: white;
    color: #1e1e1e;
    font-weight: 700;
    font-size: .95rem;
    padding: .85rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    margin-bottom: .75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    transition: opacity .15s;
}
.btn-google:hover { opacity: .9; }

.btn-skip {
    display: block;
    color: rgba(255,255,255,.45);
    font-size: .82rem;
    text-decoration: none;
    margin-top: .25rem;
    transition: color .15s;
}
.btn-skip:hover { color: rgba(255,255,255,.75); }

/* Divider "o jugá como invitado" */
.divider {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: rgba(255,255,255,.3);
    font-size: .8rem;
    margin: .25rem 0;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.15);
}
.divider span { white-space: nowrap; }

.alias-hint {
    color: rgba(255,255,255,.3);
    font-size: .75rem;
    margin-top: -.25rem;
    text-align: center;
}

/* Alias form */
.alias-form {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: .5rem;
}
.alias-form input {
    background: rgba(255,255,255,.1);
    border: 1.5px solid rgba(255,255,255,.2);
    border-radius: 12px;
    padding: .85rem 1rem;
    color: white;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    text-align: center;
}
.alias-form input::placeholder { color: rgba(255,255,255,.35); }
.alias-form input:focus { border-color: #c084fc; }
.alias-form button {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    border-radius: 12px;
    padding: .85rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(124,58,237,.4);
    font-family: 'Inter', sans-serif;
}
.alias-error {
    color: #f87171;
    font-size: .85rem;
    margin: -.25rem 0 .25rem;
}

/* ── PANTALLA PRINCIPAL ────────────────────── */
.quiz-screen {
    position: relative;
    z-index: 1;
    height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem .75rem;
    gap: .85rem;
}

/* ── TOP BAR ────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.quiz-logo {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.05rem;
    color: white;
    letter-spacing: -.5px;
}
.quiz-logo span { color: #c084fc; }

/* Timer circular */
.timer-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.timer-svg {
    width: 52px;
    height: 52px;
    transform: rotate(-90deg);
}
.timer-bg  { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 4; }
.timer-arc {
    fill: none;
    stroke: #c084fc;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke .4s;
}
#timer {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: .95rem;
    color: white;
}

/* ── CONTADOR PREGUNTAS ────────────────────── */
.q-counter {
    display: flex; gap: 4px; align-items: center;
    flex: 1; justify-content: center; padding: 0 .5rem;
}
.q-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,.2);
    transition: background .3s;
}
.q-dot-used { background: #c084fc; }

/* ── BURBUJA PREGUNTA ──────────────────────── */
.question-bubble {
    background: rgba(255,255,255,0.09);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 22px;
    padding: 1.4rem 1.25rem;
    flex-shrink: 0;
}
.question-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: white;
    line-height: 1.45;
    text-align: center;
}

/* ── OPCIONES PREGUNTADOS 2×2 ──────────────── */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    flex: 1;
}

.opt {
    border: none;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .75rem .6rem;
    transition: filter .15s, transform .1s;
    font-family: 'Inter', sans-serif;
    min-height: 0;
}
.opt:active { transform: scale(.96); }

/* Los 4 colores Preguntados */
.opt-1 { background: linear-gradient(145deg, #2563eb, #1d4ed8); }
.opt-2 { background: linear-gradient(145deg, #dc2626, #b91c1c); }
.opt-3 { background: linear-gradient(145deg, #16a34a, #15803d); }
.opt-4 { background: linear-gradient(145deg, #d97706, #b45309); }

.opt-letter {
    background: rgba(0,0,0,.25);
    color: white;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: .85rem;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.opt-text {
    color: white;
    font-weight: 600;
    font-size: clamp(.72rem, 3vw, .85rem);
    line-height: 1.3;
    text-align: center;
}

/* Estados post-respuesta */
.opt-correct { filter: brightness(1.3); outline: 3px solid #fff; }
.opt-wrong   { filter: brightness(.45) saturate(.3); }
.opt-dimmed  { filter: brightness(.4) saturate(.2); }
.opt-eliminated { filter: brightness(.3) saturate(.1); }
.opt:disabled { cursor: default; }

/* ── BARRA INFERIOR ─────────────────────────── */
.bottom-bar {
    flex-shrink: 0;
}
#help-btn {
    width: 100%;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.18);
    border-radius: 14px;
    padding: .8rem 1rem;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background .15s;
}
#help-btn:hover:not(:disabled) { background: rgba(255,255,255,.14); }
#help-btn:disabled { opacity: .4; cursor: default; }
#help-btn small { opacity: .65; font-size: .78rem; }
.help-icon { font-size: 1.1rem; }

/* ── POPUP LÍMITE ────────────────────────────── */
.limit-popup {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.limit-popup.hidden { display: none; }

.limit-card {
    background: #1e0a50;
    border: 1px solid rgba(192,132,252,.3);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 340px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    display: flex; flex-direction: column; gap: .75rem;
}
.limit-icon { font-size: 2.8rem; }
.limit-card h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 900; font-size: 1.4rem; color: white;
}
.limit-card p { color: rgba(255,255,255,.6); font-size: .9rem; line-height: 1.5; }

.limit-cta {
    display: block;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white; font-weight: 800; font-size: .95rem;
    padding: .9rem 1.25rem; border-radius: 14px;
    text-decoration: none; margin-top: .5rem;
    box-shadow: 0 4px 20px rgba(124,58,237,.5);
    transition: opacity .15s;
}
.limit-cta:hover { opacity: .9; }

.limit-ranking {
    color: rgba(255,255,255,.4); font-size: .82rem;
    text-decoration: none; transition: color .15s;
}
.limit-ranking:hover { color: rgba(255,255,255,.7); }

/* ── BANNER RESULTADO ────────────────────────── */
.result-banner {
    flex-shrink: 0;
    border-radius: 14px;
    padding: .85rem 1rem;
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
}
.result-banner.hidden { display: none; }
