:root {
  --sea: #1D9E75;
  --sand: #FAEEDA;
  --ink: #2C2C2A;
  --muted: #5F5E5A;
  --line: #D3D1C7;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 16px; background: #fff; color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  font-size: 17px; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 680px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 16px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
/* 子どもが指で押すので、どのボタンも高さ 56px を下回らせない */
button, .btn {
  display: block; width: 100%; min-height: 56px; margin: 8px 0;
  font-size: 18px; font-family: inherit; color: #fff; background: var(--sea);
  border: none; border-radius: 12px; cursor: pointer; text-align: center;
  line-height: 56px; text-decoration: none;
}
button.sub, .btn.sub { background: #fff; color: var(--sea); border: 2px solid var(--sea); line-height: 52px; }
button:disabled { background: var(--line); color: #fff; }
input {
  width: 100%; min-height: 56px; font-size: 20px; font-family: inherit;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 12px;
}
label { display: block; margin: 12px 0 4px; font-size: 15px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); }
.err { color: #A32D2D; min-height: 1.6em; }

/* ずかん */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.cell { text-align: center; font-size: 13px; }
.cell img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.cell.locked img { filter: brightness(0) opacity(0.18); }
.cell.locked .name { color: var(--line); }

/* プレイ */
.hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hud .time { font-size: 20px; font-weight: bold; }
.hud .time.warn { color: #A32D2D; }
#pool {
  width: 100%; aspect-ratio: 1; display: block; background: var(--sand);
  border-radius: 12px; touch-action: none;
}
#hintBtn { width: auto; padding: 0 16px; min-height: 44px; line-height: 44px; margin: 8px 0 0; }
#result {
  position: absolute; inset: 0; background: rgba(255,255,255,0.97);
  padding: 20px; overflow: auto; display: none;
}
#result.show { display: block; }
.stage { position: relative; }
.new { color: #BA7517; font-weight: bold; }
