/* Next Level: Word Guess Dictionary Design System */
:root {
    /* Core Palette */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --secondary-dark: #db2777;
    --accent-color: #f59e0b;
    --xp-color: #10b981;
    --warning-color: #f1c40f;

    /* Dynamic Backgrounds */
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;

    /* Glassmorphism Tokens */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-dark: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-border-dark: rgba(255, 255, 255, 0.1);

    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --radius: 24px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Initial Defaults */
    --current-bg: var(--bg-light);
    --text-color: var(--text-main);
    --card-bg: #ffffff;
    --container-bg: #f1f5f9;
    --border-color: #e2e8f0;
}

[data-theme="dark"] {
    --current-bg: var(--bg-dark);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: #1e293b;
    --container-bg: #334155;
    --border-color: #475569;
    --secondary-dark: #be185d;
}

/* 🔥 NEXT LEVEL: PREMIUM THEMES */
[data-theme="cyberpunk"] {
    --primary-color: #00ff9f;
    --secondary-color: #ff0055;
    --secondary-dark: #cc0044;
    --accent-color: #00d4ff;
    --glass-bg: rgba(10, 10, 20, 0.8);
    --text-main: #00ff9f;
    --glass-border: rgba(0, 255, 159, 0.3);
    --shadow: 0 0 20px rgba(0, 255, 159, 0.2);
}

[data-theme="zen"] {
    --primary-color: #5c6e58;
    --secondary-color: #84a98c;
    --secondary-dark: #52796f;
    --accent-color: #344e41;
    --glass-bg: rgba(218, 227, 212, 0.6);
    --text-main: #344e41;
    --glass-border: rgba(163, 177, 138, 0.4);
    --shadow: 0 10px 30px rgba(163, 177, 138, 0.2);
}

/* Aura Animations */
.aura-glow {
    position: relative;
}

.aura-glow::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0.15;
    border-radius: inherit;
    z-index: -1;
    animation: auraPulse 3s infinite alternate;
}

@keyframes auraPulse {
    0% {
        transform: scale(1);
        opacity: 0.1;
    }

    100% {
        transform: scale(1.05);
        opacity: 0.25;
    }
}

body {
    font-family: 'Poppins', 'Noto Sans Telugu', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top left, #fdfcfb 0%, #e2d1c3 100%);
    background-attachment: fixed;
    color: var(--text-color);
    transition: var(--transition);
    overflow-x: hidden;
}

[data-theme="dark"] body {
    background: radial-gradient(circle at top left, #1e293b 0%, #0f172a 100%);
}

/* 🔥 PREMIUM LANDING PAGE */
.hero-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: inherit;
    z-index: 1000;
    text-align: center;
    padding: 20px;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-section.hidden {
    opacity: 0;
    transform: translateY(-50px);
    pointer-events: none;
}

.hero-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeInDown 1s ease-out;
}

.hero-logo {
    font-size: 6rem;
    margin: 0 auto 20px auto;
    width: fit-content;
    filter: drop-shadow(0 0 20px var(--primary-color));
    animation: float 4s ease-in-out infinite;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

.start-btn {
    padding: 20px 50px;
    font-size: 1.5rem;
    border-radius: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: bounceIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.6s backwards;
}

/* Animations */
@keyframes float {

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

    50% {
        transform: translateY(-20px);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

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

    70% {
        transform: scale(0.9);
    }

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

.start-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.6);
}

.main-game-wrapper {
    transition: all 0.8s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    /* Prevent interaction while hidden */
}

.main-game-wrapper.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.main-game-wrapper {
    transition: all 0.8s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.95);
}

.main-game-wrapper.visible {
    opacity: 1;
    transform: scale(1);
}

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

