/* ===========================================================
   Tulipia — a magical land of numbers & letters
   Designed for little fingers on Fire tablets (landscape).
   Art = emoji + SVG + CSS, so it works fully offline.
   =========================================================== */

:root {
  --pink:    #ff9ecd;
  --pink-d:  #ff6fb5;
  --purple:  #b784e0;
  --purple-d:#9b5fd0;
  --blue:    #7ec8ff;
  --mint:    #8ff0c4;
  --yellow:  #ffe066;
  --peach:   #ffd0a1;
  --ink:     #5a3d7a;
  --white:   #fffdfb;

  --tap-min: 76px;             /* minimum touch target */
  --radius:  28px;
  --shadow:  0 10px 30px rgba(155, 95, 208, 0.25);
  --font: "Comic Sans MS", "Chalkboard SE", "Baloo", "Segoe UI", system-ui, sans-serif;
}

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

html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, #ffe6f4 0%, #e9d6ff 40%, #d6ecff 100%);
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}

/* Floating background sky decorations */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.7) 0 6px, transparent 7px),
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.6) 0 10px, transparent 11px),
    radial-gradient(circle at 60% 80%, rgba(255,255,255,.5) 0 8px, transparent 9px);
  pointer-events: none;
  z-index: 0;
}

.app { position: relative; z-index: 1; height: 100%; width: 100%; }

/* ---------- Tap gate ---------- */
.tapgate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #ffd9ef 0%, #e6d2ff 100%);
}
.tapgate.hidden { display: none; }
.tapgate-inner { text-align: center; animation: pop-in .5s ease; }
.tapgate-emoji { font-size: clamp(48px, 12vw, 120px); }
.tapgate-title {
  font-size: clamp(48px, 14vw, 130px);
  margin: 0 0 24px;
  color: var(--purple-d);
  text-shadow: 3px 3px 0 #fff, 6px 6px 0 rgba(155,95,208,.2);
}
.big-start-btn, .btn {
  font-family: var(--font);
  border: none; cursor: pointer;
  background: var(--pink); color: #fff;
  font-size: clamp(28px, 6vw, 44px);
  padding: 22px 48px;
  border-radius: 999px;
  min-height: var(--tap-min);
  box-shadow: 0 8px 0 var(--pink-d), var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease;
}
.big-start-btn:active, .btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--pink-d); }

/* ---------- Generic screen ---------- */
.screen { height: 100%; width: 100%; display: flex; flex-direction: column; }

.hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; gap: 12px;
}
.hud-btn {
  border: none; background: #fff; color: var(--purple-d);
  width: var(--tap-min); height: var(--tap-min);
  border-radius: 50%; font-size: 34px; cursor: pointer;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.hud-btn:active { transform: scale(.92); }
.sparkle-count {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 999px; padding: 10px 22px;
  font-size: clamp(24px, 5vw, 36px); color: var(--purple-d);
  box-shadow: var(--shadow); font-weight: bold;
}
.sparkle-count .star { font-size: 1.2em; }

/* ---------- Profile picker ---------- */
.center-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px;
  padding: 20px; overflow-y: auto;
}
.title-lg { font-size: clamp(34px, 8vw, 64px); color: var(--purple-d); margin: 0; text-shadow: 2px 2px 0 #fff; }
.title-md { font-size: clamp(24px, 5vw, 40px); color: var(--ink); margin: 0; }

.profile-grid {
  display: flex; flex-wrap: wrap; gap: 22px;
  align-items: center; justify-content: center;
  max-width: 900px;
}
.profile-card {
  background: #fff; border-radius: var(--radius);
  padding: 20px; width: 180px; min-height: 200px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: var(--shadow); cursor: pointer; border: 5px solid transparent;
  transition: transform .1s ease;
}
.profile-card:active { transform: scale(.95); }
.profile-card .avatar { font-size: 84px; line-height: 1; }
.profile-card .pname { font-size: 26px; color: var(--purple-d); font-weight: bold; }
.profile-card.add { border: 5px dashed var(--purple); background: rgba(255,255,255,.55); }
.profile-card .stars-mini { font-size: 20px; color: var(--pink-d); }

/* Avatar / name chooser */
.chooser { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 720px; }
.avatar-opt {
  font-size: 60px; background: #fff; border-radius: 24px;
  width: 100px; height: 100px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow); border: 5px solid transparent;
}
.avatar-opt.sel { border-color: var(--pink); transform: scale(1.05); }
.level-opt {
  background:#fff; border-radius: 24px; padding: 18px 26px; cursor: pointer;
  box-shadow: var(--shadow); border: 5px solid transparent; font-size: 26px; color: var(--purple-d);
}
.level-opt.sel { border-color: var(--pink); }
.name-in {
  font-family: var(--font); font-size: 34px; text-align: center;
  border: 4px solid var(--purple); border-radius: 20px; padding: 12px 20px; width: 320px; color: var(--ink);
}

