/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   hasanaliyucel.com.tr ile uyumlu renk paleti
   ============================================================ */
:root {
    /* Arka plan renkleri */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #0d0d0d;
    --bg-elevated: #141414;
    --bg-input: #0a0a0a;

    /* Metin renkleri */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --text-dim: #555555;

    /* Vurgu renkleri — hasanaliyucel.com.tr paleti */
    --accent-primary: #FF0000;
    --accent-secondary: #950101;
    --accent-dark: #3D0000;
    --accent-glow: rgba(255, 0, 0, 0.4);
    --accent-glow-strong: rgba(255, 0, 0, 0.7);

    /* Durum renkleri */
    --color-correct: #00E676;
    --color-wrong: #FF1744;
    --color-current: #FF0000;
    --color-pending: #444444;

    /* Isı haritası renkleri (2. Aşama) */
    --heat-none: rgba(0, 230, 118, 0.12);
    --heat-none-border: rgba(0, 230, 118, 0.3);
    --heat-none-text: #00E676;
    --heat-low: rgba(255, 193, 7, 0.18);
    --heat-low-border: rgba(255, 193, 7, 0.45);
    --heat-low-text: #FFC107;
    --heat-high: rgba(255, 23, 68, 0.22);
    --heat-high-border: rgba(255, 23, 68, 0.6);
    --heat-high-text: #FF1744;
    --heat-neutral: rgba(255, 255, 255, 0.04);
    --heat-neutral-border: rgba(255, 255, 255, 0.08);

    /* Hayalet Yarışçı renkleri (3. Aşama) */
    --ghost-color: #555555;
    --ghost-glow: rgba(85, 85, 85, 0.3);
    --racer-color: #00E5FF;
    --racer-glow: rgba(0, 229, 255, 0.4);

    /* Tipografi */
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Boyutlar & Spacing */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Geçişler */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Glow efektleri */
    --shadow-glow: 0 0 20px rgba(255, 0, 0, 0.15);
    --shadow-glow-strong: 0 0 40px rgba(255, 0, 0, 0.3);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Arka plan ambient glow */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, rgba(255, 0, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   ZEN MODE — Yazarken UI elemanlarını gizle
   ============================================================ */
.zen-hideable {
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    opacity: 1;
    transform: translateY(0);
}

body.zen-mode .zen-hideable {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* ============================================================
   ANA LAYOUT
   ============================================================ */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 24px 300px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    text-align: center;
    margin-bottom: 36px;
}

.app-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #FF0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-shadow: none;
}

.app-header .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Kırmızı çizgi ayraç */
.divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    margin: 16px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   KONTROL PANELİ (Süre, ses toggle)
   ============================================================ */
.controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-bottom: 28px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Özel Select */
.custom-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--radius-sm);
    padding: 10px 36px 10px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-normal);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FF0000' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.custom-select:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.custom-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

/* Sayısal süre girdisi */
.duration-input {
    width: 90px;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    transition: all var(--transition-normal);
    text-align: center;
}

.duration-input:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.duration-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

.duration-input::-webkit-inner-spin-button,
.duration-input::-webkit-outer-spin-button {
    opacity: 1;
}

.duration-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Ses Toggle */
.sound-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.sound-toggle input[type="checkbox"] {
    display: none;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--accent-secondary);
    border-radius: 12px;
    position: relative;
    transition: all var(--transition-normal);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.sound-toggle input:checked+.toggle-track {
    background-color: var(--accent-dark);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.sound-toggle input:checked+.toggle-track::after {
    transform: translateX(20px);
    background-color: var(--accent-primary);
}

.sound-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sound-icon {
    font-size: 1.1rem;
}

/* ============================================================
   METİN KAYNAĞI — Katlanabilir metin alanı
   ============================================================ */
.source-section {
    margin-bottom: 24px;
}

/* Metin Düzenle/Değiştir butonu */
.btn-toggle-source {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 0, 0, 0.15);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.5px;
}

