:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Light Theme */
  --bg-app: #f8fafc;
  --bg-sidebar: #0b1329;
  --bg-sidebar-hover: #162244;
  --bg-sidebar-active: #2563eb;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --bg-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-sidebar: #cbd5e1;
  
  --border-color: #e2e8f0;
  --border-sidebar: rgba(255, 255, 255, 0.08);
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.25);
  
  --ai-purple: #8b5cf6;
  --ai-gradient: linear-gradient(135deg, #8b5cf6, #3b82f6);
  --ai-glow: rgba(139, 92, 246, 0.3);
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 64px;
}

body.theme-dark {
  --bg-app: #090d16;
  --bg-sidebar: #060911;
  --bg-sidebar-hover: #121829;
  --bg-sidebar-active: #1d2742;
  --bg-card: #111726;
  --bg-input: #172033;
  --bg-subtle: #1a233a;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  
  --border-color: #1e293b;
  --border-sidebar: rgba(255, 255, 255, 0.06);
  
  --success-bg: rgba(16, 185, 129, 0.12);
  --danger-bg: rgba(239, 68, 68, 0.12);
  --warning-bg: rgba(245, 158, 11, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  overflow: hidden; /* Body doesn't scroll; main-content scrolls independently! */
}

/* Master Layout */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Fail-safe Backdrop for Mobile Drawer */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Fixed Sidebar for Desktop (NEVER SCROLLS WITH CONTENT) */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  max-height: 100vh;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-sidebar);
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.25s ease, min-width 0.25s ease;
  user-select: none;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .btn-ai-add span:last-child,
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .server-status span:last-child {
  display: none;
}

.sidebar.collapsed .btn-ai-add {
  padding: 12px;
  justify-content: center;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-sidebar);
  flex-shrink: 0;
}

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

.logo-icon {
  font-size: 22px;
}

.logo-text h2 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.badge-pro {
  font-size: 9.5px;
  font-weight: 800;
  background: #10b981;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
}

.close-sidebar-btn {
  background: transparent;
  color: var(--text-sidebar);
  font-size: 18px;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.close-sidebar-btn:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.sidebar-action {
  padding: 12px 10px 4px;
  flex-shrink: 0;
}

.btn-ai-add {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--ai-gradient);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--ai-glow);
  transition: transform 0.15s ease;
}

.btn-ai-add:hover {
  transform: translateY(-2px);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  scrollbar-width: thin;
}

.nav-group-title {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.8px;
  padding: 10px 8px 3px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-sidebar);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-highlight {
  border-left: 3px solid #818cf8;
}

.nav-icon {
  font-size: 17px;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.badge-hot {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: white;
}

.badge-warning {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-sidebar);
  flex-shrink: 0;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Main Content Area (SCROLLABLE & FLUID) */
.main-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  color: var(--text-primary);
}

.search-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 7px 12px;
}

