/* ============================================================
   Sona Yell（防災クイズ）本番用スタイル
   - sona-yell-index-partial.html とセットで使用
============================================================ */

/* ===== DESIGN TOKENS ===== */
:root {
  --yellow:     #FFD100;
  --yellow-lt:  #FFF5B0;
  --blue:       #1AABF0;
  --blue-dark:  #0077BB;
  --sky:        #7ECEF4;
  --red:        #E82020;
  --black:      #111111;
  --white:      #FFFFFF;
  --bg:         #F5F4EE;
  --muted:      #555555;

  --border:     3px solid #111111;
  --border-sm:  2px solid #111111;
  --shadow:     4px 4px 0 #111111;
  --shadow-lg:  6px 6px 0 #111111;
  --shadow-xl:  8px 8px 0 #111111;
  --radius:     14px;
  --radius-sm:  8px;
}

/* ===== BASE ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--black);
  background: var(--white);
  font-family: "Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
  overflow-x: hidden;
}
body > header,
body > main,
body > footer {
  width: 100%; max-width: 430px; margin-inline: auto;
  background: var(--white);
  box-shadow: 0 0 60px rgba(0,0,0,.28);
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { width: calc(100% - 28px); margin: auto; }
.section { padding: 64px 0; position: relative; }

/* ===== TYPOGRAPHY ===== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0;
  font-size: 10px; font-weight: 900; letter-spacing: .22em;
  text-transform: uppercase;
  background: var(--yellow);
  color: var(--black);
  padding: 5px 12px;
  border: var(--border-sm);
  border-radius: 4px;
}
.section-title {
  font-size: 36px; line-height: 1.1; letter-spacing: -.04em;
  margin: 16px 0 20px; font-weight: 900;
}
.section-title em { font-style: normal; color: var(--red); }
.lead { font-size: 14px; line-height: 2; color: var(--muted); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px;
  border-radius: var(--radius-sm);
  font-weight: 900; font-size: 14px;
  border: var(--border);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
  box-shadow: var(--shadow);
}
.btn:hover  { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translate(3px,3px);  box-shadow: 1px 1px 0 var(--black); }
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-red    { background: var(--red);    color: var(--white); }
.btn-dark   { background: var(--black);  color: var(--white); box-shadow: 4px 4px 0 #444; }
.btn-light  { background: var(--white);  color: var(--black); }

/* ===== 炎ボタン（Uiverse 構造・赤版・常時アニメーション） ===== */
.btn-fire {
  /* 明るい赤〜オレンジ：十分な輝度がないとパネル越しに見えない */
  --fireGrad: linear-gradient(to top, #FF0000 0%, #FF5500 50%, #FF9900 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: min(100%, 420px);
  height: 90px;
  min-height: 0;
  padding: 0;
  border: 4px solid var(--black);
  border-radius: 15px;
  background: #0A0000;
  color: var(--white);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--black);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-fire:hover  { transform: translate(-3px,-3px); box-shadow: 8px 8px 0 var(--black); }
.btn-fire:active { transform: translate(2px,2px);  box-shadow: 2px 2px 0 var(--black); }

/* 内側パネル：Uiverse の .state と同じ構造。
   幅88%×高82% にして、ボタン縁からビームが漏れ出すようにする */
.fire-state {
  position: absolute;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 5px;
  width: 88%; height: 82%;
  border-radius: 11px;
  border: 3px solid #1A0000;
  background-color: #1A0000;
  opacity: 0.85;
  z-index: 2;
}
.fire-main {
  font-size: 20px; font-weight: 900; color: var(--white);
  letter-spacing: .04em;
}
.fire-sub {
  font-size: 11px; font-weight: 700;
  color: rgba(255,200,100,1);
  letter-spacing: .1em;
}

/* 回転ビーム：Uiverse の .lightRotation を赤グラデで再現。
   位置指定なし（デフォルトでボタン左上基準）で overflow:hidden がクリップ。
   hover なしで常時スピン */
.fire-lr {
  position: absolute;
  z-index: 1;
  border-radius: inherit;
  background: var(--fireGrad);
}
.fire-lr.lr1 {
  width: 75px; height: 700px; transform: rotate(50deg);
  animation: fireSpin 2.5s linear reverse infinite;
}
.fire-lr.lr2 {
  width: 95px; height: 700px; transform: rotate(110deg);
  animation: fireSpin 3.5s linear infinite;
}
.fire-lr.lr3 {
  width: 50px; height: 370px;
  animation: fireSpin 9s linear reverse infinite;
}
.fire-lr.lr4 {
  width: 30px; height: 300px; transform: rotate(100deg);
  animation: fireSpin 4s linear infinite;
}
@keyframes fireSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===== HEADER ===== */
header {
  position: sticky; z-index: 50; top: 0;
  background: var(--yellow);
  border-bottom: var(--border);
}
.header-inner {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 38px; width: auto; display: block; }

/* ハンバーガーボタン */
.hamburger {
  flex-shrink: 0;
  width: 46px; height: 46px;
  background: var(--black);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  padding: 0;
}
.ham-line {
  display: block; width: 20px; height: 2px;
  background: var(--white); border-radius: 2px;
  transform-origin: center;
  transition: transform .24s ease, opacity .24s ease;
}
body.is-nav-open .ham-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
body.is-nav-open .ham-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.is-nav-open .ham-line:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
body.is-nav-open { overflow: hidden; }

/* ===== NAV OVERLAY ===== */
.nav-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.68);
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
body.is-nav-open .nav-overlay { opacity: 1; pointer-events: auto; }

