/* --- Offline Font Setup --- */
@font-face {
    font-family: 'Fredoka';
    src: url('assets/fonts/Fredoka-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Fredoka';
    src: url('assets/fonts/Fredoka-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Outfit';
    src: url('assets/fonts/Outfit-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Outfit';
    src: url('assets/fonts/Outfit-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'ZCOOL KuaiLe';
    src: url('assets/fonts/ZCOOLKuaiLe-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Ziyuan';
    src: url('assets/fonts/ResourceHanRoundedCN-Medium.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

:root {
    /* Kinetic Playground Palette */
    --surface: #fff6dc;
    --on-surface: #372e00;
    --surface-container: #fbe897;
    --surface-container-low: #fff1b9;
    --surface-container-lowest: #ffffff;
    --primary: #725800;
    --on-primary: #fff1d8;
    --primary-container: #fdc825;
    --on-primary-container: #584300;
    --secondary-container: #9fd9ff;
    --on-secondary-container: #004d6c;
    --tertiary: #a83206;
    --on-tertiary: #ffefeb;
    --tertiary-container: #ff9473;
    --on-tertiary-container: #5f1600;
    --art-container: #ffefeb;
    --nature-container: #e7f3e8;
    --sports-container: #f1dd82;
    --outline-variant: rgba(188, 173, 109, 0.15);
    --primary-dim: #644c00;
    --secondary-dim: #005578;
    --tertiary-dim: #952800;
    --outline-dim: #83773c;
    --quaternary-container: #d4bbff;
    --quaternary-dim: #5c4a8a;
    --quinary-container: #b8f2d1;
    --quinary-dim: #2d6b4a;

    /* Functional Colors */
    --accent-color: var(--primary-container);
    --success-color: #2ecc71;
    --error-color: #b02500;

    /* Typography (Updated for local fonts) */
    --font-main: 'Fredoka', 'Quicksand', 'Ziyuan', 'Comic Sans MS', sans-serif;
    --font-display: 'ZCOOL KuaiLe', cursive;

    /* Effects */
    --glass-blur: blur(24px);
    --shadow-ambient: 0 8px 32px rgba(55, 46, 0, 0.06);
    --shadow-lifted: 0 12px 24px rgba(114, 88, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--surface);
    color: var(--on-surface);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    height: 100%;
    position: relative;
    max-width: 1080px;
    /* Reference for vertical layout */
    margin: 0 auto;
    overflow: hidden;
}

/* Effects Layer */
.effects-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

#fireworks-canvas {
    width: 100%;
    height: 100%;
}

.feedback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 12rem;
    opacity: 0;
    transition: none;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.feedback-icon.show {
    animation: gentlePop 2.2s ease-out forwards;
}

@keyframes gentlePop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    10% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    90% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -60%) scale(0.8);
        opacity: 0;
    }
}

.soft-fail {
    animation: gentleTilt 0.4s ease-in-out;
}

@keyframes gentleTilt {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-2deg);
        background-color: rgba(100, 149, 237, 0.1);
    }

    75% {
        transform: rotate(2deg);
    }
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(20px);
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url('assets/images/background.png') center center / cover no-repeat;
    opacity: 0.5;
    animation: pulseBg 20s infinite alternate;
}

@keyframes pulseBg {
    from {
        transform: scale(1);
        opacity: 0.2;
    }

    to {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

/* Bubbles Background */
.bubbles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.bubble-container {
    position: absolute;
    bottom: -150px;
    animation: floatUp linear infinite, sway ease-in-out infinite;
    z-index: -1;
}

.bubble {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse ease-in-out infinite;
    box-shadow: inset -5px -5px 15px rgba(255, 255, 255, 0.3),
        inset 5px 5px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(1px);
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(-140vh);
        opacity: 0;
    }
}

@keyframes sway {

    0%,
    100% {
        margin-left: -25px;
    }

    50% {
        margin-left: 25px;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Settings Bar */
.settings-bar {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    display: flex;
    gap: 1.5rem;
    z-index: 100;
}

.setting-item {
    width: 64px;
    height: 64px;
    background: var(--surface-container-low);
    box-shadow: var(--shadow-ambient);
    border-radius: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#music-toggle {
    background-color: var(--tertiary-container);
}

#sound-toggle {
    background-color: var(--secondary-container);
}

#timer-toggle {
    background-color: var(--surface-container);
}

.setting-item:hover {
    transform: scale(1.1) rotate(8deg);
}

#music-toggle:hover {
    transform: scale(1.1) rotate(-8deg);
}

#timer-toggle:hover {
    transform: scale(1.1) rotate(5deg);
}

