:root {
  --bg: #fff8e7;
  --ink: #2b2d42;
  --font: "Chalkboard SE", "Comic Sans MS", "Comic Neue", "Marker Felt", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.wrap { max-width: 640px; margin: 0 auto; }
h1 { text-align: center; font-size: 2.2rem; margin: 0.5em 0 0.75em; }
.tiles { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; /* well above the 48px touch minimum */
  padding: 18px 16px;
  border-radius: 24px;
  color: #fff; text-decoration: none; text-align: center;
  font-size: 1.4rem; font-weight: 700;
  box-shadow: 0 6px 0 rgba(0,0,0,.15);
  transition: transform .1s ease;
}
.tile .emoji { font-size: 2.2rem; line-height: 1; }
.tile small { font-size: 0.95rem; font-weight: 600; }
a.tile:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.15); }
a.tile:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
.t-spell { background: #ff6b6b; }
.t-math  { background: #4dabf7; }
.t-read  { background: #51cf66; }
.t-sci   { background: #9775fa; }
.tile.disabled { background: #c9c9c9; color: #6b6b6b; box-shadow: none; cursor: not-allowed; }
.center { text-align: center; padding-top: 20vh; }
.back {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; margin-top: 24px;
  border-radius: 999px; background: #4dabf7; color: #fff; text-decoration: none; font-size: 1.2rem; font-weight: 700;
}
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }
