/* ══════════════════════════════════════════════
   FRØDEKAPP — Neobrutalisme Quiz
   ══════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', 'Arial Bold', Arial, system-ui, sans-serif;
    background-color: #FDFD96;
    min-height: 100vh;
    color: #000;
}

body.host-body {
    background-color: #2c3e50;
    color: #fff;
}

body.play-body {
    background-color: #f5f5f5;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.text-body {
    font-family: Arial, system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* ── CONTAINER ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

/* ── NEOBRUTALISME CARD ── */
.nb-card {
    background: #fff;
    border: 3px solid #000;
    box-shadow: 5px 5px 0 #000;
    padding: 24px;
    color: #000;
}

.nb-card-sm {
    background: #fff;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 #000;
    padding: 16px;
    color: #000;
}

/* ── HEADER ── */
.page-header {
    background: #fff;
    border: 3px solid #000;
    box-shadow: 7px 7px 0 #000;
    padding: 32px 36px;
    margin-bottom: 32px;
    position: relative;
    color: #000;
}

.page-header .header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-header .header-icon {
    font-size: 3rem;
    line-height: 1;
    flex-shrink: 0;
}

.page-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: #000;
}

.page-header .subtitle {
    font-family: Arial, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 6px;
    color: #000;
}

.header-stripe {
    height: 8px;
    background: repeating-linear-gradient(
        -45deg,
        #000 0px, #000 5px,
        #FDFD96 5px, #FDFD96 14px
    );
    margin: 20px -36px -32px;
}

.header-badge {
    position: absolute;
    top: -14px;
    right: 28px;
    background: #C4A1FF;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    padding: 5px 16px;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
}

/* ── SECTION LABEL ── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFDB58;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 8px 22px;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    margin-bottom: 20px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #000;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 12px 24px;
    font-family: 'Arial Black', Arial, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.08s;
    text-decoration: none;
    line-height: 1.2;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 4px 4px 0 #000 !important;
}

.btn-primary { background: #4CAF50; color: #fff; }
.tag-subject { background: #2C3E50; color: #fff; }
.tag-count   { background: #FDFD96; color: #000; }
.tag-local   { background: #2C3E50; color: #fff; }
.btn-yellow  { background: #FFDB58; }
.btn-purple  { background: #C4A1FF; }
.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-width: 2px;
    box-shadow: 3px 3px 0 #000;
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.2rem;
}

/* ── KAHOOT-STYLE ANSWER BUTTONS ── */
.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.answer-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 20px 24px;
    font-family: 'Arial Black', Arial, system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
    text-align: left;
    line-height: 1.3;
}

