:root {
  --ink: #26324c;
  --blue: #2f7fd6;
  --card-shadow: 0 8px 0 #d9e4f5, 0 14px 24px rgba(30, 60, 120, 0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  background: linear-gradient(180deg, #bfe3ff 0%, #eaf6ff 45%, #ffffff 100%);
  background-attachment: fixed;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overflow-x: hidden;
}

button { font-family: inherit; }

.deco {
  position: fixed;
  font-size: clamp(3rem, 8vw, 5.5rem);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: floaty 6s ease-in-out infinite alternate;
}
.deco-a { top: 3%; left: 3%; }
.deco-b { top: 10%; right: 4%; animation-delay: 1.5s; }
.deco-c { bottom: 5%; left: 5%; font-size: clamp(2rem, 5vw, 3.5rem); animation-delay: 3s; }

@keyframes floaty {
  from { transform: translateY(0); }
  to { transform: translateY(14px); }
}

#app { min-height: 100dvh; display: flex; flex-direction: column; position: relative; z-index: 1; }

.hidden { display: none !important; }

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.home-header h1 { font-size: clamp(1.4rem, 4.5vw, 2rem); margin: 0; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.total-stars {
  font-size: 1.15rem;
  font-weight: 800;
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 0 #d9e4f5;
}

.btn-icon {
  font-size: 1.5rem;
  background: #fff;
  border: none;
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 4px 0 #d9e4f5;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-icon:active { transform: scale(0.92); }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px 24px;
  width: 100%;
}

.game-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 210px));
  gap: 18px;
  justify-content: center;
  width: 100%;
  max-width: 700px;
  padding-top: 10px;
  position: relative;
  z-index: 1;
}
@media (min-width: 700px) {
  .game-tiles { grid-template-columns: repeat(3, 200px); }
}

.game-tile {
  border: none;
  border-radius: 28px;
  padding: 22px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.08), 0 12px 24px rgba(30, 60, 120, 0.15);
  transition: transform 0.12s;
  position: relative;
}
.game-tile:active { transform: scale(0.94); }
.tile-icon { font-size: 3.4rem; line-height: 1; }
.tile-name { font-weight: 800; font-size: 1.15rem; }
.tile-stars {
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.8);
  padding: 3px 12px;
  border-radius: 999px;
}

