/* Welcome ---------------------------------------------------------------- */
.welcome { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
.welcome > .row { grid-column: 1 / -1; }
.welcome-hero { display: flex; flex-direction: column; gap: var(--s-3); }
.welcome-kicker { color: var(--grass-dark); font-size: var(--text-lg); }
.welcome-title { font-size: var(--text-hero); text-shadow: 0 var(--px) 0 var(--white); }
.welcome-lead { font-size: var(--text-lg); max-width: 28ch; font-weight: 600; }
.welcome-cast { display: flex; align-items: flex-end; gap: var(--s-2); margin-top: var(--s-2); }
.welcome-cast svg { width: clamp(84px, 24vw, 132px); height: auto; }
.welcome-cast svg:nth-child(2) { width: clamp(104px, 30vw, 164px); }
.welcome-points { display: flex; flex-direction: column; gap: var(--s-2); }
.welcome-points li { display: flex; align-items: center; gap: var(--s-3); font-weight: 700; background: rgb(255 255 255 / 0.7); border-radius: var(--radius); padding: var(--s-2) var(--s-3); }
.welcome-points svg { width: 28px; height: 28px; flex: none; }
.welcome-side { display: flex; flex-direction: column; gap: var(--s-3); }
.welcome-tabs button { flex: 1; min-height: 48px; }
.welcome-form h2 { font-size: var(--text-lg); margin-top: var(--s-2); }
.welcome-form h2:first-child { margin-top: 0; }
@media (min-width: 860px) {
  .welcome { grid-template-columns: 1.05fr 0.95fr; align-items: start; }
  .welcome-hero { position: sticky; top: var(--s-5); padding-top: var(--s-5); }
}

/* Who's playing ---------------------------------------------------------- */
.who-title { font-size: var(--text-hero); text-shadow: 0 var(--px) 0 var(--white); }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4); }
.who-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  width: 164px; padding: var(--s-4);
  background: var(--paper); border: var(--edge); border-radius: var(--radius); box-shadow: var(--drop);
  transition: transform var(--fast) var(--ease);
}
.who-card:hover { transform: translateY(-3px); }
.who-card:active { transform: translateY(var(--px)); box-shadow: none; }
.who-card svg.pixel { width: 112px; height: auto; }
.who-card .pill svg { width: 18px; }
.who-card strong { font-size: var(--text-lg); }
.who-actions { justify-content: center; }
.btn svg { width: 22px; height: 22px; flex: none; }

/* Hub -------------------------------------------------------------------- */
.hub-hello { display: flex; align-items: center; gap: var(--s-4); }
.hub-hello svg { width: clamp(96px, 26vw, 140px); height: auto; flex: none; }
.hub-hello h1 { font-size: var(--text-xl); text-shadow: 0 3px 0 var(--white); }
.quest { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.quest > svg { width: 48px; height: auto; flex: none; }
.quest-blocks { display: flex; gap: var(--s-1); }
.quest-block { width: 28px; height: 28px; background: var(--stone-light); border: var(--edge); border-radius: 4px; box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.15); }
.quest-block.done { background: var(--gem); }

.worlds { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.world {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--s-4) var(--s-3); text-align: center;
  background: var(--paper); border: var(--edge); border-radius: var(--radius); box-shadow: var(--drop);
}
.world-math { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: var(--s-4); padding: var(--s-5); background: var(--stone-light); text-align: left; transition: transform var(--fast) var(--ease); }
.world-math:hover { transform: translateY(-2px); }
.world-math:active { transform: translateY(var(--px)); box-shadow: none; }
.world-math > svg { width: clamp(72px, 20vw, 104px); height: auto; flex: none; border: var(--edge); }
.world-math .world-name { font-size: var(--text-xl); flex: 1; }
.world-soon { background: rgb(255 248 231 / 0.72); box-shadow: none; border-style: dashed; }
.world-glyph { width: 52px; height: 52px; display: grid; place-items: center; color: var(--white); border: var(--edge); border-radius: 4px; font-size: var(--text-lg); filter: saturate(0.6); }
.world-soon .world-name { font-size: var(--text-base); }
@media (min-width: 700px) {
  .worlds { grid-template-columns: repeat(4, 1fr); }
}
.hub-links { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.pick-card { display: flex; align-items: center; gap: var(--s-3); }
.pick-card > svg { width: 44px; height: auto; flex: none; }

/* Math Mine topic map ---------------------------------------------------- */
.mine-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.mine-head h1 { font-size: var(--text-xl); text-shadow: 0 3px 0 var(--white); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); }
.tile {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  padding: var(--s-3); background: var(--paper); border: var(--edge); border-radius: var(--radius); box-shadow: var(--drop);
  transition: transform var(--fast) var(--ease);
}
.tile:hover { transform: translateY(-3px); }
.tile:active { transform: translateY(var(--px)); box-shadow: none; }
.tile.mastered { background: #fff3c4; }
.tile-ore { position: relative; width: 72px; height: 72px; border: var(--edge); }
.tile-ore svg { width: 100%; height: 100%; }
.tile-glyph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--white); font-size: 1.35rem; text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); }
.tile-name { font-size: var(--text-base); text-align: center; }
.tile .stars svg { width: 20px; height: 20px; }
@media (max-width: 380px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* Shop and rewards ------------------------------------------------------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); }
.item { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-3); background: var(--paper); border: var(--edge); border-radius: var(--radius); box-shadow: var(--drop); text-align: center; }
.item.wearing { background: var(--good-bg); }
.item-art { width: 96px; height: 84px; display: grid; place-items: center; }
.item-art svg { width: 96px; height: auto; }
.item-swatch { width: 96px; height: 64px; border: var(--edge); border-radius: 4px; }
.item-name { font-family: var(--font-display); font-weight: 800; }
.price { display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 800; }
.price svg { width: 18px; height: 18px; }
.shop-me { display: flex; align-items: center; gap: var(--s-4); }
.shop-me svg { width: 120px; height: auto; flex: none; }

.reward-list { display: flex; flex-direction: column; gap: var(--s-3); }
.reward { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.reward-icon { font-size: 2rem; width: 56px; height: 56px; display: grid; place-items: center; background: var(--white); border: var(--edge); border-radius: 4px; flex: none; }
.reward-title { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); }
.meter { height: 14px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; min-width: 120px; }
.meter > span { display: block; height: 100%; width: 100%; background: var(--gem); transform-origin: left; }

/* Top bar stays on one line on phones. */
.topbar { flex-wrap: nowrap; }
.topbar .who span { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn.small { min-height: 40px; padding-inline: var(--s-2); min-width: 40px; }
@media (max-width: 430px) {
  .topbar { gap: 6px; }
  .topbar .who span { display: none; }
  .topbar .pill { padding: 0 var(--s-2); gap: var(--s-1); }
}
.mine > .seg { display: grid; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px) { .mine > .seg { grid-template-columns: repeat(6, 1fr); } }

.world-english { background: #dcebff; }
.world-english .world-glyph { width: clamp(72px, 20vw, 104px); height: clamp(72px, 20vw, 104px); flex: none; font-size: var(--text-xl); filter: none; }

.world-bm { background: #ffe3d6; }
.world-bc { background: #ece0ff; }