[data-theme="dark"] body {
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #312e81, #1e1b4b);
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.container {
    width: 95%;
    max-width: 1000px;
    margin: 2rem auto;
    background-color: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 40px;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .container {
    background-color: var(--glass-bg-dark);
    border-color: var(--glass-border-dark);
}

.share-preview {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px dashed var(--primary-color);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* 🔥 NEXT LEVEL: XP & LEVEL SYSTEM */
.user-rank-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.level-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 6px 16px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.xp-container {
    flex-grow: 1;
    margin: 0 25px;
    position: relative;
}

.xp-bar-bg {
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.xp-text {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 6px;
    text-align: right;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Achievements Button & Modal Content */
.achievements-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievements-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 20px 15px;
    text-align: center;
    transition: var(--transition);
    filter: grayscale(1) opacity(0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.achievement-card.unlocked {
    filter: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.achievement-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
}

.achievement-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* 🔥 NEXT LEVEL: CATEGORY TABS */
.category-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 0 20px;
    margin-bottom: 10px;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--text-color);
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Rapid Fire Timer */
.timer-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: none;
    /* Only show in rapid fire mode */
}

.timer-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    transition: var(--transition);
    border-radius: 50%;
}

.theme-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: rotate(15deg);
}

[data-theme="dark"] .theme-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 400;
}

/* Stats Container */
.stats-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    flex: 1;
    min-width: 180px;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.25);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(52, 152, 219, 0.35);
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Word Display Section */
.word-display {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.word-display h2 {
    color: var(--text-main);
    margin-bottom: 25px;
    text-align: center;
    font-size: 2rem;
}

.meaning-container {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.meaning-box {
    flex: 1;
    min-width: 320px;
    background-color: var(--container-bg);
    padding: 25px;
    border-radius: 15px;
    border-left: 6px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.meaning-box:hover {
    transform: translateX(5px);
}

.meaning-box h3 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.meaning-box h3 i {
    color: var(--accent-color);
}

.meaning-box p {
    font-size: 1.4rem;
    color: var(--text-main);
    min-height: 70px;
    line-height: 1.5;
}

#telugu-meaning {
    font-family: 'Noto Sans Telugu', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
}

.hint-box {
    background-color: rgba(241, 196, 15, 0.1);
    border-radius: 12px;
    padding: 20px;
    border-left: 6px solid var(--warning-color);
    margin-top: 20px;
}

.hint-box p {
    margin: 0;
    color: var(--text-main);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.input-wrapper {
    position: relative;
    flex: 3;
    display: flex;
    align-items: center;
    min-width: 280px;
}

.voice-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.voice-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
}

.voice-btn.listening {
    color: #ef4444;
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

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

#word-input {
    width: 100%;
    padding: 20px 55px 20px 25px;
    font-size: 1.3rem;
    border: 2px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-main);
    border-radius: 15px;
    outline: none;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

#word-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

#word-input.shake {
    animation: shake 0.5s ease-in-out;
    border-color: var(--accent-color);
}

@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

.btn-primary,
.btn-secondary,
.btn-control {
    padding: 18px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    flex: 1;
    min-width: 150px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #95a5a6;
    box-shadow: none;
}

#pronounce-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background-color: var(--card-bg);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    flex: 1;
    min-width: 180px;
}

.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

/* Feedback Container */
.feedback-container {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.feedback-message {
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.feedback-correct {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--secondary-dark);
    border-left: 6px solid var(--secondary-color);
}

.feedback-wrong {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--accent-color);
    border-left: 6px solid var(--accent-color);
}

.feedback-info {
    background-color: rgba(52, 152, 219, 0.15);
    color: var(--primary-color);
    border-left: 6px solid var(--primary-color);
}

.answer-display {
    padding: 20px;
    background-color: var(--container-bg);
    border-radius: 12px;
    font-size: 1.3rem;
    text-align: center;
    font-weight: 500;
    color: var(--text-main);
}

/* Progress Section */
.progress-container {
    margin-bottom: 30px;
}

.progress-label {
    display: none;
    /* Hide 0/760 as requested by user */
}

