/* ============================================
   词之大陆 - Kids English Quiz App
   Design for ages 2-8 (Lingokids-inspired)
   Warm palette, large touch targets, playful animations
   ============================================ */

:root {
    /* Primary warm palette */
    --orange: #FF8C42;
    --orange-light: #FFB380;
    --yellow: #FFD166;
    --yellow-light: #FFE9A0;
    --green: #06D6A0;
    --green-light: #5EEAD4;
    --pink: #EF476F;
    --pink-light: #F78DA7;
    --purple: #A855F7;
    --purple-light: #C084FC;
    --blue: #3B82F6;
    --blue-light: #60A5FA;

    /* Semantic roles */
    --primary: #EF476F;
    --primary-dark: #E6335C;
    --accent: #06D6A0;
    --accent-light: #5EEAD4;
    --success: #06D6A0;
    --success-dark: #05B88A;
    --danger: #EF476F;
    --danger-light: #F78DA7;
    --warning: #FFD166;
    --warning-dark: #F0B800;

    /* Background */
    --bg-start: #FFF5F0;
    --bg-mid: #FFF0E8;
    --bg-end: #FFE8DD;
    --card: #FFFFFF;
    --card-glass: rgba(255,255,255,0.92);

    /* Text */
    --text: #3D2C2E;
    --text-light: #6B5E60;
    --muted: #A8989A;
    --border: #FFE4D9;
    --border-active: #FFB380;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 36px rgba(0,0,0,0.10);
    --shadow-pink: 0 6px 20px rgba(239,71,111,0.25);
    --shadow-green: 0 6px 20px rgba(6,214,160,0.25);
    --shadow-orange: 0 6px 20px rgba(255,140,66,0.25);

    /* Sizing */
    --radius-sm: 16px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --font-title: 2.4rem;
    --font-heading: 1.5rem;
    --font-body: 1.05rem;
    --font-small: 0.9rem;
    --btn-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-mid) 55%, var(--bg-end) 100%);
    background-attachment: fixed;
    color: var(--text);
    font-size: var(--font-body);
    line-height: 1.5;
}

/* ======================== Floating Decorations ======================== */
.floating-decorations {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.cloud {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.3;
    animation: floatCloud 12s ease-in-out infinite;
}
.cloud-1 { top: 8%; left: 5%; animation-delay: 0s; font-size: 3rem; }
.cloud-2 { top: 15%; right: 8%; animation-delay: -4s; font-size: 2rem; }
.cloud-3 { top: 60%; left: 70%; animation-delay: -8s; font-size: 2.8rem; }
.star {
    position: absolute;
    font-size: 1.5rem;
    animation: twinkleStar 3s ease-in-out infinite;
}
.star-1 { top: 10%; right: 15%; animation-delay: 0s; }
.star-2 { top: 40%; left: 8%; animation-delay: -1s; font-size: 1.2rem; }
.star-3 { top: 70%; right: 10%; animation-delay: -2s; }
.star-4 { top: 85%; left: 20%; animation-delay: -0.5s; font-size: 1.8rem; }
.balloon {
    position: absolute;
    font-size: 2rem;
    animation: floatBalloon 10s ease-in-out infinite;
}
.balloon-1 { bottom: 15%; left: 12%; animation-delay: 0s; }
.balloon-2 { bottom: 20%; right: 15%; animation-delay: -5s; }
@keyframes floatCloud {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(30px) translateY(-10px); }
    50% { transform: translateX(10px) translateY(-20px); }
    75% { transform: translateX(-20px) translateY(-5px); }
}
@keyframes twinkleStar {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.3); }
}
@keyframes floatBalloon {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-25px) rotate(3deg); }
}

/* ======================== App Shell ======================== */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    position: relative;
    z-index: 1;
}

/* ======================== Header ======================== */
.app-header {
    background: linear-gradient(135deg, var(--orange) 0%, var(--pink) 50%, var(--purple) 100%);
    color: #fff;
    text-align: center;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    flex-shrink: 0;
    box-shadow: 0 4px 24px rgba(239,71,111,0.3);
    position: relative;
    overflow: hidden;
}
.app-header::after {
    content: "🌟";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: twinkle 2s ease-in-out infinite 1s;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.6; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.25); }
}
.app-title {
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}
.home-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    transition: all 0.2s;
    backdrop-filter: blur(6px);
}
.home-btn:active {
    transform: translateY(-50%) scale(0.88);
    background: rgba(255,255,255,0.45);
}
.header-mascot {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
}
.header-mascot img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
}
.header-stars { display: none; }

/* ======================== Main Content ======================== */
.app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scroll-behavior: smooth;
}