.answer-btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.answer-btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.answer-btn .answer-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.answer-a { background: #E74C3C; }
.answer-b { background: #3498DB; }
.answer-c { background: #2ECC71; }
.answer-d { background: #F1C40F; color: #000; }

.answer-btn.selected {
    outline: 4px solid #fff;
    outline-offset: -4px;
}

.answer-btn.correct {
    background: #2ECC71 !important;
    color: #fff !important;
}

.answer-btn.incorrect {
    background: #95a5a6 !important;
    opacity: 0.5;
}

/* ── FORM ELEMENTS ── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 900;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 3px solid #000;
    font-family: Arial, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    background: #fff;
    color: #000;
    transition: box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    box-shadow: 4px 4px 0 #000;
    background: #f0f8ff;
}

.form-input::placeholder {
    color: #999;
    font-weight: 400;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

select.form-input {
    cursor: pointer;
}

/* ── ROOM CODE DISPLAY ── */
.room-code-box {
    background: #8B5CF6;
    border: 3px solid #000;
    box-shadow: 5px 5px 0 #000;
    padding: 20px;
    text-align: center;
    color: #fff;
}

.room-code {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 8px;
    color: #fff;
    margin: 8px 0;
}

/* ── TIMER ── */
.timer-display {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    line-height: 1;
}

.timer-display.warning {
    color: #E74C3C;
    animation: timer-pulse 0.5s infinite;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ── PROGRESS BAR ── */
.progress-bar {
    width: 100%;
    height: 12px;
    background: #eee;
    border: 2px solid #000;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

/* ── PLAYER LIST ── */
.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-chip {
    background: #fff;
    border: 2px solid #000;
    box-shadow: 2px 2px 0 #000;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.9rem;
}

.player-chip.host {
    background: #FFDB58;
}

/* ── LEADERBOARD ── */
.leaderboard {
    width: 100%;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 2px solid #000;
    background: #fff;
    color: #000;
    transition: transform 0.3s ease;
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-rank {
    font-size: 1.3rem;
    font-weight: 900;
    min-width: 36px;
    text-align: center;
}

.lb-name {
    flex: 1;
    font-weight: 700;
    font-size: 1.05rem;
}

.lb-score {
    font-weight: 900;
    font-size: 1.1rem;
    background: #FDFD96;
    border: 2px solid #000;
    padding: 4px 12px;
}

.lb-row.gold   { background: #FFDB58; }
.lb-row.silver { background: #E0E0E0; }
.lb-row.bronze { background: #F4C08C; }

/* ── PODIUM ── */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px 0;
}

.podium-place {
    text-align: center;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 16px 20px;
    min-width: 120px;
    color: #000;
}

.podium-place.first  { background: #FFDB58; min-height: 180px; }
.podium-place.second { background: #E0E0E0; min-height: 140px; }
.podium-place.third  { background: #F4C08C; min-height: 110px; }

.podium-medal { font-size: 2.5rem; }
.podium-name  { font-weight: 900; font-size: 1.1rem; margin: 8px 0 4px; }
.podium-score { font-weight: 700; font-size: 0.95rem; }

/* ── QUIZ CARD (library) ── */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.quiz-card {
    background: #fff;
    border: 3px solid #000;
    box-shadow: 5px 5px 0 #000;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: #000;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.quiz-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 #000;
}

.quiz-card-title {
    font-size: 1.15rem;
    font-weight: 900;
    text-transform: uppercase;
}

.quiz-card-desc {
    font-family: Arial, system-ui, sans-serif;
    font-size: 0.88rem;
    line-height: 1.5;
    font-weight: 400;
    flex: 1;
}

.quiz-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tag {
    background: #f0f0f0;
    border: 2px solid #000;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tag-count   { background: #FDFD96; }
.tag-time    { background: #87CEEB; }
.tag-subject { background: #2C3E50; }

/* ── HOST SCREEN (dark theme) ── */
.host-question-display {
    background: #16213e;
    border: 3px solid #444;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #fff;
}

.host-question-text {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 30px;
}

/* ── WAITING / LOBBY ── */
.lobby-screen {
    text-align: center;
    padding: 40px 20px;
}

.lobby-dots {
    display: inline-flex;
    gap: 8px;
    margin-top: 16px;
}

.lobby-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #000;
    animation: lobby-bounce 1.4s ease-in-out infinite;
}

.lobby-dot:nth-child(2) { animation-delay: 0.2s; }
.lobby-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes lobby-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── STATUS BADGE ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 2px solid #000;
    font-weight: 700;
    font-size: 0.85rem;
}

.status-badge.online  { background: #90EE90; }
.status-badge.offline { background: #FFB6C1; }
.status-badge.waiting { background: #FDFD96; }

/* ── SCREEN VISIBILITY ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── UTILITY ── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .container, .container-narrow, .container-wide {
        padding: 20px 16px 40px;
    }

    .page-header {
        padding: 24px;
    }

    .header-stripe {
        margin: 16px -24px -24px;
    }

    .answer-grid {
        grid-template-columns: 1fr;
    }

    .answer-btn {
        padding: 18px 20px;
        font-size: 1rem;
    }

    .quiz-grid {
        grid-template-columns: 1fr;
    }

    .podium-place {
        min-width: 90px;
        padding: 12px 10px;
    }
}

@media (max-width: 480px) {
    .page-header .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-header .header-icon {
        font-size: 2.4rem;
    }

    .room-code {
        font-size: 2.2rem;
        letter-spacing: 5px;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 1rem;
    }
}