/* ===== NAV DRAWER ===== */
.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(88vw, 340px);
  background: var(--black);
  border-left: 4px solid var(--yellow);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.22,.86,.42,1);
}
body.is-nav-open .nav-drawer { transform: translateX(0); }

/* ドロワーヘッダー */
.drawer-head {
  flex-shrink: 0;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 0 18px;
  background: var(--yellow);
  border-bottom: var(--border);
}
.drawer-head-logo { height: 32px; width: auto; display: block; }
.drawer-close {
  flex-shrink: 0;
  width: 42px; height: 42px;
  background: var(--black); color: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  font-size: 18px; font-weight: 900;
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 3px 3px 0 rgba(0,0,0,.35);
}
/* ハザードストライプ */
.drawer-hazard {
  flex-shrink: 0;
  height: 7px;
  background: repeating-linear-gradient(
    -45deg, var(--yellow) 0 7px, var(--black) 7px 14px
  );
}

/* ドロワーボディ */
.drawer-body { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.drawer-section {
  padding: 10px 18px 6px;
  font-size: 10px; font-weight: 900; letter-spacing: .22em;
  color: rgba(255,255,255,.35);
}

/* レベルリンクリスト */
.drawer-levels {
  list-style: none; margin: 0; padding: 0 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.drawer-level-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border: 2px solid rgba(255,255,255,.10);
  border-radius: 10px; text-decoration: none;
  transition: background .12s, border-color .12s, transform .1s;
}
.drawer-level-link:hover {
  background: rgba(255,209,0,.12);
  border-color: rgba(255,209,0,.5);
  transform: translateX(-3px);
}
.dll-no {
  flex-shrink: 0;
  background: var(--yellow); color: var(--black);
  font-size: 9px; font-weight: 900; letter-spacing: .12em;
  padding: 5px 9px 4px; border-radius: 4px;
}
.dll-name {
  flex: 1;
  color: var(--white); font-weight: 900; font-size: 16px; letter-spacing: -.02em;
}
.dll-badge {
  flex-shrink: 0;
  font-size: 10px; font-weight: 900; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 4px;
}
.dll-badge.lv1 { background: #2ECC71; color: #fff; }
.dll-badge.lv2 { background: var(--yellow); color: var(--black); }
.dll-badge.lv3 { background: #FF6B00; color: #fff; }
.dll-badge.lv4 { background: var(--red); color: #fff; }

/* ゲームリンク */
.drawer-game-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 0 12px;
  background: rgba(255,209,0,.1);
  border: 2px solid rgba(255,209,0,.25);
  border-radius: 10px; text-decoration: none;
  transition: background .12s, border-color .12s, transform .1s;
}
.drawer-game-link:hover {
  background: rgba(255,209,0,.22);
  border-color: rgba(255,209,0,.6);
  transform: translateX(-3px);
}
.drawer-game-link span { color: var(--yellow); font-weight: 900; font-size: 15px; }

/* 区切り */
.drawer-divider {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 12px 18px 0;
}

/* 認証ボタン群 */
.drawer-auth { padding: 10px 12px 0; display: flex; flex-direction: column; gap: 7px; }
.drawer-auth .btn { width: 100%; min-height: 44px; justify-content: center; font-size: 14px; }
.drawer-auth .btn-ghost {
  background: transparent; color: rgba(255,255,255,.65);
  border: 2px solid rgba(255,255,255,.3); box-shadow: none;
}
.drawer-auth .btn-ghost:hover { border-color: rgba(255,255,255,.6); color: var(--white); }

/* 会員登録ボタン */
.btn-regist {
  position: relative;
  background: var(--red);
  color: var(--white);
  /* サイトの基本ボーダーと同じ黒でくっきり */
  border: 3px solid var(--black);
  font-size: 16px;
  min-height: 58px;
  letter-spacing: .04em;
  overflow: hidden;
  /* フラットシャドウも黒で統一 */
  box-shadow: 4px 4px 0 var(--black);
  transition: transform .08s ease, box-shadow .08s ease;
  flex-direction: column; gap: 2px;
}
.btn-regist:hover  { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--black); }
.btn-regist:active { transform: translate(2px,2px);  box-shadow: 1px 1px 0 var(--black); }
/* 光の走り */
.btn-regist::before {
  content: "";
  position: absolute;
  top: 0; left: -70%; width: 50%; height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255,255,255,.28) 50%,
    transparent 80%
  );
  animation: registShine 2.4s ease-in-out infinite;
}
.btn-regist span.rg-main { display: block; font-weight: 900; position: relative; z-index: 1; }
.btn-regist span.rg-sub  {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: .1em; opacity: .8;
  margin-top: 3px; position: relative; z-index: 1;
}
@keyframes registShine {
  0%   { left: -70%; }
  45%  { left: 115%; }
  100% { left: 115%; }
}
/* 出しわけ：デフォルト＝未ログイン */
.auth-guest { display: flex; flex-direction: column; gap: 10px; }
.auth-member { display: none; flex-direction: column; gap: 10px; }
body.is-loggedin .auth-guest { display: none; }
body.is-loggedin .auth-member { display: flex; }