.btn-toggle-source:hover {
    color: var(--text-primary);
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-toggle-source .toggle-icon {
    font-size: 1rem;
    transition: transform var(--transition-normal);
}

.btn-toggle-source.active .toggle-icon {
    transform: rotate(180deg);
}

/* Textarea wrapper — katlanabilir alan */
.source-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.source-collapsible.open {
    max-height: 250px;
    opacity: 1;
    margin-top: 12px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.section-label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent-glow);
}

.source-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    background-color: var(--bg-card);
    border: 1px solid #1a1a1a;
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: all var(--transition-normal);
}

.source-textarea::placeholder {
    color: var(--text-dim);
}

.source-textarea:focus {
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-glow);
}

/* ============================================================
   BAŞLAT BUTONU
   ============================================================ */
.start-btn-wrapper {
    text-align: center;
    margin-bottom: 28px;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 48px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

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

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

.btn-start:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 0, 0, 0.5);
}

.btn-start:active {
    transform: translateY(0) scale(0.98);
}

.btn-start:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-start:disabled:hover {
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
}

.btn-start:disabled::before {
    display: none;
}

/* Reset butonu */
.btn-reset {
    display: none;
    margin-left: 12px;
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--accent-secondary);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-reset:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* ============================================================
   ZAMANLAYICI & İSTATİSTİK ÇUBUĞU
   ============================================================ */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    pointer-events: none;
}

.stats-bar.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
    line-height: 1;
}

.stat-value.timer {
    font-size: 2.6rem;
    min-width: 100px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* ============================================================
   YAZMA ALANI — Hedef metin ve kullanıcı girdisi
   ============================================================ */
.typing-arena {
    position: relative;
    margin-bottom: 20px;
    display: none;
}

.typing-arena.active {
    display: block;
}

/* Hedef metin kutusu */
.target-text-box {
    background-color: var(--bg-card);
    border: 1px solid #1a1a1a;
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 160px;
    max-height: 260px;
    overflow-y: auto;
    scroll-behavior: smooth;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    line-height: 2;
    letter-spacing: 0.3px;
    position: relative;
    transition: border-color var(--transition-normal);
}

.typing-arena.focused .target-text-box {
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-glow);
}

/* Kelime stilleri */
.word {
    display: inline-block;
    padding: 2px 0;
    transition: color var(--transition-fast);
}

.word.pending {
    color: var(--color-pending);
}

.word.current {
    color: var(--text-primary);
    position: relative;
}

.word.current::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse-underline 1.2s ease infinite;
}

@keyframes pulse-underline {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.word.correct {
    color: var(--color-correct);
}

.word.wrong {
    color: var(--color-wrong);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 23, 68, 0.5);
}

/* Harf bazlı stiller (mevcut kelime içinde) */
.char {
    transition: color var(--transition-fast);
}

.char.correct {
    color: var(--color-correct);
}

.char.wrong {
    color: var(--color-wrong);
}

.char.pending {
    color: var(--text-primary);
}

/* Gizli input */
.hidden-input {
    position: absolute;
    top: 0;
    left: -9999px;
    /* Ekrandan gizle ama odakta (focus) kalsın */
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Tıkla yazma ipucu */
.type-hint {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    animation: blink-hint 2s ease infinite;
}

@keyframes blink-hint {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.2;
    }
}

/* ============================================================
   SONUÇ KARTI — M5 Bilişim Tarzı İkili Panel
   ============================================================ */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 0;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.result-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.result-card {
    background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    max-width: 860px;
    width: 94%;
    text-align: center;
    box-shadow: var(--shadow-glow-strong), var(--shadow-card);
    transform: scale(0.85) translateY(30px);
    transition: transform var(--transition-slow);
    margin: auto;
}

.result-overlay.visible .result-card {
    transform: scale(1) translateY(0);
}

.result-card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff, #FF0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-card .result-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

/* İkili Panel Grid */
.result-dual-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.result-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 0;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.result-panel:hover {
    border-color: rgba(255, 0, 0, 0.2);
    box-shadow: var(--shadow-glow);
}

