/* ===== CSS Variables — Neon Arcade ===== */
:root {
    --primary: #00f0ff;
    --primary-dark: #00c4d4;
    --primary-light: #66f7ff;
    --secondary: #ff2d7c;
    --accent: #ffb800;
    --background: #080810;
    --surface: #10101e;
    --surface-light: #1a1a30;
    --surface-hover: #222240;
    --text-primary: #eef0f6;
    --text-secondary: #8b8fa8;
    --text-muted: #555874;
    --success: #00e676;
    --warning: #ffb800;
    --danger: #ff3d5a;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(0, 240, 255, 0.15);
    --font-display: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --grid-color: rgba(0, 240, 255, 0.04);
    --grid-color-bright: rgba(0, 240, 255, 0.08);
}

.hidden {
    display: none !important;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ===== Background Effects — Animated Grid ===== */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Animated grid lines */
.background-effects::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 25s linear infinite;
}

/* Grain overlay */
.background-effects::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.5;
}

@keyframes gridMove {
    0% {
        background-position: 0 0, 0 0;
    }

    100% {
        background-position: 60px 60px, 60px 60px;
    }
}

/* Gradient orbs — now with cyan/magenta */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 22s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -8s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    top: 40%;
    left: 60%;
    animation-delay: -15s;
}

@keyframes float {

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

    33% {
        transform: translateY(-20px) rotate(3deg);
    }

    66% {
        transform: translateY(15px) rotate(-3deg);
    }
}

/* ===== Mode Selection Screen ===== */
.mode-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
}

.mode-container {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.mode-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow:
        0 0 20px rgba(0, 240, 255, 0.5),
        0 0 60px rgba(0, 240, 255, 0.2);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.mode-subtitle {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
}

.mode-options {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    width: 200px;
    background: var(--surface);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: modeCardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mode-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.mode-btn:nth-child(2) {
    animation-delay: 0.2s;
}

.mode-btn:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes modeCardEntry {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

/* Hover glow line at top */
.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-btn:hover::before {
    opacity: 1;
}

.mode-btn:hover {
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateY(-6px);
    box-shadow:
        0 8px 30px rgba(0, 240, 255, 0.15),
        inset 0 1px 0 rgba(0, 240, 255, 0.1);
    background: var(--surface-light);
}

.mode-icon {
    font-size: 2.75rem;
}

.mode-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mode-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== Header ===== */
.header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(16, 16, 30, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6));
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    letter-spacing: -0.01em;
    transition: letter-spacing 0.3s ease;
}

.logo:hover .logo-text {
    letter-spacing: 0.08em;
}

.stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-light);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Stat colors */
.stat-correct .stat-number {
    color: var(--success) !important;
}

.stat-wrong .stat-number {
    color: var(--danger) !important;
}

/* Typing Timer Display */
.typing-timer-display .stat-number {
    color: var(--warning) !important;
    font-weight: 800;
    transition: color 0.3s ease;
}

.typing-timer-display.timer-warning .stat-number {
    color: var(--danger) !important;
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {

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

    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

/* ===== Main Content ===== */
.main-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1.5rem;
}

/* ===== Back Button ===== */
.back-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 50;
}

.back-btn:hover {
    background: var(--surface-light);
    color: var(--primary);
    border-color: rgba(0, 240, 255, 0.3);
}

/* ===== Timer Display ===== */
.timer-display {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--danger) 0%, #cc1133 100%);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 20px rgba(255, 61, 90, 0.4);
    z-index: 50;
}

.timer-icon {
    font-size: 1.25rem;
}

/* ===== Flashcard ===== */
.card-container {
    perspective: 1500px;
    width: 100%;
    max-width: 550px;
    animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

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

.flashcard {
    width: 100%;
    aspect-ratio: 3/2;
    cursor: pointer;
    position: relative;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-light) 100%);
    border: 1px solid rgba(0, 240, 255, 0.1);
    box-shadow:
        var(--shadow-lg),
        0 0 40px rgba(0, 240, 255, 0.08);
    text-align: center;
    gap: 1.25rem;
}

.card-back {
    transform: rotateY(180deg);
    border-color: rgba(255, 45, 124, 0.15);
    box-shadow:
        var(--shadow-lg),
        0 0 40px rgba(255, 45, 124, 0.08);
}

.card-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--background);
    box-shadow: 0 2px 12px rgba(0, 240, 255, 0.3);
}