/* ======================== Pages ======================== */
.page {
    display: none;
    min-height: 100%;
    padding: 16px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    animation: pageIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.page.active {
    display: block;
}
@keyframes pageIn {
    0% { opacity: 0; transform: scale(0.95) translateY(16px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

#page-quiz.active {
    background: none;
}
#page-quiz.active .quiz-wrap {
    background: var(--card-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ======================== Bottom Tab Bar ======================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 3px solid var(--border);
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
    border-radius: 24px 24px 0 0;
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 700;
    gap: 2px;
}
.tab-item.active {
    color: var(--pink);
    transform: translateY(-6px);
}
.tab-item.active .tab-icon {
    animation: tabBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tabBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) translateY(-4px); }
    100% { transform: scale(1) translateY(0); }
}
.tab-icon {
    font-size: 1.8rem;
    line-height: 1;
}
.tab-label {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ======================== Cards ======================== */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border: 3px solid rgba(255,255,255,0.9);
    position: relative;
}
.card::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 20px;
    right: 20px;
    height: 5px;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
    border-radius: 3px;
    opacity: 0.7;
}
.card-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ======================== Inputs ======================== */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.input-group input {
    flex: 1;
    min-width: 0;
    padding: 16px 18px;
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    outline: none;
    -webkit-appearance: none;
    background: #FFFBF8;
    color: var(--text);
    font-weight: 700;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(6,214,160,0.15);
}

/* Batch textarea */
.batch-card textarea {
    width: 100%;
    padding: 16px 18px;
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    outline: none;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    background: #FFFBF8;
    color: var(--text);
    font-weight: 700;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.batch-card textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(6,214,160,0.15);
}

/* ======================== Buttons ======================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #fff;
    -webkit-appearance: none;
    min-height: var(--btn-height);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}
.btn:active {
    transform: scale(0.93) translateY(2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--primary-dark));
    box-shadow: var(--shadow-pink);
}
.btn-secondary {
    background: linear-gradient(135deg, var(--purple), #8B5CF6);
    color: #fff;
}
.btn-success {
    background: linear-gradient(135deg, var(--green), var(--success-dark));
    box-shadow: var(--shadow-green);
}
.btn-danger {
    background: linear-gradient(135deg, #FC8181, #F56565);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Small buttons */
.btn-sm {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 42px;
    border-radius: 14px;
}

/* ======================== Quiz Hero ======================== */
.quiz-hero {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: 0 0 40px 40px;
}
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.08) saturate(1.15);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,245,240,0.08) 0%, rgba(255,240,232,0.55) 55%, rgba(255,232,221,0.96) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: heroFloat 0.8s ease;
}
@keyframes heroFloat {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: #fff;
    font-size: 1.35rem;
    font-weight: 900;
    padding: 10px 24px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(255,140,66,0.35);
    letter-spacing: 2px;
    animation: badgeWiggle 2.5s ease-in-out infinite;
}
@keyframes badgeWiggle {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--text);
    text-shadow: 3px 3px 0px rgba(255,140,66,0.2);
    letter-spacing: 4px;
    margin: 0;
}
.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-light);
    font-weight: 700;
    margin-top: -8px;
}

/* Jelly Card */
.jelly-card {
    background: var(--card-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 26px;
    width: 100%;
    border: 3px solid rgba(255,255,255,0.85);
    box-shadow: var(--shadow-lg);
    animation: jellyIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes jellyIn {
    0% { transform: scale(0.75); opacity: 0; }
    50% { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(1); }
}

.settings-row {
    margin-bottom: 20px;
}
.settings-row:last-child {
    margin-bottom: 0;
}
.settings-label {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.jelly-option {
    padding: 12px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FFFBF8, #FFFFFF);
    border: 3px solid var(--border);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow-sm);
    user-select: none;
}
.jelly-option:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: var(--shadow-md);
}
.jelly-option.active {
    background: linear-gradient(135deg, var(--green), var(--accent-light));
    color: #fff;
    border-color: var(--green);
    box-shadow: var(--shadow-green);
    transform: translateY(-4px) scale(1.07);
    animation: optionPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes optionPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1.07); }
}
.jelly-option:active {
    transform: scale(0.94);
}

/* Show Options */
.show-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.show-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, #FFFBF8, #FFFFFF);
    border: 3px solid var(--border);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-sm);
    user-select: none;
}
.show-option:hover {
    transform: translateY(-2px) scale(1.02);
}
.show-option.active {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #fff;
    border-color: var(--orange);
    box-shadow: var(--shadow-orange);
}
.show-icon {
    font-size: 1.8rem;
    line-height: 1;
}
.show-icon-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.show-name {
    flex: 1;
    font-size: 1.1rem;
}
.show-badge {
    font-size: 0.78rem;
    font-weight: 900;
    background: rgba(255,255,255,0.4);
    padding: 4px 12px;
    border-radius: 14px;
    color: var(--text-light);
}
.show-option.active .show-badge {
    background: rgba(255,255,255,0.35);
    color: #fff;
}
.show-arrow {
    font-size: 1.3rem;
    opacity: 0.5;
}

/* Character Panel */
.char-panel {
    animation: slideInRight 0.35s ease;
}
.char-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
}
.char-panel-back {
    background: linear-gradient(135deg, var(--green), var(--accent-light));
    color: #fff;
    border: none;
    border-radius: 16px;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-green);
    transition: all 0.2s;
}
.char-panel-back:active {
    transform: scale(0.88);
}

