:root {
  --bg1: #fff4f7;
  --bg2: #f3f7ff;
  --ink: #65577a;
  --muted: #8e8aa0;
  --card: rgba(255,255,255,0.92);
  --shadow: 0 18px 50px rgba(131, 118, 164, 0.14);
  --radius: 24px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  min-height: 100vh;
}
button { font: inherit; cursor: pointer; border: 0; }
img { display: block; }
.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
.screen { display: none; }
.screen.active { display: block; }
.hero-card, .level-zone, .status-card, .target-wrap, .play-wrap {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hero-card {
  min-height: calc(100vh - 68px);
  border-radius: 32px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.logo { width: min(72vw, 340px); margin-bottom: 16px; }
.subtitle { color: var(--muted); margin: 0 0 24px; }
.home-actions, .action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.primary-btn, .secondary-btn, .ghost-btn {
  padding: 14px 22px;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .icon-back:hover, .level-btn:hover, .paint-btn:hover { transform: translateY(-1px); }
.primary-btn {
  color: white;
  background: linear-gradient(135deg, #98d8c8, #a2d2ff);
  box-shadow: 0 12px 30px rgba(152, 216, 200, .34);
}
.secondary-btn { background: #fff; color: var(--ink); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.ghost-btn { background: rgba(255,255,255,.55); color: var(--ink); border: 1px solid rgba(255,255,255,.85); }
.big-btn { font-size: 20px; min-width: 220px; }
.progress-panel {
  margin-top: 18px;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.top-bar h2 { margin: 0; }
.icon-back {
  width: 52px; height: 52px; border-radius: 50%; background: white; box-shadow: var(--shadow); padding: 11px;
}
.icon-back img { width: 100%; height: 100%; object-fit: contain; }
.pill {
  margin-left: auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe4e1, #e6e6fa);
  font-weight: 700;
}
.level-zones { display: grid; gap: 16px; }
.level-zone { border-radius: 24px; padding: 18px; }
.zone-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom: 14px; }
.zone-title { font-size: 18px; font-weight: 700; }
.zone-meta { color: var(--muted); font-size: 14px; }
.level-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px; }
.level-btn {
  height: 56px; border-radius: 18px; background: white; box-shadow: 0 10px 18px rgba(0,0,0,.06); color: var(--ink); font-weight: 700;
}
.level-btn.current { outline: 3px solid #a2d2ff; }
.level-btn.done { background: linear-gradient(135deg, #ffedf2, #edf7ff); }
.level-btn.locked { opacity: .45; cursor: not-allowed; }
.status-row {
  display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
.status-card {
  border-radius: 20px; padding: 16px; text-align: center;
}
.status-card span { color: var(--muted); display: block; margin-bottom: 6px; }
.status-card strong { font-size: 28px; }
.board-layout { display:grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.target-wrap, .play-wrap { border-radius: 24px; padding: 18px; }
.target-wrap h3 { margin: 0 0 12px; }
.mini-grid, .main-grid { display:grid; gap: 6px; }
.mini-grid { justify-content: start; }
.target-cell, .grid-cell {
  border-radius: 12px; border: 1px solid rgba(101,87,122,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.game-area {
  display:grid; gap: 6px; justify-content: center; align-items: center; overflow-x: auto;
}
.paint-btn {
  border-radius: 14px; color: white; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.25);
  box-shadow: 0 10px 20px rgba(0,0,0,.12); min-width: 44px; min-height: 44px;
}
.tips { color: var(--muted); text-align:center; line-height:1.6; margin: 18px auto; max-width: 720px; }
.overlay {
  position: fixed; inset: 0; background: rgba(35, 29, 53, .48); display:flex; align-items:center; justify-content:center; padding: 20px; z-index: 20;
}
.overlay.hidden { display: none; }
.modal-card {
  width: min(100%, 420px); background: white; border-radius: 28px; box-shadow: 0 24px 70px rgba(0,0,0,.24); padding: 24px; text-align:center;
}
.modal-card h3 { margin: 0 0 10px; font-size: 28px; }
.modal-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.modal-actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.coach-card {
  width: min(100%, 460px); background: rgba(255,255,255,.97); border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.2); padding: 20px;
}
.coach-dots { display:flex; gap:8px; justify-content:center; margin-bottom:12px; }
.coach-dot { width: 10px; height: 10px; border-radius: 999px; background: #d9d9e4; }
.coach-dot.active { width: 28px; background: linear-gradient(135deg, #ffb7c5, #a2d2ff); }
.highlighted {
  position: relative; z-index: 25; box-shadow: 0 0 0 4px rgba(255,255,255,.92), 0 0 0 10px rgba(255, 213, 79, .75), 0 14px 32px rgba(255, 213, 79, .45) !important;
}
.lock-mask { pointer-events: none; }
@media (max-width: 760px) {
  .hero-card { min-height: auto; margin-top: 8px; }
  .board-layout { grid-template-columns: 1fr; }
  .status-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .app-shell { padding: 16px 12px 36px; }
  .status-row { grid-template-columns: 1fr; }
  .primary-btn, .secondary-btn, .ghost-btn { width: 100%; }
  .home-actions, .action-row { flex-direction: column; }
  .top-bar h2 { font-size: 20px; }
}
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
