/* ===== CSS Variables ===== */
:root {
    /* Core Colors - matching the image */
    --bg-primary: #0a1628;
    --bg-secondary: #0d1f3c;
    --bg-card: #0f2444;
    
    /* Accent Colors */
    --cyan: #14ffec;
    --cyan-dark: #0d7377;
    --cyan-glow: rgba(20, 255, 236, 0.3);
    --orange: #ff8c00;
    --orange-light: #ffaa00;
    --orange-glow: rgba(255, 140, 0, 0.3);
    --gold: #ffd700;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #64748b;
    
    /* Borders */
    --border-cyan: rgba(20, 255, 236, 0.3);
    --border-orange: rgba(255, 140, 0, 0.5);
    
    /* Shadows */
    --glow-cyan: 0 0 20px rgba(20, 255, 236, 0.4);
    --glow-orange: 0 0 20px rgba(255, 140, 0, 0.4);
    
    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-alt: 'Exo 2', sans-serif;
    
    /* Spacing */
    --border-radius: 12px;
    --border-radius-lg: 20px;
    
    /* Transitions */
    --transition: 0.3s ease;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

.highlight {
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
}

/* ===== Background Animation ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(20, 255, 236, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 255, 236, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--cyan-dark);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--orange);
    bottom: -50px;
    right: -50px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, 50px); }
    50% { transform: translate(25px, -25px); }
    75% { transform: translate(-25px, 25px); }
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-cyan);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-cat {
    width: 45px;
    height: 45px;
}

.mini-cat {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--orange));
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--cyan);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-buttons {
    display: flex;
    gap: 12px;
}

/* User Profile in Nav */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.user-stats-mini {
    display: flex;
    gap: 15px;
}

.user-stats-mini span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-stats-mini .coins {
    color: var(--gold);
}

.user-stats-mini .xp {
    color: var(--cyan);
}

.user-avatar {
    position: relative;
    cursor: pointer;
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-dark), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid var(--cyan);
    transition: var(--transition);
}

.avatar-circle:hover {
    box-shadow: var(--glow-cyan);
}

.level-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius);
    min-width: 200px;
    box-shadow: var(--glow-cyan);
    overflow: hidden;
    z-index: 100;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.profile-dropdown a:hover {
    background: rgba(20, 255, 236, 0.1);
    color: var(--cyan);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-cyan);
    margin: 5px 0;
}

.mobile-menu-btn {
    display: none;
    background: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 5px;
}

.mobile-menu {
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-cyan);
    padding: 20px;
    z-index: 999;
}

.mobile-menu a {
    display: block;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu a:hover {
    color: var(--cyan);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-login {
    background: transparent;
    color: var(--orange);
    border: 2px solid var(--orange);
}

.btn-login:hover {
    background: var(--orange);
    color: var(--bg-primary);
    box-shadow: var(--glow-orange);
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #000;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-orange);
}

.btn-outline {
    background: transparent;
    color: var(--cyan);
    border: 2px solid var(--cyan);
}

.btn-outline:hover {
    background: var(--cyan);
    color: var(--bg-primary);
}

.btn-play {
    background: linear-gradient(135deg, var(--orange), #ff6600);
    color: #000;
    padding: 18px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    position: relative;
    overflow: hidden;
}

.btn-play::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.btn-play:hover::before {
    left: 100%;
}

.btn-play:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--orange-glow);
}

.btn-play .btn-text {
    position: relative;
    z-index: 1;
}

.btn-play .btn-icon {
    position: relative;
    z-index: 1;
}

.btn-full {
    width: 100%;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
}

.hero-frame {
    position: relative;
    max-width: 1200px;
    width: 100%;
    padding: 60px;
    background: linear-gradient(135deg, rgba(13, 31, 60, 0.9), rgba(10, 22, 40, 0.95));
    border: 2px solid var(--border-orange);
    border-radius: var(--border-radius-lg);
}

/* Frame Decorations */
.frame-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--orange);
}

.frame-corner.top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.frame-corner.top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
}

.frame-corner.bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
}

.frame-corner.bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.frame-line {
    position: absolute;
    background: var(--orange);
}

.frame-line.top, .frame-line.bottom {
    height: 3px;
    width: 60px;
    left: 50%;
    transform: translateX(-50%);
}

.frame-line.top { top: -3px; }
.frame-line.bottom { bottom: -3px; }

.frame-line.left, .frame-line.right {
    width: 3px;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
}

.frame-line.left { left: -3px; }
.frame-line.right { right: -3px; }

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Cat Section */
.hero-cat-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cat-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
}

.geometric-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hex {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(20, 255, 236, 0.1);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid var(--border-cyan);
}