.badge-tr {
    background: linear-gradient(135deg, #cc1e5c 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(255, 45, 124, 0.3);
}

.word {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
    letter-spacing: -0.02em;
}

.sentence {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 90%;
    font-style: italic;
}

.hint {
    position: absolute;
    bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.flashcard:hover .hint {
    opacity: 1;
    color: var(--primary-light);
}

.hint-icon {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

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

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

/* ===== Swipe Indicators ===== */
.swipe-indicators {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
    z-index: 5;
}

.swipe-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.swipe-indicator span {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
}

.swipe-indicator .indicator-icon {
    font-size: 1.75rem;
}

.swipe-left {
    background: rgba(255, 61, 90, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 61, 90, 0.3);
}

.swipe-right {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

/* ===== Controls ===== */
.controls {
    display: flex;
    gap: 0.75rem;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.4s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-correct {
    background: linear-gradient(135deg, var(--success) 0%, #00c462 100%);
    color: var(--background);
    box-shadow: 0 4px 16px rgba(0, 230, 118, 0.3);
}

.btn-correct:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 230, 118, 0.4);
}

.btn-wrong {
    background: linear-gradient(135deg, var(--danger) 0%, #cc1133 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 61, 90, 0.3);
}

.btn-wrong:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 61, 90, 0.4);
}

.btn-flip {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--background);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.3);
}

.btn-flip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 240, 255, 0.4);
}

.btn:active {
    transform: translateY(0);
}

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

.btn:hover .btn-icon {
    transform: translateX(3px);
}

.btn-secondary:hover .btn-icon {
    transform: translateX(-3px);
}

/* ===== Swipe Animations ===== */
.flashcard.swiping-right {
    animation: swipeRight 0.25s ease forwards;
}

.flashcard.swiping-left {
    animation: swipeLeft 0.25s ease forwards;
}

.flashcard.swiping-right~.swipe-indicators .swipe-right,
.card-container:has(.swiping-right)~.swipe-indicators .swipe-right {
    opacity: 1;
}

.flashcard.swiping-left~.swipe-indicators .swipe-left,
.card-container:has(.swiping-left)~.swipe-indicators .swipe-left {
    opacity: 1;
}

@keyframes swipeRight {
    0% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateX(150%) rotate(15deg);
        opacity: 0;
    }
}

@keyframes swipeLeft {
    0% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-150%) rotate(-15deg);
        opacity: 0;
    }
}

.flashcard.entering {
    animation: cardEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEnter {
    0% {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

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

/* ===== Progress ===== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.progress-text {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 1.25rem;
    background: rgba(16, 16, 30, 0.7);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 240, 255, 0.06);
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}



/* ===== Typing Game Mode ===== */
.typing-game-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--background);
    padding: 2rem;
    padding-top: 100px;
    gap: 1.5rem;
    overflow-y: auto;
}

/* Game Mode Header */
.game-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(16, 16, 30, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.08);
    z-index: 50;
}

.game-header .logo:hover {
    opacity: 0.8;
}

.game-stats {
    display: flex;
    gap: 1.5rem;
}

.typing-game-screen .back-btn,
.sentence-game-screen .back-btn {
    position: absolute;
    top: 70px;
    left: 1.5rem;
}

.typing-card-container {
    width: 100%;
    max-width: 500px;
}

.typing-card {
    position: relative;
    padding: 2.5rem 2rem;
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-light) 100%);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow:
        var(--shadow-lg),
        0 0 40px rgba(0, 240, 255, 0.06);
    text-align: center;
}

.typing-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--background);
    box-shadow: 0 2px 12px rgba(0, 240, 255, 0.3);
}

.typing-badge.turkish {
    background: linear-gradient(135deg, #cc1e5c 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(255, 45, 124, 0.3);
}

.typing-word {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 25px rgba(0, 240, 255, 0.12);
    letter-spacing: -0.02em;
    margin-top: 0.75rem;
}

.typing-sentence {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.5;
    max-width: 90%;
}

.typing-input-area {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.typing-input {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    text-align: center;
    transition: all 0.25s ease;
    outline: none;
}

.typing-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    background: var(--surface-light);
}

.typing-input::placeholder {
    color: var(--text-muted);
}

.typing-submit-btn {
    width: 100%;
    padding: 0.9rem 2rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--background);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.typing-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 240, 255, 0.35);
}

.typing-feedback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.9rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    animation: feedbackPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.typing-feedback.correct {
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--success);
}

.typing-feedback.wrong {
    background: rgba(255, 61, 90, 0.12);
    border: 1px solid rgba(255, 61, 90, 0.3);
    color: var(--danger);
}

@keyframes feedbackPop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    50% {
        transform: scale(1.03);
    }

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

