/* ============================================================
   Languages Revision — liquid glass UI
   Shared stylesheet for every page
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #06080f;
  --text: #f7f8fc;
  --muted: rgba(226, 233, 255, 0.62);
  --faint: rgba(226, 233, 255, 0.55);
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);

  --accent-rgb: 138, 170, 255;
  --accent: rgb(var(--accent-rgb));
  --accent-2-rgb: 190, 166, 255;

  /* Study / game surfaces */
  --panel: rgba(255, 255, 255, 0.055);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --panel-solid: #0d1324;
  --field: rgba(6, 10, 22, 0.55);
  --option-bg: rgba(255, 255, 255, 0.045);
  --chip-bg: rgba(255, 255, 255, 0.045);
  --seg-bg: rgba(255, 255, 255, 0.05);
  --seg-active: rgba(255, 255, 255, 0.14);
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, 0.14);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --shadow-soft: 0 26px 70px -36px rgba(0, 0, 0, 0.85);

  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 18px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Inter, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype",
    Palatino, Georgia, serif;
}

/* Language accent themes */
body[data-lang="fr"] {
  --accent-rgb: 122, 162, 255;
  --accent-2-rgb: 196, 166, 255;
}

body[data-lang="es"] {
  --accent-rgb: 255, 190, 106;
  --accent-2-rgb: 255, 138, 122;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(var(--accent-rgb), 0.32);
  color: #fff;
}

:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.9);
  outline-offset: 4px;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

/* ---------- Ambient scene ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -12%, #131b34 0%, #0a0e1c 46%, #05070e 100%);
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 46% at 50% -4%, rgba(126, 156, 255, 0.2), transparent 70%),
    radial-gradient(46% 38% at 8% 22%, rgba(255, 162, 96, 0.12), transparent 72%),
    radial-gradient(40% 40% at 94% 16%, rgba(255, 122, 156, 0.1), transparent 72%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
  animation: drift 28s ease-in-out infinite alternate;
}

.orb--1 {
  width: 48vw;
  height: 48vw;
  min-width: 440px;
  min-height: 440px;
  left: -12vw;
  top: -10vw;
  background: radial-gradient(
    circle at 38% 38%,
    rgba(84, 118, 255, 0.62),
    rgba(84, 118, 255, 0) 68%
  );
}

.orb--2 {
  width: 40vw;
  height: 40vw;
  min-width: 360px;
  min-height: 360px;
  right: -12vw;
  top: 6%;
  opacity: 0.45;
  background: radial-gradient(
    circle at 55% 50%,
    rgba(255, 154, 88, 0.55),
    rgba(255, 154, 88, 0) 70%
  );
  animation-delay: -9s;
  animation-duration: 34s;
}

.orb--3 {
  width: 46vw;
  height: 46vw;
  min-width: 420px;
  min-height: 420px;
  left: 20%;
  bottom: -32%;
  opacity: 0.4;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 116, 164, 0.42),
    rgba(255, 116, 164, 0) 70%
  );
  animation-delay: -16s;
  animation-duration: 38s;
}

.grain {
  position: absolute;
  inset: -40%;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4%, 6%, 0) scale(1.08);
  }
}

/* ---------- Glass surfaces ---------- */
.glass {
  position: relative;
  background:
    linear-gradient(
      148deg,
      rgba(255, 255, 255, 0.125),
      rgba(255, 255, 255, 0.05) 44%,
      rgba(255, 255, 255, 0.028)
    );
  border: 1px solid var(--line);
  box-shadow:
    0 26px 70px -28px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.16),
    transparent 30%,
    transparent 68%,
    rgba(255, 255, 255, 0.05)
  );
}

/* Cursor-following specular highlight */
.glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.16),
    transparent 66%
  );
}

.card:hover .glare,
.year-card:hover .glare {
  opacity: 1;
}

/* ---------- Page shells ---------- */
.shell {
  width: min(1120px, 100% - 40px);
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(24px, 4.5vh, 52px) 0 28px;
  display: flex;
  flex-direction: column;
}

.shell--inner {
  width: min(1040px, 100% - 40px);
  padding: clamp(16px, 3vh, 28px) 0 32px;
}

