/* === Fool's Party — Shared Styles === */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #1a1147;
    --bg-light: #2d1b69;
    --bg-card: #362180;
    --accent: #ff6b35;
    --accent2: #ffd23f;
    --green: #44cf6c;
    --red: #ef476f;
    --blue: #118ab2;
    --purple: #9b5de5;
    --text: #ffffff;
    --text-dim: #b8a9d4;
    --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Fredoka', 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* === Buttons === */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--purple); color: white; }
.btn-green { background: var(--green); color: white; }
.btn-sm { padding: 10px 20px; font-size: 14px; }

/* === Inputs === */
input[type="text"], input[type="number"], select {
    padding: 14px 20px;
    border: 3px solid var(--bg-card);
    border-radius: var(--radius);
    background: var(--bg-light);
    color: var(--text);
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, select:focus { border-color: var(--accent); }

/* === Room Code === */
.room-code {
    font-size: 72px;
    font-weight: 700;
    letter-spacing: 16px;
    color: var(--accent2);
    text-shadow: 0 4px 12px rgba(255,210,63,0.3);
}

/* === Timer === */
.timer-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}
.timer-fill {
    height: 100%;
    background: var(--accent2);
    border-radius: 4px;
    transition: width 1s linear;
}
.timer-fill.urgent { background: var(--red); }

.timer-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent2);
}
.timer-number.urgent { color: var(--red); }

/* === Avatars === */
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.avatar.fox { background: #ff6b35; }
.avatar.cat { background: #9b5de5; }
.avatar.dog { background: #118ab2; }
.avatar.panda { background: #2d1b69; border: 3px solid white; }
.avatar.owl { background: #854d0e; }
.avatar.penguin { background: #1e293b; }
.avatar.koala { background: #6b7280; }
.avatar.rabbit { background: #ec4899; }
.avatar.bear { background: #92400e; }
.avatar.frog { background: #44cf6c; }

.avatar-emoji::after {
    font-size: 36px;
}

/* === Player Cards === */
.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px solid transparent;
}
.player-card.active { border-color: var(--accent2); }
.player-card .name { font-weight: 600; font-size: 18px; }
.player-card .score { font-weight: 700; font-size: 20px; color: var(--accent2); margin-left: auto; }

/* === Question Display === */
.question-text {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    padding: 20px;
}

.category-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--purple);
}

/* === Answer Options === */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.option-btn {
    padding: 16px 20px;
    border: 3px solid var(--bg-card);
    border-radius: var(--radius);
    background: var(--bg-light);
    color: var(--text);
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}
.option-btn:hover { border-color: var(--accent); transform: scale(1.02); }
.option-btn.selected { border-color: var(--accent2); background: var(--bg-card); }
.option-btn.correct { border-color: var(--green); background: rgba(68,207,108,0.2); }
.option-btn.wrong { border-color: var(--red); background: rgba(239,71,111,0.1); }
.option-btn .label {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
}

/* === Scoreboard === */
.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.score-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
}
.score-row.first { background: var(--accent); }
.score-row .rank { font-size: 24px; font-weight: 700; width: 40px; }
.score-row .name { font-size: 20px; font-weight: 600; flex: 1; }
.score-row .points { font-size: 24px; font-weight: 700; color: var(--accent2); }
.score-row.first .points { color: white; }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

.fade-in { animation: fadeIn 0.5s ease; }
.pulse { animation: pulse 2s ease infinite; }
.bounce { animation: bounce 1s ease infinite; }

/* === Mobile (Player view) === */
@media (max-width: 600px) {
    .question-text { font-size: 22px; }
    .room-code { font-size: 48px; letter-spacing: 10px; }
    .options-grid { grid-template-columns: 1fr; }
}
