/* Go Go Axo — Shared styles. Rules from AGENTS.md:
   min font 16px, tap targets ≥44px, no hover-only interactions.
   Updated to the vibrant 3D claymorphic playroom style with Nunito rounded font. */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

:root, [data-theme="pink"] {
  /* Approved Axo brand palette (Enhanced for maximum vibrancy) */
  --axo-body: #FFC5BE;
  --axo-shadow: #FA9A8C;
  --axo-gill-dark: #FF5A5A;     /* Saturated strawberry red */
  --axo-gill-mid: #FF7B6B;
  --axo-eye: #5A2B27;
  --axo-eye-highlight: #EBF3F8;
  --axo-blush: #FF7373;
  --axo-belly: #FFF0ED;
  --axo-outline: #7C1E18;       /* Deep red-brown for solid 3D borders */

  /* Vibrant Playroom UI Colors */
  --bg: #FFFDFB;                /* Crisp warm cream background */
  --card: #FFFFFF;
  --text: #4C2624;              /* Readable chocolate brown */
  --muted: #A07E7A;
  --border: #F8D9D5;            /* Soft peach border */
  --border-shadow: #E5B2AB;     /* 3D border shadow color */
  
  --good: #2ECC71;              /* Vibrant emerald green */
  --good-shadow: #27AE60;       /* Dark green for 3D edges */
  --bad: #FF4757;               /* Vibrant cherry red */
  --bad-shadow: #D63031;
  --accent: #FFC000;            /* Bright sunflower yellow */
  --accent-shadow: #D19D00;
  
  --action-blue: #2EA2F8;       /* Sky blue for secondary actions */
  --action-blue-shadow: #0F85DB;
  
  --shadow: 0 6px 0 var(--border-shadow);
}

[data-theme="blue"] {
  /* Approved Axo brand palette (Blueish theme for boys) */
  --axo-body: #A1DDFE;
  --axo-shadow: #79C1ED;
  --axo-gill-dark: #1E88E5;     /* Vibrant blue */
  --axo-gill-mid: #42A5F5;
  --axo-eye: #0D2B45;
  --axo-eye-highlight: #EBF3F8;
  --axo-blush: #A0E0FF;
  --axo-belly: #E3F2FD;
  --axo-outline: #0F3A5F;       /* Deep blue-brown for solid 3D borders */

  /* Vibrant Playroom UI Colors */
  --bg: #F4F9FC;                /* Cool light blue-grey background */
  --card: #FFFFFF;
  --text: #1B365D;              /* Deep readable blue */
  --muted: #6B8EA8;
  --border: #CBE3F7;            /* Soft blue border */
  --border-shadow: #99C3E6;     /* 3D border shadow color */
  
  --good: #2ECC71;
  --good-shadow: #27AE60;
  --bad: #FF4757;
  --bad-shadow: #D63031;
  --accent: #FFC000;
  --accent-shadow: #D19D00;
  
  --action-blue: #FF9F43;       /* Sky blue counterpart: bright orange for contrast */
  --action-blue-shadow: #D35400;
  
  --shadow: 0 6px 0 var(--border-shadow);
}

/* Blue theme overrides */
[data-theme="blue"] body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 64'%3E%3Cpath d='M0,22 Q35,8 70,22 T140,22' fill='none' stroke='%2379C1ED' stroke-opacity='.25' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