.setting-item .icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.setting-item.muted .icon {
    filter: grayscale(1);
    opacity: 0.4;
}

.setting-item.muted::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background: var(--error-color);
    transform: rotate(45deg);
}

.setting-item:active {
    transform: scale(0.9);
}

/* Home Screen */
.hero-card {
    background: var(--surface-container);
    border-radius: 3.5rem;
    padding: 4rem 3rem;
    margin: 2rem auto;
    width: 95%;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-ambient);
}

.welcome-tag {
    background: var(--tertiary-container);
    color: var(--on-tertiary-container);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.5rem 1.5rem;
    border-radius: 99px;
    margin-bottom: 2rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    line-height: 1.1;
    color: var(--on-surface);
    margin-bottom: 1.5rem;
    font-weight: 400;
    letter-spacing: 6px;
}

.hero-title span {
    color: var(--primary);
    font-style: normal;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--on-surface);
    opacity: 0.8;
    margin-bottom: 2.5rem;
    max-width: 280px;
    line-height: 1.4;
}

.mascot-selector {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.selector-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    color: var(--on-surface);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    animation: breathing 3s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.selector-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    animation-play-state: paused;
}

.selector-btn:active {
    transform: scale(0.9);
}

@keyframes breathing {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.3);
    }
}

.mascot-container {
    position: relative;
    width: 250px;
    height: 250px;
}

@keyframes mascotPop {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.mascot-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 2rem;
    animation: mascotSway 3s ease-in-out infinite;
}

@keyframes mascotSway {
    0% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
    100% {
        transform: rotate(-3deg);
    }
}



.game-title {
    font-family: var(--font-display);
    font-size: 5.5rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 6px;
    line-height: 1.2;
    text-shadow: 
        0.05em 0.05em 0px rgba(253, 200, 37, 0.3),
        0.1em 0.1em 0px rgba(0, 0, 0, 0.02),
        0.15em 0.15em 20px rgba(114, 88, 0, 0.15);
}