/* デモトグル（モック確認用） */
.drawer-demo {
  padding: 20px 18px 0;
  border-top: 1px dashed rgba(255,255,255,.1);
  margin-top: 18px; text-align: center;
}
.drawer-demo-btn {
  background: transparent; border: 1px dashed rgba(255,255,255,.2);
  border-radius: 4px; color: rgba(255,255,255,.28);
  font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 6px 14px;
  cursor: pointer;
}
.drawer-demo-btn:hover { color: rgba(255,255,255,.55); border-color: rgba(255,255,255,.4); }

/* ===== HERO ===== */
.hero {
  position: relative;
}
.hero-img {
  width: 100%;
  display: block;
  vertical-align: top;
}
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 0 16px 28px;
}
.hero-actions {
  display: flex;
  justify-content: center;
}

/* ===== DECISION BAND ===== */
.decision-band {
  background: var(--black);
  padding: 44px 0;
}
/* 面取りフレーム（clip-path で四隅を斜めカット） */
.decision-card-wrap {
  margin: 0 14px;
  background: var(--black);
  padding: 3px;
  clip-path: polygon(
    0 18px, 18px 0,
    calc(100% - 18px) 0, 100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%, 0 calc(100% - 18px)
  );
}
.decision-card {
  clip-path: polygon(
    0 15px, 15px 0,
    calc(100% - 15px) 0, 100% 15px,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    15px 100%, 0 calc(100% - 15px)
  );
  background: var(--white);
}
/* 危険テープ柄ライン */
.decision-hazard {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow) 0 8px,
    var(--black) 8px 16px
  );
}
/* イラスト */
.decision-card > img {
  width: 100%; display: block;
}
/* テキストボディ */
.decision-card-body {
  padding: 26px 22px 30px;
  position: relative; overflow: hidden;
}
.decision-card-body::after {
  content: "!";
  position: absolute; right: -8px; top: -20px;
  font-size: 150px; font-weight: 900;
  color: rgba(0,0,0,.04); line-height: 1;
  pointer-events: none;
}
.decision-band h2 {
  font-size: 27px; line-height: 1.4; letter-spacing: -.05em;
  margin: 0 0 14px; font-weight: 900; color: var(--black);
}
.decision-band h2 em {
  font-style: normal;
  background: var(--yellow);
  color: var(--black);
  padding: 0 5px 2px;
  border-radius: 4px;
}
.decision-band p {
  font-size: 13px; line-height: 1.95;
  color: var(--muted); margin: 0;
}

