/* =========================================================
   DVO3 Weekend Teamindeling - festive pub-quiz theme
   ========================================================= */

:root {
    --bg: #0b1530;
    --bg-2: #0f1d44;
    --surface: rgba(20, 35, 75, 0.85);
    --surface-border: rgba(245, 185, 66, 0.18);
    --text: #f4ede4;
    --muted: #b9c0d1;
    --primary: #f5b942;        /* mustard */
    --primary-strong: #f4a31a;
    --accent: #ef4444;         /* warm red */
    --accent-2: #ff7a59;
    --success: #4ade80;
    --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(245, 185, 66, 0.12), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(239, 68, 68, 0.16), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Animated background blobs */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: float 18s ease-in-out infinite;
}
.blob-1 { width: 420px; height: 420px; background: #f5b942; top: -120px; left: -80px; }
.blob-2 { width: 520px; height: 520px; background: #ef4444; bottom: -180px; right: -120px; animation-delay: -6s; }
.blob-3 { width: 320px; height: 320px; background: #6366f1; top: 40%; left: 55%; animation-delay: -12s; opacity: 0.25; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.08); }
}

/* Layout */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    gap: 1.5rem;
}

.card {
    width: 100%;
    max-width: 720px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 4vw, 2.75rem);
    box-shadow: var(--shadow-lg);
}

.card--narrow { max-width: 480px; }
.card--wide { max-width: 920px; }
.card--centered { text-align: center; }

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Typography */
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.15; }

.display {
    font-family: 'Fraunces', 'Times New Roman', serif;
    font-weight: 900;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 60%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.6rem;
}

.headline {
    font-family: 'Fraunces', 'Times New Roman', serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: var(--text);
}

.section-title {
    font-family: 'Bebas Neue', 'Inter', sans-serif;
    letter-spacing: 0.08em;
    font-size: 1.4rem;
    color: var(--primary);
    margin: 1.5rem 0 0.75rem;
}

.lead {
    color: var(--muted);
    font-size: 1.05rem;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

p { line-height: 1.55; }

/* Stack utility */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 0.4rem; text-align: left; }
.field__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(245, 185, 66, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    line-height: 1;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(245, 185, 66, 0.35);
}
.btn--primary:hover:not(:disabled) { box-shadow: 0 12px 30px rgba(245, 185, 66, 0.5); }

.btn--accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.06); }

.btn--block { width: 100%; }

button {
    /* legacy fallback for any bare <button> still in markup */
    font-family: inherit;
}

/* Flash messages */
.flash-messages {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.flash {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ffd5d5;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.flash--hide { opacity: 0; transform: translateY(-6px); pointer-events: none; }

/* Hero image */
.hero-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
    display: block;
    margin-inline: auto;
}

.hero-img--contain {
    max-width: 340px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.question-img {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 3px solid rgba(245, 185, 66, 0.4);
    box-shadow: var(--shadow-md);
    margin: 0 auto 1.25rem;
    display: block;
}

/* Question / quiz */
.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.95rem;
}
.question-meta strong { color: var(--primary); }

.timer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ffd5d5;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 0 1.5rem;
}
.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-2));
    border-radius: 999px;
    transition: width 0.4s ease;
}

.question-text {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    color: var(--text);
    margin: 0 0 1.25rem;
    text-align: center;
    line-height: 1.35;
}

.options {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 560px) {
    .options { grid-template-columns: 1fr 1fr; }
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.1s;
    font-size: 1rem;
    user-select: none;
}
.option:hover { border-color: rgba(245, 185, 66, 0.6); background: rgba(245, 185, 66, 0.06); }
.option input { accent-color: var(--primary); transform: scale(1.15); }
.option--selected {
    border-color: var(--primary);
    background: rgba(245, 185, 66, 0.14);
    box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.12);
}

/* Lists */
.player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.player-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Teams */
.teams-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-top: 1rem;
}
@media (min-width: 720px) {
    .teams-grid { grid-template-columns: 1fr 1fr; }
}

.team-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
}
.team-card__title {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    line-height: 1.25;
}
.team-card ul { list-style: none; padding: 0; margin: 0; }
.team-card li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 0.35rem;
    text-align: left;
}
.team-card li.captain {
    background: rgba(245, 185, 66, 0.15);
    border: 1px solid rgba(245, 185, 66, 0.4);
    font-weight: 600;
}
.team-card li.loser {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.team-card .score { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.92rem; }

/* Chat */
.chat {
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.chat__messages {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.chat__messages li {
    padding: 0.45rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    text-align: left;
}
.chat__form { display: flex; gap: 0.5rem; }
.chat__form input { flex: 1; }

/* Footer / logout */
.footer-row {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}
.link {
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}
.link:hover { color: var(--primary); border-color: var(--primary); }

/* Crown / poop emoji */
.crown::after { content: " 👑"; }
.poop::after { content: " 💩"; }

/* Pulse animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
}
.pulse { animation: pulse 1.6s ease-in-out infinite; }
