
:root {
  --ink: #172033;
  --ink-soft: #3a4760;
  --paper: #f4f8fb;
  --line: #d5e2ee;
  --sun: #f0a202;
  --sea: #1f7a6b;
  --coral: #e85d4c;
  --night: #172033;
  --card: #ffffff;
  --shadow: 0 1px 1px rgba(23, 32, 51, 0.04), 0 12px 32px rgba(23, 32, 51, 0.08);
  --radius: 22px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(880px 360px at 50% -12%, #e4f1fb 0%, transparent 70%),
    var(--paper);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; }
.wrap { width: min(960px, calc(100% - 32px)); margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 650; font-size: 1.35rem; }
.panda { width: 44px; height: 44px; display: block; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a, .btn, button { font-family: inherit; }
.nav a {
  text-decoration: none; border-radius: 999px; padding: 10px 14px; min-height: 44px;
  font-weight: 750; display: inline-flex; align-items: center;
}
.nav a:hover { background: rgba(255,255,255,0.75); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: 12px 18px; min-height: 48px;
  font-size: 1rem; font-weight: 750; cursor: pointer; text-decoration: none;
  background: var(--sea); color: white;
}
.btn.sun { background: var(--sun); color: #2a2112; }
.btn.sea { background: var(--sea); color: white; }
.btn.ghost { background: white; color: var(--ink); border: 2px solid var(--line); }
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: center; padding: 28px 0 10px; }
h1 { font-family: var(--display); font-size: clamp(2.1rem, 5vw, 3.8rem); line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 10px; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 58ch; }
.kicker { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 12px; }
.desk { background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: 28px; display: grid; place-items: center; }
.desk .panda { width: min(220px, 70%); height: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 10px 0 28px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; min-height: 180px;
}
.chip { width: 28px; height: 8px; border-radius: 999px; background: var(--sun); }
.chip.sea { background: var(--sea); }
.chip.coral { background: var(--coral); }
.card p { margin: 0; color: var(--ink-soft); }
.card strong { font-family: var(--display); font-size: 1.4rem; }
.still { color: var(--ink-soft); font-size: 0.95rem; min-height: 1.2em; }
.page-head { padding: 18px 0 8px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.play-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; padding-bottom: 24px; align-items: start; }
.hint { color: var(--ink); font-size: 1.05rem; background: #fff6df; border-radius: 16px; padding: 12px 14px; margin: 0 0 12px; }
label { display: block; font-weight: 800; margin: 12px 0 6px; }
.words { color: var(--ink-soft); font-weight: 750; }
input[type="range"] { width: 100%; height: 44px; }
input[type="text"], select {
  width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 12px;
  font: inherit; background: white; min-height: 48px;
}
canvas { width: 100%; background: var(--night); border-radius: 18px; display: block; touch-action: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
footer { padding: 8px 0 28px; color: var(--ink-soft); font-size: 0.92rem; }
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(100%, 520px); }
.sq {
  aspect-ratio: 1; border: 0; border-radius: 16px; font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  font-weight: 800; cursor: pointer; background: #f3e7d2; min-height: 64px;
}
.sq.dark { background: #d4b483; }
.sq.pick { outline: 4px solid var(--sun); }
.sq.good { background: #b7e4c7; }
.log-screen { background: var(--night); color: #e8f6ef; border-radius: 18px; min-height: 320px; padding: 16px; }
.log-screen p { margin: 0 0 10px; font-size: 1.05rem; }
.log-screen button {
  margin: 6px 6px 0 0; background: #24445a; color: white; border: 0; border-radius: 999px;
  padding: 12px 16px; min-height: 48px; font-weight: 750; font-size: 1rem; cursor: pointer;
}
.card, .btn, .nav a, .sq, .log-screen button, .chip-btn { transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
.btn.ghost.quiet, .btn.ghost:disabled, input[type="range"].quiet, input[type="range"]:disabled { opacity: 0.4; cursor: default; }
.btn:active, .sq:active, .card:active, .chip-btn:active, .nav a:active, .log-screen button:active { transform: scale(0.97); }
input[type="range"].quiet, input[type="range"]:disabled { pointer-events: none; }
@media (max-width: 800px) {
  .hero, .play-layout { grid-template-columns: 1fr; }
  .nav { display: flex; width: 100%; }
  .nav a { flex: 1 1 30%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sky-build { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; padding-bottom: 24px; align-items: start; }
.sky-build canvas { min-height: 420px; }
.sentence { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; overflow-x: auto; }
.line-word { font-size: 1.8rem; font-weight: 800; }
.chip-btn {
  min-height: 48px; padding: 12px 16px; border-radius: 999px; border: 2px solid var(--line);
  background: white; font: 750 1.05rem var(--font); cursor: pointer;
}
.chip-btn.on { background: var(--sun); border-color: var(--sun); }
@media (max-width: 800px) {
  .sky-build { grid-template-columns: 1fr; }
  .sky-build canvas { order: -1; }
}

.sound-switch {
  min-height: 44px; min-width: 44px; padding: 10px 14px; border-radius: 999px;
  border: 2px solid transparent; background: transparent; color: var(--sea);
  font: 750 1rem var(--font); cursor: pointer;
  transition: transform 160ms var(--ease), opacity 160ms var(--ease);
}
.sound-switch.off { opacity: 0.4; color: var(--ink); background: white; border-color: var(--line); }
.sound-switch:active { transform: scale(0.97); }