.hex-1 { top: 5%; left: 5%; animation: pulse 3s infinite; }
.hex-2 { top: 0; right: 10%; animation: pulse 3s infinite 0.5s; }
.hex-3 { bottom: 15%; left: 0; animation: pulse 3s infinite 1s; }
.hex-4 { top: 20%; right: 0; animation: pulse 3s infinite 1.5s; width: 35px; height: 35px; }
.hex-5 { bottom: 5%; right: 15%; animation: pulse 3s infinite 2s; width: 40px; height: 40px; }

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.triangle {
    position: absolute;
    color: var(--orange);
    font-size: 1.5rem;
    opacity: 0.6;
    animation: floatTri 4s infinite ease-in-out;
}

.tri-1 { top: 30%; right: 5%; }
.tri-2 { bottom: 25%; right: 0; animation-delay: -2s; }
.tri-3 { bottom: 10%; left: 10%; animation-delay: -1s; font-size: 1rem; }

@keyframes floatTri {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(180deg); }
}

.circle-deco {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed;
}

.circ-1 {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(20, 255, 236, 0.2);
    animation: rotate 30s linear infinite;
}

.circ-2 {
    width: 380px;
    height: 380px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(255, 140, 0, 0.15);
    animation: rotate 25s linear infinite reverse;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.dot-pattern {
    position: absolute;
    bottom: 20%;
    left: 5%;
    width: 60px;
    height: 40px;
    background-image: radial-gradient(circle, var(--cyan) 2px, transparent 2px);
    background-size: 12px 12px;
    opacity: 0.4;
}

.cat-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
    filter: blur(30px);
    z-index: 0;
}

.math-cat-main {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px var(--cyan-glow));
}

.sacred-geometry {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    z-index: 5;
    pointer-events: none;
}

.outer-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 140, 0, 0.2);
    border-radius: 50%;
}

.inner-ring {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border: 1px solid rgba(20, 255, 236, 0.15);
    border-radius: 50%;
}

.center-triangle {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid rgba(255, 140, 0, 0.3);
}

/* Hero Text */
.hero-text-section {
    text-align: left;
}

.hero-text-section h1 {
    font-size: 2.8rem;
    margin-bottom: 25px;
    line-height: 1.2;
}

.hero-text-section p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 35px;
    max-width: 480px;
    line-height: 1.8;
}

/* ===== Section Styles ===== */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Grade Section ===== */
.grade-section {
    background: linear-gradient(180deg, transparent, rgba(13, 31, 60, 0.5), transparent);
}

.grade-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grade-category {
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    transition: var(--transition);
}

.grade-category:hover {
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

.category-header {
    text-align: center;
    margin-bottom: 25px;
}

.category-header i {
    font-size: 2.5rem;
    color: var(--cyan);
    margin-bottom: 15px;
    display: block;
}

.category-header h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.grade-range {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.grade-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grade-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(20, 255, 236, 0.05);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: var(--transition);
    text-align: left;
}

.grade-btn:hover {
    background: rgba(20, 255, 236, 0.15);
    border-color: var(--cyan);
    transform: translateX(5px);
}

.grade-btn.selected {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    border-color: var(--orange);
    color: #000;
}

.grade-num {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    width: 35px;
}

.grade-skills {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.grade-btn.selected .grade-skills {
    color: rgba(0, 0, 0, 0.7);
}

/* ===== Games Section ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.game-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(135deg, rgba(20, 255, 236, 0.1), rgba(139, 92, 246, 0.1));
    z-index: 0;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

.game-card-content {
    position: relative;
    z-index: 1;
    padding: 30px;
    padding-top: 100px;
}

.game-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.game-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.game-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.game-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-meta .rating i {
    color: var(--gold);
}

.game-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.game-badge.popular {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #000;
}

.game-badge.new {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.view-more {
    text-align: center;
}

/* ===== Rewards Section ===== */
.rewards-section {
    background: var(--bg-secondary);
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 60px;
}

.reward-card {
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
}

.reward-card:hover {
    border-color: var(--cyan);
    transform: translateY(-5px);
}

.reward-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #000;
}

.reward-icon.xp {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
}

.reward-icon.badges {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.reward-icon.streaks {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.reward-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.reward-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.reward-examples {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reward-examples span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--cyan);
    background: rgba(20, 255, 236, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
}

/* Level Tiers */
.level-tiers {
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius-lg);
    padding: 40px;
}

.level-tiers h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 35px;
}

.tiers-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.tier {
    text-align: center;
    padding: 20px;
}

.tier-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--transition);
}

.tier:hover .tier-icon {
    transform: scale(1.1);
}

.tier-icon.bronze {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: white;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.4);
}

.tier-icon.silver {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    color: white;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.4);
}

.tier-icon.gold {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.tier-icon.platinum {
    background: linear-gradient(135deg, #e5e4e2, #a0a0a0);
    color: #333;
    box-shadow: 0 0 20px rgba(229, 228, 226, 0.4);
}

.tier-icon.diamond {
    background: linear-gradient(135deg, #b9f2ff, var(--cyan));
    color: #0a1628;
    box-shadow: 0 0 25px var(--cyan-glow);
}

.tier-name {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.tier-levels {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tier-arrow {
    color: var(--cyan);
    font-size: 1.2rem;
    opacity: 0.5;
}

/* ===== Leaderboard Section ===== */
.leaderboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.leaderboard-box {
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius-lg);
    padding: 30px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.leaderboard-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.leaderboard-header h2 i {
    color: var(--gold);
}

.leaderboard-tabs {
    display: flex;
    gap: 8px;
}

.lb-tab {
    padding: 8px 18px;
    background: rgba(20, 255, 236, 0.1);
    border: none;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.lb-tab:hover,
.lb-tab.active {
    background: var(--cyan);
    color: var(--bg-primary);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lb-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.lb-item:hover {
    background: rgba(20, 255, 236, 0.05);
}

.lb-item.rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
    border-left: 3px solid var(--gold);
}

.lb-item.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
    border-left: 3px solid #c0c0c0;
}

.lb-item.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
    border-left: 3px solid #cd7f32;
}

.lb-rank {
    width: 30px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
}

.lb-item.rank-1 .lb-rank { color: var(--gold); }
.lb-item.rank-2 .lb-rank { color: #c0c0c0; }
.lb-item.rank-3 .lb-rank { color: #cd7f32; }

.lb-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-dark), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.lb-info {
    flex: 1;
}

.lb-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.lb-level {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lb-score {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--cyan);
    font-size: 1.1rem;
}

/* Leaderboard CTA */
.leaderboard-cta {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    text-align: center;
}

.cta-cat {
    width: 150px;
    height: 150px;
    margin: 0 auto 25px;
}

.cta-cat-svg {
    width: 100%;
    height: 100%;
}

.leaderboard-cta h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.leaderboard-cta p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== News Section ===== */
.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    display: flex;
    transition: var(--transition);
}

.news-card:hover {
    border-color: var(--cyan);
    transform: translateY(-5px);
}

.news-card.featured {
    grid-column: 1 / -1;
}

.news-card.featured .news-image {
    width: 350px;
    flex-shrink: 0;
}

.news-image {
    width: 180px;
    min-height: 150px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.news-graphic {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.news-image.small .news-graphic {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

.news-content {
    padding: 25px;
    flex: 1;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--cyan);
    margin-bottom: 12px;
}

.news-content h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.news-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.read-more {
    color: var(--orange);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.read-more:hover {
    color: var(--cyan);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-cyan);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    margin-bottom: 20px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 25px;
    max-width: 280px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(20, 255, 236, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--cyan);
    color: var(--bg-primary);
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--cyan);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-bottom i {
    color: #ff6b6b;
}

/* ===== Modals ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 600px;
}

.modal-content.modal-game {
    max-width: 900px;
    height: 85vh;
    padding: 25px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cyan);
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-cat {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.modal-cat-svg {
    width: 100%;
    height: 100%;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper > i {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 1rem;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 14px 15px 14px 45px;
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(20, 255, 236, 0.2);
}

.input-wrapper select {
    cursor: pointer;
    appearance: none;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

.toggle-pw:hover {
    color: var(--cyan);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-wrap input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-cyan);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.checkbox-wrap input:checked + .checkmark {
    background: var(--cyan);
    border-color: var(--cyan);
}

.checkbox-wrap input:checked + .checkmark::after {
    content: '✓';
    color: var(--bg-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.forgot-link {
    color: var(--cyan);
    font-size: 0.9rem;
}

/* Avatar Picker */
.avatar-picker {
    margin-bottom: 25px;
}

.avatar-picker label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.avatar-opt {
    aspect-ratio: 1;
    background: var(--bg-card);
    border: 2px solid var(--border-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.avatar-opt:hover,
.avatar-opt.selected {
    border-color: var(--cyan);
    background: rgba(20, 255, 236, 0.15);
    color: var(--cyan);
}

.modal-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.modal-footer a {
    color: var(--cyan);
    font-weight: 600;
}

/* Shop Modal */
.shop-balance {
    background: rgba(255, 215, 0, 0.1);
    padding: 12px 20px;
    border-radius: 25px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.shop-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
}

.shop-tab {
    padding: 10px 25px;
    background: rgba(20, 255, 236, 0.1);
    border: none;
    border-radius: 25px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition);
}

.shop-tab:hover,
.shop-tab.active {
    background: var(--cyan);
    color: var(--bg-primary);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    max-height: 350px;
    overflow-y: auto;
    padding: 5px;
}

.shop-item {
    background: var(--bg-card);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.shop-item:hover {
    border-color: var(--cyan);
}

.shop-item.owned {
    opacity: 0.5;
}

.shop-item-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--cyan);
}

.shop-item-name {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.shop-item-price {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.shop-item .btn {
    padding: 8px 18px;
    font-size: 0.8rem;
}

/* ===== Game Container ===== */
#gameContainer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    margin-bottom: 25px;
}

.game-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.translation-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.translation-toggle input { cursor: pointer; }

.game-title {
    font-size: 1.3rem;
}

.game-stats {
    display: flex;
    gap: 25px;
}

.game-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.game-stat i {
    font-size: 1.2rem;
}

.game-stat.score i { color: var(--gold); }
.game-stat.timer i { color: var(--cyan); }
.game-stat.streak i { color: #ff6b6b; }
.game-stat.lives i { color: #ff6b6b; }

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.question-box {
    text-align: center;
    margin-bottom: 40px;
}

.question-text {
    font-family: var(--font-display);
    color: var(--text-primary);
}
.question-zh {
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 1.75rem;
    line-height: 1.4;
    margin-bottom: 10px;
}
.question-en {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-family: var(--font-body);
}
.question-keyterms {
    font-size: 0.9rem;
    color: var(--cyan);
    opacity: 0.9;
    margin-bottom: 10px;
}

.question-hint {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 450px;
}

.answer-btn {
    padding: 25px;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    background: rgba(20, 255, 236, 0.1);
    border: 2px solid var(--border-cyan);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: var(--transition);
}

.answer-btn:hover:not(:disabled) {
    background: rgba(20, 255, 236, 0.2);
    border-color: var(--cyan);
    transform: scale(1.02);
}

.answer-btn.correct {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    animation: correctPop 0.4s ease;
}

.answer-btn.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    animation: shake 0.4s ease;
}

@keyframes correctPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.progress-bar {
    width: 100%;
    max-width: 450px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 30px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--orange));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Game Results */
.game-results {
    text-align: center;
    padding: 40px;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 25px;
}

.result-icon.win { color: var(--gold); }
.result-icon.lose { color: #ef4444; }

.result-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 35px 0;
}

.result-stat {
    text-align: center;
}

.result-stat-val {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cyan);
}

.result-stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.rewards-earned {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 35px;
}

.reward-earned {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: rgba(20, 255, 236, 0.1);
    border-radius: var(--border-radius);
    font-weight: 600;
}

.reward-earned.coins i { color: var(--gold); font-size: 1.3rem; }
.reward-earned.xp i { color: var(--cyan); font-size: 1.3rem; }

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-cyan);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s ease;
    min-width: 280px;
}

.toast.success { border-color: #10b981; }
.toast.success .toast-icon { color: #10b981; }

.toast.error { border-color: #ef4444; }
.toast.error .toast-icon { color: #ef4444; }

.toast.info { border-color: var(--cyan); }
.toast.info .toast-icon { color: var(--cyan); }

.toast.reward { border-color: var(--gold); }
.toast.reward .toast-icon { color: var(--gold); }

.toast-icon {
    font-size: 1.4rem;
}

.toast-msg {
    flex: 1;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-cat-section {
        order: 1;
    }
    
    .hero-text-section {
        order: 2;
    }
    
    .hero-text-section p {
        margin-left: auto;
        margin-right: auto;
    }
    
    .cat-wrapper {
        width: 320px;
        height: 320px;
    }
    
    .grade-categories {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rewards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .leaderboard-layout {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .footer-brand p {
        max-width: 100%;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero-frame {
        padding: 40px 25px;
    }
    
    .hero-text-section h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .rewards-grid {
        grid-template-columns: 1fr;
    }
    
    .tiers-row {
        flex-direction: column;
    }
    
    .tier-arrow {
        transform: rotate(90deg);
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-card {
        flex-direction: column;
    }
    
    .news-card.featured .news-image,
    .news-image {
        width: 100%;
        min-height: 120px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .avatar-options {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .result-stats {
        flex-direction: column;
        gap: 25px;
    }
    
    .rewards-earned {
        flex-direction: column;
        align-items: center;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-frame {
        padding: 30px 20px;
    }
    
    .cat-wrapper {
        width: 260px;
        height: 260px;
    }
    
    .hero-text-section h1 {
        font-size: 1.6rem;
    }
    
    .btn-play {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .question-zh {
        font-size: 1.4rem;
    }
    
    .answer-grid {
        grid-template-columns: 1fr;
    }
    
    .answer-btn {
        padding: 20px;
        font-size: 1.5rem;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
    
    .toast {
        min-width: auto;
    }
}