/* join.spicenow.jp — 渋谷 vs 梅田 先着ウェイトリスト
 *
 * 配色は公式LINEの参加状況ページ（backend/liff/status/）に合わせている。
 * 漆黒の地に、渋谷は橙、梅田は青紫、文字は和紙色の白。金は使わない。
 * 構成・レイアウトはヒーロー実装時のまま、ここでは色だけを差し替えている。
 * 管理originのCSPと同じく style-src 'self' で配信するため、
 * markup側にstyle属性は置かず、可変値はJSからCSSOMで当てる。
 */

:root {
  color-scheme: dark;
  --washi: #100d14;
  --washi-deep: #1c1620;
  --sumi: #fffaf5;
  --sumi-soft: #bdb4b5;
  --sumi-faint: rgba(255, 250, 245, .58);
  --shu: #ff6b1a;          /* 渋谷・朱→橙 */
  --shu-deep: #ffad76;
  --ai: #8b9cff;           /* 梅田・藍→青紫 */
  --ai-deep: #d4dbff;
  --kin: #ffad76;          /* 差し色は朱の明色に統一 */
  --line: rgba(255, 250, 245, .14);
  --line-strong: rgba(255, 250, 245, .3);
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255, 107, 26, .13) 0, transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(139, 156, 255, .11) 0, transparent 42%);
}

h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.32; text-wrap: balance; }
p { margin: 0; }
em { font-style: normal; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ─────────────────────────────────────────
   ① 戦いの様子
   ───────────────────────────────────────── */
.hero { padding-bottom: 8px; }

.hero-art {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  /* 正方形の絵をそのまま置くと、広い画面で本文が全部折り返しの下へ行く。
     高さを視野の6割強で頭打ちにし、絵は中央をトリミングして見せる。 */
  max-height: min(64vh, 780px);
  background: var(--washi-deep);
  overflow: hidden;
  border-bottom: 3px solid var(--sumi);
}
.hero-art img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
/* 画像未配置でも成立させる。差し替え前に崩れて見えないようにする */
.hero-art-fallback {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center; gap: clamp(10px, 4vw, 40px);
  background:
    linear-gradient(100deg, var(--shu) 0 48%, var(--washi) 48% 52%, var(--ai) 52% 100%);
}
.hero-art.is-missing img { display: none; }
.hero-art.is-missing .hero-art-fallback { display: flex; }
.fb-city {
  font-family: var(--serif); font-weight: 800; color: #f3e9d4;
  font-size: clamp(44px, 13vw, 128px); letter-spacing: .06em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .3);
}
.fb-vs {
  font-family: var(--serif); font-weight: 800; color: var(--kin);
  font-size: clamp(28px, 8vw, 76px); letter-spacing: .04em;
}

.hero-copy { max-width: 780px; margin: 0 auto; padding: 30px 22px 6px; text-align: center; }

.kicker {
  display: inline-block;
  font-size: 11.5px; font-weight: 800; letter-spacing: .3em;
  color: var(--washi); background: var(--sumi);
  padding: 6px 16px 6px 19px; margin-bottom: 18px;
}

/* 招待付きで開いたときだけ出す。招待を持っている人に「合っている」と伝える */
.invite-badge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 5px 14px;
  font-size: 12px; font-weight: 800; letter-spacing: .12em;
  color: var(--washi); background: var(--shu);
}
/* display を指定した時点で、標準の [hidden]{display:none} を詳細度で
   上回ってしまう。hidden属性が効かなくなり、招待が無くてもバッジが出る。
   属性セレクタで明示的に打ち消す。 */
.invite-badge[hidden] { display: none; }

.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(27px, 6.6vw, 47px);
  letter-spacing: .01em;
  line-height: 1.42;
}
.hero-copy h1 em {
  background: linear-gradient(transparent 62%, rgba(255, 107, 26, .35) 62%);
  padding: 0 2px;
}
.hero-copy h1 .num {
  font-family: var(--serif);
  font-size: 1.24em; color: var(--shu-deep); letter-spacing: .01em;
}

.lead {
  margin-top: 16px; font-size: 15.5px; color: var(--sumi-soft);
  max-width: 34em; margin-left: auto; margin-right: auto;
}

/* ─────────────────────────────────────────
   CTA
   ───────────────────────────────────────── */
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 60px; padding: 0 34px; margin-top: 24px;
  background: #06c755; color: #fff;
  font-size: 17px; font-weight: 800; letter-spacing: .04em;
  text-decoration: none;
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--washi-deep);
  transition: transform .12s ease, box-shadow .12s ease;
}
.cta:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--washi-deep); }
.cta:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--washi-deep); }
.cta-hero { margin-top: 26px; }
.cta-note { margin-top: 12px; font-size: 12.5px; color: var(--sumi-faint); }

/* ─────────────────────────────────────────
   セクション共通
   ───────────────────────────────────────── */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-dark {
  background: var(--washi-deep); color: #efe6d3; border-top: 3px solid var(--kin);
}
.section-dark .eyebrow { color: var(--kin); }
.section-dark h2 { color: #f5ecd9; }

.eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: .28em;
  color: var(--kin); margin-bottom: 10px;
}
.section h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 4.4vw, 33px);
  letter-spacing: .02em;
}
.section-lead { margin-top: 12px; font-size: 14px; color: var(--sumi-soft); max-width: 42em; }
.race-copy {
  margin-top: 14px; font-size: clamp(15px, 3.1vw, 18px); font-weight: 700;
  color: var(--sumi); font-family: var(--serif);
}

/* ─────────────────────────────────────────
   ② 勢力図
   ───────────────────────────────────────── */
