* { box-sizing: border-box; }

/* History grid (review history) */
.history-grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  table-layout: fixed;
}
.history-grid th,
.history-grid td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
}
.history-grid th:first-child,
.history-grid td:first-child {
  text-align: left;
}
.history-grid thead th {
  color: var(--muted);
  font-weight: 600;
}
.history-grid tbody tr:hover {
  background: color-mix(in srgb, var(--panel) 94%, white 6%);
}
/* Make the last column (Détails) 50% width */
.history-grid th:nth-child(7),
.history-grid td:nth-child(7) {
  width: 50%;
  text-align: left;
  font-size: 14px;
}
.history-grid td:nth-child(7) {
  white-space: normal;
}
.history-grid td:nth-child(7) details {
  display: inline-block;
}
:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #22c55e;
  --primary-800: #166534;
  --danger: #ef4444;
  --warning: #f59e0b;
  --accent: #60a5fa;
  --border: #1f2937;
  --shadow: 0 12px 30px rgba(0,0,0,0.35);
}
/* Light theme overrides */
.theme-light {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #10b981;
  --primary-800: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --accent: #3b82f6;
  --border: #e2e8f0;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
/* Kids Sport theme - fun and colorful */
.theme-kids {
  --bg: #fef3c7;
  --panel: #ffffff;
  --panel-2: #fef9c3;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #f59e0b;
  --primary-800: #d97706;
  --danger: #f43f5e;
  --warning: #fb923c;
  --accent: #8b5cf6;
  --border: #fde68a;
  --shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

/* Jungle theme - nature and wildlife */
.theme-jungle {
  --bg: #064e3b;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-2: #ecfdf5;
  --text: #064e3b;
  --muted: #047857;
  --primary: #10b981;
  --primary-800: #059669;
  --danger: #f97316;
  --warning: #fbbf24;
  --accent: #14b8a6;
  --border: #a7f3d0;
  --shadow: 0 8px 24px rgba(6, 78, 59, 0.2);
}

/* Matrix theme - digital rain */
.theme-matrix {
  --bg: #000000;
  --panel: rgba(0, 20, 0, 0.95);
  --panel-2: rgba(0, 30, 0, 0.9);
  --text: #00ff41;
  --muted: #008f11;
  --primary: #00ff41;
  --primary-800: #00cc33;
  --danger: #ff0000;
  --warning: #ffff00;
  --accent: #00ff41;
  --border: #003b00;
  --shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

/* Forest theme - growing trees */
.theme-forest {
  --bg: #1a3a1a;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-2: #e8f5e8;
  --text: #1a3a1a;
  --muted: #4a7c4a;
  --primary: #2d5f2d;
  --primary-800: #1a3a1a;
  --danger: #8b4513;
  --warning: #daa520;
  --accent: #228b22;
  --border: #90ee90;
  --shadow: 0 8px 24px rgba(26, 58, 26, 0.3);
}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% -20%, #1e293b 0%, #0f172a 50%, #0b1220 100%);
  color: var(--text);
}
.theme-light body {
  background: #ffffff;
}

.theme-kids body {
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 25%, #fbbf24 50%, #fef3c7 100%);
}

.theme-jungle body {
  background: 
    linear-gradient(180deg, rgba(6, 78, 59, 0.85) 0%, rgba(5, 150, 105, 0.75) 50%, rgba(6, 78, 59, 0.9) 100%),
    repeating-linear-gradient(90deg, transparent 0px, rgba(16, 185, 129, 0.03) 50px, transparent 100px),
    repeating-linear-gradient(0deg, transparent 0px, rgba(20, 184, 166, 0.03) 80px, transparent 160px),
    radial-gradient(ellipse at 20% 30%, #10b981 0%, #059669 40%, #064e3b 100%);
  position: relative;
}

.theme-matrix body {
  background: #000000;
  position: relative;
  overflow: hidden;
}

.theme-forest body {
  background: linear-gradient(180deg, #87ceeb 0%, #b0d4e3 30%, #d4e8d4 60%, #8b7355 100%);
  position: relative;
  overflow: hidden;
}

.theme-jungle body::before,
.theme-jungle body::after {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-jungle body::before {
  content: '🌴';
  top: 5%;
  left: 10%;
  font-size: 80px;
  opacity: 0.4;
  animation: jungle-sway-1 15s ease-in-out infinite;
}

.theme-jungle body::after {
  content: '🌳';
  top: 15%;
  right: 8%;
  font-size: 100px;
  opacity: 0.35;
  animation: jungle-sway-2 18s ease-in-out infinite;
}

@keyframes jungle-sway-1 {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(15px) rotate(3deg); }
}

@keyframes jungle-sway-2 {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(-12px) rotate(-2deg); }
}

/* Random positioned jungle elements */
.jungle-emoji {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0.35;
}

.app-header {
  padding: 24px 16px 8px;
  text-align: center;
  position: relative;
}
.app-header h1 {
  margin: 0;
  font-size: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center; /* center emoji + title horizontally */
}
.app-header .app-logo {
  height: 36px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: color-mix(in srgb, var(--panel) 96%, white 4%);
}
.app-header .mascot {
  display: inline-block;
  font-size: 36px;
  margin-right: 8px; /* emoji now on the left of title text */
  transform: translateY(2px);
}
.app-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

/* Top-right header actions (tools button) */
.header-actions {
  position: absolute;
  top: 12px;
  right: 12px;
}
.tab-button.icon {
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
}

.deck-bar {
  margin-top: 12px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(14, 21, 36, 0.6);
  border: 1px solid #2b3648;
  border-radius: 10px;
  padding: 8px 10px;
}
.deck-bar label { color: var(--muted); font-size: 13px; }
.deck-select {
  background: #0a0f1b;
  color: var(--text);
  border: 1px solid #263246;
  border-radius: 8px;
  padding: 8px 10px;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tab-button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  position: relative; /* needed for tooltip positioning */
}
.tab-button.active {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-color: var(--border);
  outline: 2px solid rgba(96, 165, 250, 0.25);
}

/* Active state highlight for Review and Statistiques tabs */
.tabs .tab-button.active[data-tab="review"],
.tabs .tab-button.active[data-tab="stats"] {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8); /* sky blue */
  color: #083344; /* deep teal for good contrast */
  border-color: transparent;
  outline: 2px solid rgba(56, 189, 248, 0.35);
}

.tab { display: none; }
.tab.active { display: block; }

.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 95%, transparent), color-mix(in srgb, var(--panel-2) 95%, transparent));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.card .card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 8px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; }
label { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }

.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
input[type="text"] {
  background: color-mix(in srgb, var(--panel) 96%, white 4%);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
input[type="text"]:focus {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
}

/* Larger font for the answer input */
#answerInput {
  font-size: 20px;
  line-height: 1.2;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

/* Tooltip for elements with title attribute (ensures visibility on hover) */
.tab-button[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  white-space: nowrap;
  box-shadow: var(--shadow);
  pointer-events: none;
  z-index: 10;
  font-size: 12px;
}
.tab-button[title]:hover::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent var(--panel) transparent;
}
button.primary { background: linear-gradient(180deg, #22c55e, #16a34a); color: #08210f; font-weight: 700; }
button.secondary { background: color-mix(in srgb, var(--panel) 90%, transparent); color: var(--text); border: 1px solid var(--border); }
button.danger { background: linear-gradient(180deg, #ef4444, #b91c1c); color: #2a0a0a; font-weight: 700; }
button[aria-pressed="true"] { outline: 2px solid rgba(96, 165, 250, 0.35); }

.words-list { list-style: none; margin: 0; padding: 0; }
.words-list li {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}
.words-list .word {
  font-weight: 600;
}
.words-list .translations { color: var(--muted); }
.words-list .word, .words-list .translations {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline editable inputs */
.inline-input {
  width: 100%;
  background: #101733;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  outline: none;
}
.inline-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96,165,250,0.25);
}
.inline-input.success {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}
.inline-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.25);
}

/* Save tick indicator */
.save-tick {
  color: #22c55e;
  font-weight: 700;
  opacity: 0;
  transition: opacity .2s ease;
  margin-left: 6px;
}
.save-tick.show {
  opacity: 1;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 92%, white 8%);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.user-badge { margin-left: 6px; font-weight: 600; }
.highlight { animation: highlightFade 1.2s ease-out; background: color-mix(in srgb, var(--accent) 12%, transparent); }
@keyframes highlightFade {
  0% { background: color-mix(in srgb, var(--accent) 25%, transparent); }
  100% { background: transparent; }
}
.icon-btn { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 6px 8px; }

.empty, .done { text-align: center; color: var(--muted); padding: 16px 8px; }

.quiz.hidden, .done.hidden { display: none; }

.flashcard {
  background: color-mix(in srgb, var(--panel) 96%, white 4%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
}
.prompt-label { color: var(--muted); font-size: 12px; }
.prompt { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; margin-top: 6px; }

.score-row { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.feedback { min-height: 20px; margin-top: 6px; }
.feedback .ok { color: var(--primary); font-weight: 700; }
.feedback .ko { color: var(--danger); font-weight: 700; }
.feedback .user-answer-big {
  font-size: 30px;
  text-align: center;
  margin-top: 6px;
}
.feedback .expected {
  color: var(--muted);
  margin-top: 4px;
  text-align: center;
}
/* New incorrect row and expected answer */
.feedback .incorrect-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--danger);
  font-weight: 700;
  justify-content: center;
}
.feedback .incorrect-row .cross {
  font-size: 18px;
}
.feedback .incorrect-row .incorrect-text {
  font-size: 14px;
}
.feedback .expected-big {
  text-align: center;
  font-size: 20px;
  margin-top: 6px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10001;
}
.toast {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success { border-color: #16a34a55; }
.toast.error { border-color: #dc262655; }

/* Celebration overlay image (footballer "chuut") */
.celebrate-overlay-img {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 60vw;
  max-height: 60vh;
  z-index: 10000;
  display: none;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  border: 2px solid var(--border);
  background: var(--panel);
}

.app-footer { text-align: center; padding: 16px; color: var(--muted); }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* Stats horizontal scroll */
.stats-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.stats-wrapper canvas {
  display: block;
  min-width: 960px; /* allow horizontal sliding if many points */
}

/* Larger emoji utility */
.emoji-large {
  font-size: 28px;
  line-height: 1;
  display: inline-block;
}

/* Light theme specific adjustments */
.theme-light button.primary {
  background: linear-gradient(180deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
}

.theme-light button.danger {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #ffffff;
  font-weight: 700;
}

.theme-light .inline-input {
  background: #f8fafc;
}

.theme-light .tabs .tab-button.active[data-tab="review"],
.theme-light .tabs .tab-button.active[data-tab="stats"] {
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
  color: #ffffff;
  border-color: transparent;
  outline: 2px solid rgba(59, 130, 246, 0.25);
}

.theme-light input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.theme-light .deck-bar {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.theme-light .deck-select {
  background: #ffffff;
  border: 1px solid var(--border);
}

.theme-light .deck-select:hover {
  border-color: var(--accent);
}

.theme-light .deck-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Kids Sport theme specific styles */
.theme-kids button.primary {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.theme-kids button.danger {
  background: linear-gradient(180deg, #fb7185, #f43f5e);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.theme-kids .tabs .tab-button.active[data-tab="review"],
.theme-kids .tabs .tab-button.active[data-tab="stats"] {
  background: linear-gradient(180deg, #a78bfa, #8b5cf6);
  color: #ffffff;
  border-color: transparent;
  outline: 2px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.theme-kids .deck-bar {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #fbbf24;
  backdrop-filter: blur(8px);
}

.theme-kids .deck-select {
  background: #ffffff;
  border: 2px solid #fde68a;
}

.theme-kids .deck-select:hover {
  border-color: #fbbf24;
}

.theme-kids .deck-select:focus {
  border-color: #f59e0b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.theme-kids .card {
  border: 2px solid #fde68a;
}

/* Jungle theme specific styles */
.theme-jungle button.primary {
  background: linear-gradient(180deg, #34d399, #10b981);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.theme-jungle button.danger {
  background: linear-gradient(180deg, #fb923c, #f97316);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.theme-jungle .tabs .tab-button.active[data-tab="review"],
.theme-jungle .tabs .tab-button.active[data-tab="stats"] {
  background: linear-gradient(180deg, #5eead4, #14b8a6);
  color: #064e3b;
  border-color: transparent;
  outline: 2px solid rgba(20, 184, 166, 0.35);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
  font-weight: 700;
}

.theme-jungle .deck-bar {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #6ee7b7;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.theme-jungle .deck-select {
  background: #ffffff;
  border: 2px solid #a7f3d0;
  color: #064e3b;
  font-weight: 600;
}

.theme-jungle .deck-select:hover {
  border-color: #6ee7b7;
}

.theme-jungle .deck-select:focus {
  border-color: #10b981;
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.theme-jungle .card {
  border: 2px solid #a7f3d0;
  background: rgba(255, 255, 255, 0.98);
}

.theme-jungle .app-header {
  position: relative;
  z-index: 1;
}

.theme-jungle .container {
  position: relative;
  z-index: 1;
}

/* Matrix theme specific styles */
.theme-matrix button.primary {
  background: linear-gradient(180deg, #00ff41, #00cc33);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.8);
}

.theme-matrix button.danger {
  background: linear-gradient(180deg, #ff0000, #cc0000);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.theme-matrix .tabs .tab-button.active[data-tab="review"],
.theme-matrix .tabs .tab-button.active[data-tab="stats"] {
  background: linear-gradient(180deg, #00ff41, #00cc33);
  color: #000000;
  border-color: transparent;
  outline: 2px solid rgba(0, 255, 65, 0.5);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
  font-weight: 700;
}

.theme-matrix .deck-bar {
  background: rgba(0, 20, 0, 0.9);
  border: 2px solid #003b00;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.theme-matrix .deck-select {
  background: rgba(0, 20, 0, 0.95);
  border: 2px solid #003b00;
  color: #00ff41;
  font-weight: 600;
}

.theme-matrix .deck-select:hover {
  border-color: #00ff41;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.theme-matrix .deck-select:focus {
  border-color: #00ff41;
  outline: none;
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.theme-matrix .card {
  border: 2px solid #003b00;
  background: rgba(0, 20, 0, 0.95);
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
}

.theme-matrix .app-header {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
}

.theme-matrix .container {
  position: relative;
  z-index: 1;
}

#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Forest theme specific styles */
.theme-forest button.primary {
  background: linear-gradient(180deg, #3d7a3d, #2d5f2d);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(45, 95, 45, 0.4);
}

.theme-forest button.danger {
  background: linear-gradient(180deg, #a0522d, #8b4513);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
}

.theme-forest .tabs .tab-button.active[data-tab="review"],
.theme-forest .tabs .tab-button.active[data-tab="stats"] {
  background: linear-gradient(180deg, #32cd32, #228b22);
  color: #ffffff;
  border-color: transparent;
  outline: 2px solid rgba(34, 139, 34, 0.35);
  box-shadow: 0 4px 12px rgba(34, 139, 34, 0.4);
  font-weight: 700;
}

.theme-forest .deck-bar {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #90ee90;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(26, 58, 26, 0.2);
}

.theme-forest .deck-select {
  background: #ffffff;
  border: 2px solid #90ee90;
  color: #1a3a1a;
  font-weight: 600;
}

.theme-forest .deck-select:hover {
  border-color: #228b22;
}

.theme-forest .deck-select:focus {
  border-color: #228b22;
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.25);
}

.theme-forest .card {
  border: 2px solid #90ee90;
  background: rgba(255, 255, 255, 0.98);
}

.theme-forest .app-header,
.theme-forest .container {
  position: relative;
  z-index: 1;
}

.forest-tree {
  position: fixed;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  font-size: 80px;
  transform-origin: bottom center;
  animation: grow-tree 8s ease-out forwards;
  opacity: 0.7;
}

@keyframes grow-tree {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    transform: scaleY(1);
    opacity: 0.7;
  }
}

@media (max-width: 640px) {
  .words-list li { grid-template-columns: 1fr; align-items: start; }
  .form-row { flex-direction: column; align-items: stretch; }
}

/* Training stats styles */
.training-summary {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}

.training-summary strong {
  color: var(--primary);
  font-weight: 700;
}

.training-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 96%, white 4%);
  font-size: 14px;
}

.question-answer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.question-answer .word {
  font-weight: 600;
  color: var(--text);
}

.question-answer .arrow {
  color: var(--muted);
  font-size: 12px;
}

.question-answer .answer {
  color: var(--muted);
  font-size: 13px;
}

.training-stat-item.success {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
}

.training-stat-item.warning {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--panel));
}

.training-stat-item.error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}