.search-box input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.icon-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* User Profile Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.user-pill:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.user-pill.role-admin {
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

body.theme-dark .user-pill.role-admin {
  background: linear-gradient(135deg, #451a03, #292524);
  color: #fde68a;
}

.user-pill.role-irem {
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border-color: #ec4899;
  color: #9d174d;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.25);
}

body.theme-dark .user-pill.role-irem {
  background: linear-gradient(135deg, #500724, #292524);
  color: #fbcfe8;
}

/* Content Body */
.content-body {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.screen {
  display: none;
  animation: fadeIn 0.15s ease-in-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Personalized Welcome Banner */
.welcome-banner {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: fadeIn 0.3s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.welcome-banner.banner-admin {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1.5px solid #f59e0b;
  color: #f8fafc;
}

.welcome-banner.banner-irem {
  background: linear-gradient(135deg, #831843, #be185d);
  border: 1.5px solid #f472b6;
  color: #fff;
  box-shadow: 0 4px 18px rgba(190, 24, 93, 0.25);
}

.welcome-banner.banner-guest {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.banner-avatar {
  font-size: 28px;
  flex-shrink: 0;
}

.banner-content {
  flex: 1;
}

.banner-content b {
  font-size: 14.5px;
  display: block;
  margin-bottom: 4px;
}

/* Global Back to Main Menu Bar */
.back-to-home-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
}

.btn-back-home {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-back-home:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-ai {
  background: var(--ai-gradient);
  color: white;
  box-shadow: 0 4px 12px var(--ai-glow);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-large {
  padding: 12px 24px;
  font-size: 15px;
  margin: 14px auto;
  display: block;
}

/* Hero Section */
.hero-card {
  background: linear-gradient(135deg, #0f1c3f, #1e3a8a);
  color: white;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-text h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 6px;
}

.hero-text p {
  color: #cbd5e1;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
}

.mini-stat-num {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: #60a5fa;
  margin-bottom: 2px;
}

.mini-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

.section-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.mode-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.mode-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.tile-icon {
  font-size: 26px;
  margin-bottom: 8px;
}

.mode-tile h4 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mode-tile p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Sections Grid */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.screen-header h2 {
  font-size: 20px;
  font-weight: 800;
}

.screen-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.section-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-badge-no {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-sidebar);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.section-card h3 {
  font-size: 14.5px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.section-card p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Word Cards in Lesson */
.words-container {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.word-card-view {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.word-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.word-main-en {
  font-size: 18px;
  font-weight: 900;
  color: var(--primary);
}

.word-main-tr {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.example-box {
  background: var(--bg-subtle);
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  margin-top: 6px;
}

.notes-alert {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 14px;
  font-size: 12.5px;
}

/* Games Container */
.game-container {
  max-width: 780px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.wide-game {
  max-width: 900px;
}

.game-header {
  text-align: center;
  margin-bottom: 18px;
}

.game-header h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.game-header p {
  color: var(--text-secondary);
  font-size: 13px;
}

.game-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-bar-wrap {
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 16px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #10b981);
  transition: width 0.3s ease;
}

.question-prompt {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.question-title {
  text-align: center;
  font-size: clamp(20px, 3.5vw, 32px);
  font-weight: 900;
  color: var(--text-primary);
  margin: 8px 0 6px;
}

.question-context {
  text-align: center;
  background: var(--bg-subtle);
  padding: 6px 12px;
  border-radius: 999px;
  width: fit-content;
  margin: 0 auto 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--bg-subtle);
}

.option-btn.correct {
  background: var(--success-bg) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
}

.option-btn.wrong {
  background: var(--danger-bg) !important;
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.feedback {
  min-height: 44px;
  text-align: center;
  margin-top: 14px;
  font-weight: 700;
  font-size: 13.5px;
}

.text-input-game {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  text-align: center;
  font-weight: 700;
  outline: none;
  margin: 14px 0;
}

.text-input-game:focus {
  border-color: var(--primary);
}

/* Match Game */
.match-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.match-btn.selected {
  background: var(--bg-subtle);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.match-btn.done {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
  opacity: 0.6;
}

.match-btn.bad {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* Memory Game */
.memory-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.memory-controls .btn.active {
  background: var(--primary);
  color: white;
}

.memory-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.memory-card-btn {
  min-height: 70px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: linear-gradient(135deg, #0f1c3f, #2563eb);
  color: white;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  padding: 6px;
}

.memory-card-btn.open {
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12.5px;
  border-color: var(--primary);
}

.memory-card-btn.done {
  background: var(--success-bg);
  color: var(--success);
  font-size: 12.5px;
  border-color: var(--success);
}

/* Letter Game */
.letter-pattern-box {
  font-size: clamp(20px, 3.5vw, 32px);
  letter-spacing: 4px;
  text-align: center;
  font-weight: 900;
  color: var(--primary);
  margin: 14px 0;
}

.letter-buttons-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Cards List */
.cards-list {
  display: grid;
  gap: 8px;
}

.list-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.list-item-main b {
  font-size: 14.5px;
  color: var(--primary);
}

.list-item-main small {
  font-size: 13px;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 36px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ====================================
   YDS EXAM & PRACTICE STYLES
   ==================================== */
.exam-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 10px;
}

.exam-timer-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  padding: 5px 12px;
  border-radius: 999px;
}

.timer-digits {
  font-size: 16px;
  font-weight: 900;
  color: var(--warning);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.exam-progress-info {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Question Palette */
.exam-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 14px;
}

.palette-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  position: relative;
}

.palette-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.palette-btn.answered {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.palette-btn.flagged::after {
  content: "🚩";
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 9px;
}

/* Question Card */
.exam-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.question-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.badge-question-type {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
}

.badge-source {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.exam-passage {
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 16px;
  white-space: pre-line;
}

.exam-question-text {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.exam-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-option-card {
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exam-option-card:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.exam-option-card.selected {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
}

.exam-option-card.selected .opt-letter {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.opt-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.exam-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

/* Exam Result Card */
.score-report-card {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xl);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 12px;
}

.score-cell {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 6px;
}

.score-cell-num {
  font-size: 22px;
  font-weight: 900;
  color: #60a5fa;
}

.score-cell-label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Practice Tabs */
.practice-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.practice-question-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.solution-box {
  background: var(--success-bg);
  border-left: 4px solid var(--success);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
}

/* ====================================
   👑 YUSUF'A DANIŞ & SÜSLÜ ROYAL / FLORAL JOKER STYLES
   ==================================== */
.btn-joker {
  background: linear-gradient(135deg, #f59e0b, #d97706, #b45309);
  color: white;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  animation: royalGlow 3s infinite alternate;
}

.btn-joker.btn-joker-irem {
  background: linear-gradient(135deg, #f43f5e, #ec4899, #db2777) !important;
  border: 1.5px solid #fbcfe8 !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.45) !important;
  animation: iremFloralGlow 2.5s infinite alternate !important;
}

@keyframes royalGlow {
  0% { transform: scale(1); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1.02); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.65); }
}

@keyframes iremFloralGlow {
  0% { transform: scale(1); box-shadow: 0 4px 14px rgba(236, 72, 153, 0.45); }
  100% { transform: scale(1.03); box-shadow: 0 6px 22px rgba(236, 72, 153, 0.75); }
}

.btn-joker:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.7);
}

.joker-tip-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(30, 41, 59, 0.05));
  border: 2px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-top: 14px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
  animation: fadeIn 0.25s ease;
}

.joker-tip-card.joker-irem {
  background: linear-gradient(135deg, rgba(253, 242, 248, 0.95), rgba(252, 231, 243, 0.95)) !important;
  border: 2px solid #ec4899 !important;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.25) !important;
}

body.theme-dark .joker-tip-card.joker-irem {
  background: linear-gradient(135deg, #500724, #2a0818) !important;
  border-color: #f472b6 !important;
}

.joker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 900;
  color: #b45309;
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.25);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.joker-header.joker-header-irem {
  color: #be185d !important;
  border-bottom-color: rgba(236, 72, 153, 0.3) !important;
}

body.theme-dark .joker-header {
  color: #fde68a;
}

body.theme-dark .joker-header.joker-header-irem {
  color: #fbcfe8 !important;
}

.joker-telegram-badge {
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.4);
}

.joker-body {
  font-size: 13.5px;
  line-height: 1.6;
}

.joker-layer-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.joker-layer-box.layer-answer {
  background: var(--success-bg);
  border: 1.5px solid var(--success);
  color: var(--text-primary);
  font-size: 13.5px;
}

.btn-joker-step {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.25));
  border: 1.5px solid #f59e0b;
  color: #b45309;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.btn-joker-step.btn-step-irem {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.25)) !important;
  border-color: #ec4899 !important;
  color: #be185d !important;
}

body.theme-dark .btn-joker-step {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.25);
}

body.theme-dark .btn-joker-step.btn-step-irem {
  color: #fbcfe8 !important;
  background: rgba(236, 72, 153, 0.3) !important;
}

.btn-joker-step:hover {
  background: #f59e0b;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-joker-step.btn-step-irem:hover {
  background: #ec4899 !important;
  color: white !important;
}

/* AI MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 16px;
}

.modal-overlay.active {
  display: grid;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  font-size: 22px;
}

.modal-title h3 {
  font-size: 16px;
  font-weight: 800;
}

.modal-title p {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-group input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.form-row {
  display: flex;
  gap: 10px;
}

.flex-1 { flex: 1; }

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* =========================================================
   📱 MOBILE RESPONSIVE RULES (IPHONE & TOUCH FRIENDLY)
   ========================================================= */
@media (max-width: 768px) {
  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }

  .app-layout {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    width: 100vw !important;
  }

  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 280px !important;
    min-width: 280px !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    transition: transform 0.25s ease !important;
    z-index: 999 !important;
    box-shadow: 4px 0 25px rgba(0,0,0,0.5) !important;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .btn-ai-add span:last-child,
  .sidebar.collapsed .nav-group-title,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-badge,
  .sidebar.collapsed .server-status span:last-child {
    display: initial !important;
  }

  .main-content {
    width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .topbar {
    padding: 0 12px !important;
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .search-box {
    max-width: 160px;
  }

  .content-body {
    padding: 12px 10px !important;
  }

  .hero-card {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
  }

  .hero-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .modes-grid, .section-grid {
    grid-template-columns: 1fr !important;
  }

  .score-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .options-grid, .match-grid {
    grid-template-columns: 1fr !important;
  }

  .form-row {
    flex-direction: column !important;
  }

  .stat-pill small {
    display: none;
  }

  .exam-palette {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 4px !important;
  }

  .palette-btn {
    width: 100% !important;
    height: 34px !important;
  }

  .exam-question-card {
    padding: 16px 12px !important;
  }

  .btn-back-home {
    padding: 7px 12px !important;
    font-size: 13px !important;
  }
}

/* ====================================
   ⚡ 60SN BLITZ (DOĞRU / YANLIŞ) STYLES
   ==================================== */
.blitz-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.blitz-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--warning-bg);
  border: 1.5px solid var(--warning);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  color: var(--warning);
  font-variant-numeric: tabular-nums;
}

.blitz-timer-pill.urgent {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  animation: pulseWarning 0.6s infinite alternate;
}

@keyframes pulseWarning {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.blitz-combo-pill {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13.5px;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.blitz-score-pill {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
}

.blitz-score-pill b {
  color: var(--primary);
  font-size: 16px;
}

.blitz-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 20px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.blitz-card.flash-correct {
  background: var(--success-bg);
  border-color: var(--success);
  transform: scale(1.02);
}

.blitz-card.flash-wrong {
  background: var(--danger-bg);
  border-color: var(--danger);
  transform: scale(0.98);
}

.blitz-prompt {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.blitz-word-en {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
}

.blitz-equals {
  font-size: 24px;
  color: var(--text-muted);
  margin: 6px 0;
  font-weight: 800;
}

.blitz-word-tr {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.blitz-theme-tag {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.blitz-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 600px;
  margin: 0 auto;
}

.btn-blitz-action {
  border: none;
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
  user-select: none;
  box-shadow: var(--shadow-md);
}

.btn-blitz-action:active {
  transform: scale(0.96);
}

.btn-blitz-true {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-blitz-true:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-blitz-false {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-blitz-false:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.blitz-btn-icon {
  font-size: 28px;
}

.blitz-btn-label {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.blitz-key-hint {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Blitz Report Card */
.blitz-report-card {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  margin: 0 auto;
}

/* ====================================
   🏆 LEADERBOARD (LİDERLİK TABLOSU) STYLES
   ==================================== */
.leaderboard-podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 12px;
  align-items: flex-end;
  margin: 16px 0 24px;
}

.podium-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: transform 0.15s ease;
}

.podium-card:hover {
  transform: translateY(-2px);
}

.podium-1 {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(254, 240, 138, 0.15));
  border-color: #eab308;
  padding: 24px 12px;
  box-shadow: 0 8px 24px rgba(234, 179, 8, 0.2);
}

.podium-2 {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(226, 232, 240, 0.15));
  border-color: #94a3b8;
}

.podium-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(254, 215, 170, 0.15));
  border-color: #d97706;
}

.podium-crown {
  font-size: 32px;
  margin-bottom: 6px;
}

.podium-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.podium-stat-val {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
}

.podium-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rank-badge.rank-1 {
  background: #eab308;
  color: #000;
  border-color: #ca8a04;
}

.rank-badge.rank-2 {
  background: #94a3b8;
  color: #000;
  border-color: #64748b;
}

.rank-badge.rank-3 {
  background: #d97706;
  color: #fff;
  border-color: #b45309;
}

.leaderboard-row {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.leaderboard-row:hover {
  border-color: var(--primary);
  background: var(--bg-subtle);
}

.leaderboard-row.highlight-me {
  border: 2px solid var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

@media (max-width: 768px) {
  .leaderboard-podium {
    grid-template-columns: 1fr !important;
  }
}

/* ====================================
   💡 HARF İPUÇLU BULMACA (CANLI KUTUCUKLAR)
   ==================================== */
.letter-slots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 20px auto;
  max-width: 650px;
  cursor: text;
}

.letter-slot {
  width: 44px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 2.5px solid var(--border-color);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  text-transform: uppercase;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.letter-slot.filled {
  border-color: var(--primary);
  background: var(--bg-card);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.letter-slot.hint-revealed {
  border-color: #f59e0b;
  background: var(--warning-bg);
  color: #b45309;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.letter-slot.active-cursor {
  border-color: var(--primary);
  animation: cursorBlink 0.8s infinite alternate;
}

@keyframes cursorBlink {
  from { border-color: var(--primary); }
  to { border-color: transparent; }
}

.letter-space {
  width: 18px;
  height: 52px;
}

.hidden-screen-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* ====================================
   🧠 HAFIZA KARTLARI (3D ANİMASYONLU KARTLAR)
   ==================================== */
.memory-grid-3d {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  perspective: 1200px;
}

.memory-card-3d {
  position: relative;
  width: 100%;
  height: 90px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.memory-card-3d.flipped {
  transform: rotateY(180deg);
}

.memory-card-3d.matched {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Card Back (Kapalı Yüzey) */
.card-face-back {
  background: linear-gradient(135deg, #0f1c3f, #1e3a8a);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: white;
}

.card-face-back:hover {
  border-color: #60a5fa;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transform: scale(1.02);
}

.card-back-pattern {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.card-back-icon {
  font-size: 24px;
}

.card-back-text {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #93c5fd;
  text-transform: uppercase;
}

/* Card Front (Açık Yüzey) */
.card-face-front {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  color: var(--text-primary);
  transform: rotateY(180deg);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.card-face-front.en-card {
  border-color: #3b82f6;
}

.card-face-front.tr-card {
  border-color: #8b5cf6;
}

.card-lang-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.en-card .card-lang-tag {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.tr-card .card-lang-tag {
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
}

.card-word-text {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
}

/* Matched Card Style */
.memory-card-3d.matched .card-face-front {
  background: var(--success-bg) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3) !important;
  animation: cardMatchPulse 0.4s ease;
}

@keyframes cardMatchPulse {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.08); }
  100% { transform: rotateY(180deg) scale(1); }
}

@media (max-width: 768px) {
  .letter-slot {
    width: 34px;
    height: 42px;
    font-size: 17px;
  }
  .memory-card-3d {
    height: 75px;
  }
}

/* ====================================
   🟩 AKADEMİK WORDLE STYLES
   ==================================== */
.wordle-hint-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 14px;
}

.wordle-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin: 12px auto 20px;
}

.wordle-row {
  display: flex;
  gap: 6px;
}

.wordle-tile {
  width: 52px;
  height: 52px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  text-transform: uppercase;
  user-select: none;
  transition: transform 0.12s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.wordle-tile.pop {
  transform: scale(1.12);
  border-color: var(--text-muted);
}

.wordle-tile.correct {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.wordle-tile.present {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.wordle-tile.absent {
  background: #64748b !important;
  border-color: #64748b !important;
  color: white !important;
}

.wordle-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-top: 14px;
  user-select: none;
}

.key-row {
  display: flex;
  gap: 5px;
}

.key-btn {
  height: 48px;
  min-width: 34px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  box-shadow: var(--shadow-sm);
}

.key-btn:active {
  transform: scale(0.92);
}

.key-btn.key-wide {
  min-width: 54px;
  font-size: 12px;
  background: var(--bg-subtle);
}

.key-btn.correct {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: white !important;
}

.key-btn.present {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: white !important;
}

.key-btn.absent {
  background: #475569 !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
  opacity: 0.75;
}

@keyframes rowShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.wordle-row.shake {
  animation: rowShake 0.4s ease;
}

@media (max-width: 768px) {
  .wordle-tile {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .key-btn {
    height: 44px;
    min-width: 28px;
    padding: 0 6px;
    font-size: 13px;
  }
  .key-btn.key-wide {
    min-width: 44px;
  }
}

/* ====================================
   🍞 WORDLE TOAST NOTIFICATION
   ==================================== */
.wordle-toast-container {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.wordle-toast {
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 13.5px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: toastPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