.main-btn {
    background: var(--primary-container);
    color: var(--on-primary-container);
    border: none;
    padding: 1.2rem 3.5rem;
    font-size: clamp(1.5rem, 4vh, 2.2rem);
    font-weight: 800;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: var(--shadow-lifted);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.main-btn::after {
    content: "▶";
    width: 2.2rem;
    height: 2.2rem;
    background: var(--on-primary-container);
    color: var(--primary-container);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding-left: 2px;
    /* Offset to center triangle visually */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.main-btn:active {
    transform: scale(0.95);
}

@keyframes gentleWobble {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(-1deg) scale(1.02);
    }

    50% {
        transform: rotate(1deg) scale(1);
    }

    75% {
        transform: rotate(-1deg) scale(1.02);
    }
}

.pulse {
    animation: pulseBtn 2s infinite, gentleWobble 3s infinite ease-in-out;
}

@keyframes pulseBtn {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(255, 215, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Category Selection */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-family: var(--font-display);
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
}

.category-card {
    background: var(--surface-container-low);
    border: none;
    border-radius: 2rem;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border-bottom: 8px solid rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

.category-card[data-category="category1"] {
    background-color: var(--primary-container);
    border-bottom-color: var(--primary-dim);
}

.category-card[data-category="category2"] {
    background-color: var(--secondary-container);
    border-bottom-color: var(--secondary-dim);
}

.category-card[data-category="category3"] {
    background-color: var(--tertiary-container);
    border-bottom-color: var(--tertiary-dim);
}

.category-card[data-category="category4"] {
    background-color: #f6e38d;
    border-bottom-color: var(--outline-dim);
}

.category-card[data-category="category5"] {
    background-color: var(--quaternary-container);
    border-bottom-color: var(--quaternary-dim);
}

.category-card[data-category="category6"] {
    background-color: var(--quinary-container);
    border-bottom-color: var(--quinary-dim);
}

.category-card:active {
    transform: translateY(6px);
    border-bottom-width: 2px;
    margin-bottom: 14px;
}

.category-card .icon {
    margin-bottom: 1.5rem;
    width: 240px;
    height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: contain;
    padding: 15px;
    background-color: transparent;
    box-shadow: none;
    border: none;
}

.category-card:hover .icon {
    transform: rotate(10deg) scale(1.1);
}

.category-card span {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--on-surface);
    letter-spacing: -0.5px;
    /* -webkit-text-stroke: 10px white; */
    /* paint-order: stroke fill; */
}

.back-btn {
    margin-top: 3rem;
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 99px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-ambient);
}

.back-btn:hover {
    background: #79cdff;
    transform: translateY(-2px);
}

.back-btn:active {
    transform: scale(0.95);
}

/* Quiz Screen */
.quiz-category-label {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--primary);
    letter-spacing: 2px;
    opacity: 0.85;
    text-shadow: 0 1px 3px rgba(114, 88, 0, 0.1);
}

.quiz-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    padding-top: 5rem;
}

.progress-container {
    width: 100%;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.progress-track {
    position: absolute;
    width: 100%;
    height: 12px;
    background: var(--surface-container);
    border-radius: 99px;
}

.progress-bar {
    width: 0%;
    height: 12px;
    background: var(--primary-container);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(253, 200, 37, 0.3);
}

.train-icon {
    position: absolute;
    right: -25px;
    top: -35px;
    font-size: 2.5rem;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.2));
    animation: trainChug 0.5s infinite alternate ease-in-out;
}

@keyframes trainChug {
    from {
        transform: translateY(0) rotate(-2deg);
    }

    to {
        transform: translateY(-5px) rotate(2deg);
    }
}

.progress-text {
    position: absolute;
    top: -60px;
    left: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    font-size: 0;
}

.progress-text::before {
    content: "问题：";
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--on-surface);
    opacity: 0.6;
}

#current-question-num {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.progress-text::after {
    content: "/ 10";
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--on-surface);
    opacity: 0.3;
}

.score-display {
    font-size: 0;
    font-weight: 800;
    color: var(--primary);
    background: var(--surface-container);
    padding: 0.4rem 1.2rem;
    border-radius: 99px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    top: 1.25rem;
    right: 0;
}

.score-display::before {
    content: "分数";
    font-size: 1.2rem;
    filter: none;
}

#current-score {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-display);
}

.question-container {
    background: var(--surface-container-lowest);
    background-image: radial-gradient(var(--surface-container) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    color: var(--on-surface);
    padding: 3.5rem 2.5rem;
    border-radius: 2.5rem;
    width: 100%;
    min-height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: visible;
    box-shadow: 
        0 10px 0 var(--surface-container),
        0 20px 40px rgba(55, 46, 0, 0.1);
}

/* Left Accent Bar */
.question-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    background: var(--primary-container);
    border-radius: 0 4px 4px 0;
}

/* Mascot Decoration at Bottom-Right */
.question-mascot {
    position: absolute;
    bottom: -35px;
    right: -25px;
    width: 140px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
    z-index: 20;
    pointer-events: none;
    transform: rotate(5deg);
}