.progress-bar {
    height: 18px;
    background-color: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    width: 0%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.btn-control {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1.5px solid var(--border-color);
    flex: 1;
    min-width: 220px;
    backdrop-filter: blur(5px);
}

.btn-control:hover {
    opacity: 0.9;
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1rem;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--text-main);
    width: 90%;
    max-width: 750px;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    transform: scale(0.9);
    opacity: 0;
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.close-modal {
    font-size: 2.5rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close-modal:hover {
    transform: scale(1.2) rotate(90deg);
}

.modal-body {
    padding: 40px;
    max-height: 75vh;
    overflow-y: auto;
}

/* Custom Scrollbar */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--border-color);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.instruction-step {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    align-items: center;
}

.step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.step-content h3 {
    color: var(--text-main);
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.tip-box {
    background-color: var(--container-bg);
    border-radius: 20px;
    padding: 25px;
    margin-top: 40px;
    border-left: 6px solid var(--warning-color);
}

.tip-box h4 {
    color: var(--warning-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tip-box ul {
    padding-left: 20px;
}

.tip-box li {
    margin-bottom: 12px;
}

/* Difficulty Options */
.difficulty-option {
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    background-color: var(--container-bg);
}

.difficulty-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.difficulty-option.active {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.difficulty-option h3 {
    color: var(--text-main);
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.difficulty-tags {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   📱 MOBILE-FIRST RESPONSIVE DESIGN — PREMIUM FEEL
   ═══════════════════════════════════════════════════════ */

/* --- Tablet (≤ 820px) --- */
@media (max-width: 820px) {
    .container {
        padding: 20px;
        margin: 1rem auto;
        width: 96%;
    }

    header h1 {
        font-size: 2rem;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-box {
        min-width: unset;
        padding: 15px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .meaning-box {
        min-width: 100%;
    }

    .input-container {
        flex-direction: column;
        gap: 12px;
    }

    #word-input,
    .btn-primary {
        width: 100%;
        min-width: unset;
    }

    /* Tab scroll mask for premium feel */
    .category-tabs {
        gap: 8px;
        padding: 5px 0 15px;
        -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 90%, transparent);
        mask-image: linear-gradient(to right, transparent, black 5%, black 90%, transparent);
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .game-controls {
        gap: 10px;
    }

    .btn-control {
        min-width: unset;
        flex: 1 1 calc(50% - 10px);
    }
}

/* --- Phone (≤ 600px) --- */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
    }

    .container {
        padding: 16px;
        border-radius: 18px;
        margin: 0.5rem auto;
    }

    /* Hero Section Mobile */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 10px;
    }

    .hero-logo {
        font-size: 4rem;
    }

    .start-btn {
        padding: 16px 40px;
        font-size: 1.2rem;
    }

    /* Header */
    header {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    header h1 {
        font-size: 1.6rem;
        gap: 8px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    /* XP Section */
    .user-rank-section {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 15px;
    }

    .achievements-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Stats */
    .stat-box {
        padding: 10px;
        border-radius: 14px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Word Display */
    .word-display {
        padding: 16px;
        border-radius: 16px;
    }

    .word-display h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .meaning-box {
        padding: 18px;
        border-radius: 12px;
    }

    .meaning-box h3 {
        font-size: 1.1rem;
        gap: 8px;
    }

    .meaning-box p {
        font-size: 1rem;
        min-height: auto;
        line-height: 1.5;
    }

    #telugu-meaning {
        font-size: 1.1rem;
    }

    .hint-box {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    /* Input */
    .input-wrapper {
        border-radius: 14px;
    }

    #word-input {
        font-size: 1rem;
        padding: 14px 50px 14px 18px;
    }

    .voice-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-control {
        padding: 13px 18px;
        font-size: 0.95rem;
        border-radius: 14px;
    }

    .action-buttons {
        gap: 10px;
    }

    .btn-secondary {
        min-width: unset;
        flex: 1 1 calc(33% - 10px);
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    /* Feedback */
    .feedback-message {
        font-size: 1rem;
        padding: 15px;
        min-height: 55px;
        border-radius: 12px;
    }

    .feedback-container {
        padding: 18px;
        border-radius: 16px;
    }

    .answer-display {
        font-size: 1.1rem;
        padding: 15px;
    }

    /* Game Controls */
    .game-controls {
        gap: 8px;
        margin-bottom: 25px;
    }

    .btn-control {
        min-width: unset;
        flex: 1 1 calc(50% - 8px);
    }

    /* Footer */
    footer {
        font-size: 0.85rem;
        padding-top: 20px;
    }

    /* Modals — Bottom Sheet Feel */
    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 18px 20px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--card-bg);
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 18px 20px;
    }

    .instruction-step {
        gap: 12px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .difficulty-option {
        padding: 20px;
    }
}

/* --- Small Phone (≤ 400px) --- */
@media (max-width: 400px) {
    .container {
        padding: 12px;
        margin: 0.3rem auto;
        border-radius: 14px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .start-btn {
        padding: 14px 32px;
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .tab-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    .theme-toggle {
        margin-bottom: 8px;
    }

    .btn-secondary {
        flex: 1 1 100%;
    }

    .meaning-box h3 {
        font-size: 1rem;
    }

    .meaning-box p {
        font-size: 0.95rem;
    }
}

/* About, Contact, Privacy Sections */
.about-section,
.contact-section,
.privacy-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.about-section:last-child,
.contact-section:last-child,
.privacy-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.contact-method {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    padding: 25px;
    background-color: var(--container-bg);
    border-radius: 15px;
    border-left: 6px solid var(--primary-color);
    margin-bottom: 20px;
    transition: var(--transition);
}

.contact-method:hover {
    transform: translateX(10px);
}

.contact-method i {
    font-size: 2.2rem;
    color: var(--primary-color);
}

/* Spinner for pronounce button */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}