@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Noto+Sans+TC:wght@400;500;700&family=M+PLUS+Rounded+1c:wght@400;700&family=Quicksand:wght@500;700&display=swap');

:root {
    --cream: #fdf6ee;
    --warm-brown: #8b5e3c;
    --dark-brown: #4a2c17;
    --caramel: #c8956c;
    --latte: #e8d5c4;
    --sakura-pink: #ffb7c5;
    --gold: #f4c542;
    --gold-light: #ffe9a0;
    --star-yellow: #ffd700;
    --bg-card: #ffffff;
    --text-primary: #4a2c17;
    --text-secondary: #7a5a3a;
    --text-light: #a08060;
    --shadow-soft: 0 4px 20px rgba(139, 94, 60, 0.12);
    --shadow-medium: 0 8px 32px rgba(139, 94, 60, 0.18);
    --shadow-strong: 0 12px 40px rgba(74, 44, 23, 0.22);
    --shadow-gold: 0 4px 20px rgba(244, 197, 66, 0.35);
    --border-radius-md: 18px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --font-display: 'Fredoka', 'M PLUS Rounded 1c', 'Quicksand', sans-serif;
    --font-body: 'Noto Sans TC', 'M PLUS Rounded 1c', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100vh;
    overflow: hidden;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(160deg, #fef9f3 0%, #fdf3e7 25%, #fef5ee 50%, #fdf2e4 75%, #fef8f2 100%);
    background-image: url('./img/bg_cafe.png');
    background-size: cover;
    background-blend-mode: overlay;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><defs><filter id='shadow' x='-20%25' y='-20%25' width='140%25' height='140%25'><feDropShadow dx='0' dy='1' stdDeviation='1.5' flood-color='%238b5e3c' flood-opacity='0.3'/></filter></defs><circle cx='10' cy='12' r='7' fill='%23fdf6ee' stroke='%238b5e3c' stroke-width='2' filter='url(%23shadow)'/><rect x='7' y='4' width='3' height='5' rx='1.5' fill='%23c8956c'/><path d='M16 10 Q18 8 20 9' fill='none' stroke='%238b5e3c' stroke-width='2.5' stroke-linecap='round'/><circle cx='19' cy='9.5' r='3.5' fill='%23fdf6ee' stroke='%238b5e3c' stroke-width='1.8'/><circle cx='19' cy='9.5' r='1.8' fill='%23c8956c' opacity='0.6'/></svg>") 10 12, auto;
}

button,
.btn,
.modal-close,
.options-grid button,
.music-hint {
    cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><defs><filter id='shadow2'><feDropShadow dx='0' dy='1' stdDeviation='2' flood-color='%23f4c542' flood-opacity='0.5'/></filter></defs><circle cx='10' cy='12' r='7' fill='%23fff8f0' stroke='%23f4c542' stroke-width='2.5' filter='url(%23shadow2)'/><rect x='7' y='4' width='3' height='5' rx='1.5' fill='%23f4c542'/><path d='M16 10 Q18 8 20 9' fill='none' stroke='%23f4c542' stroke-width='2.8' stroke-linecap='round'/><circle cx='19' cy='9.5' r='3.5' fill='%23fff8f0' stroke='%23f4c542' stroke-width='2'/><circle cx='19' cy='9.5' r='1.8' fill='%23f4c542' opacity='0.7'/></svg>") 10 12, pointer;
}

.particles-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: floatUp linear forwards;
    opacity: 0;
}

.particle.dot {
    width: 4px;
    height: 4px;
    background: var(--sakura-pink);
    box-shadow: 0 0 6px var(--sakura-pink);
}

.particle.star {
    width: 3px;
    height: 3px;
    background: var(--gold-light);
    box-shadow: 0 0 8px var(--gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.particle.sparkle {
    width: 5px;
    height: 5px;
    background: white;
    box-shadow: 0 0 12px var(--star-yellow), 0 0 24px var(--gold-light);
    border-radius: 50%;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    80% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-120vh) translateX(var(--drift)) scale(0.3);
        opacity: 0;
    }
}

.floating-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.float-icon {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0.5;
    animation: gentleFloat 6s ease-in-out infinite;
}

.float-icon-1 {
    top: 8%;
    left: 5%;
    font-size: 2rem;
}

.float-icon-2 {
    top: 15%;
    right: 8%;
    font-size: 1.6rem;
    animation-delay: 1.5s;
}

.float-icon-3 {
    top: 70%;
    left: 7%;
    font-size: 1.8rem;
    animation-delay: 3s;
}

.float-icon-4 {
    top: 78%;
    right: 10%;
    font-size: 2.2rem;
    animation-delay: 0.8s;
}

@keyframes gentleFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-18px) rotate(3deg);
    }

    50% {
        transform: translateY(-8px) rotate(-2deg);
    }

    75% {
        transform: translateY(-22px) rotate(1deg);
    }
}

.game-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    height: 100%;
    padding: 12px 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    overflow: hidden;
    animation: screenEnter 0.5s var(--ease-smooth);
}

