/* ふたりあそび 共通の見た目。3本のゲームと入口のページで使う。
   紙の地に墨の線、プレイヤーAは朱、Bは藍。影はぼかさず、線と面で作る。 */
:root {
  --paper: #f4efe6;
  --paper-deep: #e9e1d2;
  --ink: #1c1b19;
  --ink-soft: #5c574e;
  --a: #e2452b;      /* プレイヤーA 朱 */
  --a-pale: #f8d9d1;
  --b: #22577a;      /* プレイヤーB 藍 */
  --b-pale: #d3e2ec;
  --ok: #2f7d4f;
  --line: 2.5px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* ゲーム画面は指の操作を全部ゲームに渡す */
body.game {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: fixed;
  inset: 0;
}

.stage {
  position: fixed;
  inset: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

canvas { display: block; touch-action: none; }

/* 上の帯：もどる・今だれの番か・点数 */
.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  border-bottom: var(--line) solid var(--ink);
  background: var(--paper);
  font-size: 15px;
  font-weight: 700;
  min-height: 48px;
}
.bar a { color: var(--ink); text-decoration: none; font-weight: 700; padding: 6px 4px; }
.bar .grow { flex: 1; }

.turn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: #fff;
}
.turn::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.turn.a::before { background: var(--a); }
.turn.b::before { background: var(--b); }

/* ボタン */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: var(--line) solid var(--ink);
  border-radius: 8px;
  padding: 12px 20px;
  min-height: 48px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn.main { background: var(--ink); color: var(--paper); box-shadow: 0 4px 0 var(--ink-soft); }
.btn.a { background: var(--a); color: #fff; }
.btn.b { background: var(--b); color: #fff; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* 始まりと終わりの重ね画面 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  background: var(--paper);
  text-align: center;
  touch-action: manipulation;
}
.sheet[hidden] { display: none; }
.sheet h1 { margin: 0; font-size: clamp(34px, 10vw, 56px); line-height: 1.15; letter-spacing: .02em; }
.sheet h2 { margin: 0; font-size: clamp(26px, 8vw, 40px); line-height: 1.2; }
.sheet p { margin: 0; max-width: 22em; font-size: 16px; color: var(--ink-soft); }
.sheet .rule { color: var(--ink); font-weight: 700; font-size: 18px; }
.sheet .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.big-number { font-size: clamp(64px, 22vw, 120px); font-weight: 800; line-height: 1; }

.note { font-size: 14px; color: var(--ink-soft); }