[data-theme="blue"] .btn {
  background: linear-gradient(180deg, #4FC3F7 0%, var(--axo-gill-dark) 100%);
  border-bottom-color: var(--axo-outline);
}

[data-theme="blue"] .xp-bar > div {
  background: linear-gradient(90deg, #00E5FF 0%, #2979FF 100%);
}

[data-theme="blue"] .adventure-path {
  background: radial-gradient(circle, #F4F9FC 0%, #E3F2FD 100%);
}

[data-theme="blue"] .path-step.locked {
  background: #E4ECF0;
  border-color: #CAD5DB;
  border-bottom-color: #B2C0C7;
}

[data-theme="blue"] .path-step.active {
  background: #FFF3E0;
}

[data-theme="blue"] .category-tab-btn.selected {
  background: #FFF3E0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: 'Nunito', "Segoe UI Rounded", "Arial Rounded MT Bold", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 64'%3E%3Cpath d='M0,22 Q35,8 70,22 T140,22' fill='none' stroke='%23FA9A8C' stroke-opacity='.25' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 140px 64px;
}

h1 { font-size: 32px; font-weight: 900; margin: 0 0 8px; color: var(--text); text-shadow: 0 1px 0 rgba(0,0,0,0.05); }
h2 { font-size: 24px; font-weight: 800; margin: 0 0 8px; color: var(--text); }
p  { font-size: 17px; line-height: 1.5; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.card {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(124, 30, 24, 0.04);
  padding: 24px;
}

.center { text-align: center; }
.muted { color: var(--muted); font-weight: 600; }
.hidden { display: none !important; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons — Tactile 3D press effect */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 44px;
  padding: 10px 24px;
  font-size: 18px;
  font-weight: 900;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fff;
  background: var(--axo-outline);
  background: linear-gradient(180deg, #FF6B6B 0%, var(--axo-gill-dark) 100%);
  border: none;
  border-bottom: 5px solid var(--axo-outline);
  border-radius: 18px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05);
  transition: transform 0.1s ease, border-bottom-width 0.1s ease, box-shadow 0.1s ease;
}
.btn:active {
  transform: translateY(4px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}
.btn.secondary {
  background: var(--card);
  color: var(--action-blue);
  border: 3px solid var(--border);
  border-bottom: 7px solid var(--border-shadow);
  box-shadow: 0 4px 0 rgba(0,0,0,0.02);
}
.btn.secondary:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
}
.btn.big {
  font-size: 24px;
  min-height: 64px;
  width: 100%;
}
.btn:disabled {
  opacity: .45;
  cursor: default;
  border-bottom-width: 0;
  transform: none;
  box-shadow: none;
}

input[type="text"], input[type="password"], input[type="email"] {
  font-size: 20px;
  font-family: inherit;
  font-weight: 700;
  padding: 12px 14px;
  min-height: 52px;
  border: 3px solid var(--border);
  border-radius: 18px;
  width: 100%;
  color: var(--text);
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(124,30,24,0.05);
}
input:focus { outline: 3px solid var(--axo-body); border-color: var(--axo-outline); }

.error-msg {
  color: var(--bad);
  font-size: 17px;
  font-weight: 800;
  min-height: 24px;
  margin: 8px 0;
}

/* Roster / icon grids — 3D tactile cells */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.icon-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  min-height: 116px;
  background: var(--card);
  border: 3px solid var(--border);
  border-bottom: 7px solid var(--border-shadow);
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.1s ease, border-bottom-width 0.1s ease;
}
.icon-cell:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
}
.icon-cell img { width: 56px; height: 56px; }
.icon-cell.selected {
  border-color: var(--action-blue);
  border-bottom-color: var(--action-blue-shadow);
  background: #E8F4FE;
}
.icon-cell.locked { opacity: .4; }

/* PIN pad */
.pin-dots { font-size: 36px; letter-spacing: 12px; min-height: 48px; font-weight: 900; color: var(--text); }
.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 300px;
  margin: 12px auto;
}
.pinpad button {
  font-size: 28px;
  font-weight: 800;
  font-family: inherit;
  min-height: 64px;
  border-radius: 18px;
  border: 3px solid var(--border);
  border-bottom: 7px solid var(--border-shadow);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, border-bottom-width 0.1s ease;
}
.pinpad button:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
  background: var(--axo-belly);
}

/* Game container */
#game-container {
  position: relative;
  width: min(100vw, 960px);
  min-height: min(56.25vw, 540px);
  margin: 0 auto;
  background: linear-gradient(180deg, var(--axo-belly), var(--bg));
  border: 3px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
@media (max-width: 400px) {
  #game-container { min-height: 70vh; }
}
/* Weekly map streak pips - Playful star badges */
.map-steps { display: flex; gap: 10px; align-items: center; }
.map-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 16px; font-weight: 900; line-height: 1;
  border: 3px solid var(--border);
  border-bottom: 6px solid var(--border-shadow);
  background: var(--card); color: var(--muted);
  transition: all 0.1s ease;
  min-width: 44px; min-height: 44px;
}
.map-step.done {
  background: var(--good);
  border-color: #2ECC71;
  border-bottom-color: #27AE60;
  color: #fff;
  font-size: 20px;
}
.map-step.active {
  background: var(--action-blue);
  border-color: var(--action-blue);
  border-bottom-color: var(--action-blue-shadow);
  color: #fff;
  font-size: 20px;
}
.map-step.locked { opacity: 0.5; }