/* Character Options Grid */
.character-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px !important;
}
.character-option {
    flex-direction: column;
    padding: 14px 10px;
    min-width: 76px;
    border-radius: 22px;
    border-color: var(--border);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.char-avatar-wrap {
    width: 60px;
    height: 60px;
    position: relative;
    margin-bottom: 4px;
}
.character-option .char-avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    background: #fff;
    image-rendering: auto;
    position: absolute;
    inset: 0;
}
.char-avatar-fallback {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    position: absolute;
    inset: 0;
}
.character-option .char-name {
    font-size: 0.85rem;
    font-weight: 800;
}
.character-option.active {
    background: linear-gradient(135deg, var(--char-color, var(--green)), var(--char-color, var(--green)));
    color: #fff;
    border-color: var(--char-color, var(--green));
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    transform: translateY(-6px) scale(1.1);
    animation: charBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.character-option.active .char-avatar-img {
    transform: scale(1.18) rotate(-5deg);
    box-shadow: 0 6px 22px rgba(0,0,0,0.2);
    border-color: #fff;
}
.character-option.active .char-avatar-fallback {
    transform: scale(1.18) rotate(-5deg);
    box-shadow: 0 6px 22px rgba(0,0,0,0.2);
    border-color: #fff;
}
@keyframes charBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.18) translateY(-10px); }
    70% { transform: scale(1.05) translateY(-4px); }
    100% { transform: scale(1.1) translateY(-6px); }
}

/* Locked Character */
.character-option.locked {
    opacity: 0.7;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border-color: #555;
    color: #888;
    cursor: help;
    transform: none !important;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.character-option.locked .char-avatar-img,
.character-option.locked .char-avatar-fallback {
    filter: grayscale(100%) brightness(0.15) contrast(1.2);
    opacity: 1;
}
.char-shadow-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border-radius: 50%;
}
.char-shadow-qm {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--yellow);
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    animation: qmPulse 1.5s ease-in-out infinite;
}
@keyframes qmPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.2); opacity: 1; }
}
.char-lock-hint {
    font-size: 0.58rem;
    font-weight: 700;
    color: #999;
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 68px;
}
.character-option.locked:active {
    transform: scale(0.93) !important;
    animation: lockShake 0.3s ease;
}
@keyframes lockShake {
    0%, 100% { transform: scale(0.93) rotate(0); }
    25% { transform: scale(0.93) rotate(-4deg); }
    75% { transform: scale(0.93) rotate(4deg); }
}

/* Jelly Start Button */
.jelly-start-btn {
    width: 100%;
    max-width: 340px;
    padding: 20px 36px;
    border-radius: var(--radius-xl);
    border: 4px solid rgba(255,255,255,0.9);
    background: linear-gradient(135deg, var(--pink), var(--primary-dark));
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-pink);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: startBtnFloat 3s ease-in-out infinite;
    margin-top: 8px;
    letter-spacing: 2px;
}
.jelly-start-btn:hover {
    transform: translateY(-5px) scale(1.06);
    box-shadow: 0 14px 40px rgba(239,71,111,0.45);
}
.jelly-start-btn:active {
    transform: scale(0.94);
}
.jelly-start-btn.btn-secondary {
    background: linear-gradient(135deg, var(--purple), #8B5CF6);
    box-shadow: 0 8px 28px rgba(168,85,247,0.35);
    font-size: 1.15rem;
    padding: 16px 28px;
    margin-top: 0;
    animation: none;
    max-width: none;
}
@keyframes startBtnFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.start-btn-icon {
    font-size: 1.6rem;
}

/* ======================== Quiz Progress Bar ======================== */
.quiz-progress-bar {
    position: relative;
    width: 100%;
    height: 20px;
    background: #FFE8DD;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink), var(--purple));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}
.quiz-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--text);
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    pointer-events: none;
}

/* ======================== Quiz Game ======================== */
.quiz-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--card-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 34px;
    padding: 22px 22px 22px 38px;
    border: 4px solid rgba(255,255,255,0.85);
    box-shadow: var(--shadow-lg);
    animation: jellyIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

/* Quiz Image Area */
.quiz-image-area {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 42vh;
    background: linear-gradient(135deg, #FFE8DD, #FFF5F0);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255,255,255,0.9);
    box-shadow: var(--shadow-md), inset 0 -6px 0 rgba(0,0,0,0.03);
}
.quiz-image-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: linear-gradient(135deg, #FFE8DD, #FFF5F0);
}

/* Play Button */
.play-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: linear-gradient(135deg, var(--green), var(--accent-light));
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-green);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}
.play-btn:active {
    transform: scale(0.88);
}
.play-btn:hover {
    transform: scale(1.1);
}
.play-btn.playing {
    animation: soundWave 0.6s ease-in-out infinite;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
}
@keyframes soundWave {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-green); }
    50% { transform: scale(1.18); box-shadow: 0 8px 32px rgba(6,214,160,0.5); }
}

