/* ============================================
   ENGLISH - SUPERSITE
   Master Grammar, Vocabulary & Writing!
   ============================================ */

/* Floating Letters Background */
.letters-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.float-letter {
    position: absolute;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.1;
    left: var(--x);
    animation: letterFloat 10s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes letterFloat {

    0%,
    100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0.1;
    }

    50% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0.2;
    }
}

/* Glass Navigation */
.glass-nav {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .glass-nav {
    background: rgba(15, 15, 26, 0.85) !important;
}

.nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-current {
    font-weight: 600;
    background: linear-gradient(135deg, #fa709a, #fee140);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.xp-display {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Main */
.lang-main {
    position: relative;
    z-index: 1;
    padding-top: 80px;
    min-height: 100vh;
}

/* Hero Section */
.lang-hero {
    padding: 3rem 2rem;
    text-align: center;
}

.book-animation {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.book-emoji {
    font-size: 5rem;
    display: inline-block;
    animation: bookBounce 2s ease-in-out infinite;
}

@keyframes bookBounce {

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

    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

.sparkles {
    position: absolute;
    top: -10px;
    right: -20px;
}

.sparkles span {
    position: absolute;
    font-size: 1.5rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

.sparkles span:nth-child(1) {
    top: 0;
    right: 0;
    animation-delay: 0s;
}

.sparkles span:nth-child(2) {
    top: -15px;
    right: 20px;
    animation-delay: 0.3s;
}

.sparkles span:nth-child(3) {
    top: 10px;
    right: -10px;
    animation-delay: 0.6s;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

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

.lang-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fa709a, #fee140);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-sub {
    display: block;
    font-size: 0.5em;
    opacity: 0.9;
}

.lang-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Word of the Day */
.word-of-day {
    display: inline-flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2.5rem;
    text-align: center;
    transition: all 0.3s;
}

.word-of-day:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #fa709a;
}

.wod-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.wod-word {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fa709a, #fee140);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.wod-meaning {
    color: var(--text-secondary);
    font-style: italic;
}

/* Activities Section */
.activities-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Activity Cards */
.activity-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
}

.activity-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(250, 112, 154, 0.2);
}

.card-visual {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grammar-visual {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.vocabulary-visual {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.synonyms-visual {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.antonyms-visual {
    background: linear-gradient(135deg, #f5576c, #f093fb);
}

.idioms-visual {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.spelling-visual {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.scramble-visual {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

.visual-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.difficulty.beginner {
    background: #dcfce7;
    color: #166534;
}

.difficulty.intermediate {
    background: #fef3c7;
    color: #92400e;
}

.difficulty.advanced {
    background: #fee2e2;
    color: #991b1b;
}

.difficulty.legendary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.xp-badge {
    color: #fa709a;
    font-weight: 600;
}

/* Daily Section */
.daily-section {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.daily-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
}

.daily-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.daily-icon {
    font-size: 1.5rem;
}

.daily-label {
    font-size: 1.25rem;
    font-weight: 700;
}

.daily-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.daily-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fa709a, #fee140);
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.daily-reward {
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.1), rgba(254, 225, 64, 0.1));
    border-radius: var(--radius-lg);
    color: #fa709a;
    font-weight: 600;
}

/* ============================================
   QUIZ MODAL
   ============================================ */

.quiz-modal,
.spelling-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 3000;
    display: none;
    overflow-y: auto;
}

.quiz-modal.active,
.spelling-modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.quiz-container,
.spelling-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* close-btn styles are now defined globally in main.css - cute face button */

.quiz-header,
.spelling-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-category {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quiz-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.quiz-body,
.spelling-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.question-box {
    text-align: center;
    margin-bottom: 2rem;
}

.question-emoji {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.5;
}

/* ============================================
   PRONUNCIATION BUTTON - Premium Design
   ============================================ */
.pronounce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.12), rgba(254, 225, 64, 0.12));
    border: 1.5px solid rgba(250, 112, 154, 0.35);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.pronounce-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50px;
    background: linear-gradient(135deg, #fa709a, #fee140, #fa709a);
    background-size: 200% 200%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s ease;
    animation: pronounceBorderShift 3s ease infinite;
}

.pronounce-btn:hover::before {
    opacity: 0.6;
}

.pronounce-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(250, 112, 154, 0.25);
    border-color: rgba(250, 112, 154, 0.6);
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.2), rgba(254, 225, 64, 0.2));
}

.pronounce-btn:active {
    transform: translateY(0) scale(0.97);
}

.pronounce-icon {
    font-size: 1.15rem;
    transition: transform 0.3s ease;
}

.pronounce-btn:hover .pronounce-icon {
    transform: scale(1.15);
}

.pronounce-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fa709a;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

/* Sound Wave Animation Container */
.sound-waves {
    display: none;
    align-items: center;
    gap: 3px;
    margin-left: 0.25rem;
    height: 18px;
}

.sound-waves .wave {
    display: block;
    width: 3px;
    height: 6px;
    background: linear-gradient(180deg, #fa709a, #fee140);
    border-radius: 3px;
    animation: soundWave 0.6s ease-in-out infinite alternate;
}

.sound-waves .wave:nth-child(1) {
    animation-delay: 0s;
    height: 8px;
}

.sound-waves .wave:nth-child(2) {
    animation-delay: 0.15s;
    height: 14px;
}

.sound-waves .wave:nth-child(3) {
    animation-delay: 0.3s;
    height: 10px;
}

/* Speaking State */
.pronounce-btn.speaking {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.22), rgba(254, 225, 64, 0.22));
    border-color: rgba(250, 112, 154, 0.7);
    box-shadow: 0 0 20px rgba(250, 112, 154, 0.2), 0 0 40px rgba(250, 112, 154, 0.08);
}

.pronounce-btn.speaking .sound-waves {
    display: flex;
}

.pronounce-btn.speaking .pronounce-icon {
    animation: pulseIcon 0.8s ease-in-out infinite;
}

/* Animations */
@keyframes soundWave {
    0% {
        transform: scaleY(0.4);
        opacity: 0.6;
    }

    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes pulseIcon {

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

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

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

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

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

/* Subtle entrance animation when button appears */
@keyframes pronounceFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }

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

.pronounce-btn.visible {
    animation: pronounceFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
}

.option-btn {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    border-color: #fa709a;
    background: rgba(250, 112, 154, 0.1);
}

.option-btn.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

.option-btn.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.feedback-box {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
}

.feedback-box.visible {
    display: flex;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.feedback-box.correct {
    background: #dcfce7;
    color: #166534;
}

.feedback-box.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.quiz-footer {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Spelling Modal Specific */
.spelling-hint {
    font-size: 1.1rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.spelling-meaning {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.spelling-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    text-align: center;
    margin-bottom: 1rem;
    font-family: inherit;
}

.spelling-input:focus {
    outline: none;
    border-color: #fa709a;
}

.check-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #fa709a, #fee140);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.check-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   RESULTS MODAL
   ============================================ */

.results-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

.results-modal.active {
    display: flex;
}

.results-box {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: bounceIn 0.5s ease;
}

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

    70% {
        transform: scale(1.05);
    }

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

.results-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.results-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fa709a;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.results-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.btn-explain {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-explain:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-again,
.btn-home {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-again {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
}

.btn-home {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .activities-grid {
        grid-template-columns: 1fr;
    }

    .results-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .score-display {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* ============================================
   LEADERBOARD MODAL
   ============================================ */
.leaderboard-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.leaderboard-modal.active {
    display: flex;
}

.leaderboard-container {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.leaderboard-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.leaderboard-list {
    margin-bottom: 1rem;
}

.your-rank-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: #333;
    border-radius: var(--radius-lg);
}

.your-rank-label {
    font-weight: 600;
}

.your-rank-position {
    font-size: 1.5rem;
    font-weight: 700;
}

.your-rank-score {
    font-weight: 600;
}

/* ============================================
   LEADERBOARD TABS - Premium Glassmorphism Design
   ============================================ */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(250, 112, 154, 0.1);
    border-radius: var(--radius-full);
    border: 1px solid rgba(250, 112, 154, 0.2);
}

.tab-btn {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab-btn:hover:not(.active) {
    background: rgba(250, 112, 154, 0.15);
    color: var(--text-primary);
}

.tab-btn.active {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.4);
    transform: scale(1.02);
}

/* ============================================
   VOCABULARY LEVELS MODAL - Premium Design
   ============================================ */
.vocab-levels-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3500;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.vocab-levels-modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.vocab-levels-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    margin: 1rem auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

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

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

.vocab-levels-header {
    text-align: center;
    margin-bottom: 2rem;
}

.vocab-levels-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.75rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

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

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

.vocab-levels-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fa709a, #fee140);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vocab-levels-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.vocab-levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .vocab-levels-grid {
        grid-template-columns: 1fr;
    }
}

.vocab-level-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: visible;
}

.vocab-level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fa709a, #fee140);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.vocab-level-card:hover:not(.locked) {
    transform: translateY(-8px) scale(1.02);
    border-color: #fa709a;
    box-shadow: 0 15px 40px rgba(250, 112, 154, 0.25);
}

.vocab-level-card:hover:not(.locked)::before {
    transform: scaleX(1);
}

.vocab-level-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.vocab-level-card.locked:hover {
    transform: none;
}

.level-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Premium Level Badge - Larger and More Visible */
.level-badge-premium {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #fa709a, #fee140, #fa709a);
    background-size: 200% 200%;
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(250, 112, 154, 0.5),
        0 0 30px rgba(254, 225, 64, 0.3);
    animation: badgeGlow 3s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes badgeGlow {

    0%,
    100% {
        background-position: 0% 50%;
        box-shadow: 0 4px 20px rgba(250, 112, 154, 0.5),
            0 0 30px rgba(254, 225, 64, 0.3);
    }

    50% {
        background-position: 100% 50%;
        box-shadow: 0 4px 25px rgba(254, 225, 64, 0.6),
            0 0 40px rgba(250, 112, 154, 0.4);
    }
}

.vocab-level-card.locked .level-badge,
.vocab-level-card.locked .level-badge-premium {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    box-shadow: none;
    animation: none;
}

.level-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.3;
    z-index: 1;
}

.level-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: block;
}

.level-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.level-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.level-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.level-words {
    color: var(--text-secondary);
}

.level-xp {
    color: #fa709a;
    font-weight: 600;
}

.level-progress {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.level-progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fa709a, #fee140);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.level-progress-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.vocab-levels-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.vocab-levels-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   MAGICAL GATHRI DESIGN - Premium Animated Pouch
   ============================================ */

/* Main Gathri Card - Redesigned */
.vocab-level-card.gathri-card {
    background: linear-gradient(145deg, rgba(30, 25, 45, 0.95), rgba(20, 15, 35, 0.98));
    border: 2px solid rgba(255, 215, 0, 0.15);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: visible;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.vocab-level-card.gathri-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(250, 112, 154, 0.3), rgba(255, 215, 0, 0.3));
    background-size: 200% 200%;
    animation: borderGlow 4s ease-in-out infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vocab-level-card.gathri-card:hover::before {
    opacity: 1;
}

@keyframes borderGlow {

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

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

.vocab-level-card.gathri-card:hover:not(.locked) {
    transform: translateY(-12px) scale(1.03);
    box-shadow:
        0 20px 60px rgba(255, 215, 0, 0.25),
        0 10px 30px rgba(250, 112, 154, 0.15),
        0 0 80px rgba(255, 215, 0, 0.1);
}

/* The Magical Gathri Pouch */
.gathri-pouch-container {
    position: relative;
    width: 140px;
    height: 160px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gathri-pouch {
    position: relative;
    width: 120px;
    height: 140px;
    animation: gathriFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
}

@keyframes gathriFloat {

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

    50% {
        transform: translateY(-12px) rotate(2deg);
    }
}

/* Pouch Body - Silk/Velvet Effect */
.gathri-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 110px;
    background: linear-gradient(145deg,
            #2d5a3d 0%,
            #1a3a26 25%,
            #0f2518 50%,
            #1a3a26 75%,
            #2d5a3d 100%);
    border-radius: 45% 45% 50% 50% / 40% 40% 60% 60%;
    box-shadow:
        inset -15px -10px 30px rgba(0, 0, 0, 0.5),
        inset 10px 10px 20px rgba(255, 255, 255, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* Silk Shimmer Effect */
.gathri-body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 40%,
            rgba(255, 255, 255, 0.08) 45%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.08) 55%,
            transparent 60%);
    animation: silkShimmer 4s ease-in-out infinite;
}

@keyframes silkShimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Fabric Texture */
.gathri-body::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 8px 8px;
}

/* Golden Rope/Tie at Top */
.gathri-tie {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 25px;
}

.gathri-tie::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg,
            #8B6914 0%,
            #DAA520 25%,
            #FFD700 50%,
            #DAA520 75%,
            #8B6914 100%);
    border-radius: 6px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

/* Rope Knot */
.gathri-knot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #FFD700 0%, #DAA520 50%, #8B6914 100%);
    border-radius: 50%;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

/* Gathri Number Display */
.gathri-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 900;
    color: #FFD700;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Outfit', sans-serif;
    letter-spacing: -2px;
    z-index: 2;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {

    0%,
    100% {
        text-shadow:
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 0.3),
            2px 2px 4px rgba(0, 0, 0, 0.5);
    }

    50% {
        text-shadow:
            0 0 15px rgba(255, 215, 0, 1),
            0 0 30px rgba(255, 215, 0, 0.7),
            0 0 45px rgba(255, 215, 0, 0.4),
            2px 2px 4px rgba(0, 0, 0, 0.5);
    }
}

/* Magical Aura Glow */
.gathri-aura {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
            rgba(255, 215, 0, 0.15) 0%,
            rgba(255, 215, 0, 0.08) 30%,
            rgba(250, 112, 154, 0.05) 50%,
            transparent 70%);
    animation: auraBreath 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auraBreath {

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

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

/* Floating Particles */
.gathri-particles {
    position: absolute;
    inset: -30px;
    pointer-events: none;
    overflow: visible;
}

.gathri-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #FFD700 0%, rgba(255, 215, 0, 0) 70%);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

.gathri-particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.gathri-particle:nth-child(2) {
    top: 30%;
    right: 5%;
    animation-delay: 0.5s;
    width: 4px;
    height: 4px;
}

.gathri-particle:nth-child(3) {
    bottom: 30%;
    left: 5%;
    animation-delay: 1s;
}

.gathri-particle:nth-child(4) {
    bottom: 20%;
    right: 10%;
    animation-delay: 1.5s;
    width: 5px;
    height: 5px;
}

.gathri-particle:nth-child(5) {
    top: 50%;
    left: 0%;
    animation-delay: 2s;
    width: 3px;
    height: 3px;
}

.gathri-particle:nth-child(6) {
    top: 10%;
    right: 20%;
    animation-delay: 2.5s;
}

@keyframes particleFloat {

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

    50% {
        transform: translateY(-15px) scale(1.2);
        opacity: 1;
    }
}

/* Gathri Meta Info */
.gathri-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.gathri-words {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.gathri-xp {
    color: #FFD700;
    font-weight: 700;
    font-size: 0.95rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Progress Bar for Gathri */
.gathri-progress {
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gathri-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.gathri-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #fa709a, #FFD700);
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    animation: progressShimmer 3s ease-in-out infinite;
}

@keyframes progressShimmer {

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

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

.gathri-progress-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ============================================
   LOCKED GATHRI STATE
   ============================================ */

.vocab-level-card.gathri-card.locked {
    cursor: not-allowed;
    filter: grayscale(0.7) brightness(0.6);
}

.vocab-level-card.gathri-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.vocab-level-card.gathri-card.locked::before {
    display: none;
}

.vocab-level-card.gathri-card.locked .gathri-pouch {
    animation: none;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.vocab-level-card.gathri-card.locked .gathri-aura {
    display: none;
}

.vocab-level-card.gathri-card.locked .gathri-particles {
    display: none;
}

.vocab-level-card.gathri-card.locked .gathri-number {
    color: rgba(255, 255, 255, 0.3);
    text-shadow: none;
    animation: none;
}

.vocab-level-card.gathri-card.locked .gathri-body {
    background: linear-gradient(145deg,
            #3a3a3a 0%,
            #2a2a2a 25%,
            #1a1a1a 50%,
            #2a2a2a 75%,
            #3a3a3a 100%);
}

.vocab-level-card.gathri-card.locked .gathri-body::before {
    display: none;
}

.vocab-level-card.gathri-card.locked .gathri-tie::before,
.vocab-level-card.gathri-card.locked .gathri-knot {
    background: linear-gradient(90deg, #555, #666, #555);
}

/* Lock Icon Overlay */
.gathri-lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.5;
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

/* Dark Mode for Vocabulary Levels */
[data-theme="dark"] .vocab-level-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .vocab-level-card:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(250, 112, 154, 0.5);
}

[data-theme="dark"] .vocab-levels-container {
    background: var(--bg-primary);
}

/* ============================================
   MOBILE FIXES - Vocabulary Levels Modal
   Ensures scrolling works and close button is always visible
   ============================================ */

/* Mobile-first fixes for all level selection modals */
@media (max-width: 768px) {

    /* Modal covers full screen and scrolls */
    .vocab-levels-modal {
        padding: 0;
        z-index: 10000 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: var(--bg-primary) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Container inherits scroll from modal */
    .vocab-levels-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 1rem;
        padding-top: 4rem;
        /* Space for fixed close button */
        padding-bottom: 2rem;
        min-height: auto;
        max-height: none;
        overflow-y: visible;
    }

    /* Close button is now a direct child of the modal - truly fixed to viewport */
    .vocab-levels-modal>.vocab-modal-close,
    .vocab-levels-modal>.close-modal {
        position: fixed !important;
        top: 0.75rem !important;
        right: 0.75rem !important;
        z-index: 10001 !important;
        /* Ensure it's visible over everything */
        background-color: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.5) !important;
    }

    /* Dark mode backdrop adjustment */
    [data-theme="dark"] .vocab-levels-modal>.vocab-modal-close,
    [data-theme="dark"] .vocab-levels-modal>.close-modal {
        background-color: rgba(30, 30, 40, 0.95) !important;
    }

    /* Reduce header padding on mobile */
    .vocab-levels-header {
        margin-bottom: 1.5rem;
    }

    .vocab-levels-icon {
        font-size: 3rem;
    }

    .vocab-levels-title {
        font-size: 1.5rem;
    }

    .vocab-levels-subtitle {
        font-size: 0.9rem;
    }

    /* Single column grid for better scrolling */
    .vocab-levels-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Slightly reduce card padding for mobile */
    .vocab-level-card {
        padding: 1.25rem;
    }

    /* Reduce premium badge size on mobile */
    .level-badge-premium {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }

    .level-icon {
        font-size: 2.5rem;
    }

    /* Footer adjustments */
    .vocab-levels-footer {
        padding-top: 0.75rem;
        padding-bottom: 1rem;
    }

    .vocab-levels-footer p {
        font-size: 0.85rem;
    }

    /* Magical Gathri Mobile Adjustments */
    .vocab-level-card.gathri-card {
        min-height: 260px;
        padding: 1.25rem 1rem;
    }

    .gathri-pouch-container {
        width: 120px;
        height: 140px;
        margin-bottom: 0.75rem;
    }

    .gathri-pouch {
        width: 100px;
        height: 120px;
    }

    .gathri-body {
        width: 85px;
        height: 95px;
    }

    .gathri-number {
        font-size: 2rem;
    }

    .gathri-tie {
        width: 50px;
        height: 22px;
        top: 12px;
    }

    .gathri-knot {
        width: 16px;
        height: 16px;
    }

    .gathri-words {
        font-size: 0.85rem;
    }

    .gathri-xp {
        font-size: 0.9rem;
    }

    .gathri-lock-overlay {
        font-size: 2.5rem;
    }
}

/* Extra small screens (very small phones) */
@media (max-width: 380px) {
    .vocab-levels-container {
        padding: 0.75rem;
        padding-top: 4.5rem;
    }

    .vocab-levels-title {
        font-size: 1.3rem;
    }

    .level-badge-premium {
        padding: 0.4rem 1.25rem;
        font-size: 0.9rem;
    }

    .vocab-level-card {
        padding: 1rem;
    }

    .level-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .level-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ============================================
   DARK MODE FIXES - English Section
   ============================================ */

/* Option Buttons */
.option-btn {
    color: var(--text-primary);
}

[data-theme="dark"] .option-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

[data-theme="dark"] .option-btn:hover:not(:disabled) {
    background: rgba(250, 112, 154, 0.2);
    border-color: rgba(250, 112, 154, 0.5);
}

[data-theme="dark"] .option-btn.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    color: #51cf66;
}

[data-theme="dark"] .option-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ff6b6b;
}

/* Difficulty Badges */
[data-theme="dark"] .difficulty.beginner {
    background: rgba(22, 101, 52, 0.3);
    color: #51cf66;
}

[data-theme="dark"] .difficulty.intermediate {
    background: rgba(146, 64, 14, 0.3);
    color: #fbbf24;
}

[data-theme="dark"] .difficulty.advanced {
    background: rgba(153, 27, 27, 0.3);
    color: #ff6b6b;
}

/* Spelling Input */
[data-theme="dark"] .spelling-input {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

[data-theme="dark"] .spelling-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Feedback Boxes */
[data-theme="dark"] .feedback-box.correct {
    background: rgba(34, 197, 94, 0.2);
    color: #51cf66;
}

[data-theme="dark"] .feedback-box.wrong {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
}

/* Pronunciation Button - Dark Mode */
[data-theme="dark"] .pronounce-btn {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.15), rgba(254, 225, 64, 0.1));
    border-color: rgba(250, 112, 154, 0.4);
}

[data-theme="dark"] .pronounce-btn:hover {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.25), rgba(254, 225, 64, 0.18));
    border-color: rgba(250, 112, 154, 0.65);
    box-shadow: 0 6px 28px rgba(250, 112, 154, 0.2);
}

[data-theme="dark"] .pronounce-label {
    color: #f882a8;
}

[data-theme="dark"] .pronounce-btn.speaking {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.28), rgba(254, 225, 64, 0.15));
    box-shadow: 0 0 25px rgba(250, 112, 154, 0.25), 0 0 50px rgba(250, 112, 154, 0.1);
}

/* Activity Cards */
[data-theme="dark"] .activity-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Word of Day */
[data-theme="dark"] .word-of-day {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Daily Card */
[data-theme="dark"] .daily-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Buttons */
[data-theme="dark"] .btn-home {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* close-btn dark mode styles are now defined globally in main.css */

/* Quiz Footer */
[data-theme="dark"] .quiz-footer {
    background: rgba(255, 255, 255, 0.05);
}

/* Results */
[data-theme="dark"] .results-box {
    background: var(--bg-primary);
}

[data-theme="dark"] .stat-label {
    color: rgba(255, 255, 255, 0.6);
}

/* Leaderboard Items */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
}

.leaderboard-item.is-player {
    border: 2px solid #fa709a;
}

.rank-number {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 35px;
}

.player-avatar {
    font-size: 1.5rem;
}

.player-name {
    flex: 1;
    font-weight: 600;
}

.player-score {
    font-weight: 700;
    color: #fa709a;
}

[data-theme="dark"] .leaderboard-item {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

[data-theme="dark"] .leaderboard-item.top-1,
[data-theme="dark"] .leaderboard-item.top-2,
[data-theme="dark"] .leaderboard-item.top-3 {
    color: #000000;
}

[data-theme="dark"] .leaderboard-tabs .tab-btn {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .leaderboard-tabs .tab-btn.active {
    color: #ffffff;
}

/* close-modal styles are now defined globally in main.css */

/* ============================================
   PREMIUM SORT TOGGLE BUTTON
   ============================================ */
.sort-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.sort-toggle-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.sort-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.sort-toggle-btn:hover::before {
    transform: translateX(100%);
}

.sort-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.sort-toggle-btn .sort-icon {
    font-size: 1.1rem;
    font-weight: 700;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: inline-block;
}

.sort-toggle-btn.descending .sort-icon {
    transform: rotate(180deg);
}

.sort-toggle-btn .sort-text {
    transition: opacity 0.2s ease;
}

/* Light variant for colored backgrounds (like BroGrammar header) */
.sort-toggle-btn.sort-toggle-light {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sort-toggle-btn.sort-toggle-light:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Dark theme adjustments */
[data-theme="dark"] .sort-toggle-btn:not(.sort-toggle-light) {
    background: linear-gradient(135deg, #764ba2, #667eea);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
}

[data-theme="dark"] .sort-toggle-btn:not(.sort-toggle-light):hover {
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .sort-toggle-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .sort-toggle-btn .sort-icon {
        font-size: 1rem;
    }
}

/* Sort animation keyframes */
@keyframes sortFadeIn {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }

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

/* Enable flexbox for ordering */
#vocabLevelsGrid,
#grammarLevelsGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

#vocabLevelsGrid>.vocab-level-card,
#grammarLevelsGrid>.vocab-level-card {
    flex: 1 1 280px;
    max-width: 400px;
}