body {
    margin: 0;
    background-color: #000;
    font-family: 'Montserrat', Arial, sans-serif;
    color: #fff;
}

/* --- SCORE MESSAGE SIZE --- */
.recap-message {
    font-size: 3em;      /* Larger than score text */
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.18em;
    color: #fff;
    line-height: 1.13;
}

.home-btn {
    background: #000 !important;
    color: #fff !important;
    font-size: 1.08em;
    font-family: 'Montserrat', Arial, sans-serif !important;
    font-weight: 700;
    border: 2px solid #fff;
    border-radius: 10px;
    padding: 13px 32px;
    margin: 18px 0 16px 0;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(44,54,77,0.09);
    transition: background 0.18s, color 0.18s, transform 0.1s;
    display: block;
    letter-spacing: 1.3px;
}
/* Remove hover/toggle/active effects entirely */
.home-btn:hover,
.home-btn:focus,
.home-btn:active {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff;
    transform: none;
}

.rules-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 120;
    transition: opacity 0.5s;
    padding-top: 0;
}

.rules-box {
    background: #000;
    border-radius: 0 0 22px 22px;   /* Only bottom corners */
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    padding: 0 24px 36px 24px;      /* ZERO top padding */
    max-width: 420px;
    width: 92vw;
    text-align: center;
    margin-top: 0;
}
.rules-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 18px;
    color: #fff;
    letter-spacing: 2px;
}
.rules-list {
    text-align: center;
    font-size: 1.08em;
    margin: 0 0 26px 0;
    padding-left: 0;
    color: #fff;
    line-height: 1.6;
}
.rules-list div {
    margin-bottom: 10px;
    font-family: inherit;
}

/* default button is white fill with black text */
.start-game-btn {
    display: inline-block;
    margin-top: 2px;
    padding: 12px 38px;
    border-radius: 10px;
    border: 2px solid #fff;
    background: #fff;
    color: #000;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 1.08em;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(255,255,255,0.12);
    letter-spacing: 1.3px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}

/* hover/toggle look becomes the "inverted" black fill + white text */
.start-game-btn:hover,
.start-game-btn:focus {
    background: #000;
    color: #fff;
    transform: scale(1.04);
}

/* Desktop-only: center the rules box vertically (lower it a touch) */
@media (min-width: 601px) {
    .rules-container {
        align-items: center;
        padding-top: 0;
    }

    .rules-box {
        margin-top: 0;
        transform: translateY(18px);
    }
}

/* NEW: Desktop-only rules typography + spacing improvements */
@media (min-width: 901px) {
    .rules-box {
        max-width: 640px;          /* wider so lines aren't cramped */
        width: min(78vw, 640px);
        padding-left: 44px;        /* more breathing room */
        padding-right: 44px;
        padding-bottom: 44px;
    }

    .rules-title {
        font-size: 2.25em;         /* slightly bigger */
        margin-bottom: 22px;
    }

    .rules-list {
        font-size: 1.18em;         /* bump body text size */
        line-height: 1.75;         /* more readable */
        margin-bottom: 30px;
    }

    .rules-list div {
        margin-bottom: 14px;       /* widen spacing between paragraphs */
    }

    .start-game-btn {
        font-size: 1.15em;
        padding: 14px 48px;
        border-radius: 12px;
    }
}

/* --- FADE-IN --- */
.game-container.fade-in,
.header-bar.fade-in {
    opacity: 0;
    transition: opacity 2s cubic-bezier(.4,2,.4,1);
}
.game-container.visible,
.header-bar.visible {
    opacity: 1;
}

/* --- HEADER BAR --- */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 120px;
    background: #000;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

/* divider line under header */
.header-bar::after {
    content: "";
    position: absolute;
    left: clamp(14px, 4vw, 34px);
    right: clamp(14px, 4vw, 34px);
    bottom: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
    pointer-events: none;
}

.streak-container {
    position: absolute;
    left: 0;
    top: 0;
    height: 120px;
    align-items: center;
    padding-left: 28px;
    color: #18d86a;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    user-select: none;
    font-size: 32px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s cubic-bezier(.4,2,.4,1), visibility 0s linear 0.7s;
    display: flex;
}
.streak-container.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.7s cubic-bezier(.4,2,.4,1), visibility 0s;
}
.streak-container.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(.4,2,.4,1), visibility 0s linear 0.4s;
}

.streak-flame {
    font-size: 42px;
    margin-right: 0.1em;
    vertical-align: middle;
    display: inline-block;
}
#streakDisplay {
    min-width: 0;
    text-align: left;
    font-size: 50px;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0;
    background: linear-gradient(90deg, #ff9800 0%, #ff5722 60%, #fff200 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.title-correct {
    color: #18d86a !important;
    transition: color 0.2s;
}
.title-incorrect {
    color: #ff3c3c !important;
    transition: color 0.2s;
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 20%;
    position: relative;
}