.tile-red { background: linear-gradient(160deg, #ffd7dd, #ffb3c1); }
.tile-blue { background: linear-gradient(160deg, #d7e8ff, #b3d1ff); }
.tile-green { background: linear-gradient(160deg, #d5f6d9, #aeecb8); }
.tile-purple { background: linear-gradient(160deg, #ead7ff, #d3b3ff); }
.tile-orange { background: linear-gradient(160deg, #ffe9cc, #ffd0a3); }
.tile-teal { background: linear-gradient(160deg, #ccf3fa, #a3e6f5); }

.game-topbar {
  width: 100%;
  max-width: 720px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 8px;
}
.game-title { font-weight: 800; font-size: 1.15rem; text-align: center; }

.round-dots { display: flex; gap: 10px; margin: 6px 0 12px; }
.dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px dashed #9ab0cc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.6);
}
.dot.current { border-style: solid; border-color: var(--blue); transform: scale(1.12); }
.dot.earned { border: none; background: #ffd93d33; }
.dot.missed { opacity: 0.4; }

.round-dots.dots-compact { gap: 6px; }
.dots-compact .dot { width: 24px; height: 24px; font-size: 0.8rem; border-width: 2px; }

.screen-game { justify-content: flex-start; }

.prompt-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  min-height: 130px;
  padding: 8px 4px;
}
.prompt-visual.pop-in { animation: pop-in 0.35s; }

.obj-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  max-width: 640px;
  line-height: 1.15;
}
.obj-row span { display: inline-block; animation: emoji-pop 0.4s backwards; }
.obj-row.small { font-size: 1.9rem; gap: 3px; max-width: 150px; }

.big-digit {
  font-size: clamp(5rem, 20vw, 9rem);
  font-weight: 900;
  color: #2f5fd6;
  text-shadow: 0 6px 0 #d7e4ff;
}

.sum-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.obj-group {
  background: #fff;
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: 0 6px 16px rgba(30, 60, 120, 0.12);
}
.plus-sign { font-size: clamp(2.4rem, 8vw, 3.4rem); font-weight: 900; color: #556; }

.shape-prompt svg { width: clamp(120px, 30vw, 170px); height: auto; display: block; }

.color-splat {
  width: clamp(110px, 28vw, 150px);
  height: clamp(110px, 28vw, 150px);
  border-radius: 42% 58% 55% 45% / 48% 40% 60% 52%;
  border: 5px solid #fff;
  box-shadow: inset -8px -12px 0 rgba(0, 0, 0, 0.12), 0 10px 20px rgba(30, 60, 120, 0.18);
  animation: blob 3s ease-in-out infinite alternate;
}

.pattern-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 640px; }
.pattern-tile {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 5px 0 rgba(30, 60, 120, 0.1);
  padding: 8px 12px;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.2;
}
.pattern-tile.q-mark {
  color: #2f5fd6;
  font-weight: 900;
  border: 3px dashed #2f5fd6;
  background: #eaf3ff;
  box-shadow: none;
}

.size-prompt { display: flex; align-items: center; gap: 18px; }
.size-arrow { font-size: clamp(2.4rem, 9vw, 3.4rem); animation: nudge 1.2s ease-in-out infinite alternate; }
.size-hint { line-height: 1; }

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 720px;
  padding-bottom: 12px;
}

.choice {
  background: #fff;
  border: none;
  border-radius: 26px;
  min-height: 130px;
  padding: 18px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 0.1s;
}
.choice:active:not(:disabled) { transform: scale(0.95); }
.choice:disabled { cursor: default; }
.choice .digit { font-size: 4.2rem; font-weight: 900; color: #33507c; }
.choice .star-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  max-width: 160px;
  font-size: 1.7rem;
}
.choice svg { width: 100%; height: 100%; max-width: 120px; max-height: 120px; display: block; }
.choice .pattern-tile { background: none; box-shadow: none; padding: 0; font-size: 3rem; }
.choice .size-emoji { line-height: 1.25; display: inline-block; }

.choice.is-correct { background: #d9f8dd; box-shadow: 0 8px 0 #a8e6b0; animation: choice-pop 0.45s; }
.choice.is-wrong { opacity: 0.4; box-shadow: none; animation: shake 0.4s; }
.choice.reveal { animation: reveal-pulse 1s infinite; }

#choices.choices-many { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
#choices.choices-many .choice { min-height: 100px; border-radius: 20px; padding: 12px 8px; }
#choices.choices-many .choice .digit { font-size: 2.8rem; }
#choices.choices-many .choice .star-group { font-size: 1.25rem; max-width: 128px; }
#choices.choices-many .choice .half-card .digit { font-size: 2.4rem; }
#choices.choices-many .choice .quarter-card .digit { font-size: 2.4rem; }

.screen-reward { justify-content: center; gap: 20px; }
.reward-title { font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 0; animation: pop-in 0.4s; }
.reward-stars { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.reward-star { font-size: clamp(3rem, 10vw, 4.5rem); opacity: 0.22; }
.reward-star.earned { opacity: 1; animation: star-pop 0.5s backwards; }
.reward-total { font-size: 1.1rem; font-weight: 700; color: #556; }

.unlock-box {
  background: #fff;
  border-radius: 24px;
  padding: 18px 24px;
  text-align: center;
  box-shadow: 0 8px 0 #ffe9a8, 0 14px 24px rgba(30, 60, 120, 0.15);
  animation: pop-in 0.5s;
  max-width: 340px;
}
.unlock-box p { margin: 0 0 14px; font-size: 1.15rem; }

.reward-buttons { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-big {
  font-size: 1.25rem;
  font-weight: 800;
  border: none;
  border-radius: 999px;
  padding: 16px 28px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 0 #d9e4f5;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-big:active { transform: scale(0.94); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 0 #1d5ea8; }

.btn-danger {
  background: #ffe3e3;
  color: #b30000;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn-danger.armed { background: #b30000; color: #fff; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 80, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 28px;
  padding: 26px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 30, 0.35);
  text-align: center;
  animation: pop-in 0.25s;
  max-height: 86dvh;
  overflow: auto;
}
.modal h2 { margin: 0 0 16px; font-size: 1.4rem; }
.modal h2 small { font-size: 0.8rem; color: #889; font-weight: 500; }

.modal-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-icon { font-size: 2.6rem; }

.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.level-btn {
  background: #f2f7ff;
  border: none;
  border-radius: 22px;
  padding: 16px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 6px 0 #d9e4f5;
  transition: transform 0.1s;
}
.level-btn:active { transform: scale(0.94); }
.level-num { font-size: 2.2rem; font-weight: 900; color: #2f5fd6; }
.level-emoji { font-size: 1.8rem; }
.level-btn.locked { opacity: 0.55; filter: grayscale(0.7); box-shadow: none; }
.level-hint { font-size: 0.9rem; color: #667; margin: 14px 0 0; }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid #eef2f8;
}
.pill {
  border: none;
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  background: #e3e8f0;
  color: #556;
}
.pill.on { background: #6bcb77; color: #fff; }

.stats-list { list-style: none; padding: 14px 4px; margin: 10px 0 18px; text-align: left; }
.stats-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-weight: 600; color: #445; }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confetti-fall linear forwards;
}

@keyframes emoji-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes choice-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9px); }
  75% { transform: translateX(9px); }
}
@keyframes reveal-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #ffd93d, 0 8px 0 #d9e4f5; }
  50% { box-shadow: 0 0 0 14px rgba(255, 217, 61, 0.35), 0 8px 0 #d9e4f5; }
}
@keyframes blob {
  from { border-radius: 42% 58% 55% 45% / 48% 40% 60% 52%; }
  to { border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%; }
}
@keyframes nudge {
  from { transform: translateY(-6px); }
  to { transform: translateY(6px); }
}
@keyframes star-pop {
  0% { transform: scale(0) rotate(-40deg); }
  60% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes confetti-fall {
  0% { transform: translateY(-6vh) translateX(0) rotate(0); opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(106vh) translateX(var(--x, 0)) rotate(var(--r, 360deg)); opacity: 0; }
}

.header-titles { display: flex; flex-direction: column; gap: 2px; }
.home-greeting { margin: 0; font-size: 1rem; font-weight: 600; color: #4a5a7a; }

.btn-collection {
  margin-top: 18px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 0 #e6d6f2, 0 12px 24px rgba(30, 60, 120, 0.12);
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.btn-collection:active { transform: scale(0.95); }
.collection-count {
  background: #9b5de5;
  color: #fff;
  border-radius: 999px;
  padding: 3px 12px;
  margin-left: 6px;
  font-size: 0.95rem;
}

.practice-banner {
  margin: 0 0 10px;
  padding: 10px 18px;
  background: #ffe9a8;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 4px 0 #f2d47a;
  animation: pop-in 0.3s;
}

.reward-extras { display: flex; flex-direction: column; gap: 8px; max-width: 420px; width: 100%; }
.extra-row {
  background: #fff;
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 5px 0 #d9e4f5;
  animation: pop-in 0.4s backwards;
}
.extra-emoji { font-size: 1.6rem; vertical-align: middle; }

.tile-amber { background: linear-gradient(160deg, #fff3c4, #ffe28a); }
.tile-pink { background: linear-gradient(160deg, #ffdcec, #ffb0d9); }
.tile-lime { background: linear-gradient(160deg, #eaf7cf, #d0ec8f); }

.obj-faded { filter: grayscale(1); opacity: 0.3; }
.minus-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 0.6em;
  height: 0.6em;
  font-size: 0.5em;
  font-weight: 900;
  color: #fff;
  background: #ff8f8f;
  border-radius: 50%;
}

.big-letter {
  font-size: clamp(5rem, 20vw, 9rem);
  font-weight: 900;
  color: #c62828;
  text-shadow: 0 6px 0 #ffd7d7;
  line-height: 1;
}

.anlaut-prompt { display: flex; align-items: center; gap: 24px; }
.anlaut-emoji { font-size: clamp(3.5rem, 14vw, 6rem); line-height: 1; }
.anlaut-q {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--blue);
  border: 4px dashed var(--blue);
  border-radius: 50%;
  background: #eaf3ff;
}

#screen-game.memory .prompt-visual { display: none; }
#screen-game.memory .choices {
  flex: 1;
  align-content: center;
  justify-content: center;
  grid-template-columns: repeat(4, minmax(72px, 150px));
  gap: 12px;
  max-width: 680px;
}
#screen-game.memory .choices.cols5 {
  grid-template-columns: repeat(5, minmax(56px, 120px));
  gap: 8px;
}

.card {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  perspective: 600px;
}
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s;
  display: block;
}
.card.flipped .card-inner,
.card.matched .card-inner { transform: rotateY(180deg); }
.card-cover,
.card-front {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 5px 0 rgba(30, 60, 120, 0.15);
}
.card-cover {
  background: linear-gradient(160deg, #4d96ff, #2f5fd6);
  color: #fff;
  font-weight: 900;
}
.card-front {
  background: #fff;
  transform: rotateY(180deg);
}
.card.matched .card-front { background: #d9f8dd; }
.card.matched { animation: choice-pop 0.45s; }

.screen-collection { justify-content: flex-start; }
.collection-tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 16px; }
.tab-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #44557a;
  background: #fff;
  box-shadow: 0 4px 0 #d9e4f5;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.tab-btn.active { background: var(--blue); color: #fff; box-shadow: 0 4px 0 #1d5ea8; }

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 640px;
}
.sticker-slot {
  border: none;
  border-radius: 24px;
  padding: 16px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fff;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  animation: pop-in 0.35s backwards;
}
.sticker-slot:active { transform: scale(0.94); }
.sticker-slot.locked {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: none;
  border: 3px dashed #b9c8e2;
  cursor: default;
}
.sticker-emoji { font-size: clamp(2.4rem, 8vw, 3.2rem); line-height: 1.1; }
.sticker-name { font-size: 0.85rem; font-weight: 700; color: #44557a; }

.trophy-item {
  border: none;
  border-radius: 24px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fff;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  animation: pop-in 0.35s backwards;
}
.trophy-item:active { transform: scale(0.94); }
.trophy-item.locked {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: none;
  border: 3px dashed #b9c8e2;
  cursor: default;
}
.trophy-item.locked .trophy-icon { filter: grayscale(1); opacity: 0.35; }
.trophy-icon { font-size: clamp(2.2rem, 8vw, 3rem); line-height: 1.1; }
.trophy-name { font-size: 0.8rem; font-weight: 700; color: #44557a; text-align: center; }

.name-input {
  border: 3px solid #d9e4f5;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 600;
  max-width: 55%;
  background: #f8fbff;
  color: var(--ink);
}
.name-input:focus { outline: none; border-color: var(--blue); }

.voice-hint {
  background: #eaf3ff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #3a4a6a;
  text-align: left;
  margin-bottom: 14px;
}
.voice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42dvh;
  overflow: auto;
  padding: 2px;
}
.voice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 3px solid #d9e4f5;
  background: #f8fbff;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.voice-row.active { border-color: var(--blue); background: #eaf3ff; }
.voice-row:active { transform: scale(0.98); }
.voice-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voice-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e3e8f0;
  color: #556;
}
.voice-badge.local { background: #d9f8dd; color: #1b6b2f; }
.voice-badge.online { background: #ffe3c9; color: #a05a00; }
.voice-check { font-weight: 900; font-size: 1.2rem; color: var(--blue); }

.tile-coral { background: linear-gradient(160deg, #ffe3d6, #ffb59e); }
.tile-mint { background: linear-gradient(160deg, #d9f7e8, #a8ecc9); }
.tile-grape { background: linear-gradient(160deg, #e8dcff, #c3aaff); }
.tile-cyan { background: linear-gradient(160deg, #d3f6f8, #9fe4ea); }
.tile-sky { background: linear-gradient(160deg, #d6f0ff, #a3e0ff); }
.tile-rose { background: linear-gradient(160deg, #ffe3ec, #ffb3c8); }
.tile-choco { background: linear-gradient(160deg, #f4e3d3, #e3bfa3); }
.tile-sand { background: linear-gradient(160deg, #fdf3d6, #f5dfa1); }
.tile-paint { background: linear-gradient(160deg, #ffe6f9, #f7c4ec); }
.tile-brick { background: linear-gradient(160deg, #eee6da, #d4c5ae); }

.clock-prompt svg,
.clock-prompt .clock {
  width: clamp(160px, 38vw, 230px);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 0 rgba(30, 60, 120, 0.12));
}

.half-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.half-word { font-size: 1.3rem; font-weight: 800; color: #c62828; }
.half-card .digit { font-size: 3.2rem; }

.quarter-card { display: flex; flex-direction: column; align-items: center; gap: 4px; line-height: 1.2; }
.quarter-word { font-size: 1rem; font-weight: 800; color: #c62828; }
.quarter-card .digit { font-size: 2.8rem; }

.backup-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 14px; }
.btn-small {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 800;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 0 #d9e4f5;
  cursor: pointer;
}
.btn-small:active { transform: scale(0.95); }

.mini-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 140px; font-size: 1.6rem; line-height: 1.15; }
.big-emoji { font-size: clamp(4rem, 16vw, 7rem); line-height: 1; }
.clap-group { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 110px; font-size: 1.6rem; line-height: 1.2; }

.seq-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 600px; }
.seq-tile {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 5px 0 rgba(30, 60, 120, 0.1);
  padding: 10px 18px;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  color: #33507c;
}
.seq-tile.q-mark { color: #2f5fd6; border: 3px dashed #2f5fd6; background: #eaf3ff; box-shadow: none; }
.seq-arrow { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 900; color: #556; }

.dice-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.dice-row .die { width: clamp(80px, 22vw, 110px); height: auto; filter: drop-shadow(0 6px 0 rgba(30, 60, 120, 0.12)); }

.obj-row.deco-row { font-size: clamp(1.9rem, 6vw, 2.8rem); gap: 5px; max-width: 620px; }
.q-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  min-height: 1.2em;
  padding: 0 8px;
  font-size: 0.7em;
  font-weight: 900;
  color: #2f5fd6;
  background: #eaf3ff;
  border: 3px dashed #2f5fd6;
  border-radius: 12px;
}

.shape-collage { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; max-width: 560px; }
.shape-collage svg { width: clamp(44px, 9vw, 58px); height: auto; }

.pos-prompt { font-size: clamp(4rem, 16vw, 7rem); line-height: 1; }
.choice .pos-svg { width: 100%; height: auto; max-width: 130px; }
.pos-svg .ps-box { font-size: 34px; }
.pos-svg .ps-ani { font-size: 26px; }

#choices.paint-mode,
#choices.mosaic-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.paint-palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.paint-swatch {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 0 rgba(30, 60, 120, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}
.paint-swatch:active { transform: scale(0.9); }
.paint-swatch.selected { transform: scale(1.15); box-shadow: 0 0 0 4px var(--ink), 0 6px 0 rgba(30, 60, 120, 0.18); }

.paint-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.paint-svg { width: clamp(240px, 62vw, 330px); height: auto; filter: drop-shadow(0 10px 0 rgba(30, 60, 120, 0.12)); }
.paint-wrap [data-region] { cursor: pointer; transition: fill 0.3s; }
.region-shake { animation: region-shake 0.4s; }
@keyframes region-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.paint-target {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 0 #d9e4f5;
}
.pt-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #d9e4f5;
  flex: none;
}

.mosaic-template { display: grid; gap: 3px; }
.mosaic-tpl-cell {
  width: clamp(20px, 5.4vw, 28px);
  height: clamp(20px, 5.4vw, 28px);
  border-radius: 6px;
  background: #eef2f8;
  box-shadow: inset 0 0 0 2px #d9e4f5;
}
.mosaic-mirror { font-size: clamp(4rem, 16vw, 7rem); line-height: 1; animation: nudge 1.2s ease-in-out infinite alternate; }

.mosaic-grid { display: grid; gap: 6px; width: min(86vw, 420px); }
.mosaic-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #e4ebf6, 0 3px 0 rgba(30, 60, 120, 0.12);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}
.mosaic-cell:active:not(:disabled) { transform: scale(0.9); }
.mosaic-cell:disabled { cursor: default; box-shadow: inset 0 0 0 2px #e4ebf6; }
.mosaic-cell.prefilled { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6); }
.mosaic-cell.wrong { animation: shake 0.4s; box-shadow: inset 0 0 0 3px #ff6b81, 0 3px 0 rgba(30, 60, 120, 0.12); }

.mosaic-done {
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 800;
  background: #6bcb77;
  color: #fff;
  box-shadow: 0 6px 0 #3f9c4b;
  cursor: pointer;
  transition: transform 0.1s;
}
.mosaic-done:active { transform: scale(0.95); }