/* ===== ABOUT ===== */
.about-section {
  background: var(--white);
  padding: 44px 0;
}
/* decision-bandと同じ面取りカード構造 */
.about-wrap {
  margin: 0 14px;
  background: var(--black);
  padding: 3px;
  clip-path: polygon(
    0 18px, 18px 0,
    calc(100% - 18px) 0, 100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%, 0 calc(100% - 18px)
  );
}
.about-card {
  clip-path: polygon(
    0 15px, 15px 0,
    calc(100% - 15px) 0, 100% 15px,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    15px 100%, 0 calc(100% - 15px)
  );
  background: var(--white);
}
.about-img { width: 100%; display: block; }
.about-body {
  padding: 26px 20px 30px;
  background: var(--yellow);
  position: relative; overflow: hidden;
}
.about-body::after {
  content: "SY";
  position: absolute; right: -6px; bottom: -16px;
  font-size: 120px; font-weight: 900; line-height: 1;
  color: rgba(0,0,0,.06); letter-spacing: -.06em;
  pointer-events: none;
}
.about-section h2 {
  font-size: 32px; line-height: 1.1; letter-spacing: -.05em;
  margin: 0 0 14px; font-weight: 900; color: var(--black);
}
.about-section h2 em { font-style: normal; color: var(--red); }
.about-section .lead { color: rgba(0,0,0,.65); font-size: 14px; }

/* ===== WHY QUIZ ===== */
.why {
  background: var(--black);
  padding: 52px 0;
}
.why .section-title { color: var(--white); margin-top: 0; }
.why .section-title em { font-style: normal; color: var(--yellow); }
.why > .wrap > .lead { color: rgba(255,255,255,.58); }
.why-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 16px; margin-top: 32px;
}
/* 黄色枠カード（黒背景に対して目立つ） */
.why-card {
  border: 3px solid var(--yellow);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
}
.why-card-img { width: 100%; display: block; }
.why-card-sep {
  height: 6px;
  background: var(--yellow);
  border-top: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
}
.why-card-body {
  padding: 20px 18px 22px;
  display: flex; gap: 14px; align-items: flex-start;
}
.why-no {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--black); color: var(--yellow);
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900; letter-spacing: .04em;
}
.why-card-text { flex: 1; }
.why-card h3 { font-size: 18px; margin: 0 0 8px; font-weight: 900; color: var(--black); }
.why-card p { color: var(--muted); line-height: 1.8; font-size: 13px; margin: 0; }

