:root {
    --bg-1: #071123;
    --bg-2: #101b38;
    --bg-3: #142955;
    --panel: rgba(10, 16, 34, 0.84);
    --panel-light: rgba(255, 255, 255, 0.08);
    --stroke: rgba(255, 255, 255, 0.12);
    --primary: #7c5cff;
    --primary-2: #4cc9f0;
    --primary-3: #22d3ee;
    --accent: #ffcc00;
    --accent-2: #ff8a00;
    --success: #22c55e;
    --success-dark: #15803d;
    --danger: #ef4444;
    --danger-dark: #b91c1c;
    --text-main: #f8fafc;
    --text-soft: #dbe4f3;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 243, 255, 0.96) 100%);
    --shadow-xl: 0 40px 90px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.18);
    --radius-xl: 38px;
    --radius-lg: 26px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 14% 18%, rgba(76, 201, 240, 0.24) 0%, transparent 26%),
        radial-gradient(circle at 84% 16%, rgba(124, 92, 255, 0.20) 0%, transparent 26%),
        radial-gradient(circle at 74% 82%, rgba(255, 204, 0, 0.12) 0%, transparent 18%),
        linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    overflow-x: hidden;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background:
        linear-gradient(rgba(255,255,255,0.024) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.024) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle at center, black 46%, transparent 94%);
}

body::after {
    background: radial-gradient(circle at center, rgba(255,255,255,0.06) 0%, transparent 62%);
    opacity: 0.8;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
    animation: floatOrb 9s ease-in-out infinite;
}

.orb-1 {
    width: 240px;
    height: 240px;
    left: -40px;
    top: 80px;
    background: rgba(34, 211, 238, 0.35);
}

.orb-2 {
    width: 280px;
    height: 280px;
    right: -60px;
    top: 60px;
    background: rgba(124, 92, 255, 0.30);
    animation-delay: -2s;
}

.orb-3 {
    width: 220px;
    height: 220px;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 204, 0, 0.24);
    animation-delay: -4s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -18px, 0) scale(1.06); }
}

.intro-screen {
    position: relative;
    z-index: 1;
    width: min(1440px, calc(100vw - 48px));
    max-width: 100%;
}

.game-container {
    position: relative;
    z-index: 1;
    width: min(1440px, 96vw);
}

.intro-screen {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.intro-screen.is-leaving {
    opacity: 0;
    transform: scale(0.98);
}

.intro-card,
.game-container {
    border-radius: var(--radius-xl);
    border: 1px solid var(--stroke);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%),
        linear-gradient(135deg, rgba(12,18,38,0.92) 0%, rgba(7,11,24,0.97) 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset, var(--shadow-xl);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.intro-card {
    min-height: min(860px, calc(100vh - 48px));
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 24px;
    padding: 34px;
    align-items: center;
}

.intro-copy {
    padding: 18px 10px 18px 10px;
    min-width: 0;
}

.intro-badge,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(124,92,255,0.16) 0%, rgba(76,201,240,0.14) 100%);
    border: 1px solid rgba(124,92,255,0.25);
    color: #dbeafe;
    font-weight: 900;
    letter-spacing: 0.4px;
}

.intro-copy h1 {
    margin: 18px 0 16px;
	margin-bottom: 40px;
    font-family: 'Fredoka One', cursive;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1.02;
    letter-spacing: -1px;
    color: #ffffff;
    text-shadow: 0 10px 24px rgba(76, 201, 240, 0.16);
}