.result-panel-header {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-panel-header .panel-icon {
    font-size: 1.2rem;
}

.result-panel-header .panel-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

.result-panel-header .panel-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Sol panel — Katiplik: Mavi-Yeşil ton */
.result-panel.panel-katiplik .result-panel-header {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.06), rgba(0, 229, 255, 0.04));
}

.result-panel.panel-katiplik .panel-badge {
    background: rgba(0, 230, 118, 0.12);
    color: #00E676;
    border: 1px solid rgba(0, 230, 118, 0.25);
}

/* Sağ panel — Şampiyona: Kırmızı-Turuncu ton */
.result-panel.panel-sampiyona .result-panel-header {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.06), rgba(255, 152, 0, 0.04));
}

.result-panel.panel-sampiyona .panel-badge {
    background: rgba(255, 0, 0, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(255, 0, 0, 0.25);
}

.result-panel-body {
    padding: 20px;
}

/* Panel içi ana metrik (büyük sayı) */
.panel-main-metric {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.panel-main-metric .metric-value {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.panel-katiplik .panel-main-metric .metric-value {
    color: #00E676;
    text-shadow: 0 0 30px rgba(0, 230, 118, 0.3);
}

.panel-sampiyona .panel-main-metric .metric-value {
    color: var(--accent-primary);
    text-shadow: 0 0 30px var(--accent-glow);
}

.panel-main-metric .metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 6px;
}

/* Panel içi alt metrikler */
.panel-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.panel-stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 12px 10px;
    text-align: center;
    transition: all var(--transition-normal);
}

.panel-stat-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.panel-stat-item .ps-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.panel-stat-item .ps-label {
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

.panel-stat-item .ps-value.color-correct {
    color: var(--color-correct);
}

.panel-stat-item .ps-value.color-wrong {
    color: var(--color-wrong);
}

.panel-stat-item .ps-value.color-accent {
    color: var(--accent-primary);
}

.panel-stat-item .ps-value.color-muted {
    color: var(--text-secondary);
}

/* Full-width stat in 2-column grid */
.panel-stat-item.full-width {
    grid-column: 1 / -1;
}

.btn-close-result {
    padding: 14px 48px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
}

.btn-close-result:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 0, 0, 0.5);
}

/* Yeni rekor rozeti */
.new-record-badge {
    display: none;
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFD600;
    margin: 12px 0 20px;
    letter-spacing: 1px;
    animation: recordShine 1.5s ease infinite;
}

.new-record-badge.visible {
    display: block;
}

@keyframes recordShine {

    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(255, 214, 0, 0.4);
    }

    50% {
        opacity: 0.7;
        text-shadow: 0 0 20px rgba(255, 214, 0, 0.8);
    }
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-container {
    width: 100%;
    height: 3px;
    background: var(--bg-elevated);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.progress-container.visible {
    opacity: 1;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), #FF4444);
    border-radius: 2px;
    transition: width 0.3s linear;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #111;
}