/* ===== GAME SECTION ===== */
.game-section {
  background: var(--yellow);
  color: var(--black);
  overflow: hidden;
  position: relative;
}
/* マンガ風ハーフトーンドット */
.game-section::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(0,0,0,.07) 1.5px, transparent 1.6px);
  background-size: 16px 16px;
  pointer-events: none;
}
.game-section .wrap { position: relative; }

/* コンパクトなヘッダー */
.game-head {
  display: flex; flex-wrap: wrap;
  align-items: baseline; gap: 4px 18px;
  margin-bottom: 14px;
}
.game-section .section-title {
  color: var(--black);
  font-size: clamp(30px, 7vw, 46px);
  line-height: 1.1;
  letter-spacing: -.04em;
  margin: 0;
  text-shadow: 3px 3px 0 var(--white);
}
.game-section .section-title em {
  display: inline-block;
  background: var(--black);
  color: var(--yellow);
  padding: 0 10px 4px;
  transform: rotate(-2deg);
  box-shadow: 4px 4px 0 rgba(0,0,0,.22);
  text-shadow: none;
}
.game-lead {
  font-size: 12.5px; font-weight: 700;
  line-height: 1.7; color: rgba(0,0,0,.7);
  margin: 0;
}

/* 遊び方チップ（1行の帯） */
.game-howto {
  display: flex; flex-wrap: wrap;
  gap: 8px; margin-bottom: 14px;
}
.howto-chip {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  background: var(--black); color: rgba(255,255,255,.85);
  padding: 9px 14px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}
.howto-chip b { color: var(--yellow); font-size: 12px; }

/* アーケード筐体（黒の面取りフレーム） */
.game-frame {
  background: var(--black);
  padding: 4px;
  clip-path: polygon(
    0 20px, 20px 0,
    calc(100% - 20px) 0, 100% 20px,
    100% calc(100% - 20px),
    calc(100% - 20px) 100%,
    20px 100%, 0 calc(100% - 20px)
  );
}
.game-cab {
  position: relative;
  background: #17191C;
  padding: 10px;
  clip-path: polygon(
    0 17px, 17px 0,
    calc(100% - 17px) 0, 100% 17px,
    100% calc(100% - 17px),
    calc(100% - 17px) 100%,
    17px 100%, 0 calc(100% - 17px)
  );
}
.game-hazard {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow) 0 8px,
    var(--black) 8px 16px
  );
}

/* HUD */
.game-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 12px;
}
.hud-block {
  display: flex; flex-direction: column; gap: 2px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.hud-block b {
  font-size: 9px; letter-spacing: .22em;
  color: rgba(255,255,255,.4); font-weight: 900;
}
.hud-block > span { font-size: 16px; font-weight: 900; color: var(--white); }
.hud-lives > span { color: var(--red); letter-spacing: 2px; font-size: 15px; }
.hud-center { align-items: center; text-align: center; }
.hud-center > span {
  font-size: 30px; line-height: 1;
  color: var(--yellow); letter-spacing: -.02em;
}
.hud-center small { font-size: 13px; font-weight: 900; }
.hud-right { align-items: flex-end; text-align: right; }

/* ゲーム画面 */
.game-screen { position: relative; }
#gameCanvas {
  width: 100%;
  aspect-ratio: 960 / 640;
  display: block;
  background: #0C0E10;
  touch-action: none;
}
.game-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,8,10,.88);
  text-align: center;
  padding: 10px;
  overflow-y: auto;
  z-index: 2;
}
.game-overlay.hidden { display: none; }
.overlay-card { max-width: 560px; width: 100%; margin: auto; color: var(--white); }
.overlay-card h3 {
  font-size: clamp(24px, 6vw, 54px); line-height: 1;
  margin: 0 0 8px; letter-spacing: -.03em; font-weight: 900;
  color: var(--yellow);
  text-shadow: 3px 3px 0 rgba(0,0,0,.65);
}
.overlay-card p {
  color: rgba(255,255,255,.85); line-height: 1.7;
  font-size: 12px; margin: 0 0 10px;
}
.overlay-card .btn { min-height: 44px; padding: 0 28px; }