.intro-copy p {
    margin: 0 0 16px;
    max-width: 620px;
    font-size: 21px;
    line-height: 1.52;
    color: var(--text-soft);
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.intro-visual {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.intro-mascot-glow {
    position: absolute;
    inset: 10% 8%;
    border-radius: 40px;
    background:
        radial-gradient(circle at center, rgba(76, 201, 240, 0.20), transparent 34%),
        radial-gradient(circle at center, rgba(255, 204, 0, 0.16), transparent 48%);
    filter: blur(10px);
}

.intro-art {
    position: relative;
    z-index: 1;
    display: block;
    width: 550px;
    /* width: 100%; */
    /* max-width: 360px; */
    height: auto;
    max-height: 760px;
    object-fit: contain;
    border-radius: 28px;
    filter: drop-shadow(0 30px 50px rgba(0,0,0,0.34));
    animation: floatHero 4.8s ease-in-out infinite;
}

@keyframes floatHero {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.game-container {
    min-height: min(880px, calc(100vh - 48px));
    padding: 28px;
}

.game-hidden {
    display: none;
}

.game-enter {
    animation: gameEnter 0.6s ease;
}

@keyframes gameEnter {
    0% { opacity: 0; transform: translateY(12px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    margin-bottom: 26px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid var(--stroke);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    border-radius: 24px;
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #dbeafe 36%, #93c5fd 100%);
    box-shadow: 0 10px 18px rgba(0,0,0,0.24), inset 0 2px 10px rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.45);
}

.player-stats {
    min-width: 0;
    width: 100%;
}

.player-name {
    display: inline-block;
    margin-bottom: 8px;
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    letter-spacing: 0.8px;
    color: #ffffff;
    text-transform: uppercase;
}

.xp-bar {
    width: 100%;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(2,6,23,0.95) 0%, rgba(15,23,42,0.9) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.16);
}

.xp-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22d3ee 0%, #4cc9f0 30%, #7c5cff 68%, #b517ff 100%);
    box-shadow: 0 0 18px rgba(76, 201, 240, 0.38), inset 0 1px 0 rgba(255,255,255,0.35);
    transition: width 0.45s ease;
    position: relative;
}

.xp-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 45%, rgba(255,255,255,0.12) 100%);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.progress-chip,
.timer-badge,
.score-badge {
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 22px;
}

.progress-chip {
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.18) 0%, rgba(124, 92, 255, 0.18) 100%), rgba(8,12,25,0.84);
    border: 1px solid rgba(76,201,240,0.25);
    font-weight: 900;
    color: #f8fafc;
}

.progress-icon {
    font-size: 22px;
}

.timer-badge {
    min-width: 146px;
    background: linear-gradient(135deg, rgba(242,191,45,0.22) 0%, rgba(255,163,26,0.18) 100%), rgba(8,12,25,0.84);
    border: 1px solid rgba(242,191,45,0.42);
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}

.timer-badge.timer-ending {
    background: linear-gradient(135deg, rgba(255,122,122,0.28) 0%, rgba(255,74,74,0.22) 100%), rgba(8,12,25,0.84);
    border-color: rgba(255,122,122,0.45);
}

.timer-icon {
    font-size: 22px;
}

.score-badge {
    min-width: 132px;
    background: linear-gradient(135deg, rgba(255,204,0,0.2) 0%, rgba(255,138,0,0.18) 100%), rgba(8,12,25,0.84);
    border: 1px solid rgba(255,204,0,0.4);
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.02fr) minmax(360px, 0.98fr);
    gap: 28px;
    align-items: stretch;
}

.wheel-area,
.challenge-area {
    min-width: 0;
}

.wheel-panel,
.card-challenge {
    border-radius: 32px;
    overflow: hidden;
}

.wheel-panel {
    min-height: 720px;
    padding: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--stroke);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), var(--shadow-lg);
}

.wheel-panel-top h2 {
    margin: 10px 0 0;
    font-family: 'Fredoka One', cursive;
    font-size: 30px;
    line-height: 1.2;
    color: #ffffff;
}

.wheel-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 620px;
    margin-top: 20px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 20%, rgba(124,92,255,0.20), transparent 34%),
        radial-gradient(circle at 20% 80%, rgba(76,201,240,0.18), transparent 30%),
        linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.08);
}

.wheel-ring {
    position: absolute;
    width: min(100%, 620px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 48%, transparent 72%);
    filter: blur(8px);
}