/* Skeleton */
.skeleton {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #FFF0E8;
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, #FFE0D0 55%, transparent 80%);
    transform: translateX(-100%);
    animation: skeletonMove 1.2s infinite;
}
@keyframes skeletonMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ======================== Options Grid ======================== */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.option-btn {
    padding: 16px 12px;
    border: 3px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(145deg, #FFFFFF, #FFFBF8);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
}
.option-btn:active {
    transform: scale(0.92) translateY(2px);
}
.option-btn:nth-child(1) { border-left: 6px solid #EF476F; }
.option-btn:nth-child(2) { border-left: 6px solid #3B82F6; }
.option-btn:nth-child(3) { border-left: 6px solid #06D6A0; }
.option-btn:nth-child(4) { border-left: 6px solid #FFD166; }

.option-btn.correct {
    border-color: var(--green) !important;
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0) !important;
    color: #065F46 !important;
    box-shadow: 0 4px 20px rgba(6,214,160,0.35) !important;
    animation: correctBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 6px solid var(--green) !important;
}
.option-btn.wrong {
    border-color: var(--danger) !important;
    background: linear-gradient(135deg, #FEE2E2, #FECACA) !important;
    color: #991B1B !important;
    box-shadow: 0 4px 20px rgba(239,71,111,0.3) !important;
    animation: shakeEnhanced 0.5s ease;
    border-left: 6px solid var(--danger) !important;
}
@keyframes correctBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.14); }
    55% { transform: scale(0.95); }
    80% { transform: scale(1.04); }
    100% { transform: scale(1); }
}
@keyframes shakeEnhanced {
    0%, 100% { transform: translateX(0) rotate(0); }
    15% { transform: translateX(-8px) rotate(-2deg); }
    30% { transform: translateX(7px) rotate(2deg); }
    45% { transform: translateX(-5px) rotate(-1deg); }
    60% { transform: translateX(4px) rotate(1deg); }
    75% { transform: translateX(-2px) rotate(0); }
}
.option-btn:disabled {
    cursor: default;
    transform: none !important;
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    padding: 22px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    animation: popIn 0.4s ease;
    background: var(--card-glass);
    border: 3px solid rgba(255,255,255,0.85);
}
.quiz-result.correct {
    background: linear-gradient(135deg, rgba(209,250,229,0.95), rgba(167,243,208,0.92));
    border: 4px solid var(--success);
    box-shadow: 0 8px 28px rgba(6,214,160,0.25);
}
.quiz-result.wrong {
    background: linear-gradient(135deg, rgba(254,226,226,0.95), rgba(254,202,202,0.92));
    border: 4px solid var(--danger);
    box-shadow: 0 8px 28px rgba(239,71,111,0.2);
}
.result-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 6px;
}
.result-text {
    font-size: 1.2rem;
    font-weight: 900;
}
.quiz-result.correct .result-text { color: #065F46; }
.quiz-result.wrong .result-text { color: #991B1B; }
@keyframes popIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Mic Button Circle */
.voice-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.mic-btn-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.8);
    background: linear-gradient(135deg, var(--green), var(--accent-light));
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-green);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.mic-btn-circle:active {
    transform: scale(0.88);
}
.mic-btn-circle.recording {
    background: linear-gradient(135deg, var(--pink), var(--pink-light));
    animation: micPulse 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(239,71,111,0.6);
}
@keyframes micPulse {
    0% { box-shadow: 0 0 0 0 rgba(239,71,111,0.6); transform: scale(1); }
    50% { box-shadow: 0 0 0 20px rgba(239,71,111,0); transform: scale(1.08); }
    100% { box-shadow: 0 0 0 0 rgba(239,71,111,0); transform: scale(1); }
}
.mic-icon {
    line-height: 1;
}
.mic-wave {
    display: none;
}

/* Mic Button (large full-width for quiz page) */
.mic-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--green), var(--accent-light));
    font-size: 1.3rem;
    margin-top: 6px;
    border-radius: 24px;
    box-shadow: var(--shadow-green);
    border: 3px solid rgba(255,255,255,0.6);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #fff;
    font-weight: 900;
    padding: 14px;
}
.mic-btn.recording {
    background: linear-gradient(135deg, var(--pink), var(--pink-light));
    animation: micPulse 1.5s infinite;
    box-shadow: 0 4px 24px rgba(239,71,111,0.4);
}

.mic-status {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    min-height: 24px;
    margin-top: 8px;
    font-weight: 700;
}

/* Next Button */
.next-btn {
    width: 100%;
    margin-top: 10px;
    border-radius: 24px;
    box-shadow: var(--shadow-pink);
    border: 3px solid rgba(255,255,255,0.6);
    font-size: 1.2rem;
    min-height: var(--btn-height);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #fff;
    font-weight: 900;
}

/* Skip Actions */
.skip-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.skip-actions .btn {
    flex: 1;
    border-radius: 24px;
    font-size: 1.05rem;
    padding: 14px;
    border: 3px solid rgba(255,255,255,0.6);
}

/* Quiz Header Bar */
.quiz-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: -4px;
}
.quiz-back-btn {
    background: rgba(255,255,255,0.7);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.quiz-back-btn:active {
    transform: scale(0.93);
    background: rgba(255,255,255,0.9);
}
.quiz-header-title {
    font-size: 1rem;
    font-weight: 900;
    color: var(--pink);
}

/* Page Back Button */
.page-back-bar {
    margin-bottom: 12px;
}
.page-back-btn {
    background: rgba(255,255,255,0.85);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}
.page-back-btn:active {
    transform: scale(0.93);
}

/* Quiz Timer */
.quiz-timer {
    text-align: center;
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--pink);
    margin-bottom: 10px;
    transition: color 0.3s;
    text-shadow: 0 2px 4px rgba(239,71,111,0.15);
}
.quiz-timer.urgent {
    color: #EF4444;
    animation: timerPulse 0.5s infinite;
}
@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Timer Bar (side) */
.timer-bar-wrap {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 5;
}
.timer-bar-track {
    width: 24px;
    height: 260px;
    background: rgba(0,0,0,0.06);
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
}
.timer-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #EF4444, #F87171, var(--yellow), var(--green), #10B981);
    border-radius: 12px;
    transition: height 0.1s linear;
}
.timer-bar-wrap.urgent .timer-bar-track {
    animation: barShake 0.35s infinite;
    border-color: #EF4444;
}
.timer-bar-wrap.urgent .timer-bar-text {
    color: #EF4444;
    border-color: #EF4444;
    animation: barShake 0.35s infinite;
}
@keyframes barShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
.timer-bar-text {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--text);
    background: rgba(255,255,255,0.96);
    padding: 5px 10px;
    border-radius: 14px;
    border: 2px solid var(--border);
    min-width: 34px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ======================== Result Panel ======================== */