/* 結果画面：大きなスコア表示 */
.result-score { display: block; margin: 4px 0 6px; }
.result-score small {
  display: block;
  font-size: 10px; letter-spacing: .3em;
  color: rgba(255,255,255,.5); font-weight: 900;
}
.result-score b {
  display: block;
  font-size: clamp(48px, 13vw, 88px);
  font-weight: 900; line-height: 1.05;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  text-shadow: 4px 4px 0 rgba(255,209,0,.4);
}
/* CTAへの誘導キャプション */
.cta-caption {
  display: block;
  font-size: 11px; font-weight: 900;
  letter-spacing: .08em;
  color: var(--yellow);
  margin-bottom: 8px;
}

/* 結果画面のCTA（クイズ誘導が主役） */
.overlay-actions {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
#quizCta { animation: ctaPulse 1.6s ease-in-out infinite; }
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.overlay-card .btn.is-sub {
  background: transparent;
  color: rgba(255,255,255,.75);
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: none;
  min-height: 38px;
  font-size: 12px;
}

/* 難易度セレクター */
.diff-select { display: flex; gap: 8px; justify-content: center; margin: 0 0 12px; }
.diff-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.4);
  background: transparent;
  color: rgba(255,255,255,.75);
  font-weight: 900; font-size: 12px;
  cursor: pointer;
}
.diff-btn.active {
  background: var(--yellow); color: var(--black);
  border-color: var(--yellow);
}

/* コントローラー */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 90px;
  gap: 10px; margin-top: 12px;
}
.ctrl {
  height: 64px;
  border: 3px solid var(--black); border-radius: 12px;
  font-weight: 900; font-size: 14px;
  background: var(--black); color: var(--yellow);
  box-shadow: 0 5px 0 rgba(0,0,0,.35);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform .06s, box-shadow .06s;
}
.ctrl b { font-size: 16px; }
.ctrl:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.ctrl-sub { background: var(--white); color: var(--black); font-size: 12px; }

/* フッターノート（1行） */
.game-notes {
  display: flex; flex-wrap: wrap;
  gap: 6px 20px; justify-content: center;
  margin-top: 16px;
}
.game-notes span {
  font-size: 11.5px; font-weight: 700;
  color: rgba(0,0,0,.6);
}

/* 広い画面 */
@media (min-width: 700px) {
  .game-head { margin-bottom: 16px; }
  .controls { grid-template-columns: 240px 240px 110px; justify-content: center; }
}

