/* =========================
    Autora: Candy González
    Juego: Trivia Time
  ========================= */

/* Fuentes */
@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Poppins:wght@400;600;700&display=swap');

/* Variables */
:root {
    --bg-yellow-1: #ffed66;
    --bg-yellow-2: #ffd23f;
    --card-bg: #ffffff;
    --card-edge: #6d401d;
    --text-brown: #6b3f18;
    --option-orange: #ea9a47;
    --option-orange-dark: #e07a2b;
    --accent-pink: #ff6fa6;
    --accent-blue: #9be3ff;
    --shadow-strong: rgba(0, 0, 0, 0.25);
    --max-width: 420px;
    --timer-color: #ff6b6b;
    /* color por defecto del anillo (se actualizará en JS) */
}

/* Reset y body */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Fondo de rayas */
    background:
        repeating-conic-gradient(from 0deg,
            var(--bg-yellow-1) 0 12deg,
            var(--bg-yellow-2) 12deg 24deg);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 18px;
}

/* Contenedor principal */
.trivia-wrap {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Logo 'sticker' */
.logo {
    font-family: 'Luckiest Guy', cursive;
    font-size: 56px;
    color: #ff4455;
    text-align: center;
    line-height: 0.88;
    padding: 10px 18px;
    background: linear-gradient(180deg, #fff 0%, #fff 70%);
    border-radius: 18px;
    text-shadow:
        -2px -2px 0 #7a3b1c,
        2px -2px 0 #7a3b1c,
        -2px 2px 0 #7a3b1c,
        2px 2px 0 #7a3b1c,
        0 6px 18px rgba(0, 0, 0, 0.18);
    transform: translateY(6px);
    box-shadow: 0 8px 0 #fff, 0 14px 30px rgba(0, 0, 0, 0.14);
}

/* Tarjeta blanca */
.card-header{
    display:flex; 
    justify-content:space-between; align-items:center;
    gap:12px;
}
#qnum{
    color:var(--text-brown); font-weight:700;
}
#puntos{
    color:var(--text-brown); font-weight:700;
}
.card {
    width: 100%;
    background: var(--card-bg);
    border-radius: 18px;
    padding: 28px 22px;
    position: relative;
    box-shadow:
        12px 12px 0px var(--card-edge),
        0 18px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.06));
    pointer-events: none;
}

/* Texto de pregunta */
.question {
    font-size: 20px;
    color: var(--text-brown);
    text-align: center;
    line-height: 1.4;
    font-weight: 600;
    padding: 6px 10px;
}

/* Opciones */
.options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

.option {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(180deg, var(--option-orange) 0%, var(--option-orange-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12), inset 0 -6px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.option:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.option:active {
    transform: translateY(-1px);
}

.option .label {
    /* min-width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 14px;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.12); */
}

.option .opt-text {
    flex: 1;
    text-align: left;
    letter-spacing: 0.1px;
}

/* Estados visuales */
.option.correct {
    background: linear-gradient(90deg, #32b055, #208e38);
    color: #06320b;
}

.option.wrong {
    background: linear-gradient(90deg, #FF6B6B, #FF3B3B);
    color: #fff;
}

.option.highlight-correct {
    background: linear-gradient(90deg, var(--accent-pink), #ffcf5b);
    color: #2a0f12;
    animation: pulse 900ms ease-in-out;
}

@keyframes pulse {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Feedback */
.feedback {
    min-height: 28px;
    color: #dbe9ff;
    font-weight: 700;
    margin-top: 4px;
}

/* Botones */
.controls {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    color: #e6eef8;
}

.btn.primary {
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    color: #fff;
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.08);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Overlay base */
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.6);
    z-index: 20;
}

.overlay.hidden {
    display: none;
}

/* Bienvenida específica */
.welcome .welcome-card {
    width: min(420px, 92%);
    padding: 20px 18px;
    border-radius: 12px;
    text-align: center;
    background: linear-gradient(180deg, #fff, #fff);
    color: var(--text-brown);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
}

.welcome .welcome-card h2 {
    font-size: 24px;
    margin-bottom: 6px;
}

.welcome .welcome-card p {
    margin-top: 6px;
    margin-bottom: 6px;
    color: #6b3f18;
    font-weight: 600;
}

/* Overlay final */
.overlay-card {
    background: linear-gradient(180deg, #0b1220, #071126);
    padding: 26px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: #e6eef8;
}

.big-score {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 12px 0;
    color: #60a5fa;
}

/* Firma */
.signature {
    margin-top: 6px;
    text-align: center;
    font-weight: 700;
    color: #7a3b1c;
    font-size: 14px;
    letter-spacing: 0.6px;
}

/* -------------------------
   Temporizador visual activo
   - Usa la variable CSS --progress (deg) para el conic-gradient
   - --timer-color controla el color del anillo
   ------------------------- */
.clock-deco {
    position: absolute;
    right: -8px;
    bottom: -24px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-6deg);
    z-index: 12;
}

.clock-deco .face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* ring: usa --progress y --timer-color */
    --progress: 360deg;
    --timer-color: var(--timer-color);
    background: conic-gradient(var(--timer-color) var(--progress), rgba(255, 255, 255, 0.06) 0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    border: 8px solid rgba(255, 127, 127, 0.06);
}

/* cara interior blanca */
.clock-deco .face::before {
    content: '';
    position: absolute;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff, #f7f8ff);
    z-index: 2;
    box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.04);
}

/* número central (tiempo) */
.time-display {
    position: relative;
    z-index: 3;
    font-weight: 800;
    color: #6b3f18;
    font-size: 26px;
}

/* decoraciones (pequeñas manecillas estilizadas) */
.clock-deco .hand-short,
.clock-deco .hand-long {
    position: absolute;
    width: 36px;
    height: 6px;
    background: var(--option-orange-dark);
    top: 50%;
    left: 50%;
    transform-origin: left center;
    transform: translate(-12px, -50%) rotate(-20deg);
    border-radius: 4px;
    z-index: 3;
    opacity: 0.9;
}

.clock-deco .hand-long {
    width: 48px;
    background: var(--accent-blue);
    transform: translate(-18px, -50%) rotate(-10deg);
}

/* pequeño triángulo decorativo exterior */
.clock-deco::after {
    content: '';
    position: absolute;
    right: -12px;
    bottom: 6px;
    width: 20px;
    height: 20px;
    transform: rotate(30deg);
    border-radius: 4px;
    background: var(--accent-pink);
    box-shadow: 0 6px 14px rgba(255, 111, 166, 0.12);
}

/* Responsive: opciones en 2 columnas si ancho permite */
@media (min-width:520px) {
    .options {
        grid-template-columns: 1fr 1fr;
    }

    .logo {
        font-size: 64px;
        padding: 12px 20px;
    }

    .card {
        padding: 30px;
    }
}

/* Móviles muy pequeños */
@media (max-width:360px) {
    .logo {
        font-size: 48px;
    }

    .question {
        font-size: 18px;
    }

    .option {
        font-size: 14px;
        padding: 12px;
    }

    .clock-deco {
        width: 88px;
        height: 88px;
        right: -6px;
        bottom: -18px;
        transform: rotate(-4deg);
    }
}