.typing-progress {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Leaderboard ===== */
.leaderboard {
    width: 100%;
    max-width: 500px;
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-light) 100%);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: feedbackPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 240, 255, 0.08);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.leaderboard-row.leaderboard-top {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.1);
}

.lb-rank {
    font-size: 1.1rem;
    min-width: 2rem;
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
}

.lb-score {
    flex: 1;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--success);
}

.lb-wrong {
    font-size: 0.8rem;
    color: var(--danger);
    opacity: 0.8;
}

.lb-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 90px;
    text-align: right;
}

.leaderboard-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 1rem;
}

.leaderboard-play-btn {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.8rem 2rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--background);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 240, 255, 0.35);
}

/* ===== Sentence Game Mode ===== */
.sentence-game-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--background);
    padding: 2rem;
    gap: 1.5rem;
}

.sentence-card-container {
    width: 100%;
    max-width: 600px;
}

.sentence-card {
    padding: 2.5rem 2rem;
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-light) 100%);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow:
        var(--shadow-lg),
        0 0 40px rgba(0, 240, 255, 0.06);
    text-align: center;
}

.sentence-text {
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.8;
}

.sentence-translation {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 240, 255, 0.06);
    line-height: 1.6;
    text-align: center;
    position: relative;
}

.sentence-translation .tr-flag {
    position: absolute;
    left: 0;
    top: 1rem;
    font-style: normal;
}

.sentence-text .blank {
    display: inline-block;
    min-width: 100px;
    padding: 0.2rem 0.8rem;
    margin: 0 0.25rem;
    background: var(--surface-light);
    border-radius: 6px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary-light);
    font-weight: 700;
    transition: all 0.3s ease;
}

.sentence-text .blank.filled {
    background: rgba(0, 240, 255, 0.1);
    border-bottom-color: var(--success);
    color: var(--success);
}

.sentence-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
}

.option-btn {
    padding: 0.9rem 1rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.option-english {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.option-turkish {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
}

.option-btn:hover:not(:disabled) {
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.12);
    background: var(--surface-light);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn.correct {
    background: rgba(0, 230, 118, 0.1);
    border-color: rgba(0, 230, 118, 0.4);
    color: var(--success);
    animation: correctGlow 0.5s ease;
}

.option-btn.correct .option-english {
    color: var(--success);
}

.option-btn.wrong {
    background: rgba(255, 61, 90, 0.1);
    border-color: rgba(255, 61, 90, 0.4);
    color: var(--danger);
    animation: wrongShake 0.4s ease;
}

.option-btn.wrong .option-english {
    color: var(--danger);
}

@keyframes correctGlow {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(0, 230, 118, 0);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 230, 118, 0.4);
    }
}

@keyframes wrongShake {

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

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

.sentence-progress {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}



/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .stats {
        gap: 1.25rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .card-container {
        max-width: 100%;
    }

    .flashcard {
        aspect-ratio: 4/3;
    }

    .card-front,
    .card-back {
        padding: 2rem 1.5rem;
    }

    .word {
        font-size: 1.75rem;
    }

    .sentence {
        font-size: 0.95rem;
    }

    .controls {
        width: 100%;
    }

    .btn {
        flex: 1;
        justify-content: center;
        padding: 0.8rem 1.25rem;
    }

    .mode-title {
        font-size: 2.5rem;
    }

    .mode-btn {
        width: 170px;
        padding: 1.5rem;
    }

    .typing-word {
        font-size: 2rem;
    }

    .typing-input {
        font-size: 1.05rem;
    }

    .sentence-text {
        font-size: 1.2rem;
    }

    .sentence-options {
        grid-template-columns: 1fr;
    }

    .option-btn {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .word {
        font-size: 1.5rem;
    }

    .sentence {
        font-size: 0.85rem;
    }

    .card-badge {
        font-size: 0.6rem;
        padding: 0.35rem 0.7rem;
    }

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

    .mode-btn {
        width: 100%;
    }

    .typing-word {
        font-size: 1.75rem;
    }

    .sentence-text {
        font-size: 1rem;
    }
}

/* ===== Accessibility: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .background-effects::before {
        animation: none;
    }

    .gradient-orb {
        animation: none;
    }

    .hint-icon {
        animation: none;
    }

    .flashcard.swiping-right,
    .flashcard.swiping-left {
        animation-duration: 0.01s;
    }

    .mode-btn {
        animation: none;
        opacity: 1;
    }
}

/* ===== Grid Game Mode (Kelime Avı) ===== */
.grid-game-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--background);
    padding: 2rem;
    padding-top: 110px;
    overflow-y: auto;
}

.grid-game-screen .back-btn {
    position: absolute;
    top: 70px;
    left: 1.5rem;
}