.screen.active {
    display: flex;
}

@keyframes screenEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.menu-content {
    text-align: center;
    padding: 10px 5px;
}

.logo-area {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-icon {
    font-size: 3.5rem;
    animation: logoBounce 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes logoBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-14px) scale(1.08);
    }

    50% {
        transform: translateY(-6px) scale(1.03);
    }

    70% {
        transform: translateY(-16px) scale(1.06);
    }
}

.game-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    background: rgba(255, 250, 245, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 14px 24px;
    border-radius: var(--border-radius-xl);
    box-shadow: 0 4px 16px rgba(139, 94, 60, 0.12);
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.title-en {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--warm-brown), #f08c9e, var(--caramel));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-sub {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
}

.menu-mascot {
    font-size: 3.5rem;
    margin: 8px 0;
    animation: mascotWave 3s ease-in-out infinite;
    display: inline-block;
}

.menu-mascot img {
    max-width: 120px;
    height: auto;
}

@keyframes mascotWave {

    0%,
    100% {
        transform: rotate(0);
    }

    20% {
        transform: rotate(8deg) scale(1.05);
    }

    40% {
        transform: rotate(-6deg) scale(1.02);
    }

    60% {
        transform: rotate(5deg) scale(1.04);
    }

    80% {
        transform: rotate(-3deg);
    }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 8px;
}

.btn {
    font-family: var(--font-display);
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-xl);
    padding: 14px 32px;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    transition: all 0.3s var(--ease-bounce);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.btn:active {
    transform: scale(0.94);
}

.btn-primary {
    background: linear-gradient(135deg, #f9c56a, #f5a841);
    color: #4a2c17;
    box-shadow: var(--shadow-gold);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 30px rgba(244, 197, 66, 0.5);
    transform: translateY(-3px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    border: 2px solid rgba(200, 150, 100, 0.2);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
}

.btn-large {
    padding: 18px 44px;
    font-size: 1.2rem;
}

.btn-back {
    background: rgba(255, 250, 245, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--border-radius-xl);
    padding: 10px 22px;
    margin-top: 28px;
}

.btn-back:hover {
    border-color: var(--caramel);
    color: var(--text-primary);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(200, 150, 100, 0.25);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    box-shadow: var(--shadow-medium);
    transform: scale(1.08);
}

.btn-quit {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
}

.btn i, .music-hint i, .modal-close i {
    font-size: 1.2em;
    vertical-align: middle;
}
.btn-quit i {
    font-size: 1.3rem;
}

.menu-footer {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.high-score-display {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(119, 97, 35, 0.7);
    background: rgba(255, 255, 255, 0.849);
    padding: 10px 22px;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-soft);
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.category-content {
    text-align: center;
    width: 100%;
    padding: 10px;
}

.screen-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: rgba(255, 250, 245, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 12px 28px;
    border-radius: var(--border-radius-xl);
    display: inline-block;
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 20px 14px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 2px solid transparent;
    transition: all 0.35s var(--ease-bounce);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-strong);
    border-color: var(--sakura-pink);
}

.category-card:active {
    transform: scale(0.95);
}

.category-icon {
    font-size: 2.6rem;
    display: block;
    margin-bottom: 8px;
}

.category-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
}

.game-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    gap: 6px;
    background: rgba(255, 250, 245, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 4px 16px rgba(139, 94, 60, 0.1);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.score-display,
.combo-display,
.progress-display {
    background: transparent;
    box-shadow: none;
    padding: 4px 8px;
}

.score-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--warm-brown);
}

.combo-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 236, 128, 0.7);
    border-radius: var(--border-radius-md);
    padding: 6px 12px;
    opacity: 0.5;
    transition: all 0.4s;
}

.combo-display.active {
    opacity: 1;
    background: rgba(255, 239, 151, 0.75);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: comboGlow 0.6s infinite alternate;
}

@keyframes comboGlow {
    from {
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
    }

    to {
        box-shadow: 0 0 28px rgba(255, 180, 0, 0.5);
    }
}

.combo-count {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: #88621b;
}

.combo-text {
    font-size: 1.0rem;
    color: #88621b;
}

.lives-display {
    display: flex;
    gap: 3px;
    font-size: 1.1rem;
}

.lives-display .heart.lost {
    opacity: 0.2;
    transform: scale(0.7);
    filter: grayscale(1);
}

.heart i {
    color: #e85d75;
    font-size: 1.3rem;
}
.lives-display .heart.lost i {
    opacity: 0.2;
    filter: grayscale(1);
}

.progress-display {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.game-main-area {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 8px;
    overflow: hidden;
}

.customer-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.customer-emoji {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: inherit;
    transition: all 0.4s var(--ease-spring);
    animation: customerIdle 3s ease-in-out infinite;
}

.customer-emoji img {
    display: block;
    width: 140px;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 6px 14px rgba(139, 94, 60, 0.3));
    max-height: 200px;
}