.game-title {
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 2px 14px rgba(0,0,0,0.5), 0 1px 0 #333;
    user-select: none;
    margin: 0;
    padding: 0;
    border: none;
    position: static;
    width: 100%;
    pointer-events: none;
    margin-bottom: 0;
    transition: color 0.2s;
}

.timer-container {
    position: absolute;
    right: 0;
    top: 0;
    height: 120px;
    display: flex;
    align-items: center;
    padding-right: 28px;
    color: #fff;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    user-select: none;
}
#timerDisplay {
    min-width: 42px;
    text-align: center;
    font-size: 50px;
}

/* --- GAME + FACT BOX --- */
.game-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    width: 100vw;

    /* reserve space so content isn't hidden behind the fixed scoreboard */
    padding-bottom: calc(30px + 74px + env(safe-area-inset-bottom));
}

.fact-box-container {
    width: 100vw;
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

/* Category banner (below header, above question) */
.category-banner {
    width: min(720px, calc(100vw - 2 * clamp(14px, 4vw, 34px)));
    margin-top: 6px;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.92);
    user-select: none;
}

/* pill wrapper so icon + text sit in one chip */
.category-banner .category-banner-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ensure the icon is vertically centered with the text */
.category-banner-icon {
    flex: 0 0 auto;
}

.fact-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-height: 200px;
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    z-index: 2;
    cursor: grab;
    transition: transform 0.25s, opacity 0.35s;
    text-align: center;
}
.fact-box.picked-up {
    opacity: 0.7;
}
.fact-box p {
    font-size: 1.6em;
    margin: 0 auto;
    color: #fff;
    background: none;
    border: none;
    padding-left: clamp(20px, 7vw, 48px);
    padding-right: clamp(20px, 7vw, 48px);
    box-sizing: border-box;
    text-align: center;
    line-height: 1.3;
    max-width: 600px;
    word-break: break-word;
    overflow-wrap: break-word;
    font-weight: bold;
}

#trueButton,
#falseButton {
    display: none !important;
}
.swipe-button {
    display: none;
}

/* --- BOTTOM CATEGORY SCOREBOARD (numbers) --- */
.category-scoreboard {
    position: fixed;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(820px, calc(100vw - 2 * clamp(14px, 4vw, 34px)));
    background: rgba(0, 0, 0, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    z-index: 115;
    box-sizing: border-box;
    padding: 14px clamp(14px, 3vw, 22px);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.category-scoreboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(10px, 2.8vw, 18px);
    align-items: center;
}

.category-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

/* Shared icon base */
.category-icon {
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    opacity: 0.95;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.08));
}

/* Sports: regular red circle */
.icon-sports {
    background: #ff3c3c;
    border-radius: 999px;
    transform: scale(1.16);
    transform-origin: center;
}

/* Media: pink triangle */
.icon-media {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 20px solid #ff4fd8;
    filter: drop-shadow(0 0 10px rgba(255,79,216,0.22));
}

/* History: yellow square */
.icon-history {
    background: #facc15;
    border-radius: 4px;
}

/* Geography: blue diamond */
.icon-geography {
    background: #3b82f6;
    transform: rotate(45deg);
    border-radius: 3px;
}

/* Misfit: violet 4-point sparkle star */
.icon-misfit {
    background: #7c3aed;
    clip-path: polygon(
        50% 4%,
        61% 28%,
        96% 50%,
        61% 72%,
        50% 96%,
        39% 72%,
        4% 50%,
        39% 28%
    );
    transform: scale(1.40);
    transform-origin: center;
    border-radius: 6px;
    filter:
        drop-shadow(0 0 10px rgba(124,58,237,0.24))
        drop-shadow(0 0 2px rgba(255,255,255,0.10));
}

.category-value {
    font-weight: 900;
    font-size: clamp(22px, 4.6vw, 28px);
    letter-spacing: 1px;
    color: #fff;
    line-height: 1;
    min-width: 22px;
    text-align: center;
}

/* spice container */
.spice-next-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    margin-top: 40px;
}
.spice-container {
    position: absolute;
    left: 0;
    top: 38%;
    transform: translateY(-60%) scale(1.1);
    width: 100vw;
    font-size: 18px;
    margin: 0;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
    text-align: center;
    background: none;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(.4,2,.4,1), transform 0s;
    z-index: 10;
}
@keyframes popspice {
    0%   { transform: translateY(-50%) scale(0.7);}
    70%  { transform: translateY(-50%) scale(1.22);}
    100% { transform: translateY(-50%) scale(1.1);}
}
.spice-container.pop {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    animation: popspice 0.22s cubic-bezier(.4,2,.4,1);
    pointer-events: auto;
}
.spice-container p {
    font-weight: normal;
    font-size: 1.08em;
    margin: 0 auto;
    padding-left: clamp(16px, 6vw, 38px);
    padding-right: clamp(16px, 6vw, 38px);
    box-sizing: border-box;
    text-align: center;
    max-width: 600px;
    word-break: break-word;
    overflow-wrap: break-word;
    color: #fff;
}