.quiz-result-panel {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, rgba(255,245,240,0.96), rgba(255,240,232,0.98));
    animation: fadeIn 0.4s ease;
    backdrop-filter: blur(8px);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.result-panel-bg {
    background: var(--card-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 36px;
    padding: 36px 28px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    border: 4px solid rgba(255,255,255,0.9);
    box-shadow: var(--shadow-lg);
    animation: jellyIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.result-stars {
    font-size: 3.5rem;
    margin-bottom: 12px;
    animation: starsPop 0.6s ease 0.3s both;
}
@keyframes starsPop {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    70% { transform: scale(1.2) rotate(8deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.result-panel-title {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 20px;
}
.result-panel-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 24px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.stat-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--pink);
}
.stat-label {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 800;
}
.result-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}
.result-extra-stats {
    margin: 12px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.result-exp-gain {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--green);
    animation: popIn 0.5s ease;
}
.result-points-gain {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--yellow);
    animation: popIn 0.5s ease 0.1s both;
}
.result-level-up {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--pink);
    animation: levelUpPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes levelUpPop {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.3); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

/* ======================== Login ======================== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #FFF5F0 0%, #FFE8DD 50%, #FFD4C4 100%);
}
.login-bg {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    animation: heroFloat 0.8s ease;
}
.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.login-mascot-img {
    display: block;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 5px solid #fff;
    box-shadow:
        0 8px 0 rgba(239,71,111,0.15),
        0 16px 40px rgba(0,0,0,0.15);
    animation: mascotBounce 2.5s ease-in-out infinite;
    background: #fff;
}
@keyframes mascotBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-14px) rotate(3deg); }
}
.login-title {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    color: var(--text);
    letter-spacing: 3px;
    text-shadow: 3px 3px 0 rgba(255,140,66,0.2);
}
.login-subtitle {
    text-align: center;
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 24px;
    margin-top: 6px;
    font-size: 1.3rem;
}

.login-form {
    background: rgba(255,255,255,0.96);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 4px solid var(--border);
    box-shadow:
        0 8px 0 rgba(239,71,111,0.12),
        0 20px 60px rgba(239,71,111,0.15);
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.login-form:hover {
    transform: translateY(-4px);
    box-shadow:
        0 14px 0 rgba(239,71,111,0.12),
        0 28px 70px rgba(239,71,111,0.2);
}
.login-input-group {
    margin-bottom: 18px;
}
.login-input-group label {
    display: block;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 8px;
}
.login-input-group input {
    width: 100%;
    padding: 18px 20px;
    border: 3px solid var(--border);
    border-radius: 22px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    background: #FFFBF8;
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input-group input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(6,214,160,0.15);
}
.login-switch {
    text-align: center;
    margin-top: 18px;
    font-size: 1.05rem;
    color: var(--text-light);
    font-weight: 700;
}
.login-switch a {
    color: var(--pink);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 900;
}

/* ======================== Profile ======================== */
.profile-card {
    background: linear-gradient(135deg, #FFF0E8, #FFFBF8);
    border-radius: var(--radius-lg);
    padding: 14px 12px 12px;
    margin-bottom: 14px;
    border: 3px solid var(--border);
    box-shadow: var(--shadow-md);
}
.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.profile-info-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 84px;
    flex-shrink: 0;
}
.profile-avatar {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.1));
}
.profile-name {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1.2;
}
.profile-phone {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    margin-top: 1px;
}
.profile-info-left .btn-sm {
    margin-top: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    min-height: auto;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
}
.profile-stat-card {
    background: var(--card);
    border-radius: 16px;
    padding: 10px 8px;
    text-align: center;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.profile-stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--pink);
    line-height: 1.2;
}
.profile-stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 700;
    margin-top: 3px;
}

/* Level & Exp */
.level-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #FFFFFF, #FFFBF8);
    border-radius: 18px;
    border: 2px solid var(--border);
}
.level-badge {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: 14px;
    border: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}
.level-info {
    flex: 1;
    min-width: 0;
}
.level-exp-bar {
    width: 100%;
    height: 12px;
    background: #FFF0E8;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.level-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
    width: 0%;
    transition: width 0.8s ease;
    border-radius: 5px;
}
.level-exp-text {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 700;
    margin-top: 3px;
    text-align: center;
}
.points-badge {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: #fff;
    font-size: 0.88rem;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(255,209,102,0.35);
}

