  :root, [data-theme="dark"] {
    --bg-page: #0C1017;
    --bg-main: #0E141F;
    --bg-surface: #161F2E;
    --bg-surface-elevated: #1C273A;
    --bg-card: #161F2E;
    --border-color: #243147;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-highlight: rgba(255, 255, 255, 0.08);
    --accent-blue: #3E6399;
    --accent-blue-hover: #335382;
    --accent-blue-dark: #223757;
    --accent-green: #2F7C59;
    --accent-green-dark: #1D543B;
    --accent-red: #A84242;
    --accent-red-dark: #782929;
    --accent-amber: #B87E28;
    --text-primary: #EDE8DF;
    --text-secondary: #90A0B7;
    --text-muted: #5C6E87;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 24px -4px rgba(0,0,0,0.4);
    --phone-border: transparent;
    --header-bg: #0E141F;
    --tab-bar-bg: #121A28;
    --node-locked-bg: #1E2837;
    --node-locked-depth: #121A26;
    --case-box-bg: #141C29;
    --case-box-border: #222E42;
    --ring-track-color: rgba(255, 255, 255, 0.08);
    --ring-halo-bg: #0E141F;
    --crown-gold: #B87E28;
    --crown-gold-dark: #7A5114;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
  }

  [data-theme="light"] {
    --bg-page: #F3F4F6;
    --bg-main: #F7F8FA;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #EEF1F5;
    --bg-card: #FFFFFF;
    --border-color: #D8DEE6;
    --border-subtle: rgba(0, 0, 0, 0.05);
    --border-highlight: rgba(255, 255, 255, 0.9);
    --accent-blue: #2E5C99;
    --accent-blue-hover: #234778;
    --accent-blue-dark: #1A3459;
    --accent-green: #2B7351;
    --accent-green-dark: #1B4C35;
    --accent-red: #A33A3A;
    --accent-red-dark: #7A2424;
    --accent-amber: #A8711E;
    --text-primary: #1C232E;
    --text-secondary: #57677D;
    --text-muted: #8796AA;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 10px -2px rgba(15,23,42,0.06);
    --shadow-lg: 0 10px 20px -3px rgba(15,23,42,0.08);
    --phone-border: transparent;
    --header-bg: #FFFFFF;
    --tab-bar-bg: #F0F2F5;
    --node-locked-bg: #E4E8EE;
    --node-locked-depth: #CBD2DC;
    --case-box-bg: #F7F8FA;
    --case-box-border: #D8DEE6;
    --ring-track-color: rgba(0, 0, 0, 0.06);
    --ring-halo-bg: #F7F8FA;
    --crown-gold: #A8711E;
    --crown-gold-dark: #70470D;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  *::-webkit-scrollbar {
    display: none;
  }

  body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
  }

  .app-shell, .phone-frame {
    width: 100%;
    max-width: 480px;
    height: 100%;
    height: 100dvh;
    background-color: var(--bg-main);
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    transition: background-color 0.25s ease;
  }

  /* Status Bar Tamamen Kaldırıldı */
  .status-bar {
    display: none !important;
  }

  .app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--header-bg);
    flex-shrink: 0;
    z-index: 10;
    transition: background 0.25s ease, border-color 0.25s ease;
  }

  .theme-toggle-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--border-color), var(--shadow-sm);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
    user-select: none;
  }
  .theme-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 var(--border-color), var(--shadow-md);
  }
  .theme-toggle-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--border-color);
  }

  .stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    padding: 6px 11px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid var(--border-color);
  }

  .stat-badge.fire { color: #FB923C; }
  .stat-badge.xp { color: #38BDF8; }
  .stat-badge.book { color: #34D399; }
  .stat-badge.heart { color: #F43F5E; }

  /* DERS SEÇİCİ TABLAR (MEDENİ HUKUK / BORÇLAR / CEZA) */
  .course-selector-bar {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    background: var(--tab-bar-bg);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    flex-shrink: 0;
    z-index: 9;
    transition: background 0.25s ease, border-color 0.25s ease;
  }

  .course-tab-btn {
    flex: 1;
    min-width: 105px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: all 0.15s ease;
  }

  .course-tab-btn.active {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: #60A5FA;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
  }

  .screen {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .screen::-webkit-scrollbar {
    display: none;
  }

  .screen.active { 
    display: flex; 
    animation: screenFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes screenFadeIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
  }

  #lessonScreen {
    overflow: hidden;
  }

  /* ================== GEÇİŞ EKRANI (HUKUKİ YÜKLENİYOR) ================== */
  #loadingScreen {
    background: var(--bg-main);
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    z-index: 50;
  }
  #loadingScreen.active {
    display: flex;
    animation: fadeIn 0.2s ease;
  }
  .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    gap: 16px;
    max-width: 340px;
  }
  .loading-icon-pulse {
    font-size: 56px;
    animation: scaleHeartbeat 1.4s ease-in-out infinite;
  }
  @keyframes scaleHeartbeat {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3)); }
    50% { transform: scale(1.15) rotate(4deg); filter: drop-shadow(0 0 25px rgba(96, 165, 250, 0.7)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3)); }
  }
  .loading-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.3px;
  }
  .loading-bar-wrap {
    width: 220px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
  }
  .loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38BDF8, #2563EB, #60A5FA);
    animation: loadProgressBar 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  @keyframes loadProgressBar {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
  }
  .loading-aphorism {
    font-size: 11.5px;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.45;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
  }

  /* ================== TAB EKRANLARI (HATA ARŞİVİ, LİGLER, PROFİL) ================== */
  .tab-screen-content {
    padding: 18px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .tab-screen-header {
    margin-bottom: 4px;
  }
  .tab-screen-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
  }
  .tab-screen-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
  }
  .coming-soon-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
  }
  .coming-soon-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 4px 10px;
    border-radius: 20px;
  }
  .coming-soon-icon {
    font-size: 40px;
    margin: 4px 0;
  }
  .coming-soon-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
  }
  .coming-soon-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    max-width: 300px;
  }
  .coming-soon-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 6px;
  }
  .coming-soon-tags span {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px 9px;
    border-radius: 8px;
  }
  .league-tiers-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 260px;
    margin-top: 8px;
  }
  .tier-pill {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-align: left;
  }
  .tier-pill.gold.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: #F59E0B;
    color: #FBBF24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  }
  .profile-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: var(--shadow-md);
  }
  .profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
  }
  .profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid #3B82F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
  }
  .profile-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
  }
  .profile-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
  }
  .profile-quick-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 14px;
  }
  .p-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .p-num {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
  }
  .p-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
  }

