:root {
  --ink: #141414;
  --paper: #f8f0de;
  --paper-soft: #f2e8d3;
  --mint: #b8d7be;
  --sky: #7dc4f5;
  --peach: #f5b893;
  --lavender: #e4d3f8;
  --yellow: #f3d63a;
  --accent: #ff7f32;
  --white: #ffffff;
  --muted: #4a4a4a;
  --focus: #f59e0b;
  --focus-shadow: rgba(245, 158, 11, 0.35);
}

:root[data-theme='dark'] {
  --ink: #f6f6f6;
  --paper: #1f2430;
  --paper-soft: #262c3a;
  --mint: #2f4b4f;
  --sky: #1f314d;
  --peach: #4a3430;
  --lavender: #3a2e4a;
  --yellow: #d9b622;
  --accent: #ff9552;
  --white: #131722;
  --muted: #d5d7dd;
  --focus: #ffd166;
  --focus-shadow: rgba(255, 209, 102, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(120deg, var(--sky) 0 26%, var(--paper) 26% 54%, var(--peach) 54% 76%, var(--lavender) 76% 100%);
  font-family: 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 14px;
  top: -48px;
  background: var(--ink);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 6px;
  border: 2px solid var(--white);
  font-weight: 700;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus-visible {
  top: 12px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--focus-shadow);
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 18px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  padding: 10px 18px;
  box-shadow: 4px 4px 0 var(--ink);
}

.brand {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  border: 2px solid transparent;
  padding: 6px 10px;
  border-radius: 999px;
}

nav a[aria-current='page'],
nav a:hover {
  border-color: var(--ink);
  background: var(--yellow);
}

.theme-toggle {
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  cursor: pointer;
}

.page-main {
  margin-top: 28px;
  margin-bottom: 36px;
  padding: 24px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  min-height: calc(100vh - 200px);
}

.hero,
.section,
.section-intro,
.card {
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  border-radius: 6px;
}

.hero {
  background: var(--mint);
  color: var(--ink);
  padding: 28px;
  margin-bottom: 26px;
}

.badge {
  display: inline-block;
  background: var(--yellow);
  color: #181818;
  border: 2px solid #181818;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0;
  line-height: 1.15;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.hero p {
  max-width: 780px;
  font-size: 1.05rem;
}

.hero-actions,
.card-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-intro {
  padding: 20px;
  margin-bottom: 22px;
  background: var(--paper-soft);
}

.section {
  margin: 24px 0;
  padding: 18px;
  background: color-mix(in srgb, var(--paper-soft) 72%, white 28%);
}

.section h2,
.section h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.three-columns {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  padding: 16px;
  background: var(--white);
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.kpi {
  border: 2px solid var(--ink);
  background: var(--paper-soft);
  padding: 10px;
}

.kpi strong {
  display: block;
  font-size: 1.2rem;
}

.btn {
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-secondary {
  background: var(--yellow);
  color: #181818;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 12px;
  margin-bottom: 14px;
}

input,
select {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 10px;
  background: var(--white);
  color: var(--ink);
}

.catalog-count {
  margin: 6px 0 0;
  font-weight: 700;
}

.no-results {
  display: none;
  margin-top: 12px;
  border: 2px dashed var(--ink);
  padding: 12px;
  background: var(--paper-soft);
}

.text-link,
.context-links a {
  color: var(--ink);
  font-weight: 800;
}

.context-links {
  margin-top: 18px;
  font-weight: 600;
}

.footer {
  padding-bottom: 28px;
}

.footer-content {
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 18px;
  text-align: center;
}

.footer a {
  color: var(--ink);
  font-weight: 800;
}

.field,
.field-row {
  margin: 12px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.field {
  flex-direction: column;
  align-items: flex-start;
}

/* =============================================
   GAME-CARD BASE & TOUCH FIX
   ============================================= */

.game-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.game-card .btn,
.game-card .reaction-box,
.game-card .memory-card,
.game-card [data-ppt] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* =============================================
   GAME PROGRESS BAR
   ============================================= */

.game-progress-wrap {
  margin: 10px 0;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-soft);
}

.game-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s linear;
}

.game-progress-bar.warn {
  background: var(--peach);
}

.game-progress-bar.danger {
  background: #ef4444;
  animation: shadow-pulse 0.5s ease infinite;
}

/* =============================================
   GAME SCORE DISPLAY
   ============================================= */

.game-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.game-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
}

.game-score-pill .pill-icon {
  font-size: 1.15rem;
}

.game-score-pill.highlight {
  background: var(--yellow);
  animation: pop-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* =============================================
   REACTION BOX (redesigned)
   ============================================= */

.reaction-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 140px;
  margin-top: 12px;
  background: var(--paper-soft);
  color: var(--ink);
  border: 3px solid var(--ink);
  padding: 22px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1.25rem;
  text-align: center;
  box-shadow: 4px 4px 0 var(--ink);
}

.reaction-box.state-waiting {
  background: var(--paper-soft);
  border-style: dashed;
}

.reaction-box.state-ready {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  animation: pop-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reaction-box.state-done {
  background: var(--sky);
  border-style: solid;
}

.result {
  margin-top: 12px;
  font-weight: 700;
  color: var(--ink) !important;
}

.toast-msg {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  animation: pop-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.imc-bar-wrap {
  margin-top: 10px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(to right, var(--sky) 0% 25%, var(--mint) 25% 50%, var(--yellow) 50% 75%, var(--peach) 75% 100%);
  position: relative;
}

.imc-bar-marker {
  position: absolute;
  top: -2px;
  width: 4px;
  height: 22px;
  background: var(--ink);
  border-radius: 2px;
  transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.juros-table-wrap {
  margin-top: 14px;
  max-height: 260px;
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-radius: 6px;
}

.juros-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.juros-table th,
.juros-table td {
  padding: 6px 10px;
  text-align: right;
  border-bottom: 1px solid var(--paper-soft);
}

.juros-table th {
  position: sticky;
  top: 0;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
}

.juros-table td:first-child,
.juros-table th:first-child {
  text-align: center;
}

.juros-table tbody tr:hover {
  background: var(--paper-soft);
}

.pomodoro-sessions {
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.idade-extra {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.7;
}

.idade-extra strong {
  color: var(--accent);
}

.currency-rate-info {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.currency-loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
}

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

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.memory-grid.grid-6 {
  grid-template-columns: repeat(4, minmax(64px, 1fr));
}

.memory-grid.grid-8 {
  grid-template-columns: repeat(4, minmax(56px, 1fr));
}

.memory-grid.grid-10 {
  grid-template-columns: repeat(5, minmax(52px, 1fr));
}

.memory-card {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sky) 0%, var(--lavender) 100%);
  min-height: 68px;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.memory-card.flipped {
  background: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(255, 127, 50, 0.3);
}

.memory-card.matched {
  background: var(--mint);
  border-color: #16a34a;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.memory-difficulty {
  margin: 10px 0;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.quiz-options .btn {
  text-align: left;
  padding: 12px 18px;
  font-size: 1rem;
  border-radius: 12px;
}

.quiz-options .btn.correct {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
}

.quiz-options .btn.wrong {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}

.quiz-timer-bar {
  margin: 8px 0;
  height: 6px;
  border-radius: 999px;
  background: var(--paper-soft);
  overflow: hidden;
}

.quiz-timer-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 1s linear;
}

/* =============================================
   QUIZ CATEGORY GRID
   ============================================= */

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

.quiz-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--cat-color, var(--white));
  cursor: pointer;
  font-family: inherit;
  box-shadow: 3px 3px 0 var(--ink);
  animation: fade-in-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-cat-card:hover {
  transform: translate(-2px, -4px);
  box-shadow: 5px 7px 0 var(--ink);
}

.quiz-cat-card:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.quiz-cat-icon {
  font-size: 2.2rem;
}

.quiz-cat-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
  text-align: center;
}

.quiz-cat-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.quiz-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
}

.quiz-meta-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--ink);
  margin: 0;
}