/* ---------- World map ---------- */
.map-wrap { flex: 1; position: relative; overflow-y: auto; padding: 10px 20px 40px; }
.map-hello { text-align: center; font-size: clamp(24px, 5vw, 38px); color: var(--purple-d); margin: 4px 0 18px; }
.islands {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 1000px; margin: 0 auto;
}
.island {
  position: relative; border-radius: var(--radius); padding: 26px 20px;
  min-height: 200px; cursor: pointer; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  box-shadow: var(--shadow); text-align: center;
  transition: transform .1s ease;
}
.island:active { transform: scale(.96); }
.island .isl-emoji { font-size: 74px; line-height: 1; filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
.island .isl-name { font-size: 27px; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,.2); }
.island .isl-skill { font-size: 19px; opacity: .95; }
.island.locked { filter: grayscale(.5) brightness(.9); }
.island .lock {
  position: absolute; inset: 0; border-radius: var(--radius);
  background: rgba(90,61,122,.55); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: #fff;
}
.island .lock .lock-emoji { font-size: 60px; }
.island .lock .lock-text { font-size: 22px; }

/* ---------- Activity common ---------- */
.stage { flex: 1; position: relative; overflow: hidden; }
.prompt-bar {
  text-align: center; font-size: clamp(26px, 5.5vw, 46px);
  color: var(--purple-d); padding: 6px 20px 12px; font-weight: bold;
}
.replay-btn {
  border: none; background: var(--yellow); color: var(--ink);
  border-radius: 999px; padding: 8px 20px; font-size: 24px; cursor: pointer;
  box-shadow: 0 5px 0 #e6c22e; margin-left: 8px;
}
.replay-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #e6c22e; }

.progress-dots { display: flex; gap: 10px; justify-content: center; padding: 6px; }
.progress-dots .dot { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.6); }
.progress-dots .dot.on { background: var(--pink); }

/* Bubbles */
.bubble {
  position: absolute; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 40px; font-weight: bold;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.9), rgba(126,200,255,.55) 45%, rgba(183,132,224,.5));
  border: 3px solid rgba(255,255,255,.7);
  box-shadow: inset -6px -6px 14px rgba(155,95,208,.25), 0 4px 10px rgba(0,0,0,.08);
}
.bubble.pop { animation: pop-burst .28s ease forwards; }

/* Feed the bunnies */
.bunny-scene { display:flex; flex-direction:column; align-items:center; gap: 10px; height:100%; padding-bottom: 10px; }
.bunny-big { font-size: clamp(90px, 22vw, 170px); line-height: 1; }
.bunny-need { font-size: clamp(30px, 6vw, 52px); color: var(--pink-d); font-weight: bold; }
.carrot-basket { display:flex; flex-wrap:wrap; gap: 14px; justify-content:center; align-content:center; flex:1; overflow:auto; padding: 10px; max-width: 900px; }
.carrot {
  font-size: clamp(44px, 9vw, 66px); cursor: pointer; line-height: 1;
  transition: transform .1s ease;
}
.carrot:active { transform: scale(.85); }
.carrot.used { opacity: .25; pointer-events: none; }
.count-badge { font-size: clamp(28px, 6vw, 48px); color: var(--purple-d); font-weight: bold; }