/* Red Circular Timer Badge */
.question-timer-badge {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    width: 90px;
    height: 90px;
    background: #b02500;
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(176, 37, 0, 0.3);
    z-index: 10;
    border: 6px solid white;
    line-height: 1;
}

.timer-label {
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: -2px;
}

#question-timer-value {
    font-size: 1.8rem;
    font-weight: 900;
    font-family: var(--font-display);
}

#question-text {
    font-size: clamp(1.6rem, 4.5vh, 2.4rem);
    line-height: 1.5;
    text-align: left;
    font-weight: 600;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    width: 100%;
}

.option-btn {
    background: var(--surface-container-low);
    border: none;
    color: var(--on-surface);
    padding: 0.6rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* border-bottom: 8px solid rgba(0, 0, 0, 0.2); */
    position: relative;
    /* margin-bottom: 8px; */
    width: 100%;
}

.option-btn.opt-a { background-color: var(--primary-container); /* border-bottom-color: var(--primary-dim); */ color: var(--on-primary-container); }
.option-btn.opt-b { background-color: var(--secondary-container); /* border-bottom-color: var(--secondary-dim); */ color: var(--on-secondary-container); }
.option-btn.opt-c { background-color: var(--tertiary-container); /* border-bottom-color: var(--tertiary-dim); */ color: var(--on-tertiary-container); }
.option-btn.opt-d { background-color: #f6e38d; /* border-bottom-color: var(--outline-dim); */ color: var(--on-surface); }

.option-btn:active, .option-btn.selected {
    /* transform: translateY(6px); */
    /* border-bottom-width: 2px; */
    /* margin-bottom: 14px; */
}

.label-circle {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--surface-container-lowest);
    color: var(--on-surface);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.6rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.option-text {
    margin-left: 1.5rem;
    flex-grow: 1;
    text-align: left;
}

.option-btn:active {
    transform: scale(0.97);
}

.option-btn.correct {
    background-color: #2ecc71 !important;
    /* border-bottom-color: #27ae60 !important; */
    color: white !important;
    /* transform: translateY(6px); */
    /* border-bottom-width: 2px; */
    /* margin-bottom: 14px; */
    animation: correctFlash 0.5s;
}

.option-btn.correct .label-circle {
    color: #27ae60;
}

.option-btn.correct::after {
    content: "✓";
    position: absolute;
    top: -15px;
    right: -10px;
    background: #27ae60;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
    border: 3px solid white;
}

.option-btn.wrong {
    background-color: #e74c3c !important;
    /* border-bottom-color: #c0392b !important; */
    color: white !important;
    /* transform: translateY(6px); */
    /* border-bottom-width: 2px; */
    /* margin-bottom: 14px; */
    animation: wrongShake 0.5s;
}

.option-btn.wrong .label-circle {
    color: #c0392b;
}

.option-btn.wrong::after {
    content: "✕";
    position: absolute;
    top: -15px;
    right: -10px;
    background: #c0392b;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
    border: 3px solid white;
}

.quit-btn {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 99px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    pointer-events: auto !important;
    box-shadow: var(--shadow-ambient);
}

/* Tips Section */
.tips-container {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto 1.5rem;
    padding: 1.5rem 2rem;
    background: var(--tertiary-container);
    border-radius: 1.5rem;
    min-height: 80px; /* 预留空间高度 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    visibility: hidden; /* 隐藏但保留空间 */
    opacity: 0;
    transition: opacity 0.3s ease-out;
    box-shadow: 0 4px 15px rgba(255, 148, 115, 0.2);
}

.tips-container.show {
    visibility: visible;
    opacity: 1;
}

.tips-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--on-tertiary-container);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#tips-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--on-tertiary-container);
    font-weight: 600;
    margin: 0;
}

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

.quit-btn:hover {
    background: #79cdff;
    transform: translateX(-50%) translateY(-2px);
}

.quit-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.quit-btn:active {
    transform: translateX(-50%) scale(0.95);
    background: var(--surface-container);
}