.app-footer p {
    color: var(--text-dim);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.app-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.app-footer a:hover {
    text-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   SCROLLBAR ÖZELLEŞTİRME
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================================
   HAYALET YARIŞÇI (Ghost Pacer) — 3. Aşama
   ============================================================ */
.ghost-pacer-container {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid #1a1a1a;
    border-radius: var(--radius-md);
    opacity: 0;
    transform: translateY(-8px);
    transition: all var(--transition-normal);
    pointer-events: none;
}

.ghost-pacer-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.gp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.gp-title {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.gp-record-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid #222;
    border-radius: 20px;
    padding: 2px 10px;
    letter-spacing: 0.5px;
}

.gp-track {
    margin-bottom: 8px;
}

.gp-track:last-child {
    margin-bottom: 0;
}

.gp-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.gp-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gp-label.ghost-label {
    color: var(--ghost-color);
}

.gp-label.racer-label {
    color: var(--racer-color);
}

.gp-wpm-live {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
}

.gp-wpm-live.ghost-wpm {
    color: var(--ghost-color);
}

.gp-wpm-live.racer-wpm {
    color: var(--racer-color);
}

.gp-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.gp-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.gp-bar-fill.ghost-fill {
    background: linear-gradient(90deg, var(--ghost-color), #777);
    box-shadow: 0 0 8px var(--ghost-glow);
}

.gp-bar-fill.racer-fill {
    background: linear-gradient(90deg, var(--racer-color), #00B8D4);
    box-shadow: 0 0 12px var(--racer-glow);
}

/* Yarışçı ileride — parıltı efekti */
.gp-bar-fill.racer-fill.ahead {
    background: linear-gradient(90deg, #00E676, #00E5FF);
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.4);
}

/* Yarışçı geride — kırmızıya dön */
.gp-bar-fill.racer-fill.behind {
    background: linear-gradient(90deg, #FF6D00, #FF1744);
    box-shadow: 0 0 12px rgba(255, 23, 68, 0.3);
}

.gp-no-record {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 4px 0;
    font-style: italic;
}

/* ============================================================
   KLAVYE ISI HARİTASI (Heatmap) — 2. Aşama
   ============================================================ */
.heatmap-section {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 0, 0, 0.1);
}

.heatmap-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.heatmap-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* Klavye konteyneri */
.keyboard-heatmap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    margin-bottom: 24px;
}

.kb-row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* Tek tuş */
.kb-key {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--heat-neutral-border);
    background: var(--heat-neutral);
    color: var(--text-muted);
    transition: all var(--transition-normal);
    cursor: default;
    user-select: none;
}

.kb-key .key-label {
    line-height: 1;
}

.kb-key .key-count {
    font-size: 0.55rem;
    font-weight: 700;
    margin-top: 2px;
    opacity: 0.8;
    line-height: 1;
}

/* Isı seviyeleri */
.kb-key.heat-none {
    background: var(--heat-none);
    border-color: var(--heat-none-border);
    color: var(--heat-none-text);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.1);
}

.kb-key.heat-low {
    background: var(--heat-low);
    border-color: var(--heat-low-border);
    color: var(--heat-low-text);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.15);
}

.kb-key.heat-high {
    background: var(--heat-high);
    border-color: var(--heat-high-border);
    color: var(--heat-high-text);
    box-shadow: 0 0 16px rgba(255, 23, 68, 0.2);
    animation: heatPulse 2s ease infinite;
}

@keyframes heatPulse {

    0%,
    100% {
        box-shadow: 0 0 16px rgba(255, 23, 68, 0.2);
    }

    50% {
        box-shadow: 0 0 24px rgba(255, 23, 68, 0.4);
    }
}

.kb-key:hover {
    transform: translateY(-2px) scale(1.1);
    z-index: 5;
}

/* Özel tuşlar — geniş */
.kb-key.key-wide-1 {
    width: 56px;
    font-size: 0.6rem;
}

.kb-key.key-wide-2 {
    width: 72px;
    font-size: 0.6rem;
}

.kb-key.key-wide-3 {
    width: 90px;
    font-size: 0.6rem;
}

.kb-key.key-space {
    width: 260px;
    font-size: 0.7rem;
}

/* Isı haritası lejant */
.heatmap-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid;
}

.legend-swatch.swatch-neutral {
    background: var(--heat-neutral);
    border-color: var(--heat-neutral-border);
}

.legend-swatch.swatch-none {
    background: var(--heat-none);
    border-color: var(--heat-none-border);
}

.legend-swatch.swatch-low {
    background: var(--heat-low);
    border-color: var(--heat-low-border);
}

.legend-swatch.swatch-high {
    background: var(--heat-high);
    border-color: var(--heat-high-border);
}

/* ============================================================
   EGZERSİZ BUTONU — 3. Aşama
   ============================================================ */
.exercise-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 0, 0, 0.08);
    text-align: center;
}

.btn-exercise {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #000;
    background: linear-gradient(135deg, #FFC107, #FF9800);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
    position: relative;
    overflow: hidden;
}

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

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

.btn-exercise:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 193, 7, 0.5);
}

.btn-exercise:active {
    transform: translateY(0) scale(0.98);
}