#wheelCanvas {
    position: relative;
    z-index: 2;
    width: min(100%, 580px);
    height: auto;
    max-height: 580px;
    filter: drop-shadow(0 26px 34px rgba(0,0,0,0.45)) drop-shadow(0 0 22px rgba(76, 201, 240, 0.18));
}

.wheel-arrow {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 80px;
    z-index: 4;
    background: linear-gradient(180deg, #fff4bf 0%, #ffcc00 45%, #f59e0b 100%);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.35), 0 0 22px rgba(255, 204, 0, 0.35);
}

.wheel-arrow::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    width: 22px;
    height: 22px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 6px rgba(255, 204, 0, 0.22), 0 0 18px rgba(255,255,255,0.4);
}

.card-challenge {
    min-height: 720px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid rgba(255,255,255,0.74);
    box-shadow: 0 24px 44px rgba(0,0,0,0.24), inset 0 2px 0 rgba(255,255,255,0.7), inset 0 -10px 18px rgba(148,163,184,0.18);
    position: relative;
}

.card-challenge::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(124,92,255,0.12), transparent 26%),
        radial-gradient(circle at bottom left, rgba(76,201,240,0.10), transparent 24%);
    pointer-events: none;
}

.card-header,
.question-box,
.challenge-actions,
.answers-grid {
    position: relative;
    z-index: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

#categoryLabel {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124,92,255,0.12) 0%, rgba(76,201,240,0.12) 100%);
    border: 1px solid rgba(124,92,255,0.18);
    font-family: 'Fredoka One', cursive;
    font-size: 16px;
    letter-spacing: 0.8px;
    color: #4338ca;
    text-transform: uppercase;
}

.question-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(15,23,42,0.06);
    color: #334155;
    font-weight: 900;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(180deg, #22d3ee 0%, #7c3aed 100%);
    box-shadow: 0 0 0 6px rgba(124,92,255,0.10);
}

.question-box {
    flex: 1;
    margin-bottom: 18px;
}