.battle {
  margin-top: 26px;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  align-items: stretch;
  border: 3px solid var(--line-strong);
  background: var(--washi-deep);
}
.camp { padding: 24px 22px 26px; min-width: 0; }
.camp-shibuya { border-top: 7px solid var(--shu); background: linear-gradient(150deg, #56200f 0%, #21130f 75%); }
.camp-umeda { border-top: 7px solid var(--ai); background: linear-gradient(210deg, #27284e 0%, #171420 76%); }

.camp-head { display: flex; align-items: center; gap: 12px; }
.mon {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  font-family: var(--serif); font-size: 21px; font-weight: 800;
  color: #f3e9d4;
}
/* 紋は白抜き。地色を都市ごとに必ず敷く（敷き忘れると薄地に白文字で消える） */
.camp-shibuya .mon, .board-shibuya .mon { background: var(--shu); }
.camp-umeda .mon, .board-umeda .mon { background: var(--ai); }
.board-shibuya .mon, .board-umeda .mon { width: 30px; height: 30px; font-size: 16px; margin-right: 9px; }
.camp-head h3 { font-family: var(--serif); font-size: 22px; letter-spacing: .06em; }
.camp-en { font-size: 10.5px; letter-spacing: .22em; color: var(--sumi-faint); }

.count {
  margin-top: 14px;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(46px, 12vw, 76px); line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.camp-shibuya .count { color: var(--shu-deep); }
.camp-umeda .count { color: var(--ai-deep); }
.count .unit { font-size: .3em; font-weight: 700; margin-left: 6px; color: var(--sumi-soft); letter-spacing: 0; }

.meter {
  margin-top: 16px; height: 12px;
  background: var(--line);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.meter > span { display: block; height: 100%; width: 0; transition: width .5s ease; }
.camp-shibuya .meter > span { background: repeating-linear-gradient(45deg, var(--shu) 0 7px, var(--shu-deep) 7px 14px); }
.camp-umeda .meter > span { background: repeating-linear-gradient(45deg, var(--ai) 0 7px, var(--ai-deep) 7px 14px); }

.remaining { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--sumi-soft); }

.versus {
  display: grid; place-items: center;
  padding: 0 14px;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(20px, 5vw, 34px); color: var(--kin);
  background: var(--washi);
  letter-spacing: .04em;
}

.updated { margin-top: 16px; font-size: 12.5px; color: var(--sumi-faint); }

/* ─────────────────────────────────────────
   ③ ルール
   ───────────────────────────────────────── */
.rules {
  list-style: none; margin: 26px 0 0; padding: 0;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
}
.rules li {
  border: 1px solid rgba(239, 230, 211, .28);
  padding: 22px 20px 24px;
  background: rgba(255, 255, 255, .04);
}
.rule-no {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; margin-bottom: 12px;
  font-family: var(--serif); font-size: 17px; font-weight: 800;
  color: var(--washi); background: var(--kin);
}
.rules h3 { font-family: var(--serif); font-size: 17.5px; letter-spacing: .03em; }
.rules p { margin-top: 8px; font-size: 14px; color: rgba(239, 230, 211, .8); }
.rules strong { color: #fff; }

/* ─────────────────────────────────────────
   ④ ランキング
   ───────────────────────────────────────── */
.boards {
  margin-top: 24px;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.board { border: 2px solid var(--line-strong); background: var(--washi-deep); }
.board h3 {
  display: flex; align-items: center;
  font-family: var(--serif); font-size: 17px; letter-spacing: .06em;
  padding: 12px 16px; border-bottom: 2px solid var(--line-strong);
}
.board-shibuya h3 { background: rgba(255, 107, 26, .16); }
.board-umeda h3 { background: rgba(139, 156, 255, .16); }

.ranking { list-style: none; margin: 0; padding: 6px 0; }
.ranking li {
  display: grid; grid-template-columns: 46px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.ranking li:last-child { border-bottom: none; }
.rank {
  font-family: var(--serif); font-weight: 800; font-size: 15px;
  color: var(--sumi-faint); font-variant-numeric: tabular-nums;
}
.board-shibuya .ranking li:nth-child(-n+3) .rank { color: var(--shu); }
.board-umeda .ranking li:nth-child(-n+3) .rank { color: var(--ai); }
.ranking-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-score { font-size: 13px; font-weight: 700; color: var(--sumi-soft); font-variant-numeric: tabular-nums; }
.ranking-empty {
  display: block; padding: 20px 16px; font-size: 13px;
  color: var(--sumi-faint); text-align: center;
}

/* ─────────────────────────────────────────
   ⑤ CTA / footer
   ───────────────────────────────────────── */
.section-cta { text-align: center; background: var(--washi-deep); border-top: 3px solid var(--sumi); }
.section-cta h2 { font-size: clamp(24px, 5.4vw, 38px); }
.section-cta h2 em {
  background: linear-gradient(transparent 62%, rgba(255, 107, 26, .35) 62%);
}
.section-cta .lead { margin-top: 14px; }

.foot {
  padding: 34px 22px 44px; text-align: center;
  background: var(--washi-deep); color: rgba(239, 230, 211, .72);
}
.foot-brand { font-family: var(--serif); font-size: 18px; font-weight: 800; color: #f3e9d4; letter-spacing: .1em; }
.foot-links { margin-top: 12px; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.foot-links a { color: rgba(239, 230, 211, .8); font-size: 13px; }
.foot-links a:hover { color: #fff; }
.foot-copy { margin-top: 16px; font-size: 11.5px; color: rgba(239, 230, 211, .5); }

a:focus-visible, .cta:focus-visible { outline: 3px solid var(--kin); outline-offset: 3px; }

@media (max-width: 620px) {
  .battle { grid-template-columns: 1fr; }
  .versus { padding: 8px 0; }
  .camp-umeda { border-top: 7px solid var(--ai); }
}
