/* AIB-DESIGN-SYSTEM v3 — プロデザイナー仕上げの共通デザイン+レイアウトパターン集(初期構築・修正後も維持) */
:root{
  /* ブランド */
  --brand:#3b5bdb; --brand-hover:#2f49b8; --brand-press:#27409f;
  --brand-soft:#eef2ff; --brand-soft-2:#e0e7ff; --brand-ink:#1e2a78;
  /* 面と境界 */
  --bg:#f6f8fc; --surface:#ffffff; --surface-2:#f9fafe; --surface-3:#f1f4fb;
  --line:#e6e9f2; --line-strong:#d4d9e8;
  /* テキスト階層 */
  --ink:#10172a; --text:#374151; --muted:#6b7280; --faint:#9aa3b2;
  /* セマンティック */
  --ok:#15803d; --ok-bg:#ecfdf3; --ok-line:#bbf7d0;
  --warn:#b45309; --warn-bg:#fffbeb; --warn-line:#fde68a;
  --err:#b91c1c; --err-bg:#fef2f2; --err-line:#fecaca;
  --info:#1e40af; --info-bg:#eff4ff; --info-line:#c7d6fe;
  /* 形状・影・余白 */
  --r-xs:6px; --r-sm:9px; --r:13px; --r-lg:18px; --r-pill:999px;
  --sh-xs:0 1px 2px rgba(16,23,42,.06);
  --sh-sm:0 1px 3px rgba(16,23,42,.07), 0 1px 2px rgba(16,23,42,.04);
  --sh:0 4px 14px rgba(16,23,42,.07), 0 2px 4px rgba(16,23,42,.04);
  --sh-lg:0 18px 44px rgba(16,23,42,.12), 0 6px 14px rgba(16,23,42,.06);
  --maxw:1120px; --ease:cubic-bezier(.4,0,.2,1);
  --font:"Inter","Noto Sans JP",-apple-system,BlinkMacSystemFont,"Hiragino Sans","Segoe UI",sans-serif;
}
*{box-sizing:border-box;}
*::selection{background:var(--brand-soft-2); color:var(--brand-ink);}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;}
html,body{margin:0;padding:0;overflow-x:hidden;max-width:100%;}
body{
  font-family:var(--font); background:var(--bg); color:var(--text);
  line-height:1.7; font-size:15.5px; letter-spacing:.005em;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
h1,h2,h3,h4,h5{color:var(--ink); line-height:1.25; margin:0 0 .55em; font-weight:700; letter-spacing:-.012em;}
h1{font-size:clamp(1.7rem,2.4vw,2.15rem);} h2{font-size:1.5rem; margin-top:.2em;} h3{font-size:1.2rem;} h4{font-size:1.02rem;}
p{margin:0 0 1em;} small{color:var(--muted);}
a{color:var(--brand); text-decoration:none; transition:color .15s var(--ease);}
a:hover{color:var(--brand-hover); text-decoration:underline; text-underline-offset:2px;}
img{max-width:100%; height:auto; display:block;}
hr{border:0; border-top:1px solid var(--line); margin:24px 0;}
code{background:var(--surface-3); padding:.12em .4em; border-radius:var(--r-xs); font-size:.88em; font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,monospace;}
:focus-visible{outline:2px solid var(--brand); outline-offset:2px; border-radius:4px;}
::-webkit-scrollbar{width:11px; height:11px;}
::-webkit-scrollbar-thumb{background:#cfd6e6; border-radius:8px; border:3px solid var(--bg);}
::-webkit-scrollbar-thumb:hover{background:#b9c2d8;}
.container{max-width:var(--maxw); margin:0 auto; padding:28px 22px;}
/* 取りこぼし対策: ラッパークラスを付け忘れても整って見えるように */
main{display:block;}
main:not(.container){max-width:var(--maxw); margin:0 auto; padding:28px 22px;}
section:not(.hero){margin:18px 0;}

/* ナビゲーション */
.navbar{background:rgba(255,255,255,.86); backdrop-filter:saturate(1.6) blur(10px);
  border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50;}
.navbar .nav-inner{max-width:var(--maxw); margin:0 auto; padding:14px 22px;
  display:flex; align-items:center; justify-content:space-between; gap:18px;}
.nav-brand{font-weight:800; font-size:1.12rem; color:var(--ink); letter-spacing:-.02em;
  display:flex; align-items:center; gap:9px;}
.nav-brand:hover{text-decoration:none; color:var(--ink);}
.nav-links{display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
.nav-links a{color:var(--muted); font-weight:600; font-size:.9rem; padding:7px 12px; border-radius:var(--r-sm);
  transition:background .15s var(--ease),color .15s var(--ease);}
.nav-links a:hover{color:var(--brand-ink); background:var(--brand-soft); text-decoration:none;}
/* ハンバーガーボタン(スマホ時のみ表示。PCでは非表示) */
.nav-toggle{display:none; flex-direction:column; justify-content:center; gap:5px;
  width:42px; height:38px; padding:8px 9px; background:transparent; border:1px solid var(--line-strong);
  border-radius:var(--r-sm); cursor:pointer; box-shadow:none;}
.nav-toggle:hover{background:var(--surface-3); transform:none;}
.nav-toggle span{display:block; width:100%; height:2px; background:var(--ink); border-radius:2px; transition:transform .2s var(--ease),opacity .2s var(--ease);}
.nav-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg);}
.nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;}
.nav-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

/* ヒーロー(画面いっぱいのフルブリード) */
.hero{position:relative; overflow:hidden; color:#fff; border-radius:0;
  width:auto; max-width:none; margin-left:calc(50% - 50vw); margin-right:calc(50% - 50vw);
  margin-top:0; margin-bottom:36px;
  padding:clamp(56px,9vw,132px) clamp(20px,6vw,48px);
  min-height:clamp(340px,52vh,620px);
  display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;
  box-shadow:none; background-color:var(--brand-press); background-size:cover; background-position:center;
  background-image:linear-gradient(180deg, rgba(12,18,42,.50), rgba(12,18,42,.66)),
    var(--hero-bg, radial-gradient(120% 140% at 0% 0%, #4c6ef5 0%, var(--brand) 45%, var(--brand-press) 100%));}
.hero > *{position:relative; z-index:1; max-width:var(--maxw); width:100%; margin-left:auto; margin-right:auto;}
.hero::after{content:""; position:absolute; inset:0; z-index:0;
  background:radial-gradient(70% 90% at 50% 0%, rgba(255,255,255,.16), transparent 62%); pointer-events:none;}
.hero h1{color:#fff; font-size:clamp(2.1rem,4.6vw,3.4rem); line-height:1.12; margin-bottom:.4em; letter-spacing:-.025em; text-shadow:0 2px 18px rgba(0,0,0,.28);}
.hero p{color:rgba(255,255,255,.96); font-size:clamp(1.02rem,1.6vw,1.28rem); line-height:1.85; max-width:64ch; margin:0 auto; text-shadow:0 1px 10px rgba(0,0,0,.22);}
.hero .btn{margin-top:26px;}

/* カード・グリッド */
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:24px; box-shadow:var(--sh-sm); margin-bottom:22px; transition:box-shadow .2s var(--ease),transform .2s var(--ease),border-color .2s var(--ease);}
a.card,.card-link{display:block; color:inherit;}
a.card:hover,.card-link:hover{text-decoration:none; box-shadow:var(--sh); transform:translateY(-2px); border-color:var(--line-strong);}
.card-title{font-size:1.08rem; font-weight:700; color:var(--ink); margin-bottom:.7em; letter-spacing:-.01em;}
.grid{display:grid; gap:22px;}
.grid.cols-2{grid-template-columns:repeat(2,1fr);}
.grid.cols-3{grid-template-columns:repeat(3,1fr);}
.grid.cols-4{grid-template-columns:repeat(4,1fr);}

/* ボタン */
.btn,button{display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 19px; background:var(--brand); color:#fff; border:1px solid transparent;
  border-radius:var(--r-sm); cursor:pointer; font:inherit; font-weight:650; line-height:1.1;
  text-decoration:none; letter-spacing:.01em; box-shadow:var(--sh-xs);
  transition:background .15s var(--ease),box-shadow .15s var(--ease),transform .06s var(--ease);}
.btn:hover,button:hover{background:var(--brand-hover); color:#fff; text-decoration:none; box-shadow:var(--sh-sm); transform:translateY(-1px);}
.btn:active,button:active{background:var(--brand-press); transform:translateY(0);}
.btn:disabled,button:disabled{opacity:.55; cursor:not-allowed; transform:none; box-shadow:none;}
.btn-secondary{background:var(--brand-soft); color:var(--brand-ink); border-color:var(--brand-soft-2);}
.btn-secondary:hover{background:var(--brand-soft-2); color:var(--brand-ink);}
.btn-ghost{background:var(--surface); color:var(--text); border-color:var(--line-strong);}
.btn-ghost:hover{background:var(--surface-3); color:var(--ink);}
.btn-danger{background:var(--err);} .btn-danger:hover{background:#a11616;}
.btn-success{background:var(--ok);} .btn-success:hover{background:#11652f;}
.btn-sm{padding:7px 13px; font-size:.85rem; border-radius:var(--r-xs);}
.btn-lg{padding:14px 26px; font-size:1.05rem;}
.btn-block{display:flex; width:100%;}

/* フォーム */
.form-group{margin-bottom:17px;}
label{display:block; font-weight:600; color:var(--ink); margin-bottom:7px; font-size:.9rem;}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=tel],
input[type=date],input[type=search],input[type=url],input[type=time],select,textarea{
  width:100%; padding:11px 13px; border:1px solid var(--line-strong); border-radius:var(--r-sm);
  font:inherit; color:var(--ink); background:var(--surface); transition:border-color .15s var(--ease),box-shadow .15s var(--ease);}
input::placeholder,textarea::placeholder{color:var(--faint);}
input:hover,select:hover,textarea:hover{border-color:#b6bed2;}
input:focus,select:focus,textarea:focus{outline:none; border-color:var(--brand); box-shadow:0 0 0 3.5px var(--brand-soft);}
input:disabled,select:disabled,textarea:disabled{background:var(--surface-3); color:var(--muted);}
textarea{min-height:118px; resize:vertical;}
.form-hint{font-size:.82rem; color:var(--muted); margin-top:5px;}

/* 認証ページ */
.auth-wrap{min-height:calc(100vh - 64px); display:flex; align-items:center; justify-content:center; padding:34px 16px;
  background:radial-gradient(80% 60% at 50% -10%, var(--brand-soft), transparent 70%);}
.auth-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--sh-lg); padding:38px 34px; width:100%; max-width:430px;}
.auth-card h1{text-align:center; font-size:1.55rem; margin-bottom:1.1em;}
.auth-card .btn{width:100%; margin-top:4px;}
.auth-alt{text-align:center; margin-top:20px; font-size:.9rem; color:var(--muted);}

/* テーブル */
.table-wrap{overflow-x:auto; border-radius:var(--r); box-shadow:var(--sh-sm); border:1px solid var(--line);}
.table,table{width:100%; border-collapse:collapse; background:var(--surface); overflow:hidden;}
.table th,.table td,th,td{padding:13px 15px; text-align:left; border-bottom:1px solid var(--line); font-size:.93rem;}
.table th,th{background:var(--surface-3); font-weight:700; color:var(--ink); font-size:.82rem;
  text-transform:uppercase; letter-spacing:.04em;}
.table tbody tr,tbody tr{transition:background .12s var(--ease);}
.table tbody tr:hover,tbody tr:hover{background:var(--surface-2);}
.table tr:last-child td,tr:last-child td{border-bottom:0;}

/* アラート・バッジ */
.alert{padding:13px 16px 13px 16px; border-radius:var(--r-sm); margin:14px 0; border:1px solid transparent;
  border-left-width:4px; font-size:.92rem;}
.alert.success{background:var(--ok-bg); color:var(--ok); border-color:var(--ok-line); border-left-color:var(--ok);}
.alert.error{background:var(--err-bg); color:var(--err); border-color:var(--err-line); border-left-color:var(--err);}
.alert.warning{background:var(--warn-bg); color:var(--warn); border-color:var(--warn-line); border-left-color:var(--warn);}
.alert.info{background:var(--info-bg); color:var(--info); border-color:var(--info-line); border-left-color:var(--info);}
.badge{display:inline-flex; align-items:center; gap:5px; padding:3px 11px; border-radius:var(--r-pill);
  font-size:.76rem; font-weight:700; background:var(--brand-soft); color:var(--brand-ink); letter-spacing:.01em;}
.badge.ok{background:var(--ok-bg); color:var(--ok);} .badge.warn{background:var(--warn-bg); color:var(--warn);}
.badge.err{background:var(--err-bg); color:var(--err);}

/* ダッシュボード */
.stat-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:18px; margin-bottom:8px;}
.stat-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:22px; box-shadow:var(--sh-sm); position:relative; overflow:hidden;}
.stat-card::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); opacity:.9;}
.stat-card .stat-label{color:var(--muted); font-size:.85rem; font-weight:600;}
.stat-card .stat-value{font-size:2rem; font-weight:800; color:var(--ink); margin-top:5px; letter-spacing:-.02em;}

/* 空状態・フッター・ユーティリティ */
.empty-state{text-align:center; color:var(--muted); padding:48px 20px;}
.site-footer{text-align:center; color:var(--muted); font-size:.85rem; padding:30px 16px; border-top:1px solid var(--line); margin-top:36px;}
.text-center{text-align:center;} .text-muted{color:var(--muted);} .text-right{text-align:right;}
.mt-0{margin-top:0;} .mb-0{margin-bottom:0;} .mt-1{margin-top:8px;} .mb-1{margin-bottom:8px;}
.mt-2{margin-top:18px;} .mb-2{margin-bottom:18px;} .mt-3{margin-top:28px;}
.flex{display:flex; gap:12px; align-items:center;} .flex-between{justify-content:space-between;}
.flex-wrap{flex-wrap:wrap;} .gap-sm{gap:8px;}

/* ===== レイアウトパターン集(v3)— トップページや特集を多彩に組むための共通部品 ===== */
/* 小さなオーバーラインラベル(セクション見出しの上に置く) */
.eyebrow{display:inline-block; font-size:.78rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase;
  color:var(--brand); margin-bottom:8px;}
.lead{font-size:1.08rem; line-height:1.9; color:var(--text); max-width:70ch;}

/* 全幅バンド(淡色/濃色)。重要メッセージ・特徴を帯で強調 */
/* 注意: left:50%+負マージン方式はAI CSSの margin 上書きで右ズレ事故を起こすため使用禁止。
   margin計算のみの方式なら、上書きされても「親幅の帯」に安全に退化する */
.section-band{width:auto; margin:44px calc(50% - 50vw); padding:clamp(36px,6vw,72px) clamp(20px,6vw,48px);
  background:var(--brand-soft);}
.section-band > .band-inner, .section-band > .container{max-width:var(--maxw); margin:0 auto; padding:0;}
.section-band.dark{background:var(--brand-press); color:rgba(255,255,255,.92);}
.section-band.dark h1,.section-band.dark h2,.section-band.dark h3{color:#fff;}
.section-band.dark .eyebrow{color:rgba(255,255,255,.75);}
.section-band.dark .card{background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.16); color:rgba(255,255,255,.92); box-shadow:none;}
.section-band.dark .card-title{color:#fff;}

/* 画像×テキストの左右分割(交互に .reverse でジグザグ) */
.split{display:grid; grid-template-columns:1fr 1fr; gap:36px; align-items:center; margin:40px 0;}
.split.reverse > .split-media{order:2;}
.split .split-media img{width:100%; border-radius:var(--r-lg); box-shadow:var(--sh);}
.split .split-media .media-ph{aspect-ratio:4/3; border-radius:var(--r-lg);
  background:linear-gradient(135deg,var(--brand-soft),var(--brand-soft-2)); display:flex; align-items:center; justify-content:center;
  color:var(--brand-ink); font-size:2.2rem;}

/* 横スクロール(スナップ)カード列 */
.hscroll{display:flex; gap:18px; overflow-x:auto; padding:6px 4px 18px; scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;}
.hscroll > *{flex:0 0 min(280px,78vw); scroll-snap-align:start; margin-bottom:0;}
.hscroll::-webkit-scrollbar{height:8px;}

/* 大きな番号付き特徴(01/02/03…) */
.feature-num{display:grid; grid-template-columns:repeat(3,1fr); gap:26px; counter-reset:featnum; margin:28px 0;}
.feature-num > div{counter-increment:featnum; position:relative; padding-top:14px;}
.feature-num > div::before{content:counter(featnum,decimal-leading-zero); display:block;
  font-size:2.4rem; font-weight:800; line-height:1; letter-spacing:-.02em; color:var(--brand-soft-2); margin-bottom:10px;}
.feature-num h3{margin-bottom:.4em;}

/* 利用の流れ(ステップ) */
.steps{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; counter-reset:stepnum; margin:28px 0;}
.steps > div{counter-increment:stepnum; background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:20px 18px; position:relative;}
.steps > div::before{content:counter(stepnum); display:flex; align-items:center; justify-content:center; position:static;
  width:30px; height:30px; border-radius:50%; background:var(--brand); color:#fff; font-weight:800; font-size:.9rem; margin-bottom:10px;}
.steps > div:not(:last-child)::after{content:"→"; position:absolute; right:-14px; top:50%; transform:translateY(-50%);
  color:var(--faint); font-weight:700; z-index:1;}

/* 実績・数値の帯 */
.kpi-strip{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:18px; text-align:center;
  padding:26px 18px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); margin:34px 0;}
.kpi-strip .kpi-value{font-size:clamp(1.8rem,3.4vw,2.6rem); font-weight:800; color:var(--brand); letter-spacing:-.02em; line-height:1.1;}
.kpi-strip .kpi-label{color:var(--muted); font-size:.88rem; font-weight:600; margin-top:6px;}

/* よくある質問(開閉式) */
.faq-item{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); margin-bottom:12px; overflow:hidden;}
.faq-item summary{cursor:pointer; list-style:none; padding:16px 20px; font-weight:700; color:var(--ink);
  display:flex; justify-content:space-between; align-items:center; gap:12px;}
.faq-item summary::-webkit-details-marker{display:none;}
.faq-item summary::after{content:"+"; font-size:1.3rem; color:var(--brand); font-weight:700; transition:transform .18s var(--ease);}
.faq-item[open] summary::after{transform:rotate(45deg);}
.faq-item .faq-body{padding:0 20px 18px; color:var(--text);}

/* お客様の声・引用 */
.quote{background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--accent, var(--brand));
  border-radius:var(--r); padding:22px 24px; margin:18px 0; box-shadow:var(--sh-sm);}