.customer-sprite.happy .customer-emoji {
    animation: customerHappy 0.6s var(--ease-bounce);
}

.customer-sprite.sad .customer-emoji {
    animation: customerSad 0.5s ease-out;
}

@keyframes customerIdle {

    0%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-7px);
    }

    60% {
        transform: translateY(-3px);
    }
}

@keyframes customerHappy {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.25) rotate(10deg);
    }

    60% {
        transform: scale(0.9) rotate(-5deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

@keyframes customerSad {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(4px);
    }
}

.customer-speech-bubble {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 8px 14px;
    margin-top: 6px;
    box-shadow: var(--shadow-medium);
    border: 2px solid var(--latte);
    max-width: 240px;
    text-align: center;
    position: relative;
}

.customer-speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
}

.bubble-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.customer-name-tag {
    font-family: var(--font-body);
    font-size: 1.0rem;
    color: var(--text-light);
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.6);
    padding: 4px 12px;
    border-radius: var(--border-radius-xl);
}

.question-card {
    background: linear-gradient(135deg, #fffdf8, #fff9f0);
    border: 3px solid var(--gold-light);
    border-radius: var(--border-radius-lg);
    padding: 10px 20px;
    text-align: center;
    box-shadow: var(--shadow-gold);
}

.question-word {
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark-brown);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    max-width: 400px;
}

.option-btn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 2.5px solid rgba(200, 150, 100, 0.2);
    border-radius: var(--border-radius-lg);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s var(--ease-bounce);
    cursor: pointer;
}

.option-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
    border-color: var(--sakura-pink);
}

.option-btn:active {
    transform: scale(0.94);
}

.option-btn.correct {
    background: #e8f8e8 !important;
    border-color: #4caf84 !important;
    box-shadow: 0 0 24px rgba(76, 175, 132, 0.4) !important;
}

.option-btn.wrong {
    background: #fff0f0 !important;
    border-color: #e57373 !important;
    box-shadow: 0 0 20px rgba(229, 115, 115, 0.3) !important;
}

.option-btn:disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-btn.highlight-correct {
    border-color: #4caf84 !important;
    background: #f0faf4 !important;
}

.feedback-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.5s var(--ease-bounce);
}

.feedback-overlay.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.feedback-overlay.show-correct {
    animation: feedbackPopCorrect 1.5s forwards;
}

@keyframes feedbackPopCorrect {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -60%) scale(0.8);
        opacity: 0;
    }
}

.feedback-overlay.show-wrong {
    animation: feedbackPopWrong 1.5s forwards;
}

@keyframes feedbackPopWrong {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    15% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }

    35% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    75% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -55%) scale(0.7);
        opacity: 0;
    }
}

.feedback-emoji img {
    width: 140px;
    height: auto;
    min-height: 80px;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.feedback-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 20px;
    border-radius: var(--border-radius-xl);
}

.result-content {
    text-align: center;
    padding: 20px 20px;
    background: rgba(255, 250, 245, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-medium);
    width: 90%;
    max-width: 400px;
}

.result-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.star {
    font-size: 3rem;
    opacity: 0.2;
    transform: scale(0.5);
    transition: all 0.6s var(--ease-bounce);
    filter: grayscale(1);
}

.star.earned {
    opacity: 1;
    transform: scale(1);
    filter: grayscale(0);
    animation: starEarned 0.7s forwards;
}

@keyframes starEarned {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.4) rotate(10deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.result-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 340px;
    margin: 0 auto 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius-md);
    padding: 14px 10px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.stat-item .fa-solid {
    font-size: 1.6rem;
    vertical-align: middle;
    margin-right: 2px;
}

.stat-icon {
    font-size: 1.6rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
}

.stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--warm-brown);
}

.result-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 44, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    padding: 28px 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-strong);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.music-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 150;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s;
    animation: musicHintPulse 2s infinite;
}

.music-hint.playing {
    animation: none;
    background: rgb(245, 245, 243);
}

@keyframes musicHintPulse {

    0%,
    100% {
        box-shadow: var(--shadow-medium);
    }

    50% {
        box-shadow: 0 0 24px rgb(244, 197, 66);
    }
}
/*
@keyframes musicSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.music-hint.playing i {
    animation: musicSpin 3s linear infinite;
}*/

@media (max-width: 480px) {
    .title-en {
        font-size: 1.5rem;
    }

    .question-word {
        font-size: 1.3rem;
    }

    .option-btn {
        font-size: 0.85rem;
        padding: 10px 6px;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .customer-emoji img {
        width: 110px;
    }
}

@media (max-height: 600px) {
    .customer-emoji img {
        width: 100px;
    }

    .question-word {
        font-size: 1.3rem;
    }

    .option-btn {
        padding: 10px 6px;
        font-size: 0.85rem;
    }

    .game-title .title-en {
        font-size: 1.5rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .game-top-bar {
        padding: 6px 10px;
    }

    .result-content {
        padding: 14px;
    }
}