/* Word Runway — dyslexia-friendly: big rounded type, generous spacing, high contrast */
:root {
  --bg1: #ffd9ec;
  --bg2: #e6d9ff;
  --card: #ffffff;
  --ink: #3a2b4d;
  --pink: #ff5f9e;
  --purple: #8b5cf6;
  --gold: #ffb32b;
  --green: #2eb872;
  --red: #ff5f6d;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Fredoka', 'Comic Sans MS', 'Chalkboard SE', sans-serif;
  font-weight: 500;
  background:
    radial-gradient(ellipse 80% 50% at 15% -5%, rgba(255, 200, 235, 0.9), transparent 60%),
    radial-gradient(ellipse 70% 55% at 90% 10%, rgba(205, 190, 255, 0.85), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(185, 230, 255, 0.9), transparent 65%),
    linear-gradient(165deg, #ffe3f0 0%, #efe2ff 55%, #ddf1ff 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100%;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle 3px at 12% 22%, rgba(255, 255, 255, 0.9) 40%, transparent 50%),
    radial-gradient(circle 2px at 78% 14%, rgba(255, 255, 255, 0.8) 40%, transparent 50%),
    radial-gradient(circle 2.5px at 32% 64%, rgba(255, 214, 245, 0.95) 40%, transparent 50%),
    radial-gradient(circle 2px at 88% 56%, rgba(255, 255, 255, 0.75) 40%, transparent 50%),
    radial-gradient(circle 3px at 58% 34%, rgba(230, 214, 255, 0.95) 40%, transparent 50%),
    radial-gradient(circle 2px at 8% 82%, rgba(255, 255, 255, 0.8) 40%, transparent 50%),
    radial-gradient(circle 2.5px at 68% 86%, rgba(255, 224, 240, 0.9) 40%, transparent 50%),
    radial-gradient(circle 2px at 44% 8%, rgba(255, 255, 255, 0.85) 40%, transparent 50%);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 1; } }