.question-box h2 {
    margin: 0;
    /* font-size: 31px; */
    line-height: 1.34;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.challenge-actions {
    display: grid;
    gap: 12px;
    margin: 4px 0 20px;
}

.btn-action,
.btn-secondary {
    appearance: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-action {
    border: none;
    min-height: 68px;
    padding: 18px 28px;
    border-radius: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
    /* box-shadow: 0 12px 0 #4c1d95, 0 18px 28px rgba(76, 29, 149, 0.28), inset 0 1px 0 rgba(255,255,255,0.3); */
}

.btn-action:hover {
    transform: translateY(-2px) scale(1.01);
    filter: brightness(1.03);
    /* box-shadow: 0 14px 0 #4c1d95, 0 24px 32px rgba(76, 29, 149, 0.34), inset 0 1px 0 rgba(255,255,255,0.3); */
}

.btn-action:active {
    transform: translateY(8px);
    box-shadow: 0 4px 0 #4c1d95, 0 10px 18px rgba(76, 29, 149, 0.25), inset 0 1px 0 rgba(255,255,255,0.22);
}

.btn-secondary {
    border: 1px solid rgba(124,92,255,0.22);
    min-height: 60px;
    padding: 16px 24px;
    border-radius: 18px;
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #4338ca;
    background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    box-shadow: 0 12px 24px rgba(15,23,42,0.10);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15,23,42,0.14);
}

.btn-large {
    width: auto;
    min-width: 220px;
}

.btn-secondary:disabled,
.btn-action:disabled {
    opacity: 0.72;
    cursor: default;
    filter: grayscale(0.08);
}

.answers-grid {
    display: grid;
    gap: 14px;
    margin-top: auto;
}

.answer-btn {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(148,163,184,0.35);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    padding: 18px 18px;
    border-radius: 18px;
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.answer-btn:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(76, 201, 240, 0.6);
    background: linear-gradient(180deg, #ffffff 0%, #eefaff 100%);
    box-shadow: 0 16px 28px rgba(15,23,42,0.12), 0 0 0 4px rgba(76,201,240,0.08);
}

.answer-btn:disabled {
    cursor: default;
}

.answer-badge {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
}

.answer-text {
    font-size: 17px;
    line-height: 1.36;
    font-weight: 900;
}

.answer-icon {
    font-size: 22px;
    color: #94a3b8;
    transition: transform 0.18s ease;
}

.answer-btn:hover .answer-icon {
    transform: translateX(4px);
}

.answer-btn.correct {
    color: #ffffff;
    border-color: rgba(255,255,255,0.2);
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 12px 24px rgba(34,197,94,0.28), inset 0 1px 0 rgba(255,255,255,0.22);
}

.answer-btn.correct .answer-badge {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
}

.answer-btn.correct .answer-icon,
.answer-btn.wrong .answer-icon {
    color: #ffffff;
}

.answer-btn.wrong {
    color: #ffffff;
    border-color: rgba(255,255,255,0.18);
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 12px 24px rgba(239,68,68,0.26), inset 0 1px 0 rgba(255,255,255,0.18);
}

.answer-btn.wrong .answer-badge {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
}

.enter-anim {
    animation: enterItem 0.35s ease both;
}

.enter-anim:nth-child(2) { animation-delay: 0.04s; }
.enter-anim:nth-child(3) { animation-delay: 0.08s; }
.enter-anim:nth-child(4) { animation-delay: 0.12s; }

@keyframes enterItem {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulseAnim 1.8s infinite;
}

@keyframes pulseAnim {
    0% {
        transform: scale(1);
        /* box-shadow: 0 12px 0 #4c1d95, 0 18px 28px rgba(76, 29, 149, 0.28), 0 0 0 0 rgba(124, 92, 255, 0.4); */
    }
    70% {
        transform: scale(1.02);
        /* box-shadow: 0 12px 0 #4c1d95, 0 18px 28px rgba(76, 29, 149, 0.28), 0 0 0 18px rgba(124, 92, 255, 0); */
    }
    100% {
        transform: scale(1);
        /* box-shadow: 0 12px 0 #4c1d95, 0 18px 28px rgba(76, 29, 149, 0.28), 0 0 0 0 rgba(124, 92, 255, 0); */
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at center, rgba(124,92,255,0.18) 0%, rgba(0,0,0,0.82) 65%);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: min(560px, 100%);
    padding: 42px 34px 34px;
    text-align: center;
    color: #ffffff;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(18,26,56,0.97) 0%, rgba(7,11,24,0.99) 100%);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.18s ease;
}

.modal-overlay.is-visible .modal-card {
    transform: translateY(0) scale(1);
}

.modal-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top center, rgba(255,204,0,0.16), transparent 24%),
        radial-gradient(circle at bottom left, rgba(76,201,240,0.12), transparent 24%),
        radial-gradient(circle at right center, rgba(124,92,255,0.14), transparent 24%);
    pointer-events: none;
}

.modal-card > * {
    position: relative;
    z-index: 1;
}

.modal-card-wide {
    width: fit-content;
    max-width: 90vw;
    height: auto;
    max-height: 98vh;
}

.modal-card-hint {
    width: min(560px, 100%);
}

.modal-icon,
.victory-icon {
    width: 92px;
    height: 92px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    border-radius: 28px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.28);
}