.exercise-info {
    margin-top: 10px;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-style: italic;
}

.exercise-weak-chars {
    display: inline-flex;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}

.weak-char-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--heat-high-text);
    background: var(--heat-high);
    border: 1px solid var(--heat-high-border);
    border-radius: var(--radius-sm);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .app-container {
        padding: 20px 16px 40px;
    }

    .app-header h1 {
        font-size: 1.8rem;
    }

    .controls-panel {
        flex-direction: column;
        gap: 12px;
    }

    .stats-bar {
        gap: 24px;
    }

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

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

    .target-text-box {
        font-size: 1rem;
        padding: 16px;
        min-height: 120px;
    }

    .result-card {
        padding: 24px 16px;
    }

    /* İkili paneli alt alta koy */
    .result-dual-panel {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .panel-main-metric .metric-value {
        font-size: 2.2rem;
    }

    .panel-stat-item .ps-value {
        font-size: 1.1rem;
    }

    /* Heatmap responsive */
    .kb-key {
        width: 30px;
        height: 30px;
        font-size: 0.6rem;
    }

    .kb-key .key-count {
        font-size: 0.45rem;
    }

    .kb-key.key-wide-1 {
        width: 40px;
    }

    .kb-key.key-wide-2 {
        width: 52px;
    }

    .kb-key.key-wide-3 {
        width: 64px;
    }

    .kb-key.key-space {
        width: 160px;
    }

    .heatmap-legend {
        gap: 12px;
    }
}