.landing {
  margin-block: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ---------- Brand / logo ---------- */
.brand {
  position: relative;
  display: flex;
  justify-content: center;
  isolation: isolate;
}

.brand::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 560px;
  height: 340px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(138, 170, 255, 0.28), transparent 72%),
    radial-gradient(closest-side at 68% 72%, rgba(255, 160, 96, 0.18), transparent 70%);
  filter: blur(26px);
  z-index: -1;
}

.brand__plate {
  position: relative;
  padding: clamp(12px, 1.6vw, 18px);
  border-radius: 32px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.96),
    rgba(234, 240, 255, 0.86)
  );
  box-shadow:
    0 34px 90px -34px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.42),
    inset 0 1px 0 #fff;
}

.brand__logo {
  display: block;
  width: clamp(220px, 23vw, 304px);
  height: auto;
  border-radius: 20px;
}

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 11px;
  font-weight: 590;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 1px rgba(var(--accent-rgb), 0.85);
  flex: none;
}

.hero {
  text-align: center;
  margin-top: clamp(22px, 3.4vh, 38px);
}

.hero h1 {
  margin: 14px 0 12px;
  text-wrap: balance;
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 620;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 48ch;
  margin: 0 auto;
  text-wrap: pretty;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.62;
  letter-spacing: -0.005em;
}

/* ---------- Language cards ---------- */
.languages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  width: min(720px, 100%);
  margin-top: clamp(26px, 4.4vh, 44px);
}

.card {
  --card-rgb: 122, 162, 255;
  --card-2-rgb: 196, 166, 255;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 286px;
  padding: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  isolation: isolate;
  transition:
    transform 0.55s var(--ease),
    border-color 0.4s ease,
    box-shadow 0.55s var(--ease);
}

.card--fr {
  --card-rgb: 104, 146, 255;
  --card-2-rgb: 196, 166, 255;
}

.card--es {
  --card-rgb: 255, 184, 92;
  --card-2-rgb: 255, 126, 116;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.16),
    transparent 30%,
    transparent 68%,
    rgba(255, 255, 255, 0.05)
  );
}

.card::after {
  content: "";
  position: absolute;
  inset: auto -25% -55% -25%;
  height: 80%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(var(--card-rgb), 0.34),
    rgba(var(--card-rgb), 0) 72%
  );
  opacity: 0.55;
  transition: opacity 0.5s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(var(--card-rgb), 0.46);
  box-shadow:
    0 44px 90px -34px rgba(0, 0, 0, 0.9),
    0 0 70px -26px rgba(var(--card-rgb), 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.card:hover::after,
.card:focus-visible::after {
  opacity: 0.9;
}

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.flag {
  position: relative;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 17px;
  overflow: hidden;
  box-shadow:
    0 12px 28px -12px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.flag::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.42),
    transparent 46%,
    rgba(0, 0, 0, 0.16)
  );
}

.flag--fr {
  background: linear-gradient(
    90deg,
    #2f4bd0 0 33.34%,
    #f5f7ff 33.34% 66.67%,
    #e23b4e 66.67% 100%
  );
}

.flag--es {
  background: linear-gradient(
    180deg,
    #d92d3f 0 26%,
    #ffc93c 26% 74%,
    #d92d3f 74% 100%
  );
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(240, 244, 255, 0.66);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card__body {
  margin-top: auto;
}

.card__native {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.4vw, 46px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.card__name {
  display: block;
  margin-top: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: rgba(246, 249, 255, 0.78);
}

.arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  transition:
    transform 0.45s var(--ease),
    background 0.35s ease,
    border-color 0.35s ease;
}

.arrow svg {
  width: 16px;
  height: 16px;
}

.card:hover .arrow,
.card:focus-visible .arrow {
  transform: translateX(3px) rotate(-45deg);
  background: rgba(var(--card-rgb), 0.3);
  border-color: rgba(var(--card-rgb), 0.4);
}

/* ---------- Not found ---------- */
.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.notfound .mark--lg {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  font-size: 20px;
  margin-bottom: 26px;
}

.notfound .eyebrow {
  justify-content: center;
}

.notfound .lede {
  max-width: 38ch;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
  color: rgba(247, 249, 255, 0.9);
  transition:
    transform 0.45s var(--ease),
    border-color 0.35s ease,
    box-shadow 0.45s var(--ease);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow:
    0 24px 50px -24px rgba(0, 0, 0, 0.9),
    0 0 44px -22px rgba(var(--accent-rgb), 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button .arrow {
  width: 36px;
  height: 36px;
}

.button:hover .arrow,
.button:focus-visible .arrow {
  transform: translateX(2px) rotate(-45deg);
  background: rgba(var(--accent-rgb), 0.26);
  border-color: rgba(var(--accent-rgb), 0.36);
}

.page-foot {
  margin: 0;
  padding-top: clamp(26px, 4.6vh, 48px);
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(226, 233, 255, 0.4);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 10px 9px 12px;
  border-radius: 999px;
  background:
    linear-gradient(
      148deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.035)
    ),
    rgba(9, 12, 23, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line-soft);
  box-shadow:
    0 18px 44px -22px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(238, 243, 255, 0.76);
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  transition:
    background 0.28s ease,
    color 0.28s ease;
}

.back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.back svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(238, 243, 255, 0.72);
}

.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.05)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: -0.03em;
}