/* XP / progress bar with glossy touch */
.xp-bar {
  background: var(--border);
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(124,30,24,0.06);
}
.xp-bar > div {
  background: linear-gradient(90deg, #FFAE00 0%, #FF5A5A 100%);
  height: 100%;
  transition: width .5s ease;
  border-radius: 999px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.15);
}

/* XP-based level badge */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 16px;
  font-size: 16px;
  font-weight: 900;
  font-family: inherit;
  color: #fff;
  background: var(--action-blue);
  border-bottom: 3px solid var(--action-blue-shadow);
  border-radius: 999px;
  white-space: nowrap;
}

.diamonds { font-size: 40px; letter-spacing: 6px; }

/* Live diamond indicator in the game top bar — lit while at most 1
   answer this session is wrong, dims when a second is wrong. */
.streak-diamond { font-size: 32px; opacity: 1; transition: opacity .3s; }
.streak-diamond.cracked { opacity: .3; }
.streak-diamond.crack-once { animation: streak-crack .4s; }
@keyframes streak-crack {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-8deg); }
  75% { transform: translateX(4px) rotate(8deg); }
}

/* Mascot */
.mascot { width: 96px; height: 96px; user-select: none; -webkit-user-drag: none; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.mascot-celebrate { animation: bounce .4s ease-in-out 3; }

/* Egg Hatching Flow Animations & Styles */
@keyframes egg-wobble {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg) scale(1.05); }
  40% { transform: rotate(6deg) scale(0.95); }
  60% { transform: rotate(-4deg) scale(1.02); }
  80% { transform: rotate(2deg) scale(0.98); }
}
.egg-wobble {
  animation: egg-wobble 0.6s ease-in-out;
}

@keyframes egg-crack-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-3px, -1px) rotate(-3deg); }
  20% { transform: translate(3px, 1px) rotate(3deg); }
  30% { transform: translate(-3px, 2px) rotate(-4deg); }
  40% { transform: translate(2px, -1px) rotate(2deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(3px, 1px) rotate(3deg); }
  70% { transform: translate(-2px, -1px) rotate(-2deg); }
  80% { transform: translate(2px, 1px) rotate(1deg); }
  90% { transform: translate(-1px, -2px) rotate(-1deg); }
}
.egg-crack-shake {
  animation: egg-crack-shake 0.5s ease-in-out;
}

@keyframes pop-in {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  80% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.pop-in {
  animation: pop-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hatch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 16px auto;
  width: 100%;
  max-width: 320px;
}
.hatch-egg-wrapper {
  position: relative;
  width: 200px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.hatch-egg-img {
  width: 180px;
  height: auto;
  max-height: 230px;
  object-fit: contain;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
}
.hatch-egg-wrapper:active .hatch-egg-img {
  transform: scale(0.92);
}
.hatch-canvas {
  position: absolute;
  top: -50px;
  left: -100px;
  width: 400px;
  height: 350px;
  pointer-events: none;
  z-index: 10;
}
.hatch-progress-container {
  width: 100%;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 16px;
  border: 2px solid var(--border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.hatch-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff7eb3, #ff758c);
  border-radius: 8px;
  transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 8px rgba(255, 117, 140, 0.6);
  position: relative;
}
.hatch-progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.4) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: progress-shimmer 1.5s infinite;
  background-size: 200% 100%;
}
@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.speech-bubble-axo {
  position: relative;
  background: var(--card);
  border: 3px solid var(--primary);
  border-radius: 18px;
  padding: 14px 18px;
  margin: 16px 0;
  max-width: 280px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--text);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.speech-bubble-axo.show {
  opacity: 1;
  transform: translateY(0);
}
.speech-bubble-axo::after, .speech-bubble-axo::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  border: solid transparent;
  width: 0;
  height: 0;
  pointer-events: none;
}
.speech-bubble-axo::after {
  border-color: rgba(255, 255, 255, 0);
  border-top-color: var(--card);
  border-width: 10px;
  margin-left: -10px;
}
.speech-bubble-axo::before {
  border-color: rgba(255, 255, 255, 0);
  border-top-color: var(--primary);
  border-width: 14px;
  margin-left: -14px;
}