.quote p{font-style:normal; margin-bottom:.6em;}
.quote .quote-by{color:var(--muted); font-size:.86rem; font-weight:600;}

/* 行動喚起の帯(登録・予約・問い合わせ) */
.cta-band{width:auto; margin:48px calc(50% - 50vw) 0;
  padding:clamp(40px,6vw,72px) clamp(20px,6vw,48px); text-align:center;
  background:linear-gradient(120deg,var(--brand),var(--brand-press)); color:#fff;}
.cta-band > *{max-width:min(var(--maxw),60ch); margin-left:auto; margin-right:auto;}
.cta-band h2{color:#fff; margin-bottom:.4em;}
.cta-band p{color:rgba(255,255,255,.92); max-width:60ch; margin:0 auto 1.2em;}
.cta-band .btn{background:#fff; color:var(--brand-ink); font-weight:800;}
.cta-band .btn:hover{background:rgba(255,255,255,.9); color:var(--brand-ink);}

/* 画像トップのカード */
.card > .card-img, .card > a > .card-img{width:calc(100% + 48px); margin:-24px -24px 16px; border-radius:var(--r) var(--r) 0 0;
  aspect-ratio:16/9; object-fit:cover;}

@media (max-width:820px){
  .split{grid-template-columns:1fr;}
  .split.reverse > .split-media{order:0;}
  .feature-num{grid-template-columns:1fr;}
  .steps > div:not(:last-child)::after{content:"";}
}

@media (max-width:820px){
  .grid.cols-2,.grid.cols-3,.grid.cols-4{grid-template-columns:1fr;}
  .nav-inner{flex-wrap:wrap; gap:10px;}
  .container{padding:22px 16px;}
}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none !important; transition:none !important; scroll-behavior:auto !important;}
}

/* ===== AIB-THEME v2 (project #167 / dir:auto / layout:minimal / nav:standard / card:shadow / deco:bar) ===== */
:root{
  --brand:#334155; --brand-hover:#2d3a4c; --brand-press:#283444;
  --brand-soft:#e2e4e7; --brand-soft-2:#ced1d6; --brand-ink:#1c232e;
  --accent:#e0526b; --accent-ink:#863140;
  --bg:#f6f8fb; --surface:#ffffff; --surface-2:#fbfbfb; --surface-3:#f7f7f7;
  --line:#e4e9f1; --line-strong:#d1d6dd;
  --ink:#111a28; --text:#3b4759; --muted:#70809a; --faint:#939fb3;
  --r-xs:7px; --r-sm:10px; --r:14px; --r-lg:20px;
  --sh-xs:0 1px 2px rgba(16,23,42,.10); --sh-sm:0 1px 3px rgba(16,23,42,.10); --sh:0 6px 18px rgba(16,23,42,.10); --sh-lg:0 22px 50px rgba(16,23,42,.14);
  --font:"Noto Sans JP","Hiragino Sans","Yu Gothic UI",system-ui,-apple-system,"Segoe UI",sans-serif;
}
h1,h2,h3,h4,h5{font-family:"Noto Sans JP","Hiragino Sans","Yu Gothic UI",system-ui,-apple-system,"Segoe UI",sans-serif; letter-spacing:-.015em;}
*::selection{background:#ced1d6; color:#1c232e;}
.badge,.tag,.chip{background:rgba(224,82,107,0.120); color:var(--accent-ink); border-color:rgba(224,82,107,0.350);}
.btn-accent{background:var(--accent); color:#fff;}
.eyebrow{color:var(--accent-ink);}
.hero{background:linear-gradient(180deg,#eaecee 0%,var(--bg) 100%); position:relative;}
.hero::after{content:'';position:absolute;inset:0;background:radial-gradient(700px 240px at 80% 0%,rgba(224,82,107,0.180),transparent 60%);pointer-events:none;}
/* deco: bar */
.container h2, main h2{padding-left:.6em; border-left:4px solid var(--brand);}


/* ===== project-specific styles (AI generated) ===== */
@charset "UTF-8";

:root {
    color-scheme: dark;
    --brand: #a442bd;
    --brand-hover: #b953d1;
    --accent: #ffdc79;
    --ink: #241034;
    --text: #f8f2ff;
    --muted: #c8b9da;
    --surface: #251436;
    --surface-raised: #301b44;
    --background: #130a21;
    --border: #584069;
    --r: 20px;
    --r-sm: 12px;
    --r-lg: 30px;
    --sh: 0 18px 48px rgb(5 1 14 / 28%);
    --sh-lg: 0 28px 80px rgb(5 1 14 / 40%);
    --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
    background: var(--background);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 0;
    color: var(--text);
    background:
        radial-gradient(ellipse at 96% 9%, rgb(164 66 189 / 14%), transparent 38%),
        radial-gradient(ellipse at 0% 40%, rgb(164 66 189 / 8%), transparent 38%),
        var(--background);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

[hidden] {
    display: none !important;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
summary,
[tabindex] {
    -webkit-tap-highlight-color: transparent;
}

button {
    touch-action: manipulation;
}

a {
    color: var(--accent);
    text-underline-offset: 0.22em;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 5px;
}

::selection {
    color: var(--ink);
    background: var(--accent);
}

h1,
h2,
h3,
h4,
p,
figure {
    margin: 0;
}

h1,
h2,
h3,
h4 {
    line-height: 1.4;
    font-weight: 800;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.25rem, 5.6vw, 4.5rem);
    letter-spacing: -0.055em;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    letter-spacing: -0.035em;
}

h3 {
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}

h4 {
    font-size: 1.08rem;
}

p + p {
    margin-top: 0.9rem;
}

h2 + p,
h3 + p,
h4 + p {
    margin-top: 0.85rem;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

.container,
.nav-inner,
.band-inner {
    width: min(1120px, calc(100% - 48px));
    margin-inline: auto;
}

main > .container > section {
    padding-block: clamp(36px, 6vw, 70px);
}

.eyebrow {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.19em;
}

.lead {
    max-width: 70ch;
    color: var(--muted);
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    line-height: 1.9;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: var(--r-sm);
    color: var(--ink);
    background: var(--accent);
    font-weight: 800;
    transform: translateY(-180%);
}

.skip-link:focus {
    transform: translateY(0);
}

.navbar {
    border-bottom: 1px solid rgb(200 185 218 / 15%);
    background: rgb(19 10 33 / 96%);
}

.nav-inner {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-brand {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.17rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-decoration: none;
    white-space: nowrap;
}

.nav-brand > span {
    color: var(--accent);
    font-size: 1.65rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
}

.nav-links a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--accent);
}

.hero {
    padding: clamp(48px, 7vw, 96px) 0;
    color: var(--ink);
    background-color: #f5edf7;
    background-image:
        linear-gradient(90deg, rgb(250 246 252 / 98%) 0%, rgb(250 246 252 / 95%) 43%, rgb(250 246 252 / 82%) 65%, rgb(250 246 252 / 55%) 100%),
        url("../img/hero.png"),
        radial-gradient(ellipse at 85% 20%, #d7b8e6, #f5edf7 70%);
    background-position: center, center right, center;
    background-size: cover;
    background-repeat: no-repeat;
}

.hero .eyebrow {
    color: #74318d;
}

.hero h1 {
    max-width: 15ch;
}

.hero .lead {
    max-width: 43ch;
    margin-top: 22px;
    color: #44314f;
}

.hero p:not(.lead) {
    max-width: 51ch;
    color: #503b5c;
    font-size: 0.9rem;
}

.hero .btn {
    margin-top: 26px;
}

.hero :focus-visible {
    outline-color: #74318d;
}

.btn {
    display: inline-flex;
    min-width: 44px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 24px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: #fff;
    background: var(--brand);
    box-shadow: 0 5px 18px rgb(164 66 189 / 20%);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover:not(:disabled) {
    background: var(--brand-hover);
    box-shadow: 0 8px 24px rgb(164 66 189 / 30%);
    text-decoration: none;
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-secondary,
.btn-ghost {
    border-color: var(--border);
    color: var(--text);
    background: var(--surface-raised);
    box-shadow: none;
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--surface);
}

.btn-ghost {
    background: transparent;
}

.btn-lg {
    min-height: 56px;
    padding: 15px 32px;
    font-size: 1rem;
}

.btn-sm {
    min-height: 44px;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

button:disabled,
.btn:disabled {
    opacity: 0.55;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.card {
    min-width: 0;
    padding: clamp(22px, 3.5vw, 36px);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--sh);
}

.card-title {
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 800;
}

.card-img {
    width: 100%;
    margin-bottom: 20px;
    border-radius: var(--r-sm);
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.grid {
    display: grid;
    gap: 24px;
}

.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.game-section > .lead {
    margin-bottom: 28px;
}

.game-card {
    position: relative;
    border-color: #715087;
    border-radius: var(--r-lg);
    background:
        radial-gradient(ellipse at 100% 0%, rgb(164 66 189 / 16%), transparent 50%),
        var(--surface);
    box-shadow: var(--sh-lg), 0 0 64px rgb(164 66 189 / 8%);
}

.form-group {
    min-width: 0;
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.form-group label,
.form-group legend {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
}

.form-group legend {
    padding: 0;
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-group .mode-option {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--muted);
    background: rgb(19 10 33 / 45%);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.mode-option:has(input:checked) {
    border-color: var(--accent);
    color: var(--accent);
    background: rgb(255 220 121 / 8%);
}

.mode-option:has(input:focus-visible) {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

.mode-option:has(input:disabled) {
    opacity: 0.65;
    cursor: not-allowed;
}

.mode-option input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 0;
    accent-color: var(--accent);
}

.mode-option strong {
    margin-left: 6px;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

.form-hint {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.8;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #826595;
    border-radius: var(--r-sm);
    color: var(--text);
    background: var(--background);
    font-size: 1rem;
    line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    min-width: 0;
    padding: 18px 14px 14px;
    border: 1px solid rgb(200 185 218 / 18%);
    border-radius: var(--r-sm);
    color: var(--text);
    background: var(--background);
    text-align: center;
}

.stat-label {
    min-height: 1.8em;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.6;
}

.stat-value {
    margin-top: 4px;
    color: var(--accent);
    font-size: clamp(1.9rem, 5vw, 3.1rem);
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums lining-nums;
}

.stat-unit {
    margin-left: 5px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
}

.game-status {
    display: flex;
    min-height: 64px;
    align-items: center;
    padding-block: 14px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.game-board {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: clamp(300px, 47vw, 440px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #75508c;
    border-radius: var(--r);
    color: var(--text);
    background:
        radial-gradient(circle at 11% 19%, rgb(255 220 121 / 65%) 0 1px, transparent 2px),
        radial-gradient(circle at 79% 32%, rgb(248 242 255 / 60%) 0 1px, transparent 2px),
        radial-gradient(circle at 32% 73%, rgb(248 242 255 / 45%) 0 1px, transparent 2px),
        radial-gradient(circle at 90% 81%, rgb(255 220 121 / 55%) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 62% 13%, rgb(248 242 255 / 35%) 0 1px, transparent 2px),
        radial-gradient(ellipse at 50% 110%, rgb(164 66 189 / 30%), transparent 65%),
        linear-gradient(155deg, #25103f, #170b2a 65%, #28113c);
    box-shadow: inset 0 0 70px rgb(5 1 14 / 35%);
    touch-action: manipulation;
}

.game-board:focus-visible {
    outline-offset: 5px;
}

.space-decoration,
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.space-decoration {
    z-index: -1;
}

.ufo {
    position: absolute;
    top: 24px;
    right: 26px;
    width: 100px;
    height: auto;
    opacity: 0.65;
    filter: drop-shadow(0 6px 15px rgb(164 66 189 / 30%));
    transform: rotate(-12deg);
    animation: ufo-float 6s ease-in-out infinite;
}

.ufo-dome {
    fill: #d6b7ed;
}

.ufo-body {
    fill: var(--brand);
    stroke: #d6b7ed;
    stroke-width: 2px;
}

.board-message {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px;
    color: var(--muted);
    text-align: center;
    pointer-events: none;
}

.board-message > span {
    color: var(--accent);
    font-size: 3.5rem;
    line-height: 1.3;
    text-shadow: 0 0 35px rgb(255 220 121 / 25%);
}

.board-message p:first-of-type {
    margin-top: 12px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 800;
}

.board-message p + p {
    margin-top: 6px;
    font-size: 0.8rem;
}

.star-button {
    position: absolute;
    z-index: 2;
    display: grid;
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    place-items: center;
    margin: 0;
    padding: 6px;
    border: 2px solid rgb(255 220 121 / 35%);
    border-radius: 50%;
    color: var(--ink);
    background: rgb(255 220 121 / 10%);
    box-shadow: 0 0 28px rgb(255 220 121 / 19%), inset 0 0 18px rgb(255 220 121 / 9%);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    -webkit-user-select: none;
}

.star-button svg {
    width: 72px;
    height: 72px;
    overflow: visible;
    filter: drop-shadow(0 3px 4px rgb(5 1 14 / 30%));
    pointer-events: none;
}

.star-button:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgb(255 220 121 / 20%);
    box-shadow: 0 0 38px rgb(255 220 121 / 30%);
}

.star-button:active:not(:disabled) svg {
    transform: scale(0.9);
}

.star-button:focus-visible {
    outline-color: #fff;
    outline-offset: 3px;
}

.star-button:disabled {
    opacity: 0;
    pointer-events: none;
}

.particles {
    z-index: 3;
}

.particle,
.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 10px currentColor;
    pointer-events: none;
    animation: particle-burst 650ms ease-out forwards;
}

.particle:nth-child(3n),
.sparkle:nth-child(3n) {
    color: #1f2430 /* AIB contrast fix */;
    background: #ef9fdf;
}

.particle:nth-child(3n + 1),
.sparkle:nth-child(3n + 1) {
    border-radius: 1px;
    clip-path: polygon(50% 0, 64% 35%, 100% 50%, 64% 65%, 50% 100%, 36% 65%, 0 50%, 36% 35%);
}

.game-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.game-actions .btn {
    min-width: 200px;
}

#game-error,
#storage-warning {
    margin-top: 20px;
}

.result-panel,
#submission-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.result-panel {
    color: var(--text);
}

#result-score {
    padding-inline: 4px;
    color: var(--accent);
    font-size: 2.2rem;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

#result-message {
    color: var(--accent);
    font-weight: 700;
}

#submission-section > p,
#submission-section .form-hint,
.result-panel > p:last-child {
    color: var(--muted);
}

#score-form {
    max-width: 520px;
    margin-top: 22px;
}

.alert {
    margin-block: 16px;
    padding: 15px 18px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--r-sm);
    color: var(--text);
    background: var(--surface-raised);
    font-size: 0.875rem;
    line-height: 1.8;
}

.alert.error {
    border-color: #dc8fba;
    color: #ffe1ef;
    background: #3a1830;
}

.alert.warning {
    border-color: var(--accent);
    color: #fff0c2;
    background: #35291c;
}

.alert.success {
    border-color: #94d8b5;
    color: #d1f6e4;
    background: #17352e;
}

.alert.info {
    border-color: #bba1e5;
    color: #eadfff;
    background: #2c2042;
}

#ranking > .lead {
    margin-bottom: 26px;
}

#ranking .card > p:first-child {
    max-width: 80ch;
    color: var(--muted);
    font-size: 0.875rem;
}

#ranking-status {
    margin-block: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.table-wrap {
    max-width: 100%;
    margin-block: 20px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overscroll-behavior-inline: contain;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.table caption {
    padding: 14px 16px;
    color: var(--muted);
    background: var(--background);
    font-size: 0.75rem;
    text-align: left;
}

.table th,
.table td {
    padding: 15px 18px;
    border-bottom: 1px solid rgb(200 185 218 / 17%);
    vertical-align: middle;
}

.table th {
    color: var(--muted);
    background: rgb(19 10 33 / 45%);
    font-size: 0.75rem;
    font-weight: 700;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table td:first-child {
    width: 68px;
    color: var(--muted);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.table td:last-child,
.table th:last-child {
    width: 100px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.table td:last-child {
    color: var(--accent);
    font-size: 1.12rem;
    font-weight: 900;
}

.table tbody tr:first-child {
    background: rgb(255 220 121 / 6%);
}

.table tbody tr:first-child td:first-child {
    color: var(--accent);
}

.empty-state {
    margin-block: 24px;
    padding: 36px 24px;
    border: 1px dashed #826595;
    border-radius: var(--r-sm);
    color: var(--muted);
    background: rgb(19 10 33 / 30%);
    text-align: center;
}

.empty-state h3 {
    color: var(--text);
    font-size: 1.1rem;
}

.empty-state p {
    max-width: 50ch;
    margin-inline: auto;
    font-size: 0.875rem;
}

.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
    margin-top: 44px;
}

.split.reverse .split-media {
    order: 2;
}

.split-media {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    box-shadow: var(--sh);
}

.split-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.split > div:not(.split-media) > p {
    color: var(--muted);
    font-size: 0.95rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    margin-top: 30px;
    counter-reset: step;
}

.steps > div {
    position: relative;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    counter-increment: step;
}

.steps > div::before {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 50%;
    color: var(--ink);
    background: var(--accent);
    content: counter(step);
    font-size: 0.9rem;
    font-weight: 900;
}

.steps > div:not(:last-child)::after {
    position: absolute;
    top: 28px;
    right: -22px;
    z-index: 1;
    color: var(--accent);
    content: "→";
    font-size: 1.25rem;
    line-height: 1;
}

.steps p {
    color: var(--muted);
    font-size: 0.875rem;
}

.faq-item {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    background: var(--surface);
}

.faq-item:first-of-type {
    margin-top: 28px;
}

.faq-item summary {
    min-height: 62px;
    padding: 18px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.faq-item summary::marker {
    color: var(--accent);
}

.faq-item[open] {
    border-color: #9672aa;
}

.faq-body {
    padding: 0 22px 22px;
    color: var(--muted);
    font-size: 0.9rem;
}

.cta-band {
    padding: clamp(30px, 5vw, 56px);
    border: 1px solid #a66ac3;
    border-radius: var(--r-lg);
    color: #fff;
    background: linear-gradient(125deg, #572572, #763181 60%, #59266d);
    box-shadow: var(--sh);
    text-align: center;
}

.cta-band p {
    max-width: 55ch;
    margin-inline: auto;
    color: #f3e5f8;
}

.cta-band .btn {
    margin-top: 24px;
    color: var(--ink);
    background: var(--accent);
    box-shadow: 0 8px 24px rgb(5 1 14 / 16%);
}

.cta-band .btn:hover {
    color: var(--ink);
    background: #ffe8a6;
}

.section-band {
    padding: 56px 0;
    color: var(--text);
    background: var(--surface);
}

.section-band.dark {
    color: var(--text);
    background: var(--background);
}

.section-band.dark .card {
    color: var(--text);
    background: var(--surface);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface-raised);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge.ok {
    color: #d1f6e4;
    background: #17352e;
}

.badge.warn {
    color: #fff0c2;
    background: #35291c;
}

.badge.err {
    color: #ffe1ef;
    background: #3a1830;
}

.site-footer {
    margin-top: 48px;
    padding: 36px 0 42px;
    border-top: 1px solid rgb(200 185 218 / 18%);
    color: var(--muted);
    background: rgb(5 1 14 / 20%);
    font-size: 0.75rem;
}

.site-footer strong {
    color: var(--accent);
    letter-spacing: 0.06em;
}

.site-footer p + p {
    margin-top: 8px;
}

@keyframes ufo-float {
    0%,
    100% {
        transform: translateY(0) rotate(-12deg);
    }
    50% {
        transform: translateY(-10px) rotate(-6deg);
    }
}

@keyframes particle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx, var(--tx, 22px)), var(--dy, var(--ty, -45px))) scale(0.15);
    }
}

@media (min-width: 1000px) {
    .game-section,
    #ranking {
        max-width: 960px;
        margin-inline: auto;
    }
}

@media (hover: hover) {
    .table tbody tr:hover {
        background: rgb(255 220 121 / 7%);
    }

    .faq-item summary:hover {
        color: var(--accent);
    }

    .mode-option:hover {
        border-color: #b38fc8;
    }
}

@media (max-width: 760px) {
    .container,
    .nav-inner,
    .band-inner {
        width: calc(100% - 32px);
    }

    .nav-inner {
        min-height: 76px;
        flex-wrap: wrap;
        gap: 0 18px;
        padding-block: 10px;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .hero {
        background-image:
            linear-gradient(90deg, rgb(250 246 252 / 97%), rgb(250 246 252 / 86%)),
            url("../img/hero.png"),
            radial-gradient(ellipse at 85% 20%, #d7b8e6, #f5edf7 70%);
    }

    .cols-3,
    .cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split,
    .steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .split {
        gap: 24px;
        margin-top: 34px;
    }

    .split.reverse .split-media {
        order: initial;
    }

    .split-media img {
        max-height: 340px;
    }

    .steps {
        gap: 24px;
    }

    .steps > div:not(:last-child)::after {
        top: auto;
        right: 26px;
        bottom: -23px;
        content: "↓";
    }

    .game-board {
        height: 340px;
    }
}

@media (max-width: 480px) {
    .container,
    .nav-inner,
    .band-inner {
        width: calc(100% - 28px);
    }

    .nav-inner {
        justify-content: center;
    }

    .nav-brand {
        justify-content: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 22px;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 9.5vw, 2.8rem);
    }

    .hero .btn {
        width: 100%;
    }

    .card {
        padding: 18px;
    }

    .game-card {
        padding: 14px;
        border-radius: var(--r);
    }

    .mode-options {
        gap: 8px;
    }

    .form-group .mode-option {
        min-height: 60px;
        gap: 8px;
        padding: 10px;
        font-size: 0.8rem;
    }

    .mode-option strong {
        margin-left: 2px;
        font-size: 1.05rem;
    }

    .stat-grid {
        gap: 6px;
    }

    .stat-card {
        padding: 12px 5px;
    }

    .stat-label {
        display: flex;
        min-height: 3.2em;
        align-items: center;
        justify-content: center;
        font-size: 0.64rem;
    }

    .stat-value {
        font-size: clamp(1.65rem, 7vw, 2.2rem);
    }

    .stat-unit {
        margin-left: 2px;
        font-size: 0.63rem;
    }

    .game-status {
        min-height: 76px;
        font-size: 0.8rem;
    }

    .game-board {
        height: 310px;
        border-radius: var(--r-sm);
    }

    .ufo {
        top: 20px;
        right: 16px;
        width: 78px;
    }

    .board-message {
        padding: 18px;
    }

    .board-message p:first-of-type {
        font-size: 1rem;
    }

    .board-message p + p {
        font-size: 0.72rem;
    }

    .game-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .game-actions {
        margin-top: 18px;
    }

    .form-hint {
        font-size: 0.75rem;
    }

    .cols-2,
    .cols-3,
    .cols-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .table th,
    .table td {
        padding: 13px 9px;
    }

    .table td:first-child {
        width: 40px;
    }

    .table td:last-child,
    .table th:last-child {
        width: 64px;
    }

    .table {
        font-size: 0.8rem;
    }

    .table td:last-child {
        font-size: 1rem;
    }

    .table caption {
        padding: 12px 9px;
        font-size: 0.68rem;
    }

    .empty-state {
        padding: 26px 14px;
    }

    .faq-item summary {
        padding: 17px 15px;
        font-size: 0.875rem;
    }

    .faq-body {
        padding: 0 15px 18px;
    }

    #submit-score,
    #refresh-ranking {
        width: 100%;
    }

    .site-footer {
        margin-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ufo {
        animation: none;
    }

    .particle,
    .sparkle {
        display: none;
    }

    .btn:hover:not(:disabled),
    .btn:active:not(:disabled),
    .star-button:active:not(:disabled) svg {
        transform: none;
    }
}

@media (forced-colors: active) {
    .btn,
    .card,
    .stat-card,
    .game-board,
    .mode-option,
    .star-button,
    .alert,
    .faq-item {
        border: 1px solid ButtonText;
    }

    .star-button svg path {
        fill: Highlight;
        stroke: ButtonText;
    }

    .star-button svg circle {
        fill: ButtonText;
    }

    .star-button svg path:last-child {
        fill: none;
        stroke: ButtonText;
    }

    .mode-option:has(input:checked) {
        outline: 2px solid Highlight;
    }
}

/* ===== AIB-HARD-OVERRIDE v2 — AI生成CSSより後に置き、最終的なレイアウトを保証 ===== */
html,body{overflow-x:hidden !important;}

/* 帯パターンの右ズレ・文字切れ防止(AI CSSが margin/position を上書きしても崩れないよう強制) */
.section-band,.cta-band{position:static !important; left:auto !important; right:auto !important;
  width:auto !important; min-width:0 !important; max-width:none !important;
  margin-left:calc(50% - 50vw) !important; margin-right:calc(50% - 50vw) !important;
  box-sizing:border-box !important;}
/* カードや分割レイアウトの中に入れられた場合は全幅化せずパネルとして表示 */
.card .section-band,.split .section-band,.grid .section-band,.hero .section-band,
.card .cta-band,.split .cta-band,.grid .cta-band,.hero .cta-band{
  margin-left:0 !important; margin-right:0 !important; border-radius:14px !important;}

/* 長い単語・URLでの横はみ出し防止 / グリッド子要素の膨張防止 */
h1,h2,h3,h4,h5,h6,p,li,dd,dt,td,th{overflow-wrap:break-word;}
.grid > *,.split > *,.steps > *,.kpi-strip > *,.feature-num > *,.hscroll > *{min-width:0 !important;}

/* ヘッダー固定(常に画面上部) */
.navbar{position:sticky !important; top:0 !important; z-index:1000 !important;}
.nav-inner{position:relative;}

/* スマホ: ハンバーガーメニュー */
@media (max-width:820px){
  .nav-toggle{display:inline-flex !important;}
  .nav-inner{flex-wrap:nowrap !important; gap:10px !important;}
  .navbar .nav-links{
    display:none !important; position:absolute !important; top:100% !important; left:0 !important; right:0 !important;
    flex-direction:column !important; align-items:stretch !important; gap:0 !important;
    background:#fff !important; border-top:1px solid var(--line) !important; border-bottom:1px solid var(--line) !important;
    box-shadow:0 14px 30px rgba(16,23,42,.14) !important; padding:6px 0 !important; margin:0 !important;
  }
  .navbar .nav-links.open{ display:flex !important; }
  .navbar .nav-links a{ padding:13px 22px !important; border-radius:0 !important; font-size:1rem !important; width:100% !important; }
}
@media (min-width:821px){ .nav-toggle{display:none !important;} }
/* --- hero override (layout: minimal) --- */
.hero, section.hero, .hero-section, .lp-hero, .hero-banner, section[class*="hero"], header[class*="hero"]{ position:relative !important; box-sizing:border-box !important; overflow:hidden !important; background-size:cover !important; background-position:center !important; background-repeat:no-repeat !important; }
.hero > *, section[class*="hero"] > *, .hero-section > *, .lp-hero > *{ position:relative !important; z-index:2 !important; float:none !important; }
.hero img, section[class*="hero"] img, .hero-section img, .lp-hero img{ display:none !important; }
.hero > div, section[class*="hero"] > div, .hero .container{ display:block !important; }
.hero, section.hero, .hero-section, .lp-hero, .hero-banner, section[class*="hero"], header[class*="hero"]{ width:auto !important; max-width:var(--maxw) !important; left:auto !important; right:auto !important; margin:26px auto 36px !important; border-radius:var(--r-lg) !important; border:1px solid var(--line) !important; display:flex !important; flex-direction:column !important; align-items:flex-start !important; justify-content:center !important; text-align:left !important; min-height:clamp(280px,38vh,440px) !important; padding:clamp(40px,6vw,80px) clamp(24px,5vw,64px) !important; color:var(--ink) !important; background-color:#f0f1f3 !important; background-image:var(--hero-bg, none) !important; }
.hero::before, section[class*="hero"]::before, .hero-section::before, .lp-hero::before{ content:"" !important; position:absolute !important; inset:0 !important; z-index:1 !important; pointer-events:none !important; background:linear-gradient(90deg, rgba(255,255,255,.90) 0%, rgba(255,255,255,.72) 55%, rgba(255,255,255,.35) 100%) !important; }
.hero > *, section[class*="hero"] > *, .hero-section > *, .lp-hero > *{ width:100% !important; max-width:100% !important; margin-left:0 !important; margin-right:0 !important; }
.hero h1, section[class*="hero"] h1{ color:var(--ink) !important; font-size:clamp(2rem,4vw,3.1rem) !important; max-width:22ch; text-shadow:none !important; }
.hero h1,.hero h2,.hero h3,.hero p,.hero span,.hero li,section[class*="hero"] h1, section[class*="hero"] h2, section[class*="hero"] h3, section[class*="hero"] p{ color:var(--text) !important; text-shadow:none !important; }
.hero p, section[class*="hero"] p{ max-width:56ch !important; margin-left:0 !important; }
.hero .btn-secondary{ background:var(--surface) !important; color:var(--brand-ink) !important; border-color:var(--line-strong) !important; }


/* AIB-HERO-IMAGE v3: existing generated content */
:root { --hero-bg: url('../img/hero.png'); }

/* STAR-CONTRAST-V14 */
body .hero::before { background:linear-gradient(90deg,rgba(22,9,43,.94),rgba(22,9,43,.72) 55%,rgba(22,9,43,.32)) !important; }
body main :is(h1,h2,h3,h4,legend) { color:#fff3ff !important; }
body .hero h1,body .hero p { color:#fff3ff !important; }