.topbar__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.1);
  color: rgba(244, 248, 255, 0.82);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar__end {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ---------- Theme controls ---------- */
.theme-dock {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border-radius: 999px;
}

.theme-dock > * {
  position: relative;
  z-index: 1;
}

.theme-dock__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
}

.theme-dock__btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.theme-dock__btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.theme-dock__btn[aria-pressed="true"] {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.theme-mini {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
}

.theme-mini:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(var(--accent-rgb), 0.32);
}

.theme-mini svg {
  width: 16px;
  height: 16px;
}

/* ---------- Year selection ---------- */
.year-hero {
  text-align: center;
  padding: clamp(38px, 8vh, 78px) 0 clamp(26px, 4vh, 42px);
}

.year-hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 620;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.year-hero .lede {
  max-width: 42ch;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.7vw, 18px);
}

.year-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 188px;
  padding: 19px;
  border-radius: 26px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  isolation: isolate;
  transition:
    transform 0.5s var(--ease),
    border-color 0.35s ease,
    box-shadow 0.5s var(--ease);
}

.year-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% -30%;
  height: 85%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(var(--accent-rgb), 0.3),
    rgba(var(--accent-rgb), 0) 72%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}

.year-card:hover,
.year-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow:
    0 36px 70px -32px rgba(0, 0, 0, 0.88),
    0 0 56px -24px rgba(var(--accent-rgb), 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.year-card:hover::after,
.year-card:focus-visible::after {
  opacity: 1;
}

.year-card__stage {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(236, 242, 255, 0.56);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.year-card__big {
  font-family: var(--font-serif);
  font-size: clamp(52px, 6.4vw, 76px);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.05em;
  background: linear-gradient(
    180deg,
    #ffffff 20%,
    rgba(255, 255, 255, 0.52)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: filter 0.4s ease;
}

.year-card:hover .year-card__big,
.year-card:focus-visible .year-card__big {
  filter: drop-shadow(0 0 22px rgba(var(--accent-rgb), 0.55));
}

.year-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  font-weight: 550;
  color: rgba(244, 248, 255, 0.82);
}

.year-card__row .arrow {
  width: 32px;
  height: 32px;
}

.year-card__row .arrow svg {
  width: 14px;
  height: 14px;
}

.year-card:hover .arrow,
.year-card:focus-visible .arrow {
  transform: translateX(2px) rotate(-45deg);
  background: rgba(var(--accent-rgb), 0.26);
  border-color: rgba(var(--accent-rgb), 0.36);
}

.year-note {
  margin: clamp(22px, 3.6vh, 34px) 0 0;
  text-align: center;
  font-size: 12px;
  color: rgba(226, 233, 255, 0.52);
  letter-spacing: 0.02em;
}

/* ---------- Year detail page ---------- */
.detail-hero {
  padding: clamp(42px, 9vh, 92px) 0 0;
}

.detail-hero .eyebrow {
  justify-content: flex-start;
}

.detail-hero h1 {
  margin: 16px 0 10px;
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 630;
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.detail-hero h1 span {
  color: rgba(var(--accent-rgb), 0.9);
}

.detail-hero .lede {
  margin: 0;
  max-width: 50ch;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: clamp(28px, 5vh, 50px);
  padding: clamp(30px, 5.4vw, 58px) clamp(22px, 4vw, 48px);
  border-radius: var(--radius-xl);
  text-align: center;
}

.placeholder__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 21px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: linear-gradient(
    150deg,
    rgba(var(--accent-rgb), 0.24),
    rgba(var(--accent-rgb), 0.06)
  );
  color: rgba(var(--accent-rgb), 0.95);
  box-shadow:
    0 0 56px -12px rgba(var(--accent-rgb), 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.placeholder__icon svg {
  width: 26px;
  height: 26px;
}

.placeholder h2 {
  margin: 4px 0 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.placeholder p {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(234, 240, 255, 0.56);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.04em;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: clamp(30px, 6vh, 56px);
}

.pager__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.4s var(--ease);
}

.pager__link:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(var(--accent-rgb), 0.32);
}

.pager__link--next {
  justify-content: flex-end;
  text-align: right;
}

.pager__link--next:hover {
  transform: translateX(2px);
}

.pager__link--prev:hover {
  transform: translateX(-2px);
}

.pager__dir {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(226, 233, 255, 0.52);
}

.pager__year {
  display: block;
  margin-top: 2px;
  font-size: 14.5px;
  font-weight: 550;
  color: rgba(246, 249, 255, 0.86);
}

.pager__link svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.7;
}

.pager__spacer {
  display: block;
}

/* ---------- Study hub ---------- */
.study {
  margin-top: clamp(28px, 5vh, 50px);
  scroll-margin-top: 104px;
}

.study button {
  font: inherit;
  cursor: pointer;
}

.study-panel {
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3.2vw, 34px);
}

.study-panel + .study-section-head {
  margin-top: clamp(26px, 4vh, 38px);
}

.study-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.study-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.study-head h2,
.study-section-head h2 {
  margin: 0;
  font-size: clamp(23px, 2.8vw, 32px);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.study-head p,
.study-section-head p {
  max-width: 58ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.study-head__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.selected-count {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

.selected-count b {
  color: var(--text);
  font-weight: 650;
}

.study-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
}

.study-link:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
}

.set-group {
  margin-top: 22px;
}

.set-label {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 9px;
}

.topic-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--chip-bg);
  color: var(--text);
  text-align: left;
  transition:
    transform 0.25s var(--ease),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.topic-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.42);
}