/* ============================================================
   ANİMASYONLAR
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

body {
    background-color: #000000 !important;
    color: #ffffff !important;
    overflow-x: hidden;
}

.navbar-arka-renk {
    background-color: #000000;
}

a:visited {
    text-decoration: none;
    color: #ffffff;
}

a:hover {
    text-decoration: none;
    color: #FF0000;
}

a:active {
    text-decoration: none;
    color: #950101;
}

a:link {
    text-decoration: none;
    color: #ffffff;
}

.banneryazi {
    background-color: #3D0000;
    border: 3px solid #950101;
    border-radius: 10px;
    margin: 10px;
    padding: 10px;
}

.ara {
    border: 2px solid #950101;
    border-radius: 5px;
    margin: 5px;
    padding: 5px;
    background-color: #3D0000;
    color: white;
}

.cizgi {
    border: 3px solid #950101;
}

.sliderimg {
    height: 500px;
    width: 100%;
}

.sliderimg1 {
    background-color: #3D0000;
    border: 3px solid #950101;
    border-radius: 10px;
    margin: 10px;
    padding: 5px;
    height: 500px;
    width: 100%;
}

.slide-yazi-arka {
    background-color: #3D0000;
    border: 3px solid #950101;
    border-radius: 10px;
    margin: 10px;
    padding: 10px;
    opacity: 0.7;
}

.card-group {
    background-color: #3D0000;
    border: 5px solid #950101;
    border-radius: 10px;
    margin: 10px;
}

.footer {
    background-color: #000000;
    color: white;
    text-align: center;
}

.socialmedia {
    background-color: #3D0000;
    border: solid 3px #950101;
    border-radius: 10px;
    margin: 10px auto;
    padding: 8px 12px;
    color: white;
    text-align: center;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    width: auto;
}

.custom-tabs .nav-link {
    color: #ffffff !important;
    background-color: transparent;
    border: 1px solid #FF0000;
    margin: 0 10px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.custom-tabs .nav-link:hover {
    background-color: #3D0000;
    color: #FF0000 !important;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.custom-tabs .nav-link.active {
    background-color: #FF0000 !important;
    color: #fff !important;
    border-color: #FF0000;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
}

.masonry-gallery {
    column-count: 3;
    column-gap: 10px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 10px;
}

.masonry-item img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

@media (max-width: 768px) {
    .masonry-gallery {
        column-count: 1;
    }
}

.baslik-cizgili {
    color: #FF0000;
    border-bottom: 2px solid #950101;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.link-kutusu {
    display: block;
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #950101;
    padding: 15px;
    margin-bottom: 15px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(149, 1, 1, 0.2);
}

.link-kutusu:hover {
    background-color: #950101 !important;
    border-color: #FF0000 !important;
    color: #ffffff !important;
    transform: translateX(10px);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
}

.link-kutusu .ikon {
    color: #FF0000 !important;
    margin-right: 15px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.link-kutusu:hover .ikon {
    color: #ffffff !important;
    transform: scale(1.2);
}

.link-kutusu small {
    color: #bbbbbb !important;
}

.link-kutusu:hover small {
    color: #eeeeee !important;
}

.navbar-nav .nav-link.active {
    background-color: transparent !important;
    border: none !important;
    color: #FF0000 !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.5);
    transform: scale(1.1);
}

.navbar-nav .nav-link {
    color: #cccccc !important;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 5px #ffffff;
}

.dropdown-menu {
    background-color: #000000;
    border: 1px solid #950101;
    color: white;
}

.dropdown-item {
    color: #ffffff;
}

.dropdown-item:hover {
    background-color: #950101;
    color: #ffffff;
}

.gothic-font {
    font-family: 'Gothic';
}

.accordion-item {
    background-color: transparent;
    border: none;
    margin-bottom: 10px;
}

.accordion-button {
    background-color: #000000;
    color: #fff;
    border: 1px solid #950101;
    border-radius: 5px !important;
}

.accordion-button:not(.collapsed) {
    background-color: #950101;
    color: #fff;
    box-shadow: 0 0 10px rgba(149, 1, 1, 0.5);
}

.accordion-body {
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #950101;
    border-top: none;
    border-radius: 0 0 5px 5px;
}

.accordion-button::after {
    filter: invert(1);
}

.display-5.text-danger {
    color: #FF0000 !important;
    text-shadow: 0 0 1px rgba(255, 0, 0, 0.8);
    font-family: 'Gothic', sans-serif;
    letter-spacing: 2px;
}

.text-muted {
    color: #eeeeee !important;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    opacity: 1 !important;
}

.text-center h2.text-danger {
    color: #FF0000 !important;
    text-shadow: 0 0 2px rgba(255, 0, 0, 0.8), 0 0 10px rgba(255, 0, 0, 0.6);
    letter-spacing: 2px;
    font-weight: 800;
}

.text-center p.text-muted {
    color: #eeeeee !important;
    font-size: 1.1rem;
    text-shadow: 2px 2px 4px #000000;
    opacity: 1 !important;
}

.icon-box {
    width: 60px;
    height: 60px;
    background-color: #000000;
    border: 2px solid #FF0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.icon-box i {
    color: #FF0000 !important;
}

.d-flex:hover .icon-box {
    background-color: #FF0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.9);
    transform: scale(1.1);
}

.d-flex:hover .icon-box i {
    color: #ffffff !important;
}

.col-md-5 h5 {
    color: #FF0000 !important;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    font-weight: bold;
}

.card {
    background-color: #000000 !important;
    border: 3px solid #950101 !important;
    box-shadow: 0 0 20px rgba(149, 1, 1, 0.4);
}

.form-control {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #950101 !important;
}

.form-control:focus {
    background-color: #ffffff !important;
    border-color: #FF0000 !important;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4) !important;
}

.form-label {
    color: #FF0000 !important;
    font-weight: bold;
}

.card-body h3 {
    color: #ffffff !important;
    text-shadow: none !important;
}

.btn-danger {
    background-color: #950101 !important;
    border-color: #950101 !important;
    color: #ffffff !important;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #FF0000 !important;
    border-color: #FF0000 !important;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    transform: scale(1.02);
}

.card-group {
    background-color: transparent !important;
    border: none !important;
    padding: 10px;
    gap: 20px;
}

.card {
    background-color: #000000 !important;
    border: 1px solid #FF0000 !important;
    border-radius: 10px !important;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
    margin-bottom: 20px;
}

.card-title {
    color: #FF0000 !important;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.6);
    font-weight: bold;
}

.card-text {
    color: #eeeeee !important;
    font-size: 1rem;
}

.card-footer {
    background-color: transparent !important;
    border-top: 1px solid #333333 !important;
}

.modal-content {
    background-color: #000000 !important;
    border: 2px solid #FF0000 !important;
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
    color: #ffffff !important;
}

.modal-header,
.modal-footer {
    border-color: #950101 !important;
}

.modal-title {
    color: #FF0000 !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    font-family: 'Gothic', sans-serif;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.footer {
    background-color: #050000 !important;
    border-top: 4px solid #FF0000 !important;
    box-shadow: 0 -10px 20px rgba(255, 0, 0, 0.3);
    margin-top: 50px !important;
    padding-top: 30px;
    padding-bottom: 30px;
    border-radius: 0 !important;
}

.footer h2,
.footer h3,
.footer h4,
.footer h5 {
    color: #ffffff !important;
    text-shadow: none !important;
}

.footer h2 {
    color: #FF0000 !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.6) !important;
}


.carousel-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #000000 0%, transparent 50%);
    pointer-events: none;
}

/* ============================================================
   KEYBOARD RACE — MOD SEÇİCİ, 2D PİST, TURBO & ONLİNE LOBİ
   ============================================================ */
