:root {
  --bg: #080f05;
  --bg2: #0f1a09;
  --card: rgba(17, 27, 10, .88);
  --card2: rgba(31, 46, 19, .92);
  --text: #eef6e6;
  --muted: #a8b996;
  --accent: #ffa02e;   /* 狼の目のアンバー: 危険・強調 */
  --accent2: #ffc65c;
  --green: #8fd93c;    /* 毒緑: CTA・勝利 */
  --purple: #79c22f;
  --radius: 18px;
}

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

html, body {
  height: 100%;
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  overscroll-behavior: none;
}

html { background: var(--bg); }
/* 注意: bodyに不透明背景を敷くと::before(z:-1)より上に描画され狼が隠れる */

/* 背景の狼 (iOSでbackground-attachment:fixedが効かないためfixed疑似要素で敷く) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(5, 9, 3, .18), rgba(5, 9, 3, .55)),
    url(bg.jpg) center top / cover no-repeat var(--bg);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadein .25s ease;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---- typography ---- */
h1.logo {
  font-size: 44px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--green), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline { text-align: center; color: var(--muted); font-size: 14px; margin-top: 6px; }
h2 { font-size: 22px; font-weight: 800; }
.sub { color: var(--muted); font-size: 13px; line-height: 1.7; }
.center { text-align: center; }
.spacer { flex: 1; }

/* ---- buttons ---- */
.btn {
  display: block;
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  color: #1a1002;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  cursor: pointer;
  transition: transform .08s ease, opacity .2s;
  box-shadow: 0 6px 20px rgba(255, 160, 46, .3);
}
.btn:active { transform: scale(.97); }
.btn.secondary {
  background: var(--card2);
  box-shadow: none;
  color: var(--text);
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 12px;
}
.btn.green {
  background: linear-gradient(135deg, #5cb821, var(--green));
  box-shadow: 0 6px 20px rgba(143, 217, 60, .3);
  color: #0c1704;
}
.btn + .btn { margin-top: 12px; }
.btn:disabled { opacity: .4; pointer-events: none; }

/* ---- cards ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 12px; }

/* ---- setup ---- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px;
}
.stepper button {
  width: 52px; height: 52px;
  border-radius: 14px;
  border: none;
  background: var(--card2);
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
}
.stepper .num { font-size: 30px; font-weight: 900; }
.stepper .num small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }

.player-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.player-list input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}
.player-list input:focus { border-color: var(--purple); }

.label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 20px 0 8px; letter-spacing: .5px; }

/* ---- handoff / reveal ---- */
.bigname {
  font-size: 34px;
  font-weight: 900;
  text-align: center;
  margin: 8px 0;
  background: linear-gradient(135deg, var(--purple), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.qcard {
  background: linear-gradient(150deg, var(--card2), var(--card));
  border: 1.5px solid rgba(121, 194, 47, .38);
  border-radius: 22px;
  padding: 34px 24px;
  text-align: center;
  margin: 18px 0;
}
.qcard .qcat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent2);
  border: 1px solid var(--accent2);
  border-radius: 99px;
  padding: 3px 12px;
  margin-bottom: 16px;
}
.qcard .qtext { font-size: 24px; font-weight: 800; line-height: 1.5; }

.progress-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.progress-dots span {
  width: 8px; height: 8px; border-radius: 99px;
  background: var(--card2);
  transition: all .3s;
}
.progress-dots span.done { background: var(--green); }
.progress-dots span.now { background: var(--accent); width: 24px; }

/* ---- timer ---- */
.timer {
  font-size: 64px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  margin: 10px 0;
}
.timer.warn { color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.order-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; }
.order-list .chip {
  background: var(--card);
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
}
.order-list .arrow { color: var(--muted); align-self: center; font-size: 12px; }

/* ---- 設定トグル ---- */
.chip-row { display: flex; gap: 8px; }
.chip-toggle {
  flex: 1;
  padding: 13px;
  border-radius: 14px;
  border: 1.5px solid var(--card2);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.chip-toggle.on {
  border-color: var(--green);
  color: var(--text);
}

/* ---- 回答ラッシュ ---- */
.screen.clapflash { animation: clapflash .35s ease; }
@keyframes clapflash {
  0% { filter: brightness(1.9); }
  100% { filter: brightness(1); }
}
.probe-q {
  background: linear-gradient(150deg, var(--card2), var(--card));
  border: 1.5px solid rgba(255, 184, 77, .45);
  border-radius: 22px;
  padding: 28px 22px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  margin-top: 14px;
}
.turn-area { text-align: center; }
.turn-label { color: var(--muted); font-size: 14px; font-weight: 700; }
.turn-name {
  font-size: 44px;
  font-weight: 900;
  margin: 10px 0 18px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.turn-name.pop { animation: pop .3s ease; }
@keyframes pop {
  0% { transform: scale(.5); opacity: 0; }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
.beatbar {
  height: 10px;
  border-radius: 99px;
  background: var(--card);
  overflow: hidden;
  margin: 0 30px;
}
.beatbar-fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--accent2), var(--accent));
}

/* ---- vote ---- */
.vote-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.vote-grid button {
  padding: 18px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  background: var(--card);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vote-grid button:active { border-color: var(--accent); }
.vote-grid button.selected {
  border-color: var(--accent);
  background: rgba(255, 160, 46, .14);
}
.vote-grid button.selected .score { color: var(--accent); }
.vote-grid .score { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---- result ---- */
.result-badge {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  padding: 22px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.result-badge.win { background: rgba(143, 217, 60, .15); color: var(--green); }
.result-badge.lose { background: rgba(255, 160, 46, .15); color: var(--accent); }

.qpair { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.qpair .row {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px;
}
.qpair .row .who { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.qpair .row .q { font-size: 16px; font-weight: 700; line-height: 1.5; }
.qpair .row.wolfrow { border: 1.5px solid rgba(255, 160, 46, .55); }
.qpair .row.wolfrow .who { color: var(--accent); }

/* ---- scoreboard ---- */
.score-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 14px;
  padding: 13px 16px;
}
.score-row .rank { font-size: 15px; font-weight: 900; color: var(--muted); width: 28px; }
.score-row .name { flex: 1; font-size: 16px; font-weight: 700; }
.score-row .stats { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.score-row .pts { font-size: 17px; font-weight: 900; color: var(--accent2); }
.score-row.top { border: 1.5px solid rgba(255, 184, 77, .5); }
.score-row.top .rank { color: var(--accent2); }

/* ---- misc ---- */
.rule-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.rule-steps .step { display: flex; gap: 12px; align-items: flex-start; }
.rule-steps .n {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 99px;
  background: var(--card2);
  color: var(--accent2);
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rule-steps p { font-size: 14px; line-height: 1.6; }

footer.note { text-align: center; color: var(--muted); font-size: 11px; margin-top: 20px; }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  /* beatbarの縮小は残り時間の情報表示なので残す */
  .screen, .turn-name.pop, .screen.clapflash, .timer.warn { animation: none !important; }
}