/* --- RESULT POPUP --- */
.result-popup {
    position: fixed;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    font-size: 54px;
    padding: 0;
    width: auto;
    max-width: 90vw;
    border-radius: 0;
    z-index: 9999;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    will-change: opacity, transform;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(.4,2,.4,1), opacity 0.2s;
}
.result-popup svg {
    display: inline-block;
    vertical-align: middle;
    width: 260px;
    height: 260px;
    filter: drop-shadow(0 0 16px rgba(24,216,106,0.25));
}
.result-popup.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    animation: popresult 0.22s cubic-bezier(.4,2,.4,1);
    pointer-events: auto;
}
@keyframes popresult {
    0%   { transform: translate(-50%, -50%) scale(0.7);}
    70%  { transform: translate(-50%, -50%) scale(1.22);}
    100% { transform: translate(-50%, -50%) scale(1.1);}
}

/* --- RECAP/ANSWER KEY --- */
.recap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: #fff;
    font-family: 'Montserrat', Arial, sans-serif;
    z-index: 1000;
    font-size: 1.04em;
    background: #000;
    border-radius: 20px;
    padding: 50px 8vw 30px 8vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-width: 96vw;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

.recap-container h2 {
    width: 100%;
    text-align: center;
    margin-bottom: 18px;
}

.final-score {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 2em;
    font-weight: bold;
}
.longest-streak {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 1.13em;
    font-weight: bold;
}

/* --- ANSWER KEY --- */
.answer-key {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.answer-key h3 {
    font-size: 1.18em;
    margin-bottom: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.answer-key ul {
    padding-left: 0;
    margin: 0;
    width: 100%;
}
.answer-key li {
    margin-bottom: 18px;
    font-size: 1em;
    list-style: none;
    background: #000;
    border-radius: 14px;
    border:  2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.09);
    padding: 24px 48px 22px 48px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    max-width: 1000px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
    word-break: break-word;
}
.answer-key .correct-box {
    border-color: #18d86a !important;
    color: #18d86a !important;
}
.answer-key .incorrect-box {
    border-color: #ff3c3c !important;
    color: #ff3c3c !important;
}
.answer-key .question-text {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
}
.answer-key .spice,
.answer-key .player-answer {
    width: 100%;
    text-align: center;
}
.answer-key .spice {
    font-style: italic;
    margin-bottom: 12px;
}
.answer-key .player-answer {
    margin-right: 8px;
    font-weight: bold;
    font-size: 1.05em;
}
.answer-key .correctness {
    display: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 700px) {
    .answer-key, .answer-key ul, .answer-key li {
        max-width: 98vw !important;
        width: 100% !important;
        padding-left: 2vw;
        padding-right: 2vw;
    }
    .recap-container {
        padding: 30px 2vw 20px 2vw;
    }
    .recap-message {
        font-size: 2em;
    }
}
@media (max-width: 600px) {
    .game-title {
        font-size: 32px;
        height: 68px;
    }

    .header-bar {
        height: 92px;
    }

    .streak-container,
    .timer-container {
        height: 92px;
    }

    .header-bar::after {
        bottom: 6px;
    }

    .timer-container {
        font-size: 1.3em;
        padding-right: 12px;
    }
    #timerDisplay {
        font-size: 28px;
    }
    .streak-container {
        font-size: 1.3em;
        padding-left: 12px;
    }
    .streak-flame {
        font-size: 28px;
        margin-right: 0.1em;
    }
    #streakDisplay {
        font-size: 28px;
    }

    .category-banner {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .category-banner .category-banner-pill {
        padding: 8px 12px;
        border-radius: 12px;
        gap: 9px;
    }

    /* Mobile-only: a little bigger than before */
    .category-scoreboard {
        border-radius: 18px;
        padding-top: 14px;
        padding-bottom: 14px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .category-scoreboard-grid {
        gap: 16px;
    }

    .category-icon {
        width: 20px;
        height: 20px;
    }

    /* triangle stays proportional on mobile */
    .icon-media {
        border-left-width: 12px;
        border-right-width: 12px;
        border-bottom-width: 22px;
    }

    .category-value {
        font-size: 30px;
    }
}

/* --- BODY SCROLL CONTROL --- */
body.noscroll,
html.noscroll {
    overflow: hidden !important;
    position: fixed;
    width: 100vw;
    height: 100vh;
    touch-action: none;
}
body.allow-scroll,
html.allow-scroll {
    overflow: auto !important;
    position: static;
    width: auto;
    height: auto;
    touch-action: auto;
}
