/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --green: #00B894;
    --green-light: #55EFC4;
    --pink: #FD79A8;
    --pink-light: #FDCB6E;
    --orange: #E17055;
    --yellow: #FFEAA7;
    --blue: #74B9FF;
    --red: #FF7675;
    --bg-start: #6C5CE7;
    --bg-end: #00CEC9;
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius: 20px;
}

body {
    font-family: "Baloo 2", "Segoe UI", sans-serif;
    background: linear-gradient(160deg, var(--bg-start), #a29bfe, var(--bg-end));
    background-attachment: fixed;
    min-height: 100vh;
    color: #2d3436;
    overflow-x: hidden;
    position: relative;
}

/* === FLOATING BACKGROUND SHAPES === */
.bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.float-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    animation: floatAround 20s ease-in-out infinite;
}

.s1 { width: 120px; height: 120px; background: #FFEAA7; top: 10%; left: -30px; animation-delay: 0s; }
.s2 { width: 80px; height: 80px; background: #FF7675; top: 30%; right: -20px; animation-delay: -4s; animation-duration: 16s; }
.s3 { width: 150px; height: 150px; background: #55EFC4; bottom: 20%; left: 10%; animation-delay: -8s; animation-duration: 22s; }
.s4 { width: 60px; height: 60px; background: #FD79A8; top: 60%; right: 15%; animation-delay: -2s; animation-duration: 18s; }
.s5 { width: 100px; height: 100px; background: #74B9FF; bottom: 5%; right: -10px; animation-delay: -6s; }
.s6 { width: 90px; height: 90px; background: #FDCB6E; top: 5%; right: 30%; animation-delay: -10s; animation-duration: 25s; }

@keyframes floatAround {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(30px, -20px) rotate(90deg) scale(1.1); }
    50% { transform: translate(-10px, 30px) rotate(180deg) scale(0.95); }
    75% { transform: translate(20px, 10px) rotate(270deg) scale(1.05); }
}

/* === CONFETTI === */
#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

/* === LAYOUT === */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

.container-wide {
    max-width: 700px;
}

/* Wider container for question list on larger screens */
.container-list {
    max-width: 900px;
}

/* === PAGES === */
.page {
    display: none;
    animation: pageIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.page.active {
    display: block;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========================================
   TRANG CHU - HERO
   ======================================== */
.hero {
    text-align: center;
    padding: 32px 16px 24px;
    color: white;
}

/* Mascot QR character */
.hero-mascot {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.mascot-body {
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: mascotBounce 2s ease-in-out infinite;
}

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

.mascot-eye {
    width: 12px;
    height: 14px;
    background: #2d3436;
    border-radius: 50%;
    position: absolute;
    top: 28px;
    animation: blink 3s ease-in-out infinite;
}

.mascot-eye.left { left: 24px; }
.mascot-eye.right { right: 24px; }

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.mascot-mouth {
    width: 20px;
    height: 10px;
    border-bottom: 3px solid #2d3436;
    border-radius: 0 0 50% 50%;
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
}

.mascot-qr {
    position: absolute;
    bottom: -6px;
    right: -16px;
    display: grid;
    grid-template-columns: repeat(3, 8px);
    gap: 2px;
    background: white;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: rotate(10deg);
}

.qr-dot {
    width: 8px;
    height: 8px;
    background: #2d3436;
    border-radius: 2px;
}

.qr-dot.empty {
    background: transparent;
}

.hero h1 {
    font-size: 26px;
    font-weight: 800;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 500;
}

/* Steps indicator */
.hero-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 13px;
    font-weight: 600;
}

.step {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-num {
    width: 22px;
    height: 22px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.step-arrow {
    opacity: 0.5;
    font-size: 16px;
}

/* ========================================
   LEVEL SELECT
   ======================================== */
.level-select {
    background: white;
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-top: 16px;
    box-shadow: var(--card-shadow);
}

.level-select h2 {
    text-align: center;
    margin-bottom: 16px;
    font-size: 19px;
    color: #636e72;
    font-weight: 700;
}

.level-buttons {
    display: flex;
    gap: 12px;
}

/* === BUTTONS === */
.btn {
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-easy, .btn-medium, .btn-hard {
    flex: 1;
    padding: 18px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.btn-easy {
    background: linear-gradient(145deg, #00B894, #55EFC4);
    color: #00634a;
}

.btn-medium {
    background: linear-gradient(145deg, #E17055, #FDCB6E);
    color: #7c3a1c;
}

.btn-hard {
    background: linear-gradient(145deg, #e84393, #fd79a8);
    color: #5e1a3a;
}

.btn-stars {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.btn-label {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-desc {
    font-size: 13px;
    opacity: 0.75;
    font-weight: 600;
}

.btn-go {
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.35);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: white;
}

.page-header h2 {
    font-size: 17px;
    font-weight: 700;
    flex: 1;
}

.btn-back {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.progress-pill {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ========================================
   DANH SACH CAU HOI - GRID LAYOUT
   ======================================== */
.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.question-item {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    animation: cardFadeIn 0.3s ease both;
}

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

.question-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    border-color: var(--primary-light);
}

.question-item:active {
    transform: scale(0.98);
}

.question-item.completed {
    background: linear-gradient(135deg, #f0fff4, #e6fffa);
    border: 2px solid var(--green);
}

.item-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(108, 92, 231, 0.3);
}

.question-item.completed .item-number {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    font-size: 20px;
    box-shadow: 0 3px 8px rgba(0, 184, 148, 0.3);
}

.item-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #2d3436;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-arrow {
    color: var(--primary-light);
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.question-item:hover .item-arrow {
    transform: translateX(4px);
}

/* ========================================
   CHI TIET CAU HOI
   ======================================== */
.question-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--card-shadow);
}

.question-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.question-number {
    font-size: 13px;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #b2bec3;
}

.question-text {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 22px;
    color: #2d3436;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 3px solid #eef1f5;
    border-radius: 14px;
    background: #fafbfc;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}

.option-btn:hover {
    border-color: var(--primary-light);
    background: #f0edff;
    transform: scale(1.02);
}

.option-btn.selected {
    border-color: var(--primary);
    background: #ede8ff;
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.2);
}

.option-btn.correct {
    border-color: var(--green);
    background: linear-gradient(135deg, #e6fffa, #f0fff4);
    animation: correctPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(0, 184, 148, 0.25);
}

.option-btn.wrong {
    border-color: var(--red);
    background: #fff5f5;
    animation: wrongShake 0.5s ease;
}

@keyframes correctPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.option-label {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #eef1f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.2s;
}

.option-btn.selected .option-label {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

.option-btn.correct .option-label {
    background: var(--green);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.4);
}

.option-btn.wrong .option-label {
    background: var(--red);
    color: white;
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

/* === NUT TRA LOI === */
.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #a29bfe);
    color: white;
    border-radius: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}

.btn-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* === KET QUA === */
.result-box {
    text-align: center;
    padding: 28px 20px;
    margin-top: 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fafbfc, #f0f4ff);
    border: 2px solid #e2e8f0;
}

.result-box.hidden {
    display: none;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 8px;
    animation: resultBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resultBounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.result-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #636e72;
}

.btn-complete {
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: #00634a;
    border-radius: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(0, 184, 148, 0.35);
}

/* ========================================
   VÒNG QUAY THỬ THÁCH
   ======================================== */
.spin-section {
    background: white;
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-top: 16px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.spin-header {
    margin-bottom: 20px;
}

.spin-icon {
    font-size: 48px;
    margin-bottom: 4px;
    animation: mascotBounce 2s ease-in-out infinite;
}

.spin-header h2 {
    font-size: 19px;
    color: #2d3436;
    font-weight: 800;
    margin-bottom: 4px;
}

.spin-header p {
    font-size: 14px;
    color: #636e72;
    font-weight: 600;
}

.spin-level-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.spin-level-label {
    font-size: 14px;
    font-weight: 700;
    color: #636e72;
}

.spin-grade-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.spin-grade-btn {
    padding: 8px 16px;
    border: 2px solid #eef1f5;
    border-radius: 20px;
    background: #fafbfc;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #636e72;
    cursor: pointer;
    transition: all 0.2s;
}

.spin-grade-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
}

.spin-grade-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.spin-grade-info {
    margin-top: 8px;
    font-size: 12px;
    color: #b2bec3;
    font-weight: 600;
}

/* Reels */
.spin-reels {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.reel {
    width: 56px;
    height: 68px;
    background: linear-gradient(145deg, #f0f4ff, #e8ecf4);
    border-radius: 14px;
    border: 3px solid #dfe6e9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.reel-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.reel.spinning .reel-num {
    animation: reelSpin 0.1s linear infinite;
}

.reel.landed {
    border-color: var(--primary);
    background: linear-gradient(145deg, #ede8ff, #f0edff);
    animation: reelLand 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reel.landed.reel-easy {
    border-color: var(--green);
    background: linear-gradient(145deg, #e6fffa, #f0fff4);
}

.reel.landed.reel-medium {
    border-color: var(--orange);
    background: linear-gradient(145deg, #fff3e0, #fff8e1);
}

.reel.landed.reel-hard {
    border-color: var(--pink);
    background: linear-gradient(145deg, #fce4ec, #ffeef5);
}

.reel-level-tag {
    position: absolute;
    bottom: 2px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

@keyframes reelSpin {
    0% { transform: translateY(-100%); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

@keyframes reelLand {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Spin button */
.btn-spin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 36px;
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: white;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-spin.spinning {
    animation: spinBtnPulse 0.8s ease-in-out infinite;
}

@keyframes spinBtnPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35); }
    50% { box-shadow: 0 4px 30px rgba(108, 92, 231, 0.6); }
}

.btn-start-challenge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 14px 36px;
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: #00634a;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(0, 184, 148, 0.35);
    animation: challengeBtnPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes challengeBtnPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.hidden {
    display: none !important;
}

/* ========================================
   TRANG THỬ THÁCH
   ======================================== */
.challenge-tracker {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.tracker-dot {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    transition: all 0.3s;
    cursor: pointer;
}

.tracker-dot.pending {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tracker-dot.current {
    background: white;
    color: var(--primary);
    border: 3px solid var(--primary);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.3);
    transform: scale(1.1);
}

.tracker-dot.correct {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: white;
    border: 2px solid var(--green);
    box-shadow: 0 3px 10px rgba(0, 184, 148, 0.3);
}

.tracker-dot.wrong {
    background: linear-gradient(135deg, var(--red), #fab1a0);
    color: white;
    border: 2px solid var(--red);
    box-shadow: 0 3px 10px rgba(255, 118, 117, 0.3);
}

.challenge-question-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--card-shadow);
}

.btn-next-challenge {
    padding: 14px 32px;
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}

/* ========================================
   KẾT QUẢ THỬ THÁCH
   ======================================== */
.challenge-result-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 24px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.challenge-result-icon {
    font-size: 80px;
    margin-bottom: 12px;
    animation: resultBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.challenge-result-card h2 {
    font-size: 24px;
    font-weight: 800;
    color: #2d3436;
    margin-bottom: 8px;
}

.challenge-result-card p {
    font-size: 16px;
    color: #636e72;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.5;
}

.challenge-score {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.score-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: scoreDotPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.score-dot.correct {
    background: linear-gradient(135deg, #e6fffa, #f0fff4);
    border: 2px solid var(--green);
}

.score-dot.wrong {
    background: #fff5f5;
    border: 2px solid var(--red);
}

@keyframes scoreDotPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.challenge-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-spin-again {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    color: #2d3436;
    border-radius: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   QR PAGE
   ======================================== */
.qr-instruction {
    color: white;
    opacity: 0.9;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.level-section {
    margin-bottom: 30px;
}

.level-section h3 {
    color: white;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.qr-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.qr-image {
    margin-bottom: 8px;
}

.qr-image svg {
    width: 100%;
    max-width: 160px;
    height: auto;
}

.qr-label {
    font-weight: 800;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 4px;
}

.qr-question {
    font-size: 12px;
    color: #636e72;
    line-height: 1.3;
    margin-bottom: 4px;
    font-weight: 600;
}

.qr-url {
    font-size: 9px;
    color: #b2bec3;
    word-break: break-all;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    text-align: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

footer a:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    body {
        background: white;
    }

    .bg-decor, #confetti-canvas, footer, .btn-back, .qr-instruction {
        display: none !important;
    }

    .page { display: none !important; }
    #page-qr { display: block !important; }

    .page-header h2 {
        color: #333;
    }

    .qr-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .qr-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .level-section h3 {
        color: #333;
    }
}

/* ========================================
   RESPONSIVE - DESKTOP / LAPTOP
   ======================================== */
@media (min-width: 768px) {
    /* Wider container for list page */
    #page-list .container {
        max-width: 900px;
    }

    /* Home page can be a bit wider too */
    #page-home .container {
        max-width: 560px;
    }

    .question-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 17px;
    }

    .level-select {
        padding: 28px 24px;
    }

    .page-header h2 {
        font-size: 20px;
    }
}

@media (min-width: 1024px) {
    #page-list .container {
        max-width: 1100px;
    }

    .question-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   RESPONSIVE - MOBILE SMALL
   ======================================== */
@media (max-width: 400px) {
    .hero h1 {
        font-size: 22px;
    }

    .question-text {
        font-size: 18px;
    }

    .level-buttons {
        flex-direction: column;
    }

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

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

    .hero-steps {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .question-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .question-grid {
        grid-template-columns: 1fr;
    }
}