@keyframes correctFlash {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Award Screen */
.award-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.award-title {
    font-family: var(--font-display);
    font-size: 5rem;
    color: var(--on-primary-container);
    margin-bottom: 2rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.trophy-animation {
    font-size: 15rem;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.6));
    animation: trophyReveal 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

@keyframes trophyReveal {
    0% {
        transform: translateY(-200px) scale(0) rotate(-45deg);
        opacity: 0;
    }

    30% {
        transform: translateY(0) scale(1.2) rotate(10deg);
        opacity: 1;
    }

    50% {
        transform: scale(1) rotate(-10deg);
    }

    70% {
        transform: scale(1.1) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.award-subtitle {
    font-size: 2.2rem;
    margin-top: 2rem;
    font-weight: 800;
    color: var(--on-surface);
}



.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--on-surface);
}

.result-stats div {
    background: var(--surface-container-low);
    padding: 0.6rem 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-ambient);
}

/* Result Screen */
.result-card {
    background: var(--surface-container-lowest);
    padding: 4rem 3rem;
    border-radius: 3.5rem;
    width: 95%;
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-ambient);
}

/* Photo Bubble Box */
.photo-bubble {
    background: var(--primary-container);
    color: var(--on-primary-container);
    padding: 1rem 2rem;
    border-radius: 2rem;
    font-size: 1.95rem; 
    font-weight: 700;
    position: fixed;
    top: 5rem;
    left: 3rem;
    box-shadow: 0 4px 12px rgba(253, 200, 37, 0.3);
    animation: seesaw 3s ease-in-out infinite;
    transform-origin: center bottom;
    z-index: 200;
}

.photo-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--primary-container);
}

@keyframes seesaw {
    0% {
        transform: rotate(-6deg);
    }
    50% {
        transform: rotate(6deg);
    }
    100% {
        transform: rotate(-6deg);
    }
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    width: 100%;
    position: relative;
    min-height: 100px;
}

#result-title {
    font-family: var(--font-display);
    font-size: 3rem;
    margin: 0;
    text-align: center;
    z-index: 1;
}

#result-mascot {
    position: fixed;
    top: 0rem;
    right: 0rem;
    width: 420px; /* 3x original size (140px * 3) */
    height: auto;
    object-fit: contain;
    animation: mascotSway 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
    z-index: 100;
}

.final-score-circle {
    width: 200px;
    height: 200px;
    background: var(--surface-container-low);
    border: 8px solid var(--primary-container);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 2rem;
    font-size: 5rem;
    font-weight: 900;
    flex-direction: column;
    position: relative;
    color: var(--primary);
    box-shadow: var(--shadow-ambient);
}

.trophy-badge {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--tertiary-container);
    width: 70px;
    height: 70px;
    border-radius: 1.5rem;
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-lifted);
    transform: rotate(12deg);
    animation: 
        badgePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        badgeWobble 4s ease-in-out infinite 0.5s;
    border: 4px solid var(--surface-container-lowest);
}

@keyframes badgePop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(12deg);
        opacity: 1;
    }
}

@keyframes badgeWobble {
    0%, 100% {
        transform: scale(1) rotate(12deg);
    }
    25% {
        transform: scale(1.05) rotate(16deg);
    }
    50% {
        transform: scale(1) rotate(8deg);
    }
    75% {
        transform: scale(1.05) rotate(14deg);
    }
}

.final-score-circle small {
    font-size: 1.5rem;
    margin-top: -10px;
    opacity: 0.5;
}

#result-message {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.secondary-btn {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: var(--shadow-ambient);
}

.secondary-btn:hover {
    background: #79cdff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(121, 205, 255, 0.3);
}

.secondary-btn:active {
    transform: scale(0.95);
}

/* Mobile/Tablet adjustments for 1080p and 4K */
@media (min-width: 1081px) {

    /* Scaling for 4K and large displays */
    html {
        font-size: 24px;
    }
}

@media (max-width: 1080px) {
    html {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 16px;
    }
}