/* ===== LEVELS ===== */
.levels { background: var(--bg); }
/* セクションヘッダー */
.levels-label {
  display: inline-block;
  background: var(--black); color: var(--yellow);
  font-size: 11px; font-weight: 900; letter-spacing: .18em;
  padding: 7px 14px 6px;
  clip-path: polygon(
    0 6px, 6px 0,
    calc(100% - 6px) 0, 100% 6px,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    6px 100%, 0 calc(100% - 6px)
  );
}
.levels .section-title {
  margin: 14px 0 14px;
  font-size: clamp(32px, 8.5vw, 42px);
}
/* マーカーペン風の強調 */
.levels .section-title em {
  font-style: normal; color: var(--black);
  background: linear-gradient(transparent 58%, var(--yellow) 58%);
  padding: 0 3px;
}
.levels .lead { margin: 0; }
/* 初級→難問のステップ帯 */
.levels-steps {
  display: flex; align-items: center; gap: 6px;
  margin-top: 22px;
  font-weight: 900; font-size: 12px;
}
.levels-steps .step {
  flex: 1;
  text-align: center;
  padding: 9px 0 8px;
  border: 2px solid var(--black);
  border-radius: 6px;
  background: var(--white); color: var(--black);
  box-shadow: 3px 3px 0 var(--black);
}
.levels-steps .step:nth-child(3) { background: var(--yellow-lt); }
.levels-steps .step:nth-child(5) { background: var(--yellow); }
.levels-steps .step:nth-child(7) { background: var(--black); color: var(--yellow); }
.levels-steps .step-arrow {
  flex-shrink: 0;
  font-size: 10px; color: var(--black);
}
.level-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 24px; margin-top: 36px;
}
/* decision / about と同じ面取り黒フレーム */
.level-card {
  display: block;
  background: var(--black);
  padding: 3px;
  clip-path: polygon(
    0 16px, 16px 0,
    calc(100% - 16px) 0, 100% 16px,
    100% calc(100% - 16px),
    calc(100% - 16px) 100%,
    16px 100%, 0 calc(100% - 16px)
  );
  text-decoration: none; color: inherit;
  transition: transform .12s;
}
.level-card:hover { transform: translateY(-4px); }
.level-card-inner {
  background: var(--white);
  clip-path: polygon(
    0 13px, 13px 0,
    calc(100% - 13px) 0, 100% 13px,
    100% calc(100% - 13px),
    calc(100% - 13px) 100%,
    13px 100%, 0 calc(100% - 13px)
  );
  overflow: hidden;
}
.level-card-inner img { width: 100%; display: block; }
/* 画像と本文の間のハザードストライプ */
.level-sep {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow) 0 8px,
    var(--black) 8px 16px
  );
}
.level-body { padding: 16px 18px 18px; }
.level-head { display: flex; align-items: center; gap: 10px; }
.level-no {
  flex-shrink: 0;
  background: var(--black); color: var(--yellow);
  font-size: 10px; font-weight: 900; letter-spacing: .14em;
  padding: 5px 9px 4px; border-radius: 4px;
}
.level-card h3 {
  font-size: 21px; margin: 0;
  letter-spacing: -.02em; font-weight: 900; color: var(--black);
}
/* むずかしさゲージ（■の数） */
.level-gauge {
  margin-left: auto;
  font-size: 13px; font-weight: 900; letter-spacing: 3px;
  color: var(--red);
  font-family: monospace;
}
.level-gauge small { color: rgba(0,0,0,.18); font-size: 13px; }
.level-card p {
  font-size: 13px; color: var(--muted);
  line-height: 1.8; margin: 10px 0 0;
}
/* 下部のリンクバー */
.level-link {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--yellow);
  border-top: 3px solid var(--black);
  padding: 13px 18px;
  font-weight: 900; font-size: 13px; color: var(--black);
}
.level-link .level-arrow { transition: transform .12s; }
.level-card:hover .level-arrow { transform: translateX(5px); }