.topic-chip[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.12),
    0 12px 28px -22px rgba(var(--accent-rgb), 0.8);
}

.topic-chip__emoji {
  flex: none;
  font-size: 20px;
  line-height: 1;
}

.topic-chip__text {
  flex: 1;
  min-width: 0;
}

.topic-chip__name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-chip__meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}

.topic-chip__check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: transparent;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.topic-chip__check svg {
  width: 12px;
  height: 12px;
}

.topic-chip[aria-pressed="true"] .topic-chip__check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.setting__label {
  display: block;
  margin-bottom: 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.seg {
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--seg-bg);
}

.seg button {
  min-height: 29px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.seg button:hover {
  color: var(--text);
}

.seg button[aria-pressed="true"] {
  background: var(--seg-active);
  color: var(--text);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.study-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 11px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-height: 148px;
  padding: 17px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--chip-bg);
  color: var(--text);
  text-align: left;
  transition:
    transform 0.3s var(--ease),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.3s ease;
}

.mode-card:hover,
.mode-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: 0 22px 48px -34px rgba(var(--accent-rgb), 0.6);
}

.mode-card__icon {
  margin-bottom: 3px;
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
}

.mode-card strong {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.mode-card__desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.42;
}

.mode-card__best {
  margin-top: auto;
  padding-top: 8px;
  color: var(--good);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.study-note {
  margin: 18px 0 0;
  color: var(--faint);
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
}

/* ---------- Games ---------- */
.game {
  min-height: 420px;
}

.game-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(18px, 3vh, 28px);
}

.progress-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--seg-bg);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--accent),
    rgba(var(--accent-2-rgb), 0.9)
  );
  transition: width 0.35s var(--ease);
}