/* Floating companion pet mascot - breathing wobbly motion */
.floating-mascot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  filter: drop-shadow(0 8px 20px rgba(124, 30, 24, 0.22));
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@media (min-width: 720px) {
  .floating-mascot {
    right: calc(50% - 360px + 24px);
  }
}
.floating-mascot:active {
  transform: scale(0.9) rotate(-3deg);
}
.floating-mascot .mascot {
  width: 160px;
  height: 160px;
}
@media (max-width: 600px) {
  .floating-mascot {
    bottom: 16px;
    right: 16px;
  }
  .floating-mascot .mascot {
    width: 125px;
    height: 125px;
  }
}
/* On small phones the mascot still overlaps active exercise content at
   104px in the bottom-right corner — shrink it further and tuck it
   closer to the corner edge so it stays out of the tap/answer area. */
@media (max-width: 420px) {
  .floating-mascot {
    bottom: 8px;
    right: 8px;
  }
  .floating-mascot .mascot {
    width: 90px;
    height: 90px;
  }
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
.floating-mascot > .mascot-wrapper > img.mascot,
.floating-mascot > img.mascot {
  animation: mascot-float 3.5s ease-in-out infinite;
}

@keyframes bounce-big {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.18); }
}
.mascot-celebrate-big { animation: bounce-big .5s ease-in-out 4; }

/* Diamond-win celebration */
.diamond-win { position: relative; display: inline-block; animation: diamond-pop .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes diamond-pop {
  0% { transform: scale(0) rotate(-25deg); opacity: 0; }
  60% { transform: scale(1.35) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.diamond-win .sparkle {
  position: absolute;
  font-size: 20px;
  opacity: 0;
  animation: sparkle-pop .9s ease-out .35s forwards;
}
.diamond-win .sparkle.s1 { top: -14px; left: -22px; }
.diamond-win .sparkle.s2 { top: -18px; right: -24px; animation-delay: .45s; }
.diamond-win .sparkle.s3 { bottom: -10px; left: -26px; animation-delay: .55s; }
.diamond-win .sparkle.s4 { bottom: -14px; right: -20px; animation-delay: .5s; }
@keyframes sparkle-pop {
  0% { opacity: 0; transform: scale(.3) translateY(4px); }
  40% { opacity: 1; transform: scale(1.1) translateY(0); }
  100% { opacity: 0; transform: scale(.9) translateY(-10px); }
}

/* Floating XP number */
@keyframes floatUp {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-60px); }
}
.xp-float {
  position: absolute;
  font-size: 26px;
  font-weight: 900;
  color: var(--good);
  animation: floatUp 1.1s ease-out forwards;
  pointer-events: none;
}

/* Correction pause after a wrong answer (untimed formats — see
   game-ui.js showCorrection). Sits over the play area inside
   #game-container; the child taps Verder when ready, no auto-advance. */
.correction-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(76, 38, 36, 0.35);
  animation: correction-fade .25s ease;
}
.correction-card {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(124, 30, 24, 0.18);
  padding: 18px 24px 22px;
  text-align: center;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  animation: correction-pop .3s ease;
}
.correction-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 900;
  margin: 12px 0 18px;
}
/* Word-problem ("redactiesommen") sentences are much longer than a bare sum,
   so they get normal-size prose instead of the 38px-per-word equation
   style, which overflowed the card (see game-ui.js buildCorrection). */
.correction-sum .correction-sentence {
  display: block;
  width: 100%;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
}
.correction-sum .answer-pill {
  background: #E8F7EF;
  color: var(--good-shadow);
  border: 3px solid var(--good);
  border-bottom: 6px solid var(--good-shadow);
  border-radius: 16px;
  padding: 2px 16px;
}
@keyframes correction-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes correction-pop {
  from { opacity: 0; transform: translateY(28px) scale(.95); }
  to { opacity: 1; transform: none; }
}