/* ===== CTA ===== */
.cta {
  background: var(--yellow);
  border-top: 4px solid var(--black);
  position: relative; overflow: hidden;
}
/* コピーは画像に描き込まれているため、画像をフル幅で主役に */
.cta-img { width: 100%; display: block; }
.cta-hazard {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow) 0 8px,
    var(--black) 8px 16px
  );
}
.cta-bar {
  position: relative;
  padding: 30px 14px 38px;
  text-align: center;
}
/* マンガ風ハーフトーンドット（ゲームセクションと共通） */
.cta-bar::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(0,0,0,.07) 1.5px, transparent 1.6px);
  background-size: 16px 16px;
  pointer-events: none;
}
/* cta-btn は btn-fire の width を上書きしない（btn-fire 側で制御） */
.cta-btn { animation: none; }
.cta-note {
  position: relative;
  display: block; margin-top: 14px;
  font-size: 12px; font-weight: 900; letter-spacing: .04em;
  color: rgba(0,0,0,.65);
}
/* スクリーンリーダー専用テキスト */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ===== SY FOOTER ===== */
.sy-ft { background: var(--black); }
/* 上部ハザードストライプ */
.sy-ft-hazard {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg, var(--yellow) 0 8px, var(--black) 8px 16px
  );
}
/* メインエリア */
.sy-ft-main { padding: 36px 0 28px; }
/* ブランド */
.sy-ft-brand { margin-bottom: 28px; }
.sy-ft-logo  { height: 34px; width: auto; display: block; }
.sy-ft-catch {
  margin: 8px 0 0; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.38); letter-spacing: .08em;
}
/* ナビグループグリッド */
.sy-ft-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 14px;
}
.sy-ft-group-label {
  margin: 0 0 10px;
  font-size: 9px; font-weight: 900; letter-spacing: .22em;
  color: var(--yellow);
}
.sy-ft-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
}
.sy-ft-links a {
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,.55);
  text-decoration: none; letter-spacing: .02em;
  transition: color .12s;
  display: inline-flex; align-items: center; gap: 4px;
}
.sy-ft-links a::before {
  content: "\203A"; font-size: 14px;
  color: var(--yellow); flex-shrink: 0;
}
.sy-ft-links a:hover { color: var(--white); }
/* 会員登録リンクは黄色で目立たせる */
.sy-ft-regist a {
  color: var(--yellow) !important;
  font-weight: 900;
}
/* ログイン前後の出しわけ */
.sy-ft-guest  { display: list-item; }
.sy-ft-member { display: none; }
body.is-loggedin .sy-ft-guest  { display: none; }
body.is-loggedin .sy-ft-member { display: list-item; }
/* コピーライトバー */
.sy-ft-copy {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 0;
  text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: rgba(255,255,255,.22);
}
/* レスポンシブ */
@media (min-width: 560px) {
  .sy-ft-nav { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 700px) {
  .sy-ft-main .wrap {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0 48px; align-items: start;
  }
  .sy-ft-brand { margin-bottom: 0; }
}

/* ===== 追従ボタン ===== */
.sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  padding: 12px 20px 16px;
  background: rgba(6,0,0,.94);
  border-top: 3px solid var(--black);
  display: flex; align-items: center; gap: 14px;
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.22,.86,.42,1);
}
.sticky-cta.is-visible { transform: translateY(0); }

/* 左テキスト部 */
.sticky-cta-copy {
  flex: 1; min-width: 0;
  font-weight: 900; letter-spacing: -.02em;
  line-height: 1.25;
}
.sticky-cta-copy strong {
  display: block; font-size: 13px; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sticky-cta-copy small {
  font-size: 10px; font-weight: 700;
  color: rgba(255,180,60,.85); letter-spacing: .06em;
}

/* ボタン（回転ビーム、コンパクト版） */
.sticky-fire {
  --fireGrad: linear-gradient(to top, #FF0000 0%, #FF5500 50%, #FF9900 100%);
  flex-shrink: 0;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 180px; height: 62px;
  padding: 0;
  border: 3px solid var(--black);
  border-radius: 12px;
  background: #0A0000;
  color: var(--white);
  font-weight: 900; font-size: 14px; letter-spacing: .04em;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--black);
  transition: transform .08s ease, box-shadow .08s ease;
}
.sticky-fire:hover  { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--black); }
.sticky-fire:active { transform: translate(1px,1px);  box-shadow: 1px 1px 0 var(--black); }
.sticky-fire-state {
  position: absolute;
  width: 87%; height: 80%;
  background-color: #1A0000; opacity: .85;
  border-radius: 8px; border: 2px solid #1A0000;
  display: grid; place-items: center; z-index: 2;
}
.sticky-fire-text {
  position: relative; z-index: 1; font-size: 14px; font-weight: 900; color: var(--white);
}
.sticky-fire .fire-lr { z-index: 1; }

@media (max-width: 380px) {
  .sticky-cta-copy strong { font-size: 12px; }
  .sticky-fire { width: 155px; height: 56px; font-size: 13px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  body { background: var(--white); }
  body::before { display: none; }
  body > header, body > main, body > footer { max-width: none; box-shadow: none; }
}
@media (max-width: 380px) {
  .hero-copy h1  { font-size: 32px; }
  .section-title { font-size: 30px; }
  .brand-logo    { height: 32px; }
}