.game-count {
  min-width: 52px;
  color: var(--muted);
  text-align: right;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.study-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.study-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
}

.study-btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px -18px rgba(var(--accent-rgb), 0.9);
}

.study-btn--primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}

.study-btn--good {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--good);
}

.study-btn--bad {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}

.study-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.study-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.study-btn--sm {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
}

.study-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.study-row--center {
  justify-content: center;
}

.question-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 20px) 0 8px;
  text-align: center;
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.question-emoji {
  margin: 0 0 8px;
  font-size: clamp(72px, 18vw, 116px);
  line-height: 1.05;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.18));
}

.question-prompt {
  margin: 0 0 16px;
  font-size: clamp(22px, 4.2vw, 33px);
  font-weight: 620;
  line-height: 1.18;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.question-hint {
  margin: -6px 0 15px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pron {
  color: var(--accent);
}

.blank {
  display: inline-block;
  min-width: 2.5em;
  border-bottom: 3px solid var(--accent);
  color: transparent;
  user-select: none;
}

.audio-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.answer-grid {
  display: grid;
  gap: 9px;
  margin-top: 8px;
  text-align: left;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--option-bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.35;
  text-align: left;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.answer-option:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.1);
}

.answer-option__key {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--seg-bg);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.answer-option.is-right {
  border-color: var(--good);
  background: var(--good-soft);
}

.answer-option.is-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.answer-option:disabled {
  cursor: default;
}

.text-answer {
  width: 100%;
  max-width: 520px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 19px;
  text-align: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.text-answer::placeholder {
  color: var(--faint);
  font-size: 15px;
}

.text-answer:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.75);
  background: var(--panel-solid);
}

.text-answer.is-ok {
  border-color: var(--good);
  background: var(--good-soft);
}

.text-answer.is-no {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.accent-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 11px 0 14px;
}

.accent-key {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 16px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.accent-key:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.12);
}

.feedback {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  animation: study-pop 0.25s var(--ease);
}

.feedback--good {
  border-color: rgba(74, 222, 128, 0.28);
  background: var(--good-soft);
  color: var(--good);
}

.feedback--bad {
  border-color: rgba(248, 113, 113, 0.28);
  background: var(--bad-soft);
  color: var(--bad);
}

.feedback--warn {
  border-color: rgba(251, 191, 36, 0.28);
  background: var(--warn-soft);
  color: var(--warn);
}

.feedback b {
  font-size: 15px;
}

.feedback__answer {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.35;
}

.feedback__sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
}

.next-row {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

@keyframes study-pop {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Flashcards */
.flash-wrap {
  max-width: 560px;
  margin: 0 auto;
  perspective: 1200px;
}

.flash-card {
  position: relative;
  width: 100%;
  height: clamp(250px, 44vh, 310px);
  padding: 0;
  border: 0;
  background: transparent;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1);
  cursor: pointer;
}

.flash-card.is-flipped {
  transform: rotateY(180deg);
}

.flash-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flash-face--back {
  transform: rotateY(180deg);
  background:
    linear-gradient(148deg, rgba(var(--accent-rgb), 0.18), transparent 70%),
    var(--panel);
}

.flash-lang {
  position: absolute;
  top: 15px;
  left: 17px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.flash-big {
  max-width: 100%;
  font-size: clamp(22px, 4.4vw, 30px);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.flash-say {
  position: absolute;
  right: 13px;
  bottom: 13px;
}

.flash-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tap-note {
  margin: 14px 0 0;
  color: var(--faint);
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
}

/* Match-up */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 9px;
}

.match-tile {
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--option-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.match-tile.is-en {
  background: var(--seg-bg);
}

.match-tile:hover:not(.is-done) {
  border-color: rgba(var(--accent-rgb), 0.55);
}

.match-tile.is-selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
  transform: scale(1.025);
}

.match-tile.is-done {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--good);
  opacity: 0.75;
  cursor: default;
}

.match-tile.is-shake {
  border-color: var(--bad);
  background: var(--bad-soft);
  animation: study-shake 0.4s ease;
}

@keyframes study-shake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Results */
.result-ring {
  --p: 0;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--p) * 1%),
    var(--seg-bg) 0
  );
}

.result-ring > div {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--panel-solid);
  font-size: 31px;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.missed-list {
  margin: 18px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
}