.grid-word-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 560px;
    padding-bottom: 2rem;
}

.grid-word-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 0.75rem;
    min-height: 90px;
    background: var(--surface);
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    gap: 0.35rem;
    user-select: none;
}

.grid-word-card:hover:not(.solved):not(.failed) {
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.12);
    background: var(--surface-light);
}

.grid-word-card:active:not(.solved):not(.failed) {
    transform: translateY(-1px);
}

.grid-word-card .grid-card-lang {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
}

.grid-card-lang.lang-en {
    background: rgba(0, 240, 255, 0.15);
    color: var(--primary-light);
}

.grid-card-lang.lang-tr {
    background: rgba(255, 45, 124, 0.15);
    color: var(--secondary);
}

.grid-word-card .grid-card-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.grid-word-card .grid-card-points {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.grid-word-card:hover .grid-card-points {
    opacity: 1;
}

/* Solved state */
.grid-word-card.solved {
    background: rgba(0, 230, 118, 0.08);
    border-color: rgba(0, 230, 118, 0.3);
    cursor: default;
    animation: gridSolve 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-word-card.solved .grid-card-text {
    color: var(--success);
}

.grid-word-card.solved .grid-card-translation {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.15rem;
}

.grid-word-card.solved .grid-card-points {
    opacity: 1;
    color: var(--success);
}

/* Failed state */
.grid-word-card.failed {
    background: rgba(255, 61, 90, 0.06);
    border-color: rgba(255, 61, 90, 0.2);
    cursor: default;
    opacity: 0.7;
}

.grid-word-card.failed .grid-card-text {
    color: var(--danger);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.grid-word-card.failed .grid-card-translation {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--danger);
    font-style: italic;
    opacity: 0.8;
    margin-top: 0.15rem;
}

.grid-word-card.failed .grid-card-points {
    opacity: 1;
    color: var(--danger);
}

@keyframes gridSolve {
    0% {
        transform: scale(0.92);
    }

    50% {
        transform: scale(1.05);
    }

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

/* Input Overlay */
.grid-input-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.2s ease;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.grid-input-card {
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-light) 100%);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 240, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: cardPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardPopIn {
    from {
        transform: scale(0.9) translateY(10px);
        opacity: 0;
    }

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

.grid-input-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grid-input-lang {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-light);
}

.grid-input-lang.turkish {
    color: var(--secondary);
}

.grid-input-word {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.grid-input-attempts {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.grid-input-attempts .attempt-heart {
    transition: all 0.3s ease;
}

.grid-input-attempts .attempt-heart.lost {
    opacity: 0.25;
    transform: scale(0.8);
    filter: grayscale(1);
}

.grid-input {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    text-align: center;
    transition: all 0.25s ease;
    outline: none;
}

.grid-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    background: var(--surface-light);
}

.grid-input::placeholder {
    color: var(--text-muted);
}

.grid-input.shake {
    animation: wrongShake 0.4s ease;
    border-color: var(--danger);
}

.grid-input-actions {
    display: flex;
    gap: 0.75rem;
}

.grid-input-cancel {
    flex: 1;
    padding: 0.8rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-input-cancel:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.grid-input-submit {
    flex: 2;
    padding: 0.8rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--background);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grid-input-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 240, 255, 0.35);
}

.grid-input-feedback {
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: var(--border-radius-sm);
    animation: feedbackPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-input-feedback.correct {
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--success);
}

.grid-input-feedback.wrong {
    background: rgba(255, 61, 90, 0.12);
    border: 1px solid rgba(255, 61, 90, 0.3);
    color: var(--danger);
}

/* Grid Game Score Stat */
.grid-game-screen .stat-correct .stat-number {
    color: var(--accent) !important;
    text-shadow: 0 0 10px rgba(255, 184, 0, 0.3);
}

/* Grid Completion */
.grid-completion {
    text-align: center;
    padding: 2rem;
    margin-top: 1rem;
}

.grid-completion-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.grid-completion-score {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(255, 184, 0, 0.4);
}

.grid-completion-detail {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.grid-play-again-btn {
    margin-top: 1.5rem;
    padding: 0.9rem 2.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--background);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grid-play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 240, 255, 0.35);
}

/* Responsive Grid */
@media (max-width: 480px) {
    .grid-word-container {
        gap: 0.5rem;
    }

    .grid-word-card {
        padding: 1rem 0.5rem;
        min-height: 75px;
    }

    .grid-word-card .grid-card-text {
        font-size: 0.85rem;
    }

    .grid-input-word {
        font-size: 1.6rem;
    }
}