:root {
  --bg: #14110f;
  --panel: #1f1a16;
  --line: #3a3129;
  --ink: #fff7e6;
  --muted: #b8ab95;
  --gold: #f5c542;
  --red: #ff5a4e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Zen Kaku Gothic New', system-ui, sans-serif;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 500px at 50% -200px, #3a2a12 0%, transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 39px, #ffffff06 39px 40px),
    repeating-linear-gradient(0deg, transparent 0 39px, #ffffff06 39px 40px),
    var(--bg);
}
.wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 96px; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ホーム */
.hero { text-align: center; padding: 40px 0 28px; }
.eyebrow { color: var(--gold); letter-spacing: .2em; font-size: 12px; font-weight: 700; margin: 0; }
.logo {
  font-family: 'Dela Gothic One', sans-serif; font-weight: 400;
  font-size: clamp(56px, 18vw, 84px); line-height: 1; margin: 14px 0 12px;
  color: var(--ink); text-shadow: 4px 4px 0 #8a5a00, 8px 8px 0 #00000080;
}
.lead { color: var(--muted); margin: 0; }
.menu { display: grid; gap: 12px; }
.card-btn {
  text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; display: grid; gap: 4px;
  transition: transform .12s, border-color .12s;
}
.card-btn:active { transform: scale(.98); }
.card-btn:hover { border-color: var(--gold); }
.card-btn.primary { background: linear-gradient(135deg, #f5c542, #e08a00); color: #1a1205; border: 0; }
.card-btn.primary .cb-sub { color: #3d2a05; }
.cb-title { font-weight: 900; font-size: 20px; }
.cb-sub { color: var(--muted); font-size: 13px; }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }

/* 共通 */
.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-weight: 700; }
.back { background: none; border: 0; color: var(--muted); padding: 8px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gold); color: #1a1205; border: 0; border-radius: 999px;
  padding: 14px 20px; font-weight: 900; text-decoration: none; min-height: 48px;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 8px 12px; min-height: 36px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 12px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 4px; font-size: 12px; }
.link.center { display: block; margin: 20px auto 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.notice { background: #2b2416; border: 1px dashed var(--gold); border-radius: 10px; padding: 10px; font-size: 13px; color: var(--gold); }

.photo { margin: 0; border-radius: var(--radius); overflow: hidden; border: 3px solid #2b241d; aspect-ratio: 4/3; background: #000; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.small { aspect-ratio: 16/9; }

.answer-form { margin-top: 14px; }
textarea {
  width: 100%; resize: none; background: var(--panel); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius); padding: 14px;
  font: 700 18px/1.5 'Zen Kaku Gothic New', sans-serif;
}
textarea:focus { outline: none; border-color: var(--gold); }
.count { color: var(--muted); font-size: 12px; }
.hint-box { background: #2b2416; color: var(--gold); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0 0; }
.answer-done { margin-top: 16px; text-align: center; }
.my-answer { font-weight: 900; font-size: 22px; margin: 8px 0 16px; }
.answer-done .row { justify-content: center; }

/* 投票 */
.answers { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.ans { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.ans.mine { border-color: var(--gold); }
.rank { font-family: 'Dela Gothic One', sans-serif; color: var(--gold); font-size: 22px; width: 24px; text-align: center; }
.ans-body { flex: 1; min-width: 0; }
.ans-text { margin: 0; font-weight: 700; font-size: 16px; }
.ans-name { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.ans-name.gold { color: var(--gold); font-weight: 900; }
.ans-tools { margin: 2px 0 0; }
.ans-tools .link { font-size: 11px; padding: 2px 6px 2px 0; }
.ippon {
  display: grid; place-items: center; gap: 2px; min-width: 64px; min-height: 56px;
  background: #2b241d; border: 2px solid var(--line); border-radius: 12px; font-size: 11px; font-weight: 900;
}
.ippon b { font-size: 18px; }
.ippon.on { background: var(--red); border-color: var(--red); color: #fff; }
.ippon:disabled { opacity: .5; }

/* 迷宮 */
.maze-bar { justify-content: space-between; }
.doors { display: flex; gap: 6px; }
.doors i { width: 16px; height: 22px; border-radius: 8px 8px 2px 2px; background: #2b241d; border: 2px solid var(--line); }
.doors i.open { background: var(--gold); border-color: var(--gold); }
.doors i.now { border-color: var(--gold); }
.time { font-weight: 900; }
.time b { font-family: 'Dela Gothic One', sans-serif; font-size: 22px; }
.time.danger { color: var(--red); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { opacity: .55; } }
.timebar { height: 6px; background: #2b241d; border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.timebar div { height: 100%; width: 100%; background: var(--gold); transition: width 1s linear; }
.room-label { color: var(--muted); font-size: 12px; margin: 0 0 6px; letter-spacing: .1em; }

.result { text-align: center; padding: 24px 0; }
.result .big { font-family: 'Dela Gothic One', sans-serif; font-size: 36px; margin: 0; }
.result.win .big { color: var(--gold); }
.run-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.run-list li { display: flex; gap: 12px; align-items: center; background: var(--panel); border-radius: var(--radius); padding: 10px; }
.run-list img { width: 80px; border-radius: 8px; }
.run-list p { margin: 0; font-weight: 700; }

/* ショップ */
.shop { list-style: none; padding: 0; display: grid; gap: 10px; }
.shop li { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.p-name { margin: 0; font-weight: 900; }
.p-desc { margin: 4px 0; color: var(--muted); font-size: 12px; }
.p-type { margin: 0; font-size: 11px; color: var(--gold); }
.owned { color: var(--gold); font-weight: 900; font-size: 13px; white-space: nowrap; }

/* 広告・モーダル・トースト */
.banner {
  position: fixed; left: 0; right: 0; bottom: 0; height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #e9e2d4; color: #555; font-size: 12px; border-top: 1px solid #ccc; padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }
.ad-tag { background: #333; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.ad-overlay, .modal { position: fixed; inset: 0; background: #000d; display: grid; place-items: center; z-index: 50; padding: 16px; }
.ad-box, .modal-box { background: #f4f0e8; color: #222; border-radius: 16px; padding: 28px 20px; width: min(360px, 100%); text-align: center; }
.modal-box { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.modal-box h2 { margin: 0 0 8px; font-family: 'Dela Gothic One', sans-serif; font-weight: 400; color: var(--red); }
.ad-label { font-weight: 700; }
.ad-count { font-size: 28px; font-weight: 900; }
.ad-box .btn.ghost { color: #222; border-color: #aaa; }
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700;
  transition: .2s; pointer-events: none; z-index: 60; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
