/* =============================================
   MAGNUS LÆRINGS-UNIVERS — Delt Design-system
   ============================================= */

:root {
  --grass: #5fa23a;
  --grass-dark: #3f7a22;
  --dirt: #7a4a1f;
  --dirt-dark: #553217;
  --sky-top: #72c5f0;
  --sky-bot: #a7e0f7;
  --stone: #8b8b8b;
  --stone-dark: #5a5a5a;
  --ink: #1a1a1a;
  --panel: #f4f0c7;
  --panel-dark: #c9b978;
  --red: #e63946;
  --red-dark: #8d1b24;
  --green: #69d43c;
  --green-dark: #2e7a12;
  --gold: #ffd94a;
  --gold-dark: #c68c00;
  --blue: #4aa3ff;
  --blue-dark: #1f5fb0;
  --pix: 'Press Start 2P', monospace;
  --read: 'VT323', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--read);
  color: var(--ink);
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(var(--sky-top), var(--sky-bot)) no-repeat fixed,
    var(--sky-bot);
  min-height: 100vh;
  position: relative;
}

.sky {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-bot) 55%, #8ad38f 55%, #5fa23a 58%, #7a4a1f 62%, #553217 100%);
  z-index: -2;
}

/* Clouds */
.clouds { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.cloud {
  position: absolute;
  width: 96px;
  height: 32px;
  background:
    linear-gradient(#fff, #fff) 16px 0 / 64px 16px no-repeat,
    linear-gradient(#fff, #fff) 0 16px / 96px 16px no-repeat;
  opacity: 0.9;
  filter: drop-shadow(2px 2px 0 #cfe8f7);
}
.c1 { top: 8%; left: -100px; animation: drift 60s linear infinite; }
.c2 { top: 18%; left: -200px; animation: drift 90s linear infinite; animation-delay: -25s; transform: scale(1.4); }
.c3 { top: 30%; left: -150px; animation: drift 75s linear infinite; animation-delay: -50s; transform: scale(0.8); }
@keyframes drift {
  from { transform: translateX(0) scale(var(--s,1)); }
  to   { transform: translateX(120vw) scale(var(--s,1)); }
}

.game-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  position: relative;
  z-index: 1;
}

/* HUD */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: var(--stone);
  border: 4px solid var(--ink);
  box-shadow:
    inset -4px -4px 0 var(--stone-dark),
    inset 4px 4px 0 #bdbdbd,
    6px 6px 0 rgba(0,0,0,0.25);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.logo-block {
  display: flex;
  flex-direction: column;
  font-family: var(--pix);
  line-height: 1.1;
}
.logo-main {
  font-size: 16px;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--gold-dark), 4px 4px 0 var(--ink);
}
.logo-sub {
  font-size: 10px;
  color: #fff;
  text-shadow: 2px 2px 0 var(--ink);
  margin-top: 4px;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--pix);
  font-size: 10px;
  color: #fff;
  text-shadow: 1px 1px 0 var(--ink);
}
.stat-label { color: var(--gold); }
.stat-value { min-width: 16px; text-align: center; }

.xp-bar {
  width: 120px;
  height: 14px;
  background: var(--ink);
  border: 2px solid #fff;
  padding: 1px;
}
.xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--blue), var(--gold));
  transition: width 0.4s cubic-bezier(.4,2,.6,1);
}

.hearts { display: flex; gap: 3px; }
.heart {
  font-size: 18px;
  color: var(--red);
  text-shadow: 1px 1px 0 var(--ink), 2px 2px 0 var(--red-dark);
  transition: transform 0.3s, opacity 0.3s;
}
.heart.lost {
  opacity: 0.25;
  color: #555;
  transform: scale(0.7) rotate(-10deg);
}

/* Main panel */
.panel {
  background: var(--panel);
  border: 4px solid var(--ink);
  padding: 18px 18px 22px;
  box-shadow:
    inset -4px -4px 0 var(--panel-dark),
    inset 4px 4px 0 #fffbd8,
    6px 6px 0 rgba(0,0,0,0.3);
  position: relative;
}