#raceModeContainer [hidden],
.race-result-card [hidden] {
    display: none !important;
}

.app-mode-switcher {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: -12px auto 28px;
    flex-wrap: wrap;
}

.mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.mode-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.mode-tab.active {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.25), rgba(149, 1, 1, 0.45));
    border-color: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 0 22px rgba(255, 0, 0, 0.35);
}

.mode-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 229, 255, 0.16);
    border: 1px solid rgba(0, 229, 255, 0.45);
    color: var(--racer-color);
}

.race-mode-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fadeInUp 0.35s ease forwards;
}

.race-mode-container[hidden] {
    display: none !important;
}

.race-setup-panel {
    background: linear-gradient(180deg, rgba(20, 20, 24, 0.96), rgba(11, 11, 14, 0.98));
    border: 1px solid rgba(255, 0, 0, 0.24);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
}

.race-setup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.race-pill-group {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.race-pill-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.race-pill-btn:hover {
    color: var(--text-primary);
}

.race-pill-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 0, 0, 0.35);
}

.race-controls-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.race-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.race-field label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.race-select-sm {
    padding: 7px 30px 7px 12px;
    font-size: 0.82rem;
}

.race-sound-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.race-sound-btn.active {
    border-color: var(--color-correct);
    color: var(--color-correct);
    background: rgba(0, 230, 118, 0.08);
}

.race-custom-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.race-custom-text-wrap textarea {
    width: 100%;
    min-height: 70px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--text-primary);
    border: 1px solid rgba(255, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.85rem;
    resize: vertical;
}

.race-solo-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.race-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: var(--radius-xl);
    border: none;
    background: linear-gradient(135deg, #FF1A1A, #950101);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.35);
    transition: all var(--transition-fast);
}

.race-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(255, 0, 0, 0.55);
}

.race-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.race-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.race-btn-secondary:hover {
    border-color: var(--racer-color);
    color: #ffffff;
}

/* Online Lobi Kartı */
.race-lobby-card {
    background: linear-gradient(160deg, rgba(16, 18, 24, 0.98), rgba(10, 10, 12, 0.98));
    border: 1px solid rgba(0, 229, 255, 0.28);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.08);
}

.race-lobby-profile {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.race-input-text {
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 0.86rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.race-input-text:focus {
    border-color: var(--racer-color);
}

.race-code-input {
    width: 115px;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
}

.race-color-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.race-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.race-color-swatch.active {
    border-color: #ffffff;
    transform: scale(1.18);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}

.race-lobby-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.race-join-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.race-active-room {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.race-room-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.race-room-code-badge {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--racer-color);
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
}

.race-lobby-status {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.race-lobby-error {
    background: rgba(255, 23, 68, 0.14);
    border: 1px solid rgba(255, 23, 68, 0.45);
    color: #ff6b81;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.82rem;
}

.race-player-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 8px;
}

.race-player-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.84rem;
    font-weight: 600;
}

.race-player-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.race-host-tag {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 193, 7, 0.16);
    color: #FFC107;
}

