@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;700&family=Outfit:wght@500;700&display=swap");

:root {
  --bg: #0d1c2f;
  --panel: rgba(13, 28, 47, 0.82);
  --ink: #eff7ff;
  --muted: #b4c7dd;
  --line: rgba(170, 203, 235, 0.3);
  --primary: #00b889;
  --primary-ink: #06281f;
  --secondary: #2a4368;
  --danger: #da4d47;
  --accent: #ffc857;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, #19406b, #0b1828 52%, #060d16);
  color: var(--ink);
  font-family: "Lexend", "Segoe UI", sans-serif;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(26px);
  pointer-events: none;
  opacity: 0.35;
}

.shape-a {
  width: 260px;
  height: 260px;
  top: -70px;
  right: -60px;
  background: #25c99a;
}

.shape-b {
  width: 230px;
  height: 230px;
  bottom: -70px;
  left: -60px;
  background: #ffbf3f;
}

.student-shell {
  width: min(920px, 94vw);
  margin: 1.3rem auto;
}

.screen {
  display: grid;
  gap: 1rem;
}

.screen.hidden {
  display: none;
}

.kicker {
  margin: 0;
  color: #8dd7c5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Outfit", "Lexend", sans-serif;
}

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.lede {
  margin: 0;
  color: var(--muted);
}

.card,
.exercise-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  padding: 1rem;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.33rem;
}

label span {
  font-size: 0.86rem;
  color: var(--muted);
}

input {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(10, 20, 33, 0.9);
  color: var(--ink);
  padding: 0.58rem 0.66rem;
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0.58rem 0.9rem;
  font: inherit;
  font-weight: 600;
}

.primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.secondary {
  background: var(--secondary);
  color: #ecf4ff;
}

.danger {
  background: var(--danger);
  color: #fff5f4;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.micro {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.meta {
  color: #d6e8ff;
  font-size: 0.95rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.mode-card {
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(214, 237, 255, 0.3);
  background: rgba(12, 32, 56, 0.85);
  color: var(--ink);
  padding: 1rem;
  display: grid;
  gap: 0.4rem;
}

.mode-card.vocab {
  border-color: rgba(0, 184, 137, 0.5);
}

.mode-card.decoding {
  border-color: rgba(255, 200, 87, 0.5);
}

.mode-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.exercise-card {
  min-height: 170px;
  display: grid;
  align-content: center;
  gap: 0.48rem;
}

.exercise-card.empty {
  color: var(--muted);
}

.exercise-card .french {
  font-size: clamp(1.5rem, 6vw, 2.3rem);
  font-weight: 700;
}

.exercise-card .english {
  font-size: 1.12rem;
  color: #d4e9ff;
}

.exercise-card .emoji {
  font-size: 1.5rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.practice-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  background: rgba(11, 30, 52, 0.8);
  color: #d9ebff;
}

.decoding-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  gap: 0.9rem;
}

.challenge-panel,
.practice-panel,
.voice-panel,
.blend-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(9, 24, 42, 0.8);
  padding: 1rem;
}

.section-label {
  margin: 0 0 0.22rem;
  color: #8dd7c5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.section-headline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.85rem;
}

.section-headline.compact {
  align-items: center;
}

.challenge-prompt {
  min-height: 132px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(255, 200, 87, 0.22), transparent 35%),
    linear-gradient(180deg, rgba(18, 49, 80, 0.96), rgba(7, 18, 30, 0.92));
  border: 1px solid rgba(166, 206, 244, 0.22);
  padding: 1rem;
  display: grid;
  align-content: center;
  gap: 0.4rem;
}

.challenge-prompt .prompt-kicker {
  color: #9bc5ef;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-prompt .prompt-main {
  font-family: "Outfit", "Lexend", sans-serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.05;
}

.challenge-prompt .prompt-main.emoji {
  font-size: clamp(2rem, 7vw, 3.2rem);
}

.challenge-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0;
}