.missed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.missed-row:last-child {
  border-bottom: 0;
}

.missed-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
}

/* Cheat sheet */
.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 13px;
  margin-top: 16px;
}

.cheat-card {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--panel-soft);
}

.cheat-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.cheat-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.cheat-card p:last-child {
  margin-bottom: 0;
}

.cheat-card b {
  color: var(--text);
}

.cheat-tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.table-wrap {
  overflow-x: auto;
}

.study-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.study-table th,
.study-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.study-table tr:last-child td {
  border-bottom: 0;
}

.study-table th {
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.study-table td b {
  color: var(--accent);
}

.study-table td:last-child {
  color: var(--muted);
}

/* Toast + confetti */
.study-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(92vw, 440px);
  padding: 10px 16px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.4;
  text-align: center;
  animation: study-pop 0.2s var(--ease);
}

.confetti {
  position: fixed;
  top: -40px;
  z-index: 90;
  font-size: 24px;
  pointer-events: none;
  animation: study-fall linear forwards;
}

@keyframes study-fall {
  to {
    transform: translateY(112vh) rotate(540deg);
    opacity: 0.9;
  }
}

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #eef2fb;
  --text: #141a2f;
  --muted: rgba(24, 32, 62, 0.68);
  --faint: rgba(24, 32, 62, 0.55);
  --line: rgba(22, 31, 64, 0.15);
  --line-soft: rgba(22, 31, 64, 0.09);

  --accent-rgb: 58, 88, 210;
  --accent: rgb(var(--accent-rgb));
  --accent-2-rgb: 124, 70, 200;

  --panel: rgba(255, 255, 255, 0.62);
  --panel-soft: rgba(255, 255, 255, 0.48);
  --panel-solid: #ffffff;
  --field: rgba(255, 255, 255, 0.72);
  --option-bg: rgba(255, 255, 255, 0.66);
  --chip-bg: rgba(255, 255, 255, 0.58);
  --seg-bg: rgba(22, 31, 64, 0.06);
  --seg-active: #ffffff;
  --good: #15803d;
  --good-soft: #dcfce7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --shadow-soft: 0 26px 70px -42px rgba(31, 45, 90, 0.35);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="light"] body[data-lang="fr"] {
  --accent-rgb: 56, 87, 208;
  --accent-2-rgb: 122, 68, 196;
}

:root[data-theme="light"] body[data-lang="es"] {
  --accent-rgb: 176, 101, 0;
  --accent-2-rgb: 190, 64, 50;
}

:root[data-theme="light"] ::selection {
  color: #fff;
}

:root[data-theme="light"] .scene {
  background: radial-gradient(
    120% 90% at 50% -12%,
    #ffffff 0%,
    #eef2fb 46%,
    #e5ebf8 100%
  );
}

:root[data-theme="light"] .scene::before {
  background:
    radial-gradient(58% 46% at 50% -4%, rgba(96, 130, 240, 0.18), transparent 70%),
    radial-gradient(46% 38% at 8% 22%, rgba(255, 170, 90, 0.14), transparent 72%),
    radial-gradient(40% 40% at 94% 16%, rgba(255, 122, 156, 0.12), transparent 72%);
}

:root[data-theme="light"] .orb {
  opacity: 0.34;
}

:root[data-theme="light"] .orb--2 {
  opacity: 0.28;
}

:root[data-theme="light"] .orb--3 {
  opacity: 0.24;
}

:root[data-theme="light"] .grain {
  opacity: 0.035;
}

:root[data-theme="light"] .brand::before {
  background:
    radial-gradient(closest-side, rgba(96, 130, 240, 0.2), transparent 72%),
    radial-gradient(closest-side at 68% 72%, rgba(255, 160, 96, 0.14), transparent 70%);
}

:root[data-theme="light"] .brand__plate {
  background: linear-gradient(155deg, #ffffff, #f2f6ff);
  box-shadow:
    0 34px 90px -38px rgba(31, 45, 90, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.8),
    inset 0 1px 0 #fff;
}

:root[data-theme="light"] .glass {
  border-color: var(--line);
  background:
    linear-gradient(
      148deg,
      rgba(255, 255, 255, 0.82),
      rgba(255, 255, 255, 0.58) 44%,
      rgba(255, 255, 255, 0.44)
    );
  box-shadow:
    0 26px 70px -32px rgba(31, 45, 90, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}

:root[data-theme="light"] .glass::before {
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.6),
    transparent 32%,
    transparent 68%,
    rgba(255, 255, 255, 0.22)
  );
}

