/* 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: 'Comic Sans MS', 'Chalkboard SE', 'Segoe Print', sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 60%, #d9f3ff);
  color: var(--ink);
  min-height: 100%;
  overflow-x: hidden;
}
#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: #fff3d1; border: 3px solid var(--gold); border-radius: 999px;
  padding: 5px 14px; font-weight: bold; font-size: 17px; white-space: nowrap;
}
.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: var(--pink); color: #fff; font-size: 17px; font-weight: bold;
  padding: 9px 16px; box-shadow: 0 4px 0 rgba(58, 43, 77, 0.35);
  transition: transform 0.08s;
}
.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: var(--purple); }
.btn.go { background: var(--green); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.back { background: #fff; color: var(--ink); font-size: 15px; }
.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: var(--red); }
.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 .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: var(--card); 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.25); transition: transform 0.1s;
}
.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: var(--card); border: 3px solid var(--ink);
  border-radius: 18px; box-shadow: 0 5px 0 rgba(58, 43, 77, 0.25); 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 .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: var(--pink); color: #fff; border-color: var(--pink); }
.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; }
}