/* ======================== Word List ======================== */
.word-list { list-style: none; }
.word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 2px dashed var(--border);
    transition: background 0.2s;
}
.word-item:last-child { border-bottom: none; }
.word-info { flex: 1; min-width: 0; }
.word-cn { font-weight: 900; font-size: 1.35rem; color: var(--text); display: flex; align-items: center; gap: 6px; }
.word-en { font-size: 1.1rem; color: var(--text-light); margin-top: 4px; font-weight: 700; }
.word-meta { font-size: 0.9rem; color: var(--muted); margin-top: 4px; font-weight: 600; }
.word-actions { display: flex; gap: 8px; margin-left: 10px; }

.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
    animation: badgePop 0.4s ease;
}
@keyframes badgePop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 4px 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-filter::-webkit-scrollbar { display: none; }
.category-chip {
    flex-shrink: 0;
    padding: 13px 22px;
    border-radius: 26px;
    background: linear-gradient(135deg, #FFFFFF, #FFFBF8);
    border: 3px solid var(--border);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}
.category-chip:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: var(--shadow-md);
}
.category-chip.active {
    color: #fff;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    animation: chipBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.category-chip:active {
    transform: scale(0.92);
}
@keyframes chipBounce {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-8px) scale(1.14); }
    70% { transform: translateY(-3px) scale(1.05); }
    100% { transform: translateY(-5px) scale(1.1); }
}
.chip-count {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 900;
    background: rgba(255,255,255,0.35);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Word Thumbs */
.word-thumb-grid {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.word-thumb {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: #FFF0E8;
}
.word-thumb-placeholder {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    background: #FFF0E8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    border: 2px dashed var(--border);
}

/* ======================== Modal ======================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(61,44,46,0.5);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    background: var(--card);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    border-radius: 32px 32px 0 0;
    overflow-y: auto;
    animation: slideUp 0.35s ease;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    border: 4px solid var(--border);
    border-bottom: none;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.modal-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.modal-close:active {
    background: #F5F5F5;
}

.modal-img-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}
.modal-img-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: #FFF0E8;
    border: 3px solid var(--border);
}
.modal-img-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #FFF0E8;
}
.modal-img-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-active);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    color: var(--text-light);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    background: #FFFBF8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-area:active {
    border-color: var(--green);
    background: #F0FFF8;
}
.upload-area input {
    display: none;
}

/* ======================== Batch ======================== */
.batch-status {
    margin-top: 12px;
}
.batch-progress {
    width: 100%;
    height: 14px;
    background: #FFF0E8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 2px solid var(--border);
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 6px;
}
.batch-text {
    font-size: 0.95rem;
    color: var(--text-light);
    min-height: 24px;
    font-weight: 700;
    text-align: center;
}

/* ======================== Quiz Loading ======================== */
.quiz-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 245, 240, 0.97);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(6px);
}
.quiz-loading-inner {
    width: 80%;
    max-width: 320px;
    text-align: center;
}
.quiz-loading-track {
    position: relative;
    height: 80px;
    margin-bottom: 24px;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(180deg, #D1FAE5 0%, #A7F3D0 100%);
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.08);
}
.quiz-loading-track::before,
.quiz-loading-track::after {
    content: "🌳";
    position: absolute;
    bottom: 8px;
    font-size: 1.3rem;
    opacity: 0.6;
}
.quiz-loading-track::before { left: 12px; }
.quiz-loading-track::after { right: 12px; }
.quiz-loading-char {
    width: 60px;
    height: 60px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    animation: charWalk 2.4s linear infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    object-fit: contain;
}
@keyframes charWalk {
    0% { left: 8px; transform: translateY(-50%) scaleX(1) rotate(-3deg); }
    12% { transform: translateY(-72%) scaleX(1) rotate(3deg); }
    25% { transform: translateY(-50%) scaleX(1) rotate(-3deg); }
    37% { transform: translateY(-72%) scaleX(1) rotate(3deg); }
    50% { left: calc(100% - 68px); transform: translateY(-50%) scaleX(1) rotate(-3deg); }
    51% { transform: translateY(-50%) scaleX(-1) rotate(-3deg); }
    62% { transform: translateY(-72%) scaleX(-1) rotate(3deg); }
    75% { transform: translateY(-50%) scaleX(-1) rotate(-3deg); }
    87% { transform: translateY(-72%) scaleX(-1) rotate(3deg); }
    100% { left: 8px; transform: translateY(-50%) scaleX(-1) rotate(-3deg); }
}
.quiz-loading-bar {
    width: 100%;
    height: 16px;
    background: #FFF0E8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.quiz-loading-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}
.quiz-loading-text {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 1px;
}

/* ======================== Voice Start Button ======================== */
.voice-start-btn {
    background: linear-gradient(135deg, var(--pink), var(--pink-light));
    box-shadow: var(--shadow-pink);
}
.voice-start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 28px rgba(239,71,111,0.45);
}
.voice-start-btn:active {
    transform: translateY(1px) scale(0.96);
}

/* ======================== Empty State ======================== */
.empty {
    text-align: center;
    color: var(--muted);
    padding: 36px 0;
    font-size: 1.05rem;
    font-weight: 700;
}

/* ======================== Save Status ======================== */
.save-status {
    font-size: 0.95rem;
    color: var(--muted);
    min-height: 24px;
    font-weight: 700;
}