:root[data-theme="light"] .glare {
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 0%),
    rgba(var(--accent-rgb), 0.12),
    transparent 66%
  );
}

:root[data-theme="light"] .card:hover,
:root[data-theme="light"] .card:focus-visible {
  box-shadow:
    0 44px 90px -38px rgba(31, 45, 90, 0.36),
    0 0 70px -30px rgba(var(--card-rgb), 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

:root[data-theme="light"] .pill {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.55);
  color: rgba(24, 32, 62, 0.62);
}

:root[data-theme="light"] .card__foot {
  color: rgba(23, 31, 62, 0.74);
}

:root[data-theme="light"] .arrow {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
}

:root[data-theme="light"] .card:hover .arrow,
:root[data-theme="light"] .card:focus-visible .arrow,
:root[data-theme="light"] .year-card:hover .arrow,
:root[data-theme="light"] .year-card:focus-visible .arrow {
  background: rgba(var(--card-rgb, var(--accent-rgb)), 0.16);
  border-color: rgba(var(--card-rgb, var(--accent-rgb)), 0.32);
}

:root[data-theme="light"] .button {
  color: var(--text);
}

:root[data-theme="light"] .page-foot {
  color: rgba(24, 32, 62, 0.42);
}

:root[data-theme="light"] .topbar {
  border-color: var(--line-soft);
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.68)),
    rgba(241, 245, 255, 0.62);
  box-shadow:
    0 18px 44px -24px rgba(31, 45, 90, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

:root[data-theme="light"] .back,
:root[data-theme="light"] .topbar__brand {
  color: rgba(23, 31, 62, 0.72);
}

:root[data-theme="light"] .back:hover {
  background: rgba(22, 31, 64, 0.06);
  color: var(--text);
}

:root[data-theme="light"] .mark {
  border-color: var(--line);
  background: linear-gradient(150deg, #ffffff, rgba(230, 237, 252, 0.86));
  box-shadow: inset 0 1px 0 #fff;
}

:root[data-theme="light"] .topbar__tag {
  color: rgba(23, 31, 62, 0.74);
}

:root[data-theme="light"] .theme-dock__btn:hover,
:root[data-theme="light"] .theme-mini:hover {
  background: rgba(22, 31, 64, 0.07);
}

:root[data-theme="light"] .theme-dock__btn[aria-pressed="true"] {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

:root[data-theme="light"] .theme-mini {
  background: rgba(255, 255, 255, 0.55);
}

:root[data-theme="light"] .year-card:hover,
:root[data-theme="light"] .year-card:focus-visible {
  box-shadow:
    0 36px 70px -34px rgba(31, 45, 90, 0.36),
    0 0 56px -28px rgba(var(--accent-rgb), 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .year-card__stage {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.54);
  color: rgba(23, 31, 62, 0.56);
}

:root[data-theme="light"] .year-card__big {
  background: linear-gradient(
    180deg,
    #1d2748 20%,
    rgba(29, 39, 72, 0.52)
  );
  -webkit-background-clip: text;
  background-clip: text;
}

:root[data-theme="light"] .year-card__row {
  color: rgba(23, 31, 62, 0.8);
}

:root[data-theme="light"] .year-note {
  color: rgba(24, 32, 62, 0.52);
}

:root[data-theme="light"] .tag {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.5);
  color: rgba(23, 31, 62, 0.6);
}

:root[data-theme="light"] .pager__link:hover {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(var(--accent-rgb), 0.3);
}

:root[data-theme="light"] .pager__dir {
  color: rgba(24, 32, 62, 0.52);
}

:root[data-theme="light"] .pager__year {
  color: rgba(23, 31, 62, 0.86);
}

:root[data-theme="light"] .study-link:hover,
:root[data-theme="light"] .study-btn--ghost:hover {
  background: rgba(22, 31, 64, 0.06);
}

:root[data-theme="light"] .mode-card:hover,
:root[data-theme="light"] .mode-card:focus-visible {
  box-shadow: 0 22px 48px -36px rgba(var(--accent-rgb), 0.42);
}

:root[data-theme="light"] .flash-face {
  box-shadow: var(--shadow-soft);
}

:root[data-theme="light"] .feedback--good {
  border-color: rgba(21, 128, 61, 0.24);
}

:root[data-theme="light"] .feedback--bad {
  border-color: rgba(185, 28, 28, 0.24);
}

:root[data-theme="light"] .feedback--warn {
  border-color: rgba(146, 64, 14, 0.24);
}

:root[data-theme="light"] .result-ring > div {
  box-shadow: 0 8px 24px -18px rgba(31, 45, 90, 0.4);
}

/* ---------- Entrance motion ---------- */
.reveal {
  animation: rise 0.95s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 75ms + 80ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Cross-document page transition ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-out 0.22s ease both;
}

::view-transition-new(root) {
  animation: vt-in 0.42s var(--ease) both;
}

@keyframes vt-out {
  to {
    opacity: 0;
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
    transform: scale(1.008);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar__brand span {
    display: none;
  }
}

@media (max-width: 720px) {
  .shell,
  .shell--inner {
    width: min(100% - 28px, 560px);
  }

  .languages {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .card {
    min-height: 250px;
  }

  .brand__logo {
    width: clamp(200px, 54vw, 280px);
  }

  .brand::before {
    width: 420px;
    height: 280px;
  }

  .topbar__brand {
    display: none;
  }

  .detail-hero h1 {
    font-size: clamp(44px, 13vw, 70px);
  }

  .pager__spacer {
    display: none;
  }
}

@media (max-width: 440px) {
  .shell,
  .shell--inner {
    width: min(100% - 22px, 560px);
  }

  .year-grid {
    gap: 10px;
  }

  .year-card {
    min-height: 158px;
    padding: 15px;
    border-radius: 22px;
  }

  .year-card__big {
    font-size: 48px;
  }

  .year-card__row {
    font-size: 12.5px;
  }

  .year-card__row .arrow {
    width: 28px;
    height: 28px;
  }

  .card {
    padding: 20px;
    border-radius: 24px;
  }

  .card__native {
    font-size: 38px;
  }

  .topbar__tag {
    padding: 7px 11px;
    font-size: 10px;
  }

  .back span {
    display: none;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager__link--next {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (min-width: 660px) {
  .answer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .theme-dock {
    position: static;
    top: auto;
    right: auto;
    display: flex;
    width: max-content;
    margin: max(10px, env(safe-area-inset-top)) auto 0;
  }

  .theme-dock__btn {
    padding: 8px;
  }

  .theme-dock__btn span {
    display: none;
  }

  .study-head {
    align-items: flex-start;
  }

  .study-head__actions {
    width: 100%;
  }

  .mode-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  }

  .match-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (max-width: 440px) {
  .theme-dock__btn {
    min-height: 32px;
  }

  .study-panel {
    padding: 18px;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    gap: 14px;
  }

  .mode-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mode-card {
    min-height: 142px;
    padding: 14px;
  }

  .mode-card__desc {
    font-size: 11.5px;
  }

  .match-grid {
    grid-template-columns: 1fr 1fr;
  }

  .question-prompt {
    font-size: 22px;
  }

  .flash-card {
    height: 258px;
  }

  .flash-face {
    padding: 22px 18px;
  }

  .study-btn {
    padding: 8px 12px;
  }

  .result-ring {
    width: 132px;
    height: 132px;
  }

  .result-ring > div {
    width: 102px;
    height: 102px;
    font-size: 28px;
  }
}

/* ---------- Reduced motion / transparency ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    animation: none;
  }

  .orb {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass,
  .topbar,
  .card,
  .year-card {
    background: #10152a;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  :root[data-theme="light"] .glass,
  :root[data-theme="light"] .topbar,
  :root[data-theme="light"] .card,
  :root[data-theme="light"] .year-card {
    background: #f8faff;
  }

  :root[data-theme="light"] .theme-dock,
  :root[data-theme="light"] .theme-mini {
    background: #ffffff;
  }
}