/* Tabs */
.exercise-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tab {
  font-family: var(--pix);
  font-size: 9px;
  color: #fff;
  background: var(--stone);
  border: 3px solid var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 1px 1px 0 var(--ink);
  letter-spacing: 1px;
  box-shadow:
    inset -3px -3px 0 var(--stone-dark),
    inset 3px 3px 0 #bdbdbd,
    3px 3px 0 rgba(0,0,0,0.35);
  transition: transform 0.1s;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 140px;
}
.tab:hover { filter: brightness(1.08); }
.tab .tab-emoji { font-family: var(--read); font-size: 18px; }
.tab.active {
  background: var(--gold);
  color: var(--ink);
  text-shadow: none;
  border-color: var(--ink);
  box-shadow:
    inset -3px -3px 0 var(--gold-dark),
    inset 3px 3px 0 #ffe889,
    3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.progress-label {
  font-family: var(--pix);
  font-size: 9px;
  color: var(--ink);
  white-space: nowrap;
}
.progress-bar {
  flex: 1;
  height: 14px;
  background: var(--stone-dark);
  border: 2px solid var(--ink);
  padding: 1px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    45deg,
    var(--green) 0 6px,
    var(--green-dark) 6px 12px
  );
  transition: width 0.5s cubic-bezier(.4,2,.6,1);
}

/* Scene (Shelly + dialogue) */
.scene {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.trainer {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Shelly the turtle */
.turtle {
  width: 96px;
  height: 96px;
  position: relative;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.35));
  animation: turtleBob 3s ease-in-out infinite;
  transform-origin: center bottom;
}
.turtle-svg { width: 100%; height: 100%; display: block; }

.turtle-svg .face { display: none; }
.turtle.happy .face-happy,
.turtle.cheer .face-cheer,
.turtle.think .face-think,
.turtle.sad   .face-sad { display: block; }
.turtle.speaking .face { display: none !important; }
.turtle.speaking .face-speak { display: block !important; }
.turtle.speaking .mouth-open {
  animation: mouthTalk 0.35s ease-in-out infinite alternate;
  transform-origin: 50px 30px;
}
@keyframes mouthTalk {
  0%   { transform: scaleY(0.3); }
  100% { transform: scaleY(1.1); }
}

.speech-bubble {
  position: absolute;
  right: -8px;
  top: -6px;
  display: none;
  gap: 3px;
  padding: 5px 8px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.turtle.speaking .speech-bubble { display: flex; }
.speech-bubble span {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--ink);
  border-radius: 50%;
  animation: dotPulse 1.2s infinite;
}
.speech-bubble span:nth-child(2) { animation-delay: 0.2s; }
.speech-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30%           { opacity: 1;   transform: scale(1.2); }
}

@keyframes turtleBob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}

.turtle.cheer { animation: turtleCheer 0.55s ease-out 2; }
@keyframes turtleCheer {
  0%   { transform: translateY(0)    scale(1)    rotate(0); }
  25%  { transform: translateY(-18px) scale(1.12) rotate(-6deg); }
  50%  { transform: translateY(-2px) scale(0.94) rotate(4deg); }
  75%  { transform: translateY(-10px) scale(1.05) rotate(-2deg); }
  100% { transform: translateY(0)    scale(1)    rotate(0); }
}

.turtle.shake { animation: turtleShake 0.6s ease-in-out; }
@keyframes turtleShake {
  0%,100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-7px) rotate(-4deg); }
  40% { transform: translateX(7px)  rotate(4deg); }
  60% { transform: translateX(-5px) rotate(-3deg); }
  80% { transform: translateX(5px)  rotate(3deg); }
}

.turtle.think { animation: turtleThink 1.4s ease-in-out infinite; }
@keyframes turtleThink {
  0%,100% { transform: rotate(0); }
  50%     { transform: rotate(-5deg); }
}

.dialogue {
  flex: 1;
  background: #fff;
  border: 3px solid var(--ink);
  padding: 14px 16px;
  font-size: 22px;
  line-height: 1.25;
  position: relative;
  box-shadow: inset -3px -3px 0 #dcdcdc;
  min-height: 70px;
}
.dialogue::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 24px;
  border: 7px solid transparent;
  border-right-color: var(--ink);
}
.dialogue::after {
  content: '';
  position: absolute;
  left: -9px;
  top: 24px;
  border: 7px solid transparent;
  border-right-color: #fff;
}
.dialogue b { color: var(--blue-dark); }

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.btn {
  font-family: var(--pix);
  font-size: 10px;
  padding: 12px 14px;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--ink);
  cursor: pointer;
  text-shadow: 1px 1px 0 var(--ink);
  box-shadow:
    inset -3px -3px 0 var(--blue-dark),
    inset 3px 3px 0 #7fc0ff,
    3px 3px 0 rgba(0,0,0,0.35);
  transition: transform 0.08s;
  image-rendering: pixelated;
  letter-spacing: 1px;
}
.btn:hover { filter: brightness(1.08); }
.btn:active {
  transform: translate(2px, 2px);
  box-shadow:
    inset -2px -2px 0 var(--blue-dark),
    inset 2px 2px 0 #7fc0ff,
    1px 1px 0 rgba(0,0,0,0.35);
}
.btn .ico { font-family: var(--read); font-size: 16px; margin-right: 4px; }