#app { position: relative; z-index: 1; }
#app { max-width: 900px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; padding: 12px 14px 20px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px 12px; }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.hello { font-size: 20px; }
.screen-title { font-size: 19px; font-weight: bold; }
.coin-chip {
  background: linear-gradient(180deg, #fff8e2 0%, #ffe9ad 100%);
  border: 3px solid var(--gold); border-radius: 999px;
  padding: 5px 14px; font-weight: 600; font-size: 17px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(255, 179, 43, 0.35), inset 0 1px 0 #fff;
}
.icon-btn { background: #fff; border: 3px solid var(--ink); border-radius: 12px; font-size: 18px; padding: 5px 10px; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit; cursor: pointer; border: 3px solid var(--ink); border-radius: 16px;
  background: linear-gradient(180deg, #ff8ab8 0%, var(--pink) 55%, #f0468c 100%);
  color: #fff; font-size: 17px; font-weight: 600;
  padding: 9px 16px;
  box-shadow: 0 4px 0 rgba(58, 43, 77, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.08s;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(58, 43, 77, 0.35); }
.btn.big { font-size: 20px; padding: 13px 24px; border-radius: 20px; }
.btn.alt { background: linear-gradient(180deg, #a688ff 0%, var(--purple) 55%, #7443e8 100%); }
.btn.go { background: linear-gradient(180deg, #52d494 0%, var(--green) 55%, #1f9e60 100%); }
.btn.ghost { background: linear-gradient(180deg, #ffffff, #f3edfa); color: var(--ink); text-shadow: none; }
.btn.back { background: linear-gradient(180deg, #ffffff, #f3edfa); color: var(--ink); font-size: 15px; text-shadow: none; }
.btn.tiny { font-size: 14px; padding: 6px 12px; border-radius: 12px; box-shadow: 0 3px 0 rgba(58, 43, 77, 0.3); }
.btn.off { opacity: 0.45; pointer-events: none; }
.btn.danger { background: linear-gradient(180deg, #ff8089, var(--red) 55%, #e8404f 100%); }
.link-btn { background: none; border: none; font-family: inherit; color: rgba(58, 43, 77, 0.55); font-size: 14px; cursor: pointer; padding: 8px; }
.foot { text-align: center; margin-top: auto; padding-top: 10px; }

/* ---------- home ---------- */
.home-main { display: flex; gap: 16px; align-items: flex-start; flex: 1; }
.home-avatar { position: relative; flex: 0 0 38%; cursor: pointer; text-align: center; }
.home-avatar::before {
  content: '';
  position: absolute; top: 4%; left: 50%; transform: translateX(-50%);
  width: 82%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.25) 55%, transparent 72%);
  z-index: -1;
}
.home-avatar::after {
  content: '';
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  width: 52%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(58, 43, 77, 0.22), transparent 70%);
}
.home-avatar .avatar { width: 100%; max-width: 280px; filter: drop-shadow(0 8px 14px rgba(58, 43, 77, 0.25)); }
.avatar-hint { font-size: 14px; color: rgba(58, 43, 77, 0.65); margin-top: 2px; }
.bob { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.home-actions { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.game-card {
  font-family: inherit; cursor: pointer;
  background: linear-gradient(170deg, #ffffff 0%, #fff6fb 100%);
  border: 3px solid var(--ink);
  border-radius: 18px; padding: 14px 12px; text-align: left; display: flex; flex-direction: column; gap: 3px;
  box-shadow: 0 5px 0 rgba(58, 43, 77, 0.22), 0 10px 24px rgba(139, 92, 246, 0.16);
  transition: transform 0.1s, box-shadow 0.1s;
}
.game-card:hover { box-shadow: 0 8px 0 rgba(58, 43, 77, 0.22), 0 14px 30px rgba(139, 92, 246, 0.22); }
.game-card:hover { transform: translateY(-3px); }
.game-emoji { font-size: 30px; }
.game-name { font-weight: bold; font-size: 17px; color: var(--ink); }
.game-desc { font-size: 13.5px; color: rgba(58, 43, 77, 0.7); }
.runway-card { background: linear-gradient(140deg, #fff3d1, #ffe0f0); }
.home-btns { display: flex; gap: 12px; }
.home-btns .btn { flex: 1; }

/* ---------- rounds ---------- */
.game-screen { padding: 0; }
#game-stage { flex: 1; display: flex; flex-direction: column; padding: 12px 14px 20px; }
.round-top { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; }
.btn-quit { background: #fff; border: 3px solid var(--ink); border-radius: 12px; font-size: 16px; padding: 6px 11px; cursor: pointer; font-family: inherit; }
.round-progress { flex: 1; height: 16px; background: rgba(255, 255, 255, 0.7); border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; }
.round-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--pink), var(--purple)); transition: width 0.3s; }
.round-coins { font-weight: bold; font-size: 17px; white-space: nowrap; }
.round-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; position: relative; text-align: center; }
.q-emoji { font-size: 84px; line-height: 1; }
.q-prompt { font-size: 21px; font-weight: bold; }
.btn-say { font-family: inherit; font-size: 20px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; vertical-align: middle; }
.q-opts { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.opt {
  font-family: inherit; cursor: pointer;
  background: linear-gradient(175deg, #ffffff, #fdf7ff);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 5px 0 rgba(58, 43, 77, 0.22), 0 8px 20px rgba(139, 92, 246, 0.12);
  transition: transform 0.1s;
}
.opt:active { transform: translateY(3px); }
.word-card { font-size: 30px; letter-spacing: 3px; padding: 18px 26px; font-weight: bold; }
.emoji-card { font-size: 54px; padding: 14px 22px; }
.emoji-opts.four .emoji-card { font-size: 46px; padding: 12px 18px; }
.opt.right { background: #d9ffe8; border-color: var(--green); }
.opt.wrong { background: #ffe0e3; border-color: var(--red); }
.flash { position: absolute; top: 6%; left: 50%; transform: translateX(-50%); font-size: 34px; font-weight: bold; animation: pop 0.85s ease-out forwards; pointer-events: none; white-space: nowrap; }
.flash-ok { color: var(--green); }
.flash-no { color: var(--red); font-size: 26px; }
@keyframes pop { 0% { transform: translateX(-50%) scale(0.4); opacity: 0; } 25% { transform: translateX(-50%) scale(1.15); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.shake { animation: shake 0.35s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

/* word builder */
.build-slots { display: flex; gap: 10px; }
.slot {
  width: 52px; height: 60px; border: 3px dashed rgba(58, 43, 77, 0.4); border-radius: 12px;
  background: rgba(255, 255, 255, 0.55); font-size: 32px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}
.slot.filled { border-style: solid; border-color: var(--green); background: #d9ffe8; }
.build-tiles { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.tile {
  font-family: inherit; width: 58px; height: 64px; font-size: 32px; font-weight: bold; cursor: pointer;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 rgba(58, 43, 77, 0.25);
}
.tile.used { opacity: 0.25; pointer-events: none; }

/* flash fashion */
.flash-word { font-size: 56px; font-weight: bold; letter-spacing: 5px; background: #fff; border: 4px solid var(--ink); border-radius: 20px; padding: 16px 34px; box-shadow: 0 6px 0 rgba(58, 43, 77, 0.25); }
.timer-bar { width: min(420px, 80%); height: 14px; border: 3px solid var(--ink); border-radius: 999px; background: rgba(255, 255, 255, 0.6); overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); }

/* letter twins */
.twins-target { display: inline-block; background: #fff; border: 4px solid var(--purple); border-radius: 14px; font-size: 40px; padding: 2px 18px; margin: 0 6px; }
.twins-count { font-size: 16px; color: rgba(58, 43, 77, 0.7); }
.twins-grid { display: grid; grid-template-columns: repeat(4, 64px); gap: 12px; }
.twin-cell {
  font-family: Georgia, 'Times New Roman', serif; width: 64px; height: 64px; font-size: 34px; cursor: pointer;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 rgba(58, 43, 77, 0.25);
}
.twin-cell.got { background: #ffd9ec; border-color: var(--pink); color: var(--pink); pointer-events: none; }

/* word closet */
.closet-word { font-size: 34px; font-weight: bold; letter-spacing: 3px; color: var(--purple); }

/* round end */
.round-end { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.round-end-burst { font-size: 64px; animation: bob 1.4s ease-in-out infinite; }
.round-end h2 { font-size: 30px; }
.round-end-coins { font-size: 40px; font-weight: bold; color: var(--gold); text-shadow: 0 2px 0 rgba(58, 43, 77, 0.3); }
.round-end-note { color: rgba(58, 43, 77, 0.65); }
.round-end-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }

/* ---------- shop & closet ---------- */
.shop-main { display: flex; gap: 16px; flex: 1; min-height: 0; }
.shop-preview { flex: 0 0 36%; position: sticky; top: 10px; align-self: flex-start; }
.shop-preview::before {
  content: '';
  position: absolute; top: 2%; left: 50%; transform: translateX(-50%);
  width: 80%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 55%, transparent 72%);
  z-index: -1;
}
.shop-preview .avatar { width: 100%; max-width: 260px; filter: drop-shadow(0 8px 14px rgba(58, 43, 77, 0.25)); }
.shop-items { flex: 1; overflow-y: auto; padding-bottom: 30px; }
.shop-h { margin: 16px 0 8px; font-size: 17px; color: var(--purple); }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.item-card {
  background: var(--card); border: 3px solid var(--rc, var(--ink)); border-radius: 14px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; cursor: pointer;
}
.item-card.trying { outline: 4px dashed var(--purple); outline-offset: 2px; }
.item-rarity { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--rc, #888); font-weight: bold; }
.item-name { font-weight: bold; font-size: 15px; }
.closet-rows { display: flex; flex-direction: column; gap: 8px; }
.closet-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.closet-slot { font-size: 22px; }
.chip {
  font-family: inherit; cursor: pointer; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 6px 13px; font-size: 14.5px; font-weight: bold; color: var(--ink);
}
.chip.on { background: linear-gradient(180deg, #ff8ab8, var(--pink)); color: #fff; border-color: #d84a86; box-shadow: 0 2px 6px rgba(255, 95, 158, 0.4); }
.chip.vibe { border-color: var(--gold); }
.chip.off-chip { border-style: dashed; color: rgba(58, 43, 77, 0.6); }
.chip small { font-weight: normal; opacity: 0.7; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2.5px var(--ink); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3.5px var(--pink); }
.swatches { gap: 12px; }

/* ---------- runway ---------- */
.runway-intro { text-align: center; font-size: 19px; margin: 24px 0 18px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; max-width: 640px; margin: 0 auto; width: 100%; }
.theme-card {
  font-family: inherit; cursor: pointer; background: var(--card); border: 3px solid var(--ink); border-radius: 18px;
  padding: 22px 14px; font-size: 18px; font-weight: bold; color: var(--ink);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  box-shadow: 0 5px 0 rgba(58, 43, 77, 0.25); transition: transform 0.1s;
}
.theme-card:hover { transform: translateY(-3px); }
.theme-e { font-size: 40px; }
.runway-tip { margin-top: 12px; color: rgba(58, 43, 77, 0.65); font-size: 14.5px; }
.runway-stage {
  position: relative; overflow: hidden; padding: 0;
  background: linear-gradient(180deg, #241a3d 0%, #3b2a5e 55%, #241a3d 100%);
}
.stage-lights { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: space-around; font-size: 30px; filter: drop-shadow(0 0 18px #fff7c4); }
.catwalk {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 70%; height: 34%; background: linear-gradient(180deg, #ff9ab1, #ff5f9e);
  clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
  box-shadow: 0 0 60px rgba(255, 95, 158, 0.6);
}
.runway-avatar { position: absolute; bottom: 8%; left: 50%; width: 200px; transform: translateX(-50%); animation: walkin 3.6s ease-out forwards; }
.runway-avatar .avatar { width: 100%; filter: drop-shadow(0 0 26px rgba(255, 255, 255, 0.5)); }
@keyframes walkin {
  0% { bottom: 34%; width: 90px; opacity: 0; }
  15% { opacity: 1; }
  100% { bottom: 6%; width: 210px; opacity: 1; }
}
.walk { animation: sway 0.7s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.runway-result {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: rgba(36, 26, 61, 0.82); color: #fff; text-align: center; animation: fadein 0.5s;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.stars { font-size: 52px; min-height: 66px; }
.star-pop { display: inline-block; color: var(--gold); animation: starpop 0.4s cubic-bezier(0.2, 2, 0.4, 1); }
.star-pop.dim { color: rgba(255, 255, 255, 0.22); }
@keyframes starpop { from { transform: scale(0); } to { transform: scale(1); } }
.judge-line { font-size: 26px; font-weight: bold; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span { position: absolute; top: -8%; font-size: 24px; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(120vh) rotate(340deg); } }

/* ---------- parent ---------- */
.parent-body { max-width: 760px; margin: 0 auto; width: 100%; padding-bottom: 40px; }
.parent-body h3 { margin: 22px 0 8px; color: var(--purple); }
.parent-note { font-size: 14.5px; color: rgba(58, 43, 77, 0.75); line-height: 1.5; margin-bottom: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.stat { background: #fff; border: 3px solid var(--ink); border-radius: 14px; text-align: center; padding: 12px 6px; }
.stat-n { font-size: 28px; font-weight: bold; color: var(--pink); }
.stat-l { font-size: 12.5px; color: rgba(58, 43, 77, 0.7); line-height: 1.3; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 3px solid var(--ink); border-radius: 12px; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f3ecff; }
.dim { color: rgba(58, 43, 77, 0.45); }
.missed-words { display: flex; gap: 8px; flex-wrap: wrap; }
.missed-words .chip { cursor: default; }

/* ---------- welcome ---------- */
.welcome { align-items: center; justify-content: center; }
.welcome-card {
  background: var(--card); border: 4px solid var(--ink); border-radius: 26px; padding: 36px 30px;
  display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center;
  box-shadow: 0 8px 0 rgba(58, 43, 77, 0.25); max-width: 420px; width: 100%;
}
.welcome-logo { font-size: 56px; }
.welcome-card h1 { font-size: 36px; color: var(--pink); }
.welcome-card p { color: rgba(58, 43, 77, 0.75); font-size: 16px; }
#name-input {
  font-family: inherit; font-size: 20px; padding: 12px 16px; border: 3px solid var(--ink);
  border-radius: 14px; width: 100%; text-align: center;
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .home-main { flex-direction: column; align-items: center; }
  .home-avatar { flex: none; width: 52%; }
  .home-avatar .avatar { max-width: 200px; }
  .home-actions { width: 100%; }
  .shop-main { flex-direction: column; }
  .shop-preview { position: static; align-self: center; flex: none; width: 46%; }
  .shop-preview .avatar { max-width: 190px; }
  .twins-grid { grid-template-columns: repeat(4, 56px); gap: 10px; }
  .twin-cell { width: 56px; height: 56px; font-size: 30px; }
  .flash-word { font-size: 42px; padding: 12px 22px; }
  .word-card { font-size: 24px; padding: 14px 18px; }
  .emoji-card { font-size: 44px; padding: 12px 16px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .q-emoji { font-size: 66px; }
}

/* ---------- profiles ---------- */
.profile-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.profile-btn { width: 100%; }

/* ---------- dance moves ---------- */
.move-chip { font-size: 15px; }
.dance-spin { animation: dspin 1.1s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes dspin {
  0% { transform: scaleX(1); }
  25% { transform: scaleX(-0.15) rotate(2deg); }
  50% { transform: scaleX(-1); }
  75% { transform: scaleX(-0.15) rotate(-2deg); }
  100% { transform: scaleX(1); }
}
.dance-bounce { animation: dbounce 0.42s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes dbounce {
  0% { transform: translateY(0) scale(1.03, 0.97); }
  100% { transform: translateY(-30px) scale(0.98, 1.04); }
}
.dance-twirl { animation: dtwirl 1.3s ease-in-out infinite; transform-origin: 50% 78%; }
@keyframes dtwirl {
  0% { transform: rotate(-8deg) translateY(0); }
  25% { transform: rotate(0deg) translateY(-14px) scaleX(0.4); }
  50% { transform: rotate(8deg) translateY(0); }
  75% { transform: rotate(0deg) translateY(-14px) scaleX(-0.4); }
  100% { transform: rotate(-8deg) translateY(0); }
}

/* camera flashes during the performance */
.camera-flashes { position: absolute; inset: 0; pointer-events: none; }
.camera-flashes span {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(255,255,255,0.35) 45%, transparent 70%);
  opacity: 0; animation: camflash 1.6s ease-out infinite;
}
@keyframes camflash {
  0% { opacity: 0; transform: scale(0.4); }
  6% { opacity: 1; transform: scale(3.2); }
  16% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; }
}
.judge-sub { font-size: 18px; color: #ffd9ec; }

/* ---------- Sound School & Lessons ---------- */
.menu-sub { text-align: center; font-size: 15.5px; color: rgba(58, 43, 77, 0.7); margin: 4px 0 14px; }
.menu-cards { display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; width: 100%; padding-bottom: 30px; }
.rule-card { background: var(--card); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: 0 5px 0 rgba(58, 43, 77, 0.25); }
.rule-card.locked-card { opacity: 0.6; }
.rule-card-head { display: flex; gap: 12px; align-items: center; }
.rule-e { font-size: 36px; }
.rule-name { font-weight: bold; font-size: 18px; }
.rule-text { font-size: 14px; color: rgba(58, 43, 77, 0.7); }
.level-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.level-chip {
  font-family: inherit; cursor: pointer; background: var(--pink); color: #fff; border: 2.5px solid var(--ink);
  border-radius: 999px; padding: 7px 14px; font-size: 14.5px; font-weight: bold;
  box-shadow: 0 3px 0 rgba(58, 43, 77, 0.3);
}
.level-chip.done { background: var(--green); }
.level-chip.locked { background: #e7e2ef; color: rgba(58, 43, 77, 0.55); cursor: default; box-shadow: none; }
.sound-card { background: linear-gradient(140deg, #e2f4ff, #f0e4ff); }
.lesson-card { background: linear-gradient(140deg, #e8ffe9, #fff8d9); }
.rule-banner {
  background: #fff; border: 3px solid var(--purple); border-radius: 16px; padding: 10px 18px;
  font-size: 19px; font-weight: bold; color: var(--purple);
}
.sound-word { font-size: 54px; font-weight: bold; letter-spacing: 4px; background: #fff; border: 4px solid var(--ink); border-radius: 20px; padding: 14px 30px; box-shadow: 0 6px 0 rgba(58, 43, 77, 0.25); }
.sound-word .blank { color: var(--pink); border-bottom: 5px dashed var(--pink); padding: 0 6px; }
.sound-word .blank.filled { color: var(--green); border-bottom-color: var(--green); }
.sound-word .hl { color: var(--purple); text-decoration: underline wavy rgba(139, 92, 246, 0.5) 3px; }
.choice-tile { font-size: 34px; font-weight: bold; padding: 14px 28px; letter-spacing: 2px; }
.stars-row { font-size: 54px; color: var(--gold); letter-spacing: 6px; }
.dim-star { color: rgba(58, 43, 77, 0.18); }
.unlock-note { font-size: 18px; font-weight: bold; color: var(--purple); }
.hw { font-size: 11px; vertical-align: super; margin-left: 2px; }
.sent-slots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 90%; }
.sent-slot {
  min-width: 48px; height: 44px; border: 3px dashed rgba(58, 43, 77, 0.4); border-radius: 10px;
  background: rgba(255, 255, 255, 0.55); font-size: 20px; font-weight: bold; padding: 4px 8px;
  display: flex; align-items: center; justify-content: center;
}
.sent-slot.filled { border-style: solid; border-color: var(--green); background: #d9ffe8; }
.word-tile {
  font-family: inherit; font-size: 21px; font-weight: bold; cursor: pointer; padding: 10px 16px;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 rgba(58, 43, 77, 0.25);
}
.word-tile.used { opacity: 0.25; pointer-events: none; }

/* add-to-home-screen tip */
.a2hs {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px;
  background: #fff; border: 2.5px solid var(--purple); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; color: var(--ink);
}
.a2hs-x { background: none; border: none; font-family: inherit; font-size: 14px; cursor: pointer; color: rgba(58, 43, 77, 0.55); }

/* Beat Drum */
.syl-word { font-size: 40px; font-weight: bold; letter-spacing: 3px; }
.beat-dots { font-size: 30px; min-height: 40px; letter-spacing: 6px; }
.syl-chunks { font-size: 30px; font-weight: bold; letter-spacing: 2px; }
.syl-chunks.good { color: var(--green); }
.syl-chunks.bad { color: var(--purple); }
.drum-btn {
  font-size: 74px; background: #fff; border: 5px solid var(--ink); border-radius: 50%;
  width: 140px; height: 140px; cursor: pointer; box-shadow: 0 7px 0 rgba(58, 43, 77, 0.3);
  transition: transform 0.06s;
}
.drum-btn:active { transform: scale(0.92) translateY(4px); box-shadow: 0 2px 0 rgba(58, 43, 77, 0.3); }

/* ---------- unlocks, claims & rewards ---------- */
.unlock-info { font-size: 12.5px; font-weight: 600; color: rgba(58, 43, 77, 0.75); line-height: 1.35; }
.mini-bar { width: 100%; height: 9px; background: rgba(58, 43, 77, 0.12); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.mini-bar > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--pink)); border-radius: 999px; transition: width 0.4s; }
.mini-bar.big { height: 12px; margin: 8px 0 6px; border: 2px solid rgba(58, 43, 77, 0.25); }
.mini-num { font-size: 11.5px; font-weight: 600; color: rgba(58, 43, 77, 0.6); margin-top: 2px; }
.sparkle-btn { animation: bob 1.4s ease-in-out infinite; }
.unlock-banner {
  background: linear-gradient(90deg, #fff3d1, #ffe0f0); border: 3px solid var(--gold);
  border-radius: 14px; padding: 10px 18px; font-size: 17px; font-weight: 600; margin-top: 6px;
  animation: bob 1.8s ease-in-out infinite;
}
.menu-progress { margin-top: 8px; }
.reward-badge {
  display: inline-block; font-size: 12.5px; font-weight: 600; margin: 2px 6px 0 0;
  background: rgba(255, 255, 255, 0.8); border: 2px solid rgba(58, 43, 77, 0.2);
  border-radius: 999px; padding: 3px 10px; color: rgba(58, 43, 77, 0.75);
}
.reward-badge.ready { border-color: var(--gold); background: #fff3d1; animation: bob 1.4s ease-in-out infinite; }
.reward-badge.got { border-color: var(--green); background: #d9ffe8; }
.claim-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(42, 26, 74, 0.75); animation: fadein 0.3s;
}
.claim-card {
  background: linear-gradient(170deg, #fff, #fff2f9); border: 4px solid var(--gold); border-radius: 26px;
  padding: 34px 40px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.4); max-width: 92%;
}
.claim-burst { font-size: 60px; animation: starpop 0.5s cubic-bezier(0.2, 2, 0.4, 1); }
.claim-sub { color: rgba(58, 43, 77, 0.7); font-size: 16px; }
.claim-name { font-size: 40px; font-weight: 700; color: var(--pink); letter-spacing: 2px; }
.claim-rarity { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Closet World ---------- */
.closet-screen { padding-bottom: 8px; }
.closet-world {
  flex: 1; overflow-x: auto; overflow-y: hidden; border: 4px solid var(--ink); border-radius: 20px;
  background: linear-gradient(180deg, #f6e7ff 0%, #ffe9f4 58%, #d9b8e8 58%, #c9a3dc 100%);
  min-height: 420px; -webkit-overflow-scrolling: touch;
}
.cw-room { position: relative; height: 420px; }
.cw-display { position: absolute; bottom: 118px; width: 150px; text-align: center; cursor: pointer; }
.cw-case {
  height: 150px; background: rgba(255, 255, 255, 0.85); border: 3.5px solid var(--rc, var(--ink));
  border-radius: 16px 16px 8px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px; box-shadow: 0 6px 18px rgba(80, 40, 110, 0.25), inset 0 2px 0 #fff;
}
.cw-case.owned { background: linear-gradient(170deg, #fff, #fff4e2); }
.cw-item-name { font-size: 15px; font-weight: 700; line-height: 1.2; }
.cw-rar { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--rc, #888); }
.cw-power { font-size: 22px; }
.cw-mystery { font-size: 44px; font-weight: 700; color: rgba(58, 43, 77, 0.35); }
.cw-hint { font-size: 10.5px; color: rgba(58, 43, 77, 0.6); line-height: 1.3; }
.cw-pedestal {
  width: 70%; height: 26px; margin: 0 auto; background: linear-gradient(180deg, #b48ccb, #8f6aa8);
  border-radius: 4px 4px 8px 8px; box-shadow: 0 4px 8px rgba(60, 30, 90, 0.3);
}
.cw-avatar { position: absolute; bottom: 26px; width: 120px; transition: left 1.3s ease-in-out; z-index: 4; }
.cw-avatar .avatar { width: 100%; filter: drop-shadow(0 6px 10px rgba(60, 30, 90, 0.35)); }
.cw-pulse .cw-case { animation: starpop 0.5s cubic-bezier(0.2, 2, 0.4, 1); }
.cw-tip { text-align: center; font-size: 14px; color: rgba(58, 43, 77, 0.65); padding: 8px 0 2px; }

/* ---------- My Story ---------- */
.story-body { max-width: 720px; margin: 0 auto; width: 100%; padding-bottom: 40px; }
.story-lead { text-align: center; font-size: 22px; font-weight: 600; margin: 10px 0 14px; }
.story-sub { font-size: 14px; color: rgba(58, 43, 77, 0.65); margin-bottom: 8px; }
.mastered-shelf { display: flex; gap: 10px; flex-wrap: wrap; }
.word-trophy {
  font-family: inherit; cursor: pointer; font-size: 17px; font-weight: 600;
  background: linear-gradient(180deg, #fff8e2, #ffedb8); border: 3px solid var(--gold); border-radius: 14px;
  padding: 8px 14px; box-shadow: 0 3px 0 rgba(58, 43, 77, 0.2);
}

/* ---------- runway powers ---------- */
.power-label {
  position: absolute; top: 14%; left: 50%; transform: translateX(-50%);
  font-size: 26px; font-weight: 700; color: #ffe45e; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  animation: powerpop 1s ease 3.6s backwards;
  z-index: 6; white-space: nowrap;
}
@keyframes powerpop { 0% { transform: translateX(-50%) scale(0); } 60% { transform: translateX(-50%) scale(1.25); } 100% { transform: translateX(-50%) scale(1); } }
.fx-twirl .runway-avatar .avatar, .fx-fanfare .runway-avatar .avatar { animation: twirl3d 1.6s ease-in-out 3.7s; }
@keyframes twirl3d { 0% { transform: rotateY(0); } 100% { transform: rotateY(720deg); } }
.fx-fly .runway-avatar { animation: flyup 2.4s ease-in-out 3.7s; }
@keyframes flyup { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-90px); } }
.fx-flamenco .runway-avatar .avatar { animation: sway 0.35s ease-in-out 3.7s 8; }
.fx-rainbow .catwalk { animation: hueshift 3s linear 3.6s infinite; }
@keyframes hueshift { to { filter: hue-rotate(360deg); } }
.fx-bubbles .stage-lights, .fx-starfall .stage-lights { filter: drop-shadow(0 0 26px #9ad8f5); }

@media (max-width: 640px) {
  .home-btns { flex-wrap: wrap; }
  .cw-room { height: 380px; }
  .claim-name { font-size: 30px; }
}