/* ======================== Record List ======================== */
.record-list { list-style: none; }
.record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 2px dashed var(--border);
    animation: slideInRight 0.4s ease;
}
.record-item:last-child { border-bottom: none; }
@keyframes slideInRight {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.record-title {
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--text);
}
.record-meta {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 700;
    margin-top: 4px;
}
.record-score {
    text-align: right;
    margin-left: 12px;
}
.record-score-value {
    font-size: 1.4rem;
    font-weight: 900;
}
.record-score-detail {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 700;
}

/* ======================== Wrong Book ======================== */
.wrong-list {
    list-style: none;
    max-height: 340px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.wrong-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 2px dashed var(--border);
    animation: slideInRight 0.35s ease;
}
.wrong-item:last-child { border-bottom: none; }
.wrong-word-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.wrong-word-cn {
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--text);
}
.wrong-word-en {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 3px;
    font-weight: 700;
}
.wrong-count {
    display: inline-block;
    background: linear-gradient(135deg, #FC8181, #F56565);
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 900;
}
.wrong-stat-item {
    flex: 1;
    text-align: center;
    background: linear-gradient(135deg, #FFFBF8, #FFFFFF);
    border-radius: 16px;
    padding: 10px 6px;
    border: 2px solid var(--border);
}
.wrong-stat-item b {
    display: block;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--pink);
    line-height: 1.2;
}
.wrong-stat-item span {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 700;
}

/* ======================== Character Pool ======================== */
.character-pool {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 4px;
}
.character-card {
    background: linear-gradient(135deg, #FFFFFF, #FFFBF8);
    border: 3px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}
.character-card:active {
    transform: scale(0.97);
}
.character-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.character-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #fff;
}
.character-card-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #FFF0E8, #FFFBF8);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.character-card-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.character-card-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text);
}
.character-card-rank {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}
.character-card-rank::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.1), rgba(255,255,255,0.5));
    z-index: -1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Rank Colors */