.quiz-type-tag {
  background: var(--lavender);
}

.quiz-options .quiz-bool-btn {
  text-align: center;
  font-size: 1.05rem;
  padding: 14px 22px;
}

/* =============================================
   PPT ARENA
   ============================================= */

.ppt-arena {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.ppt-hand {
  font-size: 3.5rem;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  animation: pop-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ppt-vs {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
}

.ppt-choices {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.ppt-choices .btn {
  font-size: 1.8rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 3px 3px 0 var(--ink);
}

.ppt-choices .btn:hover {
  transform: scale(1.1) translate(-2px, -2px);
}

/* =============================================
   CLICK TARGET (redesigned)
   ============================================= */

.click-target-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 180px;
  margin: 12px 0;
  background: var(--accent);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.5rem;
  text-align: center;
  box-shadow: 4px 4px 0 var(--ink);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.click-target-area:active {
  transform: scale(0.97);
  box-shadow: 2px 2px 0 var(--ink);
}

.click-target-area.idle {
  background: var(--paper-soft);
  color: var(--ink);
  border-style: dashed;
}

.click-target-area.finished {
  background: var(--mint);
  color: var(--ink);
}

.click-count-display {
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  margin: 8px 0;
  color: var(--accent);
  transition: transform 0.1s ease;
}

.click-count-display.bump {
  transform: scale(1.15);
}

/* =============================================
   KEYFRAMES
   ============================================= */

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shadow-pulse {
  0%, 100% {
    box-shadow: 3px 3px 0 var(--ink);
  }
  50% {
    box-shadow: 5px 5px 0 var(--ink);
  }
}

@keyframes badge-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes flip-in {
  from {
    transform: rotateY(90deg);
    opacity: 0;
  }
  to {
    transform: rotateY(0);
    opacity: 1;
  }
}

/* =============================================
   ENTRY ANIMATIONS
   ============================================= */

.header {
  animation: fade-in-down 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-main {
  animation: fade-in-up 0.6s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero {
  animation: fade-in-up 0.6s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.badge {
  animation: pop-in 0.5s 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero h1 {
  animation: fade-in-up 0.6s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero p {
  animation: fade-in 0.6s 0.45s ease both;
}

.hero-actions {
  animation: fade-in-up 0.5s 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.section-intro {
  animation: slide-in-left 0.5s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.section {
  animation: fade-in-up 0.55s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card {
  animation: fade-in-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.grid .card:nth-child(1) { animation-delay: 0.15s; }
.grid .card:nth-child(2) { animation-delay: 0.25s; }
.grid .card:nth-child(3) { animation-delay: 0.35s; }
.grid .card:nth-child(4) { animation-delay: 0.45s; }
.grid .card:nth-child(5) { animation-delay: 0.55s; }
.grid .card:nth-child(6) { animation-delay: 0.65s; }

.footer {
  animation: fade-in-up 0.5s 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* =============================================
   HOVER & INTERACTIVE TRANSITIONS
   ============================================= */

.brand {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              letter-spacing 0.2s ease;
}

.brand:hover {
  transform: scale(1.04);
  letter-spacing: 0.1em;
}

nav a {
  transition: border-color 0.2s ease,
              background-color 0.25s ease,
              transform 0.15s ease;
}

nav a:hover {
  transform: translateY(-1px);
}

.theme-toggle {
  transition: background-color 0.35s ease,
              box-shadow 0.35s ease,
              color 0.35s ease;
}

.theme-toggle:hover {
  box-shadow: 2px 2px 0 var(--ink);
}

.theme-toggle:active {
  box-shadow: 0 0 0 var(--ink);
}

.card {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.4s ease,
              color 0.4s ease,
              border-color 0.3s ease;
}

.card:hover {
  transform: translate(-2px, -4px);
  box-shadow: 5px 7px 0 var(--ink);
}

.btn {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.2s ease;
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.badge {
  transition: transform 0.2s ease;
}

.badge:hover {
  animation: badge-bounce 0.4s ease;
}

.hero {
  transition: box-shadow 0.3s ease,
              background-color 0.4s ease,
              color 0.4s ease,
              border-color 0.3s ease;
}

.hero:hover {
  box-shadow: 5px 5px 0 var(--ink);
}

.section-intro {
  transition: transform 0.25s ease,
              box-shadow 0.25s ease,
              background-color 0.4s ease,
              color 0.4s ease,
              border-color 0.3s ease;
}

.section-intro:hover {
  transform: translateX(2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.footer-content {
  transition: box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.4s ease,
              color 0.4s ease,
              border-color 0.3s ease;
}

.footer-content:hover {
  transform: translate(-1px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

/* =============================================
   INPUT & FORM TRANSITIONS
   ============================================= */

input,
select {
  transition: border-color 0.2s ease,
              box-shadow 0.2s ease,
              background-color 0.3s ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 3px 3px 0 var(--accent);
}

input:hover,
select:hover {
  border-color: var(--muted);
}

.result {
  transition: opacity 0.3s ease;
}

/* =============================================
   LINK UNDERLINE ANIMATION
   ============================================= */

.footer a,
.context-links a,
.text-link {
  position: relative;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a::after,
.context-links a::after,
.text-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.footer a:hover::after,
.context-links a:hover::after,
.text-link:hover::after {
  width: 100%;
}

/* =============================================
   GAME-SPECIFIC ANIMATIONS
   ============================================= */

.reaction-box {
  transition: background-color 0.2s ease,
              transform 0.15s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease,
              color 0.15s ease;
}

.reaction-box:hover {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px var(--accent);
  border-color: var(--accent);
}

.reaction-box:active {
  transform: scale(0.96);
}

.memory-card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.25s ease,
              box-shadow 0.2s ease,
              border-color 0.25s ease,
              color 0.2s ease;
  transform-style: preserve-3d;
}

.memory-card:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 4px 6px 0 var(--ink);
}

.memory-card:active {
  transform: translateY(0) scale(0.95);
}

.memory-card.flipped {
  animation: flip-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.memory-card.matched {
  animation: pop-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-options button {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.2s ease,
              background-color 0.15s ease;
}

.quiz-options button:hover {
  transform: translateX(4px);
  box-shadow: 3px 3px 0 var(--ink);
}

.quiz-options button:active {
  transform: translateX(1px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* =============================================
   KPI ANIMATIONS
   ============================================= */

.kpi {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease,
              background-color 0.4s ease,
              color 0.4s ease,
              border-color 0.3s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--ink);
}

/* =============================================
   CATALOG ANIMATIONS
   ============================================= */

.catalog-toolbar {
  animation: fade-in 0.5s 0.3s ease both;
}

.no-results {
  animation: fade-in 0.3s ease both;
}

/* =============================================
   SMOOTH THEME TRANSITION (color-only, no override)
   ============================================= */

body {
  transition: background 0.4s ease, color 0.4s ease;
}

.nav {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.3s ease;
}

.page-main {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.3s ease;
}

.section {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.3s ease;
}

/* =============================================
   ACCESSIBILITY: REDUCED MOTION
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   RESPONSIVE
   ============================================= */

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

  .page-main {
    padding: 14px;
    min-height: calc(100vh - 160px);
  }

  .nav {
    border-radius: 20px;
    flex-direction: column;
    align-items: stretch;
  }

  nav {
    justify-content: center;
  }
}