/* Unicorn path */
.path-wrap { flex:1; position: relative; overflow: hidden; }
.stone {
  position: absolute; width: clamp(74px, 14vw, 108px); height: clamp(74px, 14vw, 108px);
  border-radius: 50%; background: linear-gradient(160deg, #fff, #ffe6f4);
  border: 6px solid var(--pink); color: var(--purple-d);
  display:flex; align-items:center; justify-content:center;
  font-size: clamp(34px, 7vw, 52px); font-weight: bold; cursor: pointer;
  box-shadow: var(--shadow);
}
.stone.done { background: linear-gradient(160deg, #d7ffe9, #8ff0c4); border-color: var(--mint); }
.stone.next { animation: pulse 1s ease-in-out infinite; }
.unicorn-walker { position: absolute; font-size: clamp(50px, 11vw, 80px); transition: left .5s ease, top .5s ease; z-index: 5; pointer-events:none; }

/* Letter tracing */
.trace-wrap { flex:1; display:flex; align-items:center; justify-content:center; position: relative; }
.trace-canvas { touch-action: none; border-radius: 24px; background: rgba(255,255,255,.5); box-shadow: var(--shadow); }

/* ---------- Overlays & celebration ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(155,95,208,.35);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay.hidden { display: none; }
.card {
  background: #fff; border-radius: var(--radius); padding: 34px 40px;
  text-align: center; box-shadow: var(--shadow); max-width: 560px; animation: pop-in .4s ease;
}
.card .big-emoji { font-size: 96px; }
.card h2 { font-size: clamp(30px, 6vw, 48px); color: var(--pink-d); margin: 10px 0; }
.card p { font-size: 26px; color: var(--ink); }

.sparkle-fx { position: fixed; pointer-events: none; z-index: 45; font-size: 34px; will-change: transform, opacity; }

/* ---------- Animations ---------- */
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pop-burst { to { transform: scale(1.6); opacity: 0; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes float-up { to { transform: translateY(-120vh); } }

.wiggle { animation: wiggle .4s ease; }
@keyframes wiggle { 0%,100%{transform:rotate(0);} 25%{transform:rotate(-6deg);} 75%{transform:rotate(6deg);} }

/* ---------- Tier badge on islands ---------- */
.isl-tier {
  margin-top: 4px; background: rgba(255,255,255,.85); color: var(--purple-d);
  font-size: 17px; font-weight: bold; padding: 4px 14px; border-radius: 999px;
}

/* ---------- Mansion banner on the map ---------- */
.mansion-banner {
  display: flex; align-items: center; gap: 18px; cursor: pointer;
  max-width: 1000px; margin: 0 auto 22px; padding: 16px 24px;
  border-radius: var(--radius); color: #fff;
  background: linear-gradient(120deg, #ffb0d8, #c9a3f0);
  box-shadow: var(--shadow);
}
.mansion-banner:active { transform: scale(.98); }
.mb-emoji { font-size: 60px; }
.mb-title { font-size: 28px; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,.15); }
.mb-sub { font-size: 20px; opacity: .95; }

/* ---------- Mansion room ---------- */
.m-stage { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 8px 12px 12px; gap: 8px; }

.m-palette { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; }
.m-swatch-row { display: flex; align-items: center; gap: 8px; }
.m-swatch-label { font-size: 20px; color: var(--purple-d); font-weight: bold; }
.m-swatch {
  width: 40px; height: 40px; border-radius: 50%; border: 4px solid #fff; cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.m-swatch:active { transform: scale(.9); }

.m-room {
  flex: 1; position: relative; border-radius: var(--radius);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.5), var(--shadow);
  overflow: hidden; touch-action: none; min-height: 200px;
}
.m-item {
  position: absolute; transform: translate(-50%, -50%);
  cursor: grab; line-height: 1; touch-action: none;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.2));
}
.m-item.dragging { cursor: grabbing; filter: drop-shadow(0 8px 8px rgba(0,0,0,.3)); }
.m-item.pop-in-item { animation: pop-in .35s ease; }

.m-trash {
  position: absolute; top: 12px; right: 12px; z-index: 30; pointer-events: none;
  font-size: 44px; width: 68px; height: 68px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.7); box-shadow: var(--shadow);
  transition: transform .1s ease, background .1s ease;
}
.m-trash.hot { background: #ff8fa3; transform: scale(1.25); }

.m-shop {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden;
  padding: 10px 6px; -webkit-overflow-scrolling: touch;
  background: rgba(255,255,255,.4); border-radius: 22px;
}
.m-shop-item {
  flex: 0 0 auto; width: 92px; border: none; cursor: pointer;
  background: #fff; border-radius: 20px; padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--shadow); font-family: var(--font);
}
.m-shop-item:active { transform: scale(.93); }
.m-shop-item.cant { opacity: .4; }
.m-shop-emoji { font-size: 46px; line-height: 1; }
.m-shop-cost { font-size: 22px; color: var(--pink-d); font-weight: bold; }

/* ---------- Ballet de Ponis ---------- */
.ballet-cue { font-size: clamp(28px, 6vw, 46px); color: var(--purple-d); font-weight: bold; text-align: center; }
.ballet-cue span { margin-left: 6px; }
.ballet-count { text-align: center; font-size: clamp(40px, 9vw, 72px); color: var(--pink-d); font-weight: bold; line-height: 1; }
.ballet-stars { display: flex; gap: 8px; justify-content: center; padding: 4px; flex-wrap: wrap; }
.ballet-stars .b-star { font-size: 26px; filter: grayscale(1) opacity(.4); transition: filter .2s ease, transform .2s ease; }
.ballet-stars .b-star.on { filter: none; transform: scale(1.2); }

.ballet-stage {
  flex: 1; position: relative; margin: 8px 16px 16px; border-radius: var(--radius);
  overflow: hidden; touch-action: none;
  background: linear-gradient(#f6e0ff 0%, #f6e0ff 62%, #ffe9d6 62%, #ffe9d6 100%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.5), var(--shadow);
}
.ballet-stage .b-mirror {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  font-size: 54px; opacity: .5;
}
.ballet-stage .b-barre {
  position: absolute; left: 6%; right: 6%; top: 60%; height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, #d9a066, #b9793f); box-shadow: 0 3px 6px rgba(0,0,0,.15);
}
.ballet-stage .b-note { position: absolute; font-size: 34px; opacity: .7; animation: float-note 3s ease-in-out infinite; }
.ballet-stage .n1 { left: 12%; top: 24%; }
.ballet-stage .n2 { right: 12%; top: 34%; animation-delay: 1.2s; }
@keyframes float-note { 0%,100%{ transform: translateY(0) rotate(-8deg); } 50%{ transform: translateY(-16px) rotate(8deg); } }

.pony {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  font-size: clamp(90px, 22vw, 170px); line-height: 1;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.2));
  transform-origin: center bottom;
}
.pony.twirl { animation: ponyTwirl .8s ease; }
.pony.jump  { animation: ponyJump  .8s ease; }
.pony.bow   { animation: ponyBow   .8s ease; }
@keyframes ponyTwirl { 0%{ transform: translateX(-50%) rotateY(0) scale(1);} 100%{ transform: translateX(-50%) rotateY(720deg) scale(1);} }
@keyframes ponyJump  { 0%,100%{ transform: translateX(-50%) translateY(0);} 40%{ transform: translateX(-50%) translateY(-90px) scale(1.06);} }
@keyframes ponyBow   { 0%,100%{ transform: translateX(-50%) translateY(0) scaleY(1) rotate(0);} 50%{ transform: translateX(-50%) translateY(12px) scaleY(.78) rotate(6deg);} }

/* ---------- Palabras Mágicas (word building & reading) ---------- */
.words-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 10px 16px 24px; overflow-y: auto;
}
.w-clue { font-size: clamp(80px, 18vw, 150px); line-height: 1; }

.w-slots { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.w-slot {
  min-width: clamp(64px, 13vw, 100px); height: clamp(64px, 13vw, 100px);
  border-radius: 18px; background: rgba(255,255,255,.55);
  border: 4px dashed var(--purple); color: var(--purple-d);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(30px, 6vw, 48px); font-weight: bold; padding: 0 10px;
}
.w-slot.hint { color: rgba(155,95,208,.35); }
.w-slot.filled { background: #fff; border-style: solid; border-color: var(--mint); color: var(--purple-d); animation: pop-in .3s ease; }

.w-tray { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.w-tile {
  font-family: var(--font); border: none; cursor: pointer;
  min-width: clamp(64px, 13vw, 100px); height: clamp(64px, 13vw, 100px);
  border-radius: 18px; background: var(--yellow); color: var(--ink);
  font-size: clamp(30px, 6vw, 48px); font-weight: bold; padding: 0 10px;
  box-shadow: 0 6px 0 #e6c22e, var(--shadow);
}
.w-tile:active { transform: translateY(4px); box-shadow: 0 2px 0 #e6c22e; }
.w-tile.used { opacity: 0; pointer-events: none; }

.w-read {
  font-size: clamp(56px, 13vw, 110px); font-weight: bold; color: var(--purple-d);
  letter-spacing: 4px; text-shadow: 2px 2px 0 #fff; background: rgba(255,255,255,.55);
  padding: 12px 36px; border-radius: 24px;
}
.w-options { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.w-opt {
  border: 5px solid transparent; cursor: pointer; background: #fff; border-radius: 24px;
  width: clamp(96px, 20vw, 150px); height: clamp(96px, 20vw, 150px);
  font-size: clamp(52px, 11vw, 88px); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.w-opt:active { transform: scale(.94); }
.w-opt.w-correct { border-color: var(--mint); }

/* ---------- Shared: mode-choice screen ---------- */
.choice-row { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; }
.choice-btn {
  font-family: var(--font); border: none; cursor: pointer; background: #fff;
  border-radius: var(--radius); padding: 26px 30px; min-width: 200px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: var(--shadow);
}
.choice-btn:active { transform: scale(.95); }
.choice-emoji { font-size: 72px; line-height: 1; }
.choice-label { font-size: 30px; color: var(--purple-d); font-weight: bold; }
.turn-on { background: var(--yellow); border-radius: 999px; padding: 2px 14px; }

/* ---------- Memory ---------- */
.mem-grid { display: grid; gap: 12px; justify-content: center; align-content: start; padding: 10px 16px 24px; overflow-y: auto; flex: 1; }
.mem-card { width: clamp(58px, 12vw, 104px); aspect-ratio: 1; perspective: 600px; cursor: pointer; }
.mem-inner { position: relative; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mem-card.flipped .mem-inner, .mem-card.done .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.mem-back { background: linear-gradient(160deg, #b784e0, #7ec8ff); color: #fff; font-size: clamp(26px, 5vw, 44px); }
.mem-front { background: #fff; transform: rotateY(180deg); font-size: clamp(34px, 7vw, 60px); }
.mem-card.done .mem-front { box-shadow: inset 0 0 0 4px var(--mint), var(--shadow); }

/* ---------- Tic-Tac-Toe ---------- */
.ttt-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  width: min(56vh, 430px); margin: 10px auto; aspect-ratio: 1;
}
.ttt-cell {
  background: #fff; border-radius: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(48px, 14vw, 96px); box-shadow: var(--shadow);
}
.ttt-cell:active { transform: scale(.96); }
.ttt-cell.filled { cursor: default; }
.ttt-cell.win { background: var(--mint); animation: pulse 0.6s ease infinite; }

/* ---------- Crossword ---------- */
.cw-gridwrap { flex: 1; display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; justify-content: center; padding: 8px 12px; overflow: auto; }
.cw-grid { display: grid; gap: 4px; }
.cw-cell {
  position: relative; width: clamp(38px, 8vw, 62px); aspect-ratio: 1; background: #fff;
  border-radius: 8px; box-shadow: 0 2px 5px rgba(155,95,208,.2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cw-block { width: clamp(38px, 8vw, 62px); aspect-ratio: 1; }
.cw-num { position: absolute; top: 2px; left: 4px; font-size: 13px; color: var(--purple); }
.cw-letter { font-size: clamp(22px, 5vw, 38px); font-weight: bold; color: var(--purple-d); }
.cw-cell.active { background: #efe0ff; }
.cw-cell.cursor { box-shadow: inset 0 0 0 3px var(--pink); }
.cw-cell.solved { background: #d7ffe9; }
.cw-cell.solved .cw-letter { color: #3a9b6e; }
.cw-cell.wrongflash { animation: wiggle .4s ease; background: #ffd7de; }

.cw-clues { display: flex; flex-direction: column; gap: 10px; }
.cw-clue-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cw-clue-label { font-size: 30px; color: var(--purple-d); font-weight: bold; }
.cw-clue { border: none; background: #fff; border-radius: 14px; padding: 6px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; box-shadow: var(--shadow); }
.cw-clue-num { font-size: 18px; color: var(--purple); font-weight: bold; }
.cw-clue-emoji { font-size: 34px; }

.cw-keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 8px 10px 14px; }
.cw-key {
  font-family: var(--font); border: none; cursor: pointer; background: var(--yellow); color: var(--ink);
  min-width: clamp(34px, 6.5vw, 48px); height: clamp(40px, 7vw, 52px); border-radius: 12px;
  font-size: clamp(20px, 4vw, 28px); font-weight: bold; box-shadow: 0 4px 0 #e6c22e;
}
.cw-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #e6c22e; }
.cw-key.cw-back { background: var(--pink); box-shadow: 0 4px 0 var(--pink-d); color: #fff; }