.rank-sss {
    background: radial-gradient(circle at 35% 35%, #FFF8DC, #FFD700, #FF8C00, #FF4500);
    background-size: 200% 200%;
    animation: rankShine 8s ease infinite;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.4), 0 0 12px rgba(255,140,0,0.5), 0 0 24px rgba(255,215,0,0.3), inset 0 0 8px rgba(255,255,255,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    font-size: 0.65rem;
}
.rank-sss::before {
    box-shadow: 0 0 0 2px rgba(255,215,0,0.5), 0 0 12px rgba(255,140,0,0.4);
}
.rank-ss {
    background: radial-gradient(circle at 35% 35%, #FFF8DC, #FFD700, #FFA500);
    background-size: 200% 200%;
    animation: rankShine 6s ease infinite;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.35), 0 0 10px rgba(255,165,0,0.4), inset 0 0 6px rgba(255,255,255,0.25);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.rank-ss::before {
    box-shadow: 0 0 0 2px rgba(255,215,0,0.4), 0 0 10px rgba(255,165,0,0.3);
}
.rank-s {
    background: radial-gradient(circle at 35% 35%, #FFF8DC, #FFD700, #DAA520);
    background-size: 200% 200%;
    animation: rankShine 6s ease infinite;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.3), 0 0 8px rgba(218,165,32,0.35), inset 0 0 5px rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.rank-s::before {
    box-shadow: 0 0 0 2px rgba(255,215,0,0.35), 0 0 8px rgba(218,165,32,0.25);
}
.rank-a5, .rank-a4, .rank-a3, .rank-a2, .rank-a1 {
    background: radial-gradient(circle at 35% 35%, #F8F8F8, #E0E0E0, #C0C0C0);
    background-size: 200% 200%;
    animation: rankShine 8s ease infinite;
    box-shadow: 0 0 0 3px rgba(192,192,192,0.35), 0 0 6px rgba(176,176,176,0.3), inset 0 0 5px rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.rank-a5::before, .rank-a4::before, .rank-a3::before, .rank-a2::before, .rank-a1::before {
    box-shadow: 0 0 0 2px rgba(192,192,192,0.35), 0 0 6px rgba(176,176,176,0.25);
}
.rank-b5, .rank-b4, .rank-b3, .rank-b2, .rank-b1 {
    background: radial-gradient(circle at 35% 35%, #F5DEB3, #CD7F32, #8B4513);
    background-size: 200% 200%;
    animation: rankShine 8s ease infinite;
    box-shadow: 0 0 0 3px rgba(205,127,50,0.3), 0 0 5px rgba(139,69,19,0.25), inset 0 0 4px rgba(255,255,255,0.15);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.rank-b5::before, .rank-b4::before, .rank-b3::before, .rank-b2::before, .rank-b1::before {
    box-shadow: 0 0 0 2px rgba(205,127,50,0.3), 0 0 5px rgba(139,69,19,0.2);
}
.rank-c5, .rank-c4, .rank-c3, .rank-c2, .rank-c1 {
    background: radial-gradient(circle at 35% 35%, #E0F0FF, #87CEEB, #4682B4);
    background-size: 200% 200%;
    animation: rankShine 10s ease infinite;
    box-shadow: 0 0 0 3px rgba(135,206,235,0.3), 0 0 5px rgba(70,130,180,0.2), inset 0 0 4px rgba(255,255,255,0.15);
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.rank-c5::before, .rank-c4::before, .rank-c3::before, .rank-c2::before, .rank-c1::before {
    box-shadow: 0 0 0 2px rgba(135,206,235,0.3), 0 0 5px rgba(70,130,180,0.15);
}
.rank-d5, .rank-d4, .rank-d3, .rank-d2, .rank-d1 {
    background: radial-gradient(circle at 35% 35%, #E0FFE8, #98FB98, #3CB371);
    background-size: 200% 200%;
    animation: rankShine 10s ease infinite;
    box-shadow: 0 0 0 3px rgba(152,251,152,0.3), 0 0 5px rgba(60,179,113,0.2), inset 0 0 4px rgba(255,255,255,0.15);
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.rank-d5::before, .rank-d4::before, .rank-d3::before, .rank-d2::before, .rank-d1::before {
    box-shadow: 0 0 0 2px rgba(152,251,152,0.3), 0 0 5px rgba(60,179,113,0.15);
}
@keyframes rankShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.character-hexagon-wrap {
    display: flex;
    justify-content: center;
    margin: 6px 0 10px;
}

.hexagon-svg {
    width: 150px;
    height: 150px;
}

.character-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    padding-top: 8px;
    border-top: 2px dashed var(--border);
    gap: 4px;
}
.character-stats-row > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.character-stats-row b {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text);
}
.character-stats-row span {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
}

/* ======================== Combo ======================== */
.combo-display {
    position: fixed;
    top: max(90px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) scale(0);
    z-index: 450;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.combo-display.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
.combo-display.hide {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
}
.combo-fire-bg {
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: -4px;
    animation: fireFlicker 0.3s infinite alternate;
    filter: drop-shadow(0 0 10px var(--glow, rgba(255, 140, 66, 0.5)));
}
.combo-number {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    -webkit-text-stroke: 3px #fff;
}
.combo-text {
    font-size: 1.4rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
    letter-spacing: 4px;
}
@keyframes comboPop {
    0% { transform: scale(0.3); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
@keyframes fireFlicker {
    0% { transform: scale(1) rotate(-3deg); opacity: 0.85; }
    100% { transform: scale(1.2) rotate(3deg); opacity: 1; }
}
.fire-particle {
    position: fixed;
    pointer-events: none;
    z-index: 440;
    font-size: 1.3rem;
    animation: fireParticleFly 0.8s ease-out forwards;
}
@keyframes fireParticleFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0.3); opacity: 0; }
}

/* ======================== Particles ======================== */
@keyframes particleFly {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}

/* Screen Shake */
.screen-shake {
    animation: screenShake 0.5s ease;
}
@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-10px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

/* Image Pop */
#quizImage {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
#quizImage.image-pop {
    animation: imagePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes imagePop {
    0% { transform: scale(0.8); opacity: 0.5; }
    60% { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ======================== Toast ======================== */
.toast {
    position: fixed;
    top: max(80px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--pink), var(--orange));
    color: #fff;
    padding: 14px 28px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 800;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    max-width: 82vw;
    text-align: center;
    box-shadow: 0 8px 28px rgba(239,71,111,0.35);
    letter-spacing: 0.5px;
}
.toast.show { opacity: 1; }

/* ======================== Alert Modal ======================== */
.alert-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
}
.alert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(61,44,46,0.55);
    backdrop-filter: blur(4px);
}
.alert-box {
    position: relative;
    background: linear-gradient(135deg, #FFFFFF, #FFFBF8);
    border-radius: 28px;
    padding: 30px 26px 24px;
    width: 82vw;
    max-width: 360px;
    text-align: center;
    border: 4px solid var(--border);
    box-shadow: 0 14px 44px rgba(61,44,46,0.25);
    animation: popIn 0.35s ease;
}
.alert-title {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--pink);
    margin-bottom: 14px;
}
.alert-message {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 22px;
    white-space: pre-line;
}
.alert-btn {
    background: linear-gradient(135deg, var(--pink), var(--green));
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 14px 40px;
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(6,214,160,0.3);
    transition: all 0.2s;
}
.alert-btn:active {
    transform: scale(0.94);
}
.alert-btn.btn-secondary {
    background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.confirm-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btns .alert-btn {
    flex: 1;
    padding: 14px 18px;
    white-space: nowrap;
}

/* ======================== Responsive ======================== */
@media (max-width: 360px) {
    .options-grid { gap: 10px; }
    .option-btn { font-size: 1.3rem; padding: 14px 10px; min-height: 54px; }
    .app-title { font-size: 1.5rem; }
    .hero-title { font-size: 2.5rem; }
    .jelly-start-btn { font-size: 1.3rem; padding: 16px 28px; }
    .login-title { font-size: 2.5rem; }
    .login-subtitle { font-size: 1.15rem; }
    .tab-icon { font-size: 1.5rem; }
    .tab-label { font-size: 0.82rem; }
    .card { padding: 18px; }
    .jelly-card { padding: 20px; }
}

@media (min-width: 768px) {
    .page {
        max-width: 600px;
        margin: 0 auto;
    }
    .quiz-wrap {
        max-width: 560px;
        margin: 0 auto;
    }
    .tab-bar {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }
}