/* Telemetri HUD */
.race-arena {
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-margin-top: 84px;
}

.race-telemetry-hud {
    display: grid;
    grid-template-columns: 1.1fr 1.6fr 0.7fr 0.7fr 0.9fr auto;
    gap: 10px;
    align-items: center;
    background: rgba(14, 14, 18, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.race-hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.race-hud-val {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
}

.race-hud-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.race-turbo-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.race-turbo-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.race-turbo-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.race-turbo-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #00E5FF, #FFC107);
    transition: width 0.1s linear;
}

.race-turbo-card.turbo-active .race-turbo-fill {
    background: linear-gradient(90deg, #00E5FF, #FF9100, #FF1744);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.85);
    animation: turboPulse 0.45s ease-in-out infinite alternate;
}

.race-turbo-card.turbo-active .race-turbo-top {
    color: #00E5FF;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

@keyframes turboPulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.35); }
}

.race-abort-btn {
    padding: 7px 14px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 23, 68, 0.45);
    background: rgba(255, 23, 68, 0.14);
    color: #ff6b81;
    font-weight: 700;
    cursor: pointer;
}

.race-abort-btn:hover {
    background: rgba(255, 23, 68, 0.28);
    color: #ffffff;
}

/* 2D Canvas Pist Çerçevesi */
.race-canvas-stage {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid rgba(255, 0, 0, 0.28);
    background: #07080d;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.75);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.race-canvas-stage.turbo-glow {
    border-color: #00E5FF;
    box-shadow: 0 0 34px rgba(0, 229, 255, 0.42);
}

.race-canvas-stage.error-shake {
    border-color: var(--color-wrong);
    animation: raceShake 0.24s ease;
}

#raceCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 1;
}

.race-countdown-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 28px rgba(255, 0, 0, 0.85);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.race-countdown-overlay.visible {
    opacity: 1;
    animation: countdownPop 0.4s ease;
}

@keyframes countdownPop {
    0% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.race-spectator-banner {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.82);
    border: 1px solid rgba(0, 229, 255, 0.45);
    color: var(--racer-color);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Kelime Yazma Bandı */
.race-typing-panel {
    position: relative;
    background: rgba(14, 14, 18, 0.96);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    cursor: text;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.race-typing-panel.focused {
    border-color: var(--accent-primary);
    box-shadow: 0 0 24px rgba(255, 0, 0, 0.2);
}

.race-typing-panel.shake {
    border-color: var(--color-wrong);
    animation: raceShake 0.22s ease;
}

@keyframes raceShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.race-word-stream {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 1.55rem;
    min-height: 46px;
}

.race-word-active {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-weight: 700;
}

.race-word-upcoming {
    color: var(--text-muted);
    opacity: 0.68;
    font-size: 1.25rem;
}

.race-char.pending { color: #d8d8e0; }
.race-char.correct { color: var(--color-correct); }
.race-char.wrong {
    color: #ffffff;
    background: rgba(255, 23, 68, 0.72);
    border-radius: 3px;
}

.race-type-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--text-dim);
    text-align: center;
}

/* Yarış Podyum / Sonuç Listesi */
.race-result-card {
    max-width: 680px;
}

.race-grace-banner {
    margin: 8px 0 14px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: var(--racer-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.race-standings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 20px;
}

.race-standing-row {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.race-standing-row.is-me {
    border-color: var(--racer-color);
    background: rgba(0, 229, 255, 0.08);
}

.race-rank-badge {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.05rem;
    text-align: center;
}

.race-standing-meta {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.race-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.race-stat-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
}

.race-stat-val {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

.race-stat-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.race-result-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .race-telemetry-hud {
        grid-template-columns: repeat(3, 1fr);
    }
    .race-turbo-card {
        grid-column: 1 / -1;
    }
    .race-word-stream {
        font-size: 1.2rem;
    }
    .race-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
