/* 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 #165 / dir:auto / layout:banner / nav:underline / card:border / deco:dot) ===== */
:root{
  --brand:#be185d; --brand-hover:#ab1553; --brand-press:#98134a;
  --brand-soft:#f5dee8; --brand-soft-2:#efc7d8; --brand-ink:#680d33;
  --accent:#0e7490; --accent-ink:#084556;
  --bg:#fdfbfc; --surface:#ffffff; --surface-2:#fbfbfb; --surface-3:#f7f7f7;
  --line:#f4e3ea; --line-strong:#e0d0d7;
  --ink:#2b0f1d; --text:#553444; --muted:#8d7280; --faint:#a9959f;
  --r-xs:4px; --r-sm:6px; --r:8px; --r-lg:12px;
  --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:"Hiragino Mincho ProN","Yu Mincho","YuMincho","Noto Serif JP",serif;
}
h1,h2,h3,h4,h5{font-family:"Hiragino Mincho ProN","Yu Mincho","YuMincho","Noto Serif JP",serif; letter-spacing:0;}
*::selection{background:#efc7d8; color:#680d33;}
.badge,.tag,.chip{background:rgba(14,116,144,0.120); color:var(--accent-ink); border-color:rgba(14,116,144,0.350);}
.btn-accent{background:var(--accent); color:#fff;}
.eyebrow{color:var(--accent-ink);}
.hero{background:linear-gradient(180deg,#f8e7ee 0%,var(--bg) 100%); position:relative;}
.hero::after{content:'';position:absolute;inset:0;background:radial-gradient(700px 240px at 80% 0%,rgba(14,116,144,0.180),transparent 60%);pointer-events:none;}
/* nav: underline */
@media (min-width:821px){
  .navbar .nav-links a{border-radius:0; padding:9px 4px; margin:0 8px; position:relative; background:transparent;}
  .navbar .nav-links a::after{content:''; position:absolute; left:0; right:0; bottom:2px; height:2px; background:var(--accent); transform:scaleX(0); transform-origin:left; transition:transform .18s ease;}
  .navbar .nav-links a:hover{background:transparent; color:var(--ink);}
  .navbar .nav-links a:hover::after{transform:scaleX(1);}
}
/* card: border(フラット・枠線) */
.card,.stat-card{box-shadow:none; border:1.5px solid var(--line-strong);}
a.card:hover,.card-link:hover{box-shadow:none; border-color:var(--brand); transform:none;}
/* deco: dot */
.container h2::before, main h2::before{content:''; display:inline-block; width:.5em; height:.5em; border-radius:50%; background:var(--accent); margin-right:.45em; vertical-align:.08em;}


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

:root {
  color-scheme: light;
  --brand: #b83750;
  --brand-hover: #982b40;
  --accent: #7050aa;
  --ink: #302536;
  --muted: #65586c;
  --surface: #ffffff;
  --surface-soft: #fff6e9;
  --cream: #fff9ee;
  --coral-soft: #ffe1dc;
  --lavender-soft: #eee5ff;
  --line: #dfd0dc;
  --success: #256343;
  --success-soft: #e8f5ec;
  --error: #a4263c;
  --error-soft: #fff0f1;
  --warning: #745012;
  --warning-soft: #fff3d5;
  --r: 8px;
  --r-sm: 4px;
  --r-lg: 12px;
  --sh: none;
  --font: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  background-color: var(--cream);
  background-image: radial-gradient(var(--line) 0.8px, transparent 0.8px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

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

button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

button:not(:disabled),
summary,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
}

a {
  color: var(--brand);
  text-underline-offset: 0.25em;
}

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

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

[hidden] {
  display: none !important;
}

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

img {
  display: block;
  height: auto;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.8rem, 5.5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.035em;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
}

h3 {
  margin-bottom: 0.6rem;
  font-size: 1.12rem;
}

h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

small,
.form-hint {
  font-size: 0.84rem;
  line-height: 1.7;
}

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

main.container,
body > .container {
  padding-block: 2rem 3rem;
}

.navbar {
  border-bottom: 2px solid var(--line);
  background: var(--surface);
}

.nav-inner {
  display: flex;
  width: min(1120px, calc(100% - 40px));
  min-height: 74px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-block: 0.8rem;
}

.nav-brand {
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem 1.4rem;
  flex-wrap: wrap;
}

.nav-links a {
  padding-block: 0.35rem;
  border-bottom: 3px solid transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--brand);
}

.hero {
  padding: clamp(1.5rem, 4vw, 2.75rem) 1.25rem;
  border-bottom: 5px solid var(--coral-soft);
  background: linear-gradient(115deg, var(--brand), #754596);
  color: #fff;
  text-align: center;
}

.hero h1,
.hero h2,
.hero p,
.hero .eyebrow,
.hero .lead {
  color: #fff;
}

.hero p {
  max-width: 44rem;
  margin-inline: auto;
}

.hero .eyebrow {
  border-color: #fff;
}

.hero .btn {
  margin-top: 0.5rem;
}

.hero .btn-secondary {
  border-color: #fff;
  background: var(--surface);
  color: var(--brand);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.lead {
  max-width: 48rem;
  color: var(--muted);
  font-size: 1.03rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.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));
}

.grid > *,
.split > *,
.game-layout > *,
.play-layout > * {
  min-width: 0;
}

.card {
  padding: clamp(1rem, 2.5vw, 1.6rem);
  border: 1px solid var(--line);
  border-top: 4px solid var(--coral-soft);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh);
}

.card-title {
  margin-bottom: 0.65rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.card-img {
  width: 100%;
  max-height: 260px;
  margin-bottom: 1.1rem;
  border-radius: var(--r-sm);
  object-fit: cover;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  max-width: 100%;
  padding: 0.65rem 1.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px solid var(--brand);
  border-radius: var(--r);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.btn:hover:not(:disabled) {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
  color: #fff;
}

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

.btn:disabled {
  border-style: dashed;
  opacity: 0.6;
}

.btn-secondary {
  border-color: var(--accent);
  background: var(--lavender-soft);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--coral-soft);
  color: var(--ink);
}

.btn-success {
  border-color: var(--success);
  background: var(--success);
}

.btn-danger {
  border-color: var(--error);
  background: var(--error);
}

.btn-lg {
  min-height: 52px;
  padding: 0.8rem 1.65rem;
  font-size: 1.05rem;
}

.btn-sm {
  min-height: 40px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.actions,
.button-row,
.game-controls,
.game-actions,
.dialog-actions,
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

.form-group {
  min-width: 0;
  margin-bottom: 1.1rem;
}

label,
legend {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
}

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

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--error);
}

input[type="radio"],
input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--brand);
  vertical-align: middle;
}

fieldset {
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.form-hint {
  margin-top: 0.45rem;
  margin-bottom: 0;
  color: var(--muted);
}

.difficulty-options,
.difficulty-selector {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.difficulty-options label {
  display: flex;
  min-height: 46px;
  margin: 0;
  padding: 0.65rem 1rem;
  align-items: center;
  gap: 0.6rem;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}

.difficulty-options label:has(input:checked) {
  border-color: var(--brand);
  background: var(--coral-soft);
}

.difficulty-options label:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.alert {
  margin-block: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
}

.alert:empty,
.status-message:empty,
.game-message:empty {
  display: none;
}

.alert.success,
.alert-success {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.alert.error,
.alert-error {
  border-color: var(--error);
  background: var(--error-soft);
  color: var(--error);
}

.alert.warning,
.alert-warning {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.alert.info,
.alert-info {
  border-color: var(--accent);
  background: var(--lavender-soft);
  color: var(--ink);
}

.badge {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--lavender-soft);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
}

.badge.ok {
  background: var(--success-soft);
  color: var(--success);
}

.badge.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.err {
  background: var(--error-soft);
  color: var(--error);
}

.game-layout,
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.game-panel,
.play-panel {
  min-width: 0;
  border-top-color: var(--brand);
}

.game-sidebar,
.sidebar {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.game-controls {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.game-controls .form-group {
  margin-bottom: 0;
}

.game-controls select {
  width: auto;
  max-width: 100%;
}

.instructions,
.how-to-play,
.help-panel {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--r);
  background: var(--lavender-soft);
  color: var(--ink);
  font-size: 0.92rem;
}

.instructions h2,
.how-to-play h2,
.help-panel h2 {
  font-size: 1.1rem;
}

.instructions ol,
.instructions ul,
.how-to-play ol,
.how-to-play ul {
  margin: 0;
  padding-left: 1.4rem;
}

.instructions li + li,
.how-to-play li + li {
  margin-top: 0.3rem;
}

.game-stats,
.stats,
.stat-grid,
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-block: 1rem;
}

.stat,
.stat-card,
.result-stat {
  min-width: 0;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  text-align: center;
}

.stat-label,
.stat dt,
.result-stat dt {
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.stat-value,
.stat dd,
.result-stat dd,
#move-count,
#moves,
#timer,
#elapsed-time {
  margin: 0;
  color: var(--brand);
  font-size: clamp(1.2rem, 3vw, 1.85rem);
  font-weight: 900;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.game-board,
.memory-board,
#game-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.4vw, 12px);
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(8px, 2vw, 16px);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-soft);
  isolation: isolate;
}

:is(.game-board, .memory-board, #game-board) > button,
.memory-card,
.cat-card,
.game-card {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: var(--r);
  background: var(--lavender-soft);
  color: var(--ink);
  font-size: clamp(1.7rem, 5vw, 3.3rem);
  line-height: 1;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

:is(.game-board, .memory-board, #game-board) > button:hover:not(:disabled),
.memory-card:hover:not(:disabled),
.cat-card:hover:not(:disabled),
.game-card:hover:not(:disabled) {
  z-index: 1;
  border-color: var(--brand);
  background: var(--coral-soft);
  transform: translateY(-3px);
}

:is(.game-board, .memory-board, #game-board) > button:focus-visible,
.memory-card:focus-visible,
.cat-card:focus-visible,
.game-card:focus-visible {
  z-index: 2;
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

:is(.game-board, .memory-board, #game-board) > button:disabled,
.memory-card:disabled,
.cat-card:disabled,
.game-card:disabled {
  opacity: 1;
  cursor: default;
}

.card-inner {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: inherit;
}

.card-front,
.card-back,
.card-face,
.card-symbol,
.card-emoji {
  grid-area: 1 / 1;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: inherit;
}

.card-front,
.card-face {
  display: none;
}

.card-back {
  display: flex;
  color: var(--accent);
  font-size: 0.8em;
  font-weight: 900;
}

:is(.memory-card, .cat-card, .game-card, .game-board > button, .memory-board > button, #game-board > button):is(.flipped, .is-flipped, .revealed, .is-revealed, .matched, .is-matched, [data-state="open"], [data-state="revealed"], [data-state="matched"]) {
  border-color: var(--brand);
  background: var(--surface);
  color: var(--ink);
}

:is(.flipped, .is-flipped, .revealed, .is-revealed, .matched, .is-matched, [data-state="open"], [data-state="revealed"], [data-state="matched"]) > .card-back,
:is(.flipped, .is-flipped, .revealed, .is-revealed, .matched, .is-matched, [data-state="open"], [data-state="revealed"], [data-state="matched"]) > .card-inner > .card-back {
  display: none;
}

:is(.flipped, .is-flipped, .revealed, .is-revealed, .matched, .is-matched, [data-state="open"], [data-state="revealed"], [data-state="matched"]) > :is(.card-front, .card-face),
:is(.flipped, .is-flipped, .revealed, .is-revealed, .matched, .is-matched, [data-state="open"], [data-state="revealed"], [data-state="matched"]) > .card-inner > :is(.card-front, .card-face) {
  display: flex;
}

:is(.memory-card, .cat-card, .game-card, .game-board > button, .memory-board > button, #game-board > button):is(.matched, .is-matched, [data-state="matched"]) {
  border: 3px double var(--success);
  background: var(--success-soft);
  color: var(--ink);
}

:is(.memory-card, .cat-card, .game-card, .game-board > button, .memory-board > button, #game-board > button):is(.match-animation, .just-matched, .celebrate, .is-matching) {
  animation: pair-pop 420ms ease-out;
}

.card-front svg,
.card-face svg,
.card-inner svg,
.cat-face {
  display: block;
  width: 80%;
  height: auto;
  max-height: 90%;
}

.card-name,
.card-caption {
  font-size: clamp(0.6rem, 1.5vw, 0.8rem);
  font-weight: 800;
  line-height: 1.3;
}

.game-message,
.game-status,
.status-message {
  margin-block: 0.85rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.game-actions {
  margin-top: 1rem;
}

.personal-results,
.local-results,
.ranking-section {
  margin-top: 1.5rem;
}

.record-list,
.score-summary {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.record-list > div,
.score-summary > div {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-soft);
}

.record-list dt,
.score-summary dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.record-list dd,
.score-summary dd {
  margin: 0.3rem 0 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.9rem;
}

.table caption {
  padding-bottom: 0.75rem;
  color: var(--muted);
  text-align: left;
}

.table th,
.table td {
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: var(--lavender-soft);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.table td {
  font-variant-numeric: tabular-nums;
}

.table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.table tbody tr:hover {
  background: var(--coral-soft);
}

.table td:first-child {
  color: var(--brand);
  font-weight: 900;
}

.ranking-note,
.privacy-note,
.storage-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.ranking-note {
  margin-top: 1rem;
}

.empty-state {
  padding: 1.5rem 1rem;
  border: 1px dashed var(--accent);
  border-radius: var(--r);
  background: var(--lavender-soft);
  color: var(--ink);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
}

dialog {
  width: min(520px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: clamp(1.2rem, 4vw, 2rem);
  overflow-y: auto;
  border: 3px solid var(--brand);
  border-radius: var(--r-lg);
  background: var(--cream);
  color: var(--ink);
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgb(48 37 54 / 72%);
}

dialog[open] {
  animation: dialog-arrive 180ms ease-out;
}

dialog h2 {
  color: var(--brand);
  text-align: center;
}

dialog form {
  margin-top: 1.25rem;
}

.dialog-icon,
.celebration-icon {
  margin-bottom: 0.5rem;
  font-size: 3rem;
  line-height: 1.2;
  text-align: center;
}

.dialog-actions {
  margin-top: 1.25rem;
}

.dialog-actions > .btn {
  flex: 1 1 160px;
}

.result-summary,
.clear-summary {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--lavender-soft);
  color: var(--ink);
  text-align: center;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding-block: 2rem;
}

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

.split-media img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.section-band {
  padding: 2.5rem 1.25rem;
  background: var(--lavender-soft);
  color: var(--ink);
}

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

.section-band.dark {
  background: var(--accent);
  color: #fff;
}

.section-band.dark .lead,
.section-band.dark .eyebrow {
  color: #fff;
}

.section-band.dark .eyebrow {
  border-color: #fff;
}

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

.faq-item {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.faq-item summary {
  min-height: 48px;
  padding: 1rem;
  color: var(--ink);
  font-weight: 800;
}

.faq-item[open] summary {
  color: var(--brand);
}

.faq-body {
  padding: 0 1rem 1.25rem;
  color: var(--muted);
}

.cta-band {
  padding: 2.5rem 1.25rem;
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.cta-band .btn {
  border-color: var(--surface);
  background: var(--surface);
  color: var(--brand);
}

.cta-band .btn:hover:not(:disabled) {
  border-color: var(--coral-soft);
  background: var(--coral-soft);
  color: var(--ink);
}

.steps,
.feature-num {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  counter-reset: feature;
}

.steps > div,
.feature-num > div {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  counter-increment: feature;
}

.steps > div::before,
.feature-num > div::before {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  content: counter(feature);
  font-weight: 900;
}

.feature-num > div::before {
  content: counter(feature, decimal-leading-zero);
}

.site-footer {
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer p {
  margin-bottom: 0.4rem;
}

.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  transform: translateY(-200%);
  border: 2px solid var(--brand);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

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

@keyframes pair-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.07) rotate(-3deg);
  }
  75% {
    transform: scale(1.02) rotate(2deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes dialog-arrive {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1100px) {
  .game-panel,
  .play-panel {
    padding: 1.75rem;
  }
}

@media (max-width: 820px) {
  .game-layout,
  .play-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .game-board,
  .memory-board,
  #game-board {
    max-width: 560px;
  }
}

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

  main.container,
  body > .container {
    padding-block: 1.1rem 2rem;
  }

  .nav-inner {
    min-height: 64px;
    gap: 0.35rem 0.75rem;
  }

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

  .nav-links {
    gap: 0.25rem 0.8rem;
  }

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

  .hero {
    padding: 1.35rem 0.85rem;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .hero p {
    font-size: 0.9rem;
  }

  .card {
    padding: 1rem;
  }

  .cols-2,
  .cols-3,
  .cols-4,
  .game-sidebar,
  .sidebar,
  .split,
  .steps,
  .feature-num {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .game-controls {
    align-items: stretch;
    gap: 0.65rem;
  }

  .game-controls .form-group {
    flex: 1 1 100%;
  }

  .game-controls select {
    width: 100%;
  }

  .game-controls .btn {
    flex: 1 1 auto;
  }

  .game-stats,
  .stats,
  .stat-grid,
  .result-stats {
    gap: 0.4rem;
  }

  .stat,
  .stat-card,
  .result-stat {
    padding: 0.6rem 0.25rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .game-board,
  .memory-board,
  #game-board {
    gap: 6px;
    padding: 7px;
    border-radius: var(--r);
  }

  :is(.game-board, .memory-board, #game-board) > button,
  .memory-card,
  .cat-card,
  .game-card {
    border-radius: var(--r-sm);
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }

  .instructions,
  .how-to-play,
  .help-panel {
    padding: 0.8rem;
    font-size: 0.85rem;
  }

  .table {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.65rem 0.4rem;
  }

  .table th {
    font-size: 0.72rem;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading .btn {
    min-height: 44px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions > .btn {
    flex: 0 0 auto;
    width: 100%;
  }

  .card-name,
  .card-caption {
    font-size: 0.6rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  :is(.game-board, .memory-board, #game-board) > button:hover:not(:disabled),
  .memory-card:hover:not(:disabled),
  .cat-card:hover:not(:disabled),
  .game-card:hover:not(:disabled),
  .btn:active:not(:disabled) {
    transform: none;
  }
}

@media (forced-colors: active) {
  .btn,
  .card,
  .stat,
  .stat-card,
  .alert,
  dialog,
  .game-board,
  .memory-board,
  #game-board {
    border-color: CanvasText;
  }

  :is(.game-board, .memory-board, #game-board) > button,
  .memory-card,
  .cat-card,
  .game-card {
    border-color: ButtonText;
  }

  :is(.memory-card, .cat-card, .game-card, .game-board > button, .memory-board > button, #game-board > button):is(.matched, .is-matched, [data-state="matched"]) {
    border: 4px double Highlight;
  }

  :focus-visible {
    outline-color: Highlight;
  }
}


/* PUBLIC-SAMPLE-SKIN-V9 */
:root {
  --font-head: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  --cream: #fff8e9;
  --coral: #ff655e;
  --purple: #6944a1;
  --lavender: #eee4ff;
  --ink: #342343;
}
body, body *, body *::before, body *::after { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink) !important; background: radial-gradient(circle at 1px 1px, #dfcde5 1px, transparent 1.5px) 0 0 / 22px 22px, var(--cream) !important;
  font-family: var(--font-body) !important; font-size: 15px; line-height: 1.7;
}
body h1, body h2, body h3, body h4, body button, body input, body select, body .btn {
  font-family: var(--font-head) !important; letter-spacing: .015em !important;
}
body h1, body h2, body h3, body h4 { color: var(--ink) !important; font-weight: 850 !important; line-height: 1.4; }
body h1 { font-size: clamp(25px, 4vw, 40px) !important; margin: 10px 0; }
body h2 { font-size: clamp(21px, 3vw, 28px) !important; margin: 8px 0 12px; }
body h3 { font-size: 19px; }
body p { margin: 8px 0 14px; }
body a { color: #633c94; text-underline-offset: 4px; }
body .container, body .nav-inner, body .band-inner { width: min(100% - 32px, 1040px) !important; margin-inline: auto; }
body main section { margin-block: 32px; scroll-margin-top: 20px; }
body .navbar { position: relative; background: #fffaf1 !important; border-bottom: 3px solid var(--coral); padding: 12px 0; }
body .nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
body .nav-brand { font-weight: 900; font-size: 21px; color: var(--ink) !important; text-decoration: none; }
body .nav-brand span { color: #d63e42; }
body .nav-links { display: flex; gap: 6px 16px; flex-wrap: wrap; }
body .nav-links a { font-size: 13px; font-weight: 750; text-decoration: none; padding: 4px 0; }
body .hero { padding: 24px 0 26px !important; min-height: 0 !important; background: linear-gradient(120deg, #fff0da, #f0e5ff) !important; border-bottom: 1px solid #e2cbe5; }
body .hero p { font-size: 14px; max-width: 720px; }
body .eyebrow { display: inline-block; padding: 3px 10px; border: 0 !important; border-radius: 999px; background: #eee2ff; color: #63338f !important; font-size: 11px; font-weight: 850; letter-spacing: .1em; }
body .card, body .faq-item { background: #fffdf8 !important; border: 2px solid #e4d4ed !important; border-radius: 22px !important; padding: 22px; box-shadow: 0 5px 0 #e9dceb, 0 12px 26px #58315b0a !important; }
body #game { padding: 20px clamp(12px, 3vw, 28px) !important; border: 3px solid #b397d6 !important; border-top: 7px solid var(--coral) !important; margin-top: 24px; }
body #game h2::before, body #game h2::after { content: none !important; }
body #game .lead { font-size: 14px; margin-bottom: 10px; }
body .alert { padding: 12px 15px; border: 1px solid #c9b1e4 !important; border-radius: 13px; background: #f0e8ff !important; color: #49315f !important; font-size: 13px; }
body .alert.warning, body .alert.error { background: #fff0dc !important; color: #713c22 !important; border-color: #dcaa76 !important; }
body #quick-guide { margin: 10px 0 14px; }
body .neko-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin: 12px 0; }
body .form-group { flex: 1 1 260px; min-width: 0; margin: 0; }
body label { display: block; font-weight: 800; font-size: 13px; margin-bottom: 5px; }
body select, body input:not([type="hidden"]) { width: 100%; min-width: 0; max-width: 100%; padding: 11px 12px; border: 2px solid #bda4d7 !important; border-radius: 12px !important; background: #fffdf8 !important; color: var(--ink) !important; font-size: 16px; }
body .form-hint, body .neko-muted { color: #695a72 !important; font-size: 12px; line-height: 1.65; margin: 6px 0; }
body .neko-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
body .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; padding: 10px 18px !important; border: 2px solid #c94347 !important; border-radius: 14px !important; background: var(--coral) !important; color: #342033 !important; box-shadow: 0 4px 0 #bd414d !important; text-decoration: none; font-weight: 850; font-size: 14px !important; white-space: normal; text-align: center; cursor: pointer; transition: translate .15s, box-shadow .15s; }
body .btn-secondary, body .btn-ghost { background: var(--lavender) !important; border-color: #9572bd !important; color: #442b64 !important; box-shadow: 0 4px 0 #a586c5 !important; }
body .btn:not(:disabled):hover { translate: 0 -2px; }
body .btn:disabled { opacity: .6; cursor: not-allowed; }
body .btn-block { width: 100%; }
body :is(a, button, input, select, summary):focus-visible { outline: 3px solid #5833a0 !important; outline-offset: 4px; }
body .neko-skip { position: absolute; left: 12px; top: -120px; z-index: 100; }
body .neko-skip:focus { top: 12px; }
body #game .stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 520px; margin: 14px auto 8px; }
body #game .stat-card { padding: 8px 4px !important; text-align: center; border: 1px solid #dfc9eb !important; border-radius: 13px; background: #fff1df !important; box-shadow: 0 3px 0 #e5d2df; }
body .stat-label { font-size: 11px; font-weight: 750; color: #67516e !important; }
body #game .stat-value { font-size: clamp(19px, 3vw, 27px) !important; line-height: 1.3; font-weight: 900; color: #713c8e !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
body .neko-status { font-size: 13px; text-align: center; margin: 12px 0 !important; color: #56366c; font-weight: 700; }
body #board { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr))) !important; width: 100% !important; max-width: 520px !important; margin: 14px auto 18px !important; gap: clamp(7px, 1.8vw, 12px) !important; padding: 10px !important; background: #eadcf5; border: 2px solid #d4b7e5; border-radius: 20px; }
body #board { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
body #board > * { min-width: 0; width: 100% !important; aspect-ratio: 4 / 5; height: auto !important; border-radius: 14px !important; }
body #board button { padding: 0 !important; border: 2px solid #78509e !important; box-shadow: 0 4px 0 #694580, 0 6px 10px #45265326 !important; color: #342343 !important; }
body #board :is(.card-back, .neko-card-back, .neko-card__back) { background: repeating-linear-gradient(135deg, #7651a7 0 14px, #8c66b9 14px 28px) !important; color: #fff6df !important; border: 3px solid #ff8980 !important; border-radius: 12px; }
body #board :is(.card-front, .neko-card-front, .neko-card__front) { background: #fffbed !important; color: #342343 !important; border-radius: 12px; }
body #board :is(.is-flipped, .is-matched, [aria-pressed="true"]) { background-color: #fffbed !important; color: #342343 !important; }
body #board :is(.is-matched, .matched) { border-color: #cb5b68 !important; box-shadow: 0 3px 0 #bc7488, 0 0 0 2px #ffd6bd !important; opacity: 1 !important; }
body #board svg { max-width: 100%; color: #342343 !important; }
body #board img { max-width: 100%; object-fit: contain; }
body .grid.cols-2, body .steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
body .empty-state { color: #695675; background: #f7f0ff; border-radius: 12px; padding: 16px; font-size: 14px; }
body .table-wrap { max-width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid #dac5e8; }
body .table { width: 100%; border-collapse: collapse; background: #fffdf8; font-size: 13px; }
body .table caption { padding: 12px; font-weight: 800; text-align: left; color: #53336d; }
body .table th, body .table td { padding: 11px 8px; border-bottom: 1px solid #e9dbef; text-align: left; overflow-wrap: anywhere; }
body .table th { background: #ede0fa !important; color: #49305d !important; }
body .table tbody tr:nth-child(even) { background: #fff3e8; }
body .split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 26px; margin: 28px 0; }
body .neko-illustration { display: block; width: 100%; height: auto; border-radius: 24px; border: 3px solid #edcfde; }
body .section-band, body .cta-band { padding: 30px 0 !important; background: #ede1fa !important; border-block: 2px solid #d5bde6; }
body .cta-band { background: #ffe1d7 !important; }
body .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body .steps > div { padding: 18px; background: #fffaf0; border-radius: 18px; }
body .faq-item { padding: 16px 20px; margin-bottom: 12px; }
body summary { cursor: pointer; font-weight: 800; }
body .neko-dialog { width: min(560px, calc(100% - 24px)); max-height: 90dvh; overflow: auto; padding: 24px; border: 3px solid #ac86ce !important; border-radius: 24px; background: #fff9eb; color: var(--ink); box-shadow: 0 12px 0 #67417e40, 0 24px 80px #33203f50; }
body .neko-dialog::backdrop { background: #30203caa; backdrop-filter: blur(4px); }
body #result-title { color: #9b354c !important; }
body .badge { padding: 2px 8px; border-radius: 20px; background: #eadcf8; color: #56336f; }
body .site-footer { padding: 28px 0; background: #382743 !important; color: #fff5e7 !important; border-top: 5px solid var(--coral); font-size: 13px; }
body .site-footer .neko-muted, body .site-footer a { color: #e5d1f2 !important; }
body .sample-maker-credit, body #sample-maker-credit { max-width: 100%; margin: 14px auto; padding: 12px 16px; font: 12px/1.7 var(--font-body) !important; color: #65516f !important; background: #f6edf9 !important; border: 1px solid #dfcce9; border-radius: 12px; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  body .container, body .nav-inner, body .band-inner { width: calc(100% - 24px) !important; }
  body .hero { padding: 18px 0 !important; }
  body .hero p br { content: ""; }
  body .nav-links { gap: 4px 14px; }
  body .nav-links a { font-size: 12px; }
  body #game { padding: 16px 10px !important; }
  body .neko-toolbar { align-items: stretch; }
  body .neko-toolbar > *, body .neko-actions { width: 100%; }
  body .neko-actions > .btn { flex: 1 1 120px; padding-inline: 10px !important; }
  body .grid.cols-2, body .split, body .steps { grid-template-columns: 1fr; }
  body .card { padding: 16px; }
  body #board { padding: 7px !important; }
  body #board > * { border-radius: 10px !important; }
  body .neko-dialog { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  body .btn:not(:disabled):hover { translate: none; }
}
/* ===== 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: banner) --- */
.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:none !important; min-width:0 !important; left:auto !important; right:auto !important; margin-left:calc(50% - 50vw) !important; margin-right:calc(50% - 50vw) !important; margin-top:0 !important; border-radius:0 !important; box-sizing:border-box !important; display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important; text-align:center !important; min-height:clamp(220px,30vh,340px) !important; padding:clamp(36px,5vw,64px) clamp(20px,6vw,48px) !important; color:#fff !important; background-color:var(--brand-press) !important; background-image:var(--hero-bg, linear-gradient(120deg, var(--brand) 0%, var(--brand-press) 100%)) !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(180deg, rgba(8,12,30,.38), rgba(8,12,30,.52)) !important; }
.hero > *, section[class*="hero"] > *, .hero-section > *, .lp-hero > *{ width:100% !important; max-width:var(--maxw) !important; margin-left:auto !important; margin-right:auto !important; }
.hero h1, section[class*="hero"] h1{ font-size:clamp(1.7rem,3.2vw,2.5rem) !important; }
.hero p, section[class*="hero"] p{ max-width:64ch !important; margin-left:auto !important; margin-right:auto !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:#fff !important; }
.hero .btn-secondary{ background:rgba(255,255,255,.16) !important; color:#fff !important; border-color:rgba(255,255,255,.5) !important; }

/* PUBLIC-SAMPLE-READABILITY-V9 */
body :is(p,span,a,div,li,dt,dd,label,small,button,input,select,summary,th,td){font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI','Noto Sans JP',sans-serif !important;}

/* PUBLIC-SAMPLE-MOBILE-V9 */
body #board .neko-card.is-covered{background:linear-gradient(145deg,#8260e8,#5831ac) !important;color:#fff9eb !important;box-shadow:0 4px 0 #3d217a,0 7px 15px #6a42b12b !important;opacity:1 !important;}
body #board .neko-card.is-covered :is(.neko-cover,.neko-card-name){color:#fff9eb !important;}
body #board .neko-card:disabled{opacity:1 !important;}
@media(max-width:600px){
 body #main{width:100% !important;max-width:none !important;padding:0 !important;}
 body #main>.container{width:calc(100% - 24px) !important;max-width:none !important;margin:0 auto !important;padding:0 !important;}
 body #game{width:100% !important;padding:16px 10px !important;margin:20px 0 !important;}
 body #board{width:100% !important;max-width:520px !important;margin:16px auto !important;padding:7px !important;gap:6px !important;}
 body #board .neko-card{min-width:0 !important;min-height:66px !important;}
 body #board .neko-card .neko-cover{font-size:29px !important;line-height:1.1 !important;}
 body #board .neko-card .neko-card-name{font-size:10px !important;line-height:1.2 !important;}
 body #game .neko-stats{gap:6px !important;}
 body #game :is(p,label){font-size:13px !important;}
}