/* Answer options (Rekenrace) */
.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.options button {
  font-size: 28px;
  font-weight: 800;
  font-family: inherit;
  min-height: 64px;
  border-radius: 18px;
  border: 3px solid var(--border);
  border-bottom: 7px solid var(--border-shadow);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, border-bottom-width 0.1s ease;
}
.options button:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
}
.options button.correct { border-color: var(--good); border-bottom-color: var(--good-shadow); background: #E8F7EF; color: var(--good-shadow); }
.options button.wrong { border-color: var(--bad); border-bottom-color: var(--bad-shadow); background: #FBEAEA; color: var(--bad-shadow); }

/* Drag tiles (Sleepoefening) */
.tile {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  font-size: 30px;
  font-weight: 800;
  background: var(--card);
  border: 3px solid var(--axo-gill-mid);
  border-bottom: 6px solid var(--axo-outline);
  border-radius: 16px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05);
  transition: transform 0.1s ease, border-bottom-width 0.1s ease;
}
.tile.dragging { opacity: .85; cursor: grabbing; z-index: 10; transform: scale(1.05); }

.dropzone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  font-size: 30px;
  font-weight: 800;
  border: 3px dashed var(--axo-gill-dark);
  border-radius: 18px;
  background: rgba(255, 255, 255, .6);
  vertical-align: middle;
}
.dropzone.over { background: var(--accent); border-style: solid; }
.dropzone[data-filled] { cursor: pointer; }

/* Small-phone exercise content: the shared answer/tile/correction styles
   above are sized for larger screens and crowd a small viewport together
   with the mascot. Trim them a bit (still well above the 16px floor and
   44px tap-target minimum) so a game fits more comfortably. Must come
   AFTER the base .options/.tile/.dropzone/.correction-sum rules above —
   same specificity, so an earlier position here was being overridden by
   the later base rules regardless of viewport width. */
@media (max-width: 420px) {
  .options button { font-size: 22px; min-height: 56px; }
  .tile { width: 60px; height: 60px; font-size: 24px; }
  .dropzone { width: 68px; height: 68px; font-size: 24px; }
  .correction-sum { font-size: 28px; }
  .correction-sum .correction-sentence { font-size: 17px; }
}

/* Countdown bar */
.timebar { background: var(--border); border-radius: 999px; height: 12px; overflow: hidden; }
.timebar > div { background: var(--axo-gill-dark); height: 100%; width: 100%; }

/* Game ladder cards (home.html) */
.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  min-height: 100px;
  padding: 16px;
  border: 3px solid var(--border);
  border-bottom: 7px solid var(--border-shadow);
  border-radius: 20px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-bottom-width 0.2s ease, box-shadow 0.2s ease;
}
.game-card:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
}
.game-card.locked {
  opacity: .5;
  cursor: pointer;
  touch-action: manipulation;
  border-bottom-width: 3px;
  transform: none !important;
}

#rekenrace-card {
  border: 3px solid var(--border);
  border-bottom: 7px solid var(--border-shadow);
  border-radius: 24px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-bottom-width 0.2s ease;
}
#rekenrace-card:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
}
#rekenrace-card.locked {
  opacity: .5;
  cursor: pointer;
  touch-action: manipulation;
  border-bottom-width: 3px;
  transform: none !important;
}

.game-card .badge-nieuw {
  position: absolute;
  top: -12px;
  right: -6px;
  background: var(--good);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 999px;
  border-bottom: 2px solid var(--good-shadow);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-transform: uppercase;
}

/* Expander buttons row under game grid */
.expander-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.expander-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px; /* Respect tap-target rule in AGENTS.md */
  padding: 4px 12px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.expander-btn:hover {
  text-decoration: underline;
}
.expander-btn:active {
  transform: scale(0.97);
  opacity: 0.8;
}

/* Blue style for Meer spellen */
.expander-btn.blue-pill {
  color: var(--action-blue);
}

/* Gold style for Uitgespeeld */
.expander-btn.gold-pill {
  color: var(--accent-shadow);
}

/* Shared toast (locked-game tooltip, success, and error variants) */
.lock-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--axo-outline);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  border-radius: 18px;
  border-bottom: 5px solid #5a140f;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  cursor: pointer;
  touch-action: manipulation;
  z-index: 1000;
  animation: lock-toast-in .25s ease-out;
}
.lock-toast.hide { animation: lock-toast-out .2s ease-in forwards; }
.lock-toast-icon { font-size: 22px; flex-shrink: 0; }
.lock-toast.toast-success { background: var(--good); border-bottom-color: var(--good-shadow); }
.lock-toast.toast-error { background: var(--bad); border-bottom-color: var(--bad-shadow); }

/* Top bar in games */
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