.challenge-choice {
  border: 1px solid rgba(174, 206, 232, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(17, 40, 69, 0.95), rgba(6, 18, 32, 0.96));
  color: var(--ink);
  min-height: 104px;
  padding: 0.8rem;
  text-align: left;
  display: grid;
  gap: 0.3rem;
  align-content: center;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.challenge-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 200, 87, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.challenge-choice .choice-main {
  font-family: "Outfit", "Lexend", sans-serif;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  line-height: 1.08;
}

.challenge-choice .choice-main.emoji {
  font-size: clamp(2rem, 5vw, 2.6rem);
}

.challenge-choice .choice-sub {
  font-size: 0.82rem;
  color: #b7cee6;
}

.challenge-choice.correct {
  border-color: rgba(0, 184, 137, 0.8);
  background: linear-gradient(180deg, rgba(10, 73, 59, 0.96), rgba(5, 31, 27, 0.96));
}

.challenge-choice.wrong {
  border-color: rgba(218, 77, 71, 0.8);
  background: linear-gradient(180deg, rgba(95, 30, 33, 0.96), rgba(36, 8, 11, 0.96));
}

.challenge-choice.idle-dim {
  opacity: 0.75;
}

.practice-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.practice-tile {
  border: 1px solid rgba(174, 206, 232, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(17, 40, 69, 0.95), rgba(6, 18, 32, 0.96));
  color: var(--ink);
  padding: 0.8rem;
  text-align: left;
  display: grid;
  gap: 0.3rem;
  min-height: 122px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.practice-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 200, 87, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.practice-tile .tile-word {
  font-family: "Outfit", "Lexend", sans-serif;
  font-size: 1.2rem;
  line-height: 1.08;
}

.practice-tile .tile-meaning {
  color: #b3c9df;
  font-size: 0.84rem;
}

.practice-tile .tile-emoji {
  font-size: 1.4rem;
  line-height: 1;
  justify-self: end;
}

.practice-tile .tile-rank {
  color: #84a0bc;
  font-size: 0.72rem;
}

.practice-tile.correct {
  border-color: rgba(0, 184, 137, 0.8);
  background: linear-gradient(180deg, rgba(10, 73, 59, 0.96), rgba(5, 31, 27, 0.96));
}

.practice-tile.wrong {
  border-color: rgba(218, 77, 71, 0.8);
  background: linear-gradient(180deg, rgba(95, 30, 33, 0.96), rgba(36, 8, 11, 0.96));
}

.practice-tile.idle-dim {
  opacity: 0.82;
}

.practice-tile.active {
  border-color: rgba(255, 200, 87, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 200, 87, 0.22);
}

.voice-row {
  align-items: end;
}

.voice-picker {
  min-width: min(320px, 100%);
}

.voice-picker select {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(10, 20, 33, 0.9);
  color: var(--ink);
  padding: 0.58rem 0.66rem;
  font: inherit;
}

.blend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.blend-chip {
  border: 1px dashed rgba(185, 206, 228, 0.6);
  border-radius: 10px;
  background: rgba(6, 20, 35, 0.75);
  text-align: center;
  padding: 0.33rem 0.45rem;
  font-size: 0.88rem;
  color: #d6ebff;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.blend-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 200, 87, 0.75);
}

.blend-chip.active {
  border-style: solid;
  border-color: rgba(0, 184, 137, 0.85);
  background: rgba(8, 56, 46, 0.85);
}

.blend-result {
  border: 1px solid rgba(166, 206, 244, 0.22);
  border-radius: 12px;
  background: rgba(7, 18, 30, 0.8);
  padding: 0.8rem;
}

.toast {
  position: fixed;
  right: 0.8rem;
  bottom: 0.8rem;
  background: #0e2c4f;
  color: #eff8ff;
  border-radius: 10px;
  padding: 0.48rem 0.72rem;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }

  .decoding-layout {
    grid-template-columns: 1fr;
  }

  .practice-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challenge-choices {
    grid-template-columns: 1fr;
  }

  .blend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