.btn-speak { background: var(--blue); box-shadow:
  inset -3px -3px 0 var(--blue-dark),
  inset 3px 3px 0 #7fc0ff,
  3px 3px 0 rgba(0,0,0,0.35); }

.btn-hint {
  background: var(--gold);
  color: var(--ink);
  text-shadow: none;
  box-shadow:
    inset -3px -3px 0 var(--gold-dark),
    inset 3px 3px 0 #ffe889,
    3px 3px 0 rgba(0,0,0,0.35);
}

.btn-check {
  background: var(--green);
  color: #fff;
  box-shadow:
    inset -3px -3px 0 var(--green-dark),
    inset 3px 3px 0 #9df273,
    3px 3px 0 rgba(0,0,0,0.35);
  flex-shrink: 0;
}

/* Input */
.answer-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.answer-input {
  flex: 1;
  font-family: var(--read);
  font-size: 32px;
  padding: 10px 14px;
  background: #fff;
  border: 4px solid var(--ink);
  box-shadow: inset 3px 3px 0 #d4d4a0;
  outline: none;
  color: var(--ink);
  letter-spacing: 2px;
  min-width: 0;
}
.answer-input:focus {
  box-shadow: inset 3px 3px 0 #d4d4a0, 0 0 0 3px var(--gold);
}
.answer-input.bad { animation: shakeX 0.5s; background: #ffe1e1; }
.answer-input.good { background: #e1ffd6; }
@keyframes shakeX {
  0%,100%{transform:translateX(0);}
  20%{transform:translateX(-8px);}
  40%{transform:translateX(8px);}
  60%{transform:translateX(-6px);}
  80%{transform:translateX(6px);}
}

/* Feedback */
.feedback {
  min-height: 70px;
  background: #fff;
  border: 3px dashed var(--stone-dark);
  padding: 10px 12px;
  font-size: 20px;
  color: var(--ink);
}
.feedback:empty { display: none; }
.feedback .hint-row {
  font-family: var(--pix);
  font-size: 10px;
  letter-spacing: 3px;
  margin-bottom: 6px;
  color: var(--ink);
}
.feedback .hint-row span {
  display: inline-block;
  min-width: 14px;
  padding: 2px 3px;
  margin-right: 2px;
  background: #eee;
  border: 2px solid var(--stone-dark);
}
.feedback .hint-label {
  font-family: var(--pix);
  font-size: 8px;
  color: var(--stone-dark);
  margin-bottom: 2px;
  margin-top: 6px;
}
.feedback .hint-label:first-child { margin-top: 0; }
.feedback .hint-row .ok { background: var(--green); color: #fff; border-color: var(--green-dark); }
.feedback .hint-row .bad { background: var(--red); color: #fff; border-color: var(--red-dark); text-decoration: line-through; }
.feedback .hint-row .miss { background: #fff5a8; color: var(--ink); border-color: var(--gold-dark); }
.feedback .tip { font-size: 22px; color: var(--dirt-dark); }
.feedback .tip b { color: var(--red-dark); }
.feedback.ok { border-color: var(--green-dark); background: #ecffe1; }
.feedback.err { border-color: var(--red-dark); }

/* Caught words / pills */
.caught {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  min-height: 30px;
}
.caught .pill {
  font-family: var(--pix);
  font-size: 8px;
  padding: 6px 10px;
  background: var(--green);
  color: #fff;
  border: 2px solid var(--green-dark);
  text-shadow: 1px 1px 0 var(--ink);
  border-radius: 10px 14px 10px 14px;
  box-shadow: inset -2px -2px 0 var(--green-dark), inset 2px 2px 0 #9df273;
  animation: popIn 0.4s;
}
.caught .pill.missed {
  background: var(--red);
  border-color: var(--red-dark);
}
@keyframes popIn {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* Friends strip */
.friends-strip {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.55);
  border: 3px solid var(--ink);
  box-shadow: inset -3px -3px 0 var(--panel-dark), inset 3px 3px 0 #fffbd8;
}
.friends-label {
  font-family: var(--pix);
  font-size: 9px;
  color: var(--dirt-dark);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.friends-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.friend-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px 4px;
  background: #fff;
  border: 2px solid var(--stone-dark);
  min-width: 60px;
  filter: grayscale(1);
  opacity: 0.35;
  transition: filter 0.4s, opacity 0.4s;
  box-shadow: inset -2px -2px 0 #ddd;
}
.friend-slot.unlocked {
  filter: none;
  opacity: 1;
  background: #fff5a8;
  border-color: var(--gold-dark);
  box-shadow: inset -2px -2px 0 var(--gold), 2px 2px 0 rgba(0,0,0,0.25);
  animation: friendPop 0.7s cubic-bezier(.3,1.6,.5,1);
}
@keyframes friendPop {
  0%   { transform: scale(0) rotate(-40deg); }
  55%  { transform: scale(1.35) rotate(12deg); }
  80%  { transform: scale(0.92) rotate(-4deg); }
  100% { transform: scale(1) rotate(0); }
}
.friend-emoji { font-size: 26px; line-height: 1; }
.friend-name {
  font-family: var(--pix);
  font-size: 6px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.5px;
}
.friend-slot.next {
  border-style: dashed;
  border-color: var(--blue-dark);
  opacity: 0.55;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: inset -4px -4px 0 var(--panel-dark), inset 4px 4px 0 #fffbd8, 6px 6px 0 rgba(0,0,0,0.35);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 60;
  animation: toastIn 0.5s cubic-bezier(.3,1.6,.5,1);
}
.toast.hidden { display: none; }
.toast-emoji { font-size: 38px; line-height: 1; }
.toast-text {
  font-family: var(--pix);
  font-size: 10px;
  color: var(--ink);
  line-height: 1.5;
  max-width: 240px;
}
.toast-text b { color: var(--gold-dark); }
@keyframes toastIn {
  0%   { transform: translate(-50%, -100px) scale(0.8); opacity: 0; }
  60%  { transform: translate(-50%, 8px) scale(1.06); opacity: 1; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* Footer */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 18px;
  color: #fff;
  text-shadow: 2px 2px 0 var(--ink);
  flex-wrap: wrap;
  gap: 8px;
}
.link-btn {
  background: none;
  border: none;
  color: #fff;
  font-family: var(--read);
  font-size: 20px;
  text-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  padding: 4px 8px;
}
.link-btn:hover { color: var(--gold); }
.foot-tip b { color: var(--gold); }

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.overlay.hidden { display: none; }
.win-card {
  background: var(--panel);
  border: 6px solid var(--ink);
  padding: 30px 36px;
  text-align: center;
  box-shadow: inset -4px -4px 0 var(--panel-dark), inset 4px 4px 0 #fffbd8, 8px 8px 0 rgba(0,0,0,0.4);
  max-width: 90vw;
  animation: popIn 0.5s;
}
.win-card h2 {
  font-family: var(--pix);
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--gold-dark);
}
.win-card p { font-size: 22px; margin: 8px 0; }
.win-stats {
  font-family: var(--pix);
  font-size: 10px;
  color: var(--dirt-dark);
}

/* Stats dashboard */
.stats-card {
  background: var(--panel);
  border: 6px solid var(--ink);
  padding: 24px 28px;
  text-align: center;
  box-shadow: inset -4px -4px 0 var(--panel-dark), inset 4px 4px 0 #fffbd8, 8px 8px 0 rgba(0,0,0,0.4);
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  animation: popIn 0.5s;
}
.stats-card h2 {
  font-family: var(--pix);
  font-size: 16px;
  margin: 0 0 12px;
  color: var(--dirt-dark);
}
.stats-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.stats-tabs .tab {
  font-family: var(--pix);
  font-size: 8px;
  padding: 6px 10px;
  border: 3px solid var(--ink);
  background: var(--stone);
  cursor: pointer;
  color: var(--ink);
}
.stats-tabs .tab.active {
  background: var(--green);
  color: #fff;
  text-shadow: 1px 1px 0 var(--ink);
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 18px;
}
.stats-table th {
  font-family: var(--pix);
  font-size: 7px;
  color: var(--stone-dark);
  padding: 4px 8px;
  border-bottom: 2px solid var(--ink);
  text-align: center;
}
.stats-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--stone);
  text-align: center;
}
.stats-table .stat-word {
  font-family: var(--pix);
  font-size: 10px;
  text-align: left;
  letter-spacing: 1px;
}
.stats-table .stat-none {
  font-size: 14px;
  color: var(--stone-dark);
  font-style: italic;
}
tr.stat-easy { background: #ecffe1; }
tr.stat-medium { background: #fff9e0; }
tr.stat-hard { background: #ffe5e5; }
tr.stat-unseen { background: #f5f5f5; opacity: 0.6; }
.btn-reset-stats {
  margin-top: 14px;
  font-family: var(--pix);
  font-size: 8px;
  padding: 8px 16px;
  background: var(--stone);
  color: var(--red-dark);
  border: 3px solid var(--red-dark);
  cursor: pointer;
}
.btn-reset-stats:hover {
  background: var(--red);
  color: #fff;
}
.stats-empty {
  font-family: var(--mono);
  font-size: 20px;
  color: var(--dirt-dark);
  padding: 30px 10px;
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

/* Walking turtles */
.walkers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 45;
}
.walker {
  position: absolute;
  width: 48px;
  height: 48px;
  will-change: transform, top, left;
  image-rendering: pixelated;
  transform-origin: center center;
}
.walker svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.walker.land { animation: walkerLand 0.4s ease-out; }
@keyframes walkerLand {
  0%   { transform: scale(1.4, 0.6); filter: brightness(2); }
  30%  { transform: scale(0.85, 1.2); }
  50%  { transform: scale(1.1, 0.9); }
  70%  { transform: scale(0.95, 1.05); }
  100% { transform: scale(1, 1); }
}

.shockwave {
  position: absolute;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 0 12px var(--gold), 0 0 24px rgba(255,217,74,0.5);
  animation: shockExpand 0.55s ease-out forwards;
  pointer-events: none;
}
@keyframes shockExpand {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(12); opacity: 0; }
}

/* Multiple choice buttons */
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.choice-btn {
  font-family: var(--pix);
  font-size: 10px;
  padding: 14px 18px;
  background: var(--stone);
  color: #fff;
  border: 3px solid var(--ink);
  cursor: pointer;
  text-shadow: 1px 1px 0 var(--ink);
  box-shadow:
    inset -3px -3px 0 var(--stone-dark),
    inset 3px 3px 0 #bdbdbd,
    3px 3px 0 rgba(0,0,0,0.35);
  transition: transform 0.08s;
  flex: 1 1 calc(50% - 10px);
  min-width: 120px;
  text-align: center;
}
.choice-btn:hover { filter: brightness(1.08); }
.choice-btn:active { transform: translate(2px, 2px); }
.choice-btn.correct {
  background: var(--green);
  box-shadow: inset -3px -3px 0 var(--green-dark), inset 3px 3px 0 #9df273, 3px 3px 0 rgba(0,0,0,0.35);
}
.choice-btn.wrong {
  background: var(--red);
  animation: shakeX 0.5s;
  box-shadow: inset -3px -3px 0 var(--red-dark), inset 3px 3px 0 #ff8e98, 3px 3px 0 rgba(0,0,0,0.35);
}

/* Puzzle pieces (sætningspuslespil) */
.puzzle-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  min-height: 48px;
}
.puzzle-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  min-height: 48px;
  background: rgba(255,255,255,0.5);
  border: 3px dashed var(--stone-dark);
  padding: 8px;
}
.puzzle-word {
  font-family: var(--pix);
  font-size: 10px;
  padding: 10px 14px;
  background: var(--blue);
  color: #fff;
  border: 3px solid var(--ink);
  cursor: pointer;
  text-shadow: 1px 1px 0 var(--ink);
  box-shadow:
    inset -3px -3px 0 var(--blue-dark),
    inset 3px 3px 0 #7fc0ff,
    3px 3px 0 rgba(0,0,0,0.35);
  transition: transform 0.15s;
  animation: popIn 0.3s;
}
.puzzle-word:hover { transform: translateY(-3px); }

@media (max-width: 520px) {
  .hud { gap: 10px; }
  .hud-right { gap: 10px; }
  .logo-main { font-size: 12px; }
  .logo-sub { font-size: 8px; }
  .xp-bar { width: 80px; }
  .scene { gap: 10px; }
  .trainer { width: 70px; height: 70px; }
  .turtle { width: 70px; height: 70px; }
  .dialogue { font-size: 18px; padding: 10px 12px; }
  .answer-input { font-size: 26px; }
  .btn { font-size: 9px; padding: 10px 10px; }
  .feedback { font-size: 18px; }
}