/* Purchase confirmation overlay */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(76, 30, 24, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(4px);
}
.confirm-card {
  background: var(--card);
  border: 3px solid var(--border);
  border-bottom: 8px solid var(--border-shadow);
  border-radius: 28px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  animation: diamond-pop .35s cubic-bezier(.34,1.56,.64,1);
}
.confirm-card img, .confirm-card .confirm-emoji { width: 84px; height: 84px; }
.confirm-card .confirm-emoji { display: block; margin: 0 auto; font-size: 72px; line-height: 84px; }
.confirm-card p { font-size: 19px; font-weight: 800; margin: 14px 0 0; }
.confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.confirm-actions .btn { flex: 1; }

/* Ensure standard, uniform spacing between main layout sections in wrappers */
.wrap > * + *,
#question-types > * + * {
  margin-top: 20px;
}

/* Speaker button: replays the phrase in its data-say attribute (audio.js).
   Sits inline next to instructions so pre-readers can hear any text. */
.speaker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 3px solid var(--border);
  border-bottom: 6px solid var(--border-shadow);
  border-radius: 50%;
  background: var(--card);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.speaker-btn:active { transform: translateY(2px); border-bottom-width: 4px; }
.speaker-btn.small {
  min-width: 44px;
  min-height: 44px;
  border-width: 2px;
  border-bottom-width: 4px;
  font-size: 17px;
}

/* Interactive Category Tabs (home.html) */
.category-tabs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.category-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  min-height: 80px;
  background: var(--card);
  border: 3px solid var(--border);
  border-bottom: 7px solid var(--border-shadow);
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.1s ease, border-bottom-width 0.1s ease, background-color 0.1s ease;
  touch-action: manipulation;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  text-align: center;
}

.category-tab-btn:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
}

.category-tab-btn.selected {
  border-color: var(--action-blue);
  border-bottom-color: var(--action-blue-shadow);
  background: #E8F4FE;
  color: var(--action-blue-shadow);
}

.active-category-card {
  border-top-color: var(--action-blue) !important;
  border-top-width: 6px !important;
}

/* Adventure Path Map Layout styling */
.adventure-path {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 40px 16px;
  background: radial-gradient(circle, #FFFDFB 0%, #FFF5F2 100%);
  border-radius: 24px;
  margin-top: 14px;
  overflow: hidden;
}

.path-connection-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.path-step-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 2;
}

.path-step-container:nth-child(odd) {
  justify-content: flex-start;
  padding-left: 20%;
}

.path-step-container:nth-child(even) {
  justify-content: flex-end;
  padding-right: 20%;
}

@media (max-width: 480px) {
  .path-step-container:nth-child(odd) {
    padding-left: 10%;
  }
  .path-step-container:nth-child(even) {
    padding-right: 10%;
  }
}

.path-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-bottom: 8px solid var(--border-shadow);
  background: var(--card);
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 12px rgba(124, 30, 24, 0.08);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-bottom-width 0.2s ease, background-color 0.2s ease;
  touch-action: manipulation;
}

.path-step:active {
  transform: scale(0.92) translateY(4px);
  border-bottom-width: 4px;
}

.path-step.locked {
  opacity: 0.75;
  background: #F5EAE8;
  border-color: #E2CDCA;
  border-bottom-color: #C8AFAB;
  transform: none !important;
  cursor: pointer;
}

.path-step.active {
  border-color: var(--action-blue);
  border-bottom-color: var(--action-blue-shadow);
  background: #E8F4FE;
  animation: step-float 2.5s ease-in-out infinite;
}

.path-step.completed {
  border-color: var(--accent);
  border-bottom-color: var(--accent-shadow);
  background: #FFFCE8;
}

@keyframes step-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.step-label {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.path-step.locked .step-label {
  color: var(--muted);
}

.step-badge {
  position: absolute;
  top: -12px;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  border-bottom: 2px solid rgba(0,0,0,0.15);
  text-transform: uppercase;
}

.step-badge.nieuw {
  background: var(--good);
}

.step-badge.trophy {
  background: var(--accent);
  font-size: 14px;
  padding: 2px 6px;
  top: -14px;
}

.step-diamonds {
  position: absolute;
  bottom: -22px;
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.step-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E5B2AB;
}

.step-pip.filled {
  background: var(--action-blue);
  box-shadow: 0 0 4px var(--action-blue);
}

.path-step.completed .step-pip.filled {
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent);
}

/* Classmate cards hover/active styles */
.classmate-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.classmate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