.modal-icon-book {
    background: radial-gradient(circle at 30% 30%, #dbeafe 0%, #60a5fa 42%, #2563eb 100%);
}

.modal-icon-hint {
    background: radial-gradient(circle at 30% 30%, #fff4bf 0%, #ffcc00 42%, #ff8a00 100%);
}

.victory-icon {
    background: radial-gradient(circle at 30% 30%, #fff4bf 0%, #ffcc00 42%, #ff8a00 100%);
}


.modal-card-feedback {
    width: min(560px, 100%);
}

.modal-icon-feedback-positive {
    background: radial-gradient(circle at 30% 30%, #dcfce7 0%, #4ade80 42%, #15803d 100%);
}

.modal-icon-feedback-negative {
    background: radial-gradient(circle at 30% 30%, #fee2e2 0%, #f87171 42%, #b91c1c 100%);
}

.modal-card h2 {
    margin: 0 0 12px;
    font-family: 'Fredoka One', cursive;
    font-size: 34px;
    line-height: 1.16;
}

.modal-card p {
    margin: 0 0 20px;
    font-size: 18px;
    line-height: 1.55;
    color: var(--text-soft);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
}

.modal-action {
    width: auto;
    min-width: 180px;
    margin: 8px auto 0;
}

.instructions-list {
    display: grid;
    gap: 12px;
    margin: 24px 0 10px;
    text-align: left;
}

.instruction-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.instruction-item span {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
}

.instruction-item p {
    margin: 0;
    color: #f8fafc;
    font-size: 17px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.skill-pill,
.seal-box,
.final-score-box {
    border-radius: 22px;
}

.skill-pill {
    padding: 14px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-weight: 900;
    color: #f8fafc;
}

.seal-box,
.final-score-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
    padding: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.seal-box span,
.final-score-box span {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.seal-box strong {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: #ffffff;
}

.final-score-box strong {
    font-family: 'Fredoka One', cursive;
    font-size: 44px;
    line-height: 1;
    color: #ffcc00;
    text-shadow: 0 0 18px rgba(255,204,0,0.22);
}

.hidden {
    display: none !important;
}

@media (max-width: 1240px) {
    .intro-card {
        grid-template-columns: 1fr;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .intro-copy {
        order: 2;
    }

    .intro-visual {
        min-height: auto;
        max-height: 420px;
        order: 1;
    }

    .intro-art {
        width: min(100%, 620px);
        max-width: 100%;
    }

    .wheel-panel,
    .card-challenge {
        min-height: auto;
    }
}

@media (max-width: 820px) {
    body {
        padding: 14px;
        align-items: flex-start;
    }

    .intro-card,
    .game-container {
        border-radius: 28px;
        padding: 18px;
        min-height: auto;
    }

    .intro-copy h1 {
        font-size: clamp(34px, 9vw, 52px);
    }

    .intro-copy p {
        font-size: 18px;
    }

    .game-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        justify-content: stretch;
    }

    .progress-chip,
    .timer-badge,
    .score-badge {
        flex: 1;
    }

    .wheel-panel {
        padding: 18px;
    }

    .wheel-box {
        min-height: 440px;
    }

    .wheel-arrow {
        top: 10px;
    }

    #wheelCanvas {
        width: min(100%, 440px);
    }

    .card-challenge {
        padding: 22px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .question-box h2 {
        font-size: 24px;
    }

    .btn-action {
        font-size: 19px;
        min-height: 62px;
    }

    .answer-btn {
        grid-template-columns: 48px 1fr auto;
        padding: 16px;
    }

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

@media (max-width: 560px) {
    .intro-actions {
        flex-direction: column;
    }

    .btn-large,
    .modal-action {
        width: 100%;
        min-width: 0;
    }

    .avatar {
        width: 62px;
        height: 62px;
        flex-basis: 62px;
        font-size: 30px;
        border-radius: 20px;
    }

    .player-name {
        font-size: 15px;
    }

    .score-badge {
        font-size: 24px;
    }

    #categoryLabel,
    .question-status {
        font-size: 13px;
        min-height: 42px;
        padding: 8px 12px;
    }

    .question-box h2 {
        font-size: 21px;
    }

    #wheelCanvas {
        width: min(100%, 340px);
    }

    .wheel-arrow {
        width: 44px;
        height: 62px;
    }

    .answer-btn {
        grid-template-columns: 42px 1fr auto;
        gap: 10px;
    }

    .answer-badge {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .modal-card {
        padding: 34px 20px 24px;
        border-radius: 24px;
    }

    .modal-card h2 {
        font-size: 28px;
    }

    .seal-box strong,
    .final-score-box strong {
        font-size: 34px;
    }
}

#hintBtn {
    background: linear-gradient(135deg,#8b5cf6,#6d28d9);
    color: white;
}
.wordsearch-layout {
    grid-template-columns: minmax(620px, 1.08fr) minmax(360px, 0.92fr);
}

.board-panel-shell {
    min-height: 720px;
}

.board-panel-top {
    margin-bottom: 14px;
}

.board-subtitle {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.5;
}

.board-box {
    min-height: 620px;
    padding: 28px;
    position: relative;
}

.board-ring {
    position: absolute;
    inset: 38px;
    border-radius: 34px;
    border: 1px solid rgba(255,255,255,0.08);
    background: radial-gradient(circle at 50% 10%, rgba(124,92,255,0.12), transparent 34%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.18);
}

.word-board {
    position: relative;
    z-index: 2;
    width: min(100%, 640px);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
}

.board-cell {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 22px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    font-family: 'Fredoka One', cursive;
    font-size: 34px;
    line-height: 1;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(18, 32, 61, 0.92) 0%, rgba(11, 22, 43, 0.96) 100%);
    box-shadow: 0 10px 22px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.board-cell:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 14px 26px rgba(0,0,0,0.26), 0 0 0 4px rgba(76,201,240,0.08);
}

.board-cell.is-selected {
    background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
    box-shadow: 0 12px 24px rgba(37,99,235,0.30), inset 0 1px 0 rgba(255,255,255,0.22);
}

.board-cell.is-found {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 12px 24px rgba(21,128,61,0.28), inset 0 1px 0 rgba(255,255,255,0.22);
}

.board-cell.is-invalid {
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
}

.board-cell.is-hint {
    animation: hintPulse 0.9s ease;
}

@keyframes hintPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,204,0,0.50); }
    45% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(255,204,0,0); }
    100% { transform: scale(1); }
}

.board-help-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.board-help-chip {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-weight: 800;
    line-height: 1.35;
}

.word-card {
    justify-content: flex-start;
}

.compact-question-box {
    flex: 0 0 auto;
    margin-bottom: 16px;
}

.compact-question-box h2 {
    font-size: 28px;
}

.word-panel-section {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-mini-title {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: #0f172a;
}

.word-pill-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.word-pill {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    border: 1px solid rgba(148,163,184,0.28);
    box-shadow: 0 10px 18px rgba(15,23,42,0.08);
}

.word-pill span {
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    color: #312e81;
}

.word-pill strong {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.word-pill.is-found {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    border-color: rgba(255,255,255,0.18);
}

.word-pill.is-found span,
.word-pill.is-found strong {
    color: #ffffff;
}

.challenge-actions-inline {
    /* grid-template-columns: 1fr 1fr; */
    margin-top: 0;
    margin-bottom: 16px;
}

.info-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: auto;
}

.info-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(15,23,42,0.05);
    border: 1px solid rgba(148,163,184,0.18);
    display: grid;
    gap: 8px;
}

.info-card span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.info-card strong {
    font-size: 19px;
    line-height: 1.25;
    color: #0f172a;
}

@media (max-width: 1220px) {
    .wordsearch-layout {
        grid-template-columns: 1fr;
    }

    .board-panel-shell,
    .word-card {
        min-height: auto;
    }
}

@media (max-width: 860px) {
    .word-board {
        gap: 8px;
    }

    .board-cell {
        height: 58px;
        border-radius: 18px;
        font-size: 28px;
    }

    .word-pill-list,
    .challenge-actions-inline,
    .info-grid,
    .board-help-row {
        grid-template-columns: 1fr;
    }

    .compact-question-box h2 {
        font-size: 24px;
    }
}

@media (max-width: 560px) {
    .board-box {
        padding: 18px;
        min-height: auto;
    }

    .board-ring {
        inset: 20px;
        border-radius: 24px;
    }

    .word-board {
        gap: 6px;
    }

    .board-cell {
        height: 44px;
        border-radius: 14px;
        font-size: 22px;
    }
}

button#resetSelectionBtn {
    display: none;
}