/* ==========================================================
   CNPトレカデッキ工房 — styles.css
   デザイントークン「プレミアム公式」リデザイン（2026-07-14）
   ========================================================== */

:root{
  --bg:#FFFFFF;
  --bg-section:#F4F7FA;
  --line:#E4E8EE;
  --navy:#17325C;
  --navy-deep:#0F2547;
  --accent:#1E63C8;
  --soft-bg:#DFF0FF;
  --soft-line:#BBDFFA;
  --soft-ink:#17456F;
  --warn:#B3261E;
  --ok:#2E9E5B;
  --ink:#1B2430;
  --ink-soft:#5A6472;

  --gold:#C9A961;
  --gold-deep:#A8873F;
  --gold-accent:#B8933E; /* カウンター数字の下線・達成チェック等のアクセント専用（多用しない） */
  --line-soft:rgba(23,50,92,.10);
  --ink-body:#3a4a6e; /* 本文色（2026-07-14 デザイン格上げ方針: やや濃い紺グレー） */

  --c-blue:#2D6BD8;
  --c-red:#D8402D;
  --c-yellow:#DFA00A;
  --c-green:#2E9E5B;
  --c-purple:#7A4FBF;

  --font-display: "Shippori Mincho","Hiragino Mincho ProN","Yu Mincho",serif;
  --font-body: "Zen Kaku Gothic New","Hiragino Kaku Gothic ProN","Hiragino Sans","Yu Gothic Medium","Yu Gothic",sans-serif;
  --font-num: "Outfit","Zen Kaku Gothic New","Hiragino Kaku Gothic ProN",sans-serif;

  --font: var(--font-body);
  --font-mincho: var(--font-display);

  /* 青海波（せいがいは）文様 — インラインSVG data URI（装飾のみ／外部画像なし） */
  --seigaiha-navy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'%3E%3Cg fill='none' stroke='%2317325C' stroke-width='1.4'%3E%3Ccircle cx='0' cy='28' r='28'/%3E%3Ccircle cx='0' cy='28' r='21'/%3E%3Ccircle cx='0' cy='28' r='14'/%3E%3Ccircle cx='0' cy='28' r='7'/%3E%3Ccircle cx='56' cy='28' r='28'/%3E%3Ccircle cx='56' cy='28' r='21'/%3E%3Ccircle cx='56' cy='28' r='14'/%3E%3Ccircle cx='56' cy='28' r='7'/%3E%3Ccircle cx='28' cy='0' r='28'/%3E%3Ccircle cx='28' cy='0' r='21'/%3E%3Ccircle cx='28' cy='0' r='14'/%3E%3Ccircle cx='28' cy='0' r='7'/%3E%3C/g%3E%3C/svg%3E");
  --seigaiha-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'%3E%3Cg fill='none' stroke='%23C9A961' stroke-width='1.4'%3E%3Ccircle cx='0' cy='28' r='28'/%3E%3Ccircle cx='0' cy='28' r='21'/%3E%3Ccircle cx='0' cy='28' r='14'/%3E%3Ccircle cx='0' cy='28' r='7'/%3E%3Ccircle cx='56' cy='28' r='28'/%3E%3Ccircle cx='56' cy='28' r='21'/%3E%3Ccircle cx='56' cy='28' r='14'/%3E%3Ccircle cx='56' cy='28' r='7'/%3E%3Ccircle cx='28' cy='0' r='28'/%3E%3Ccircle cx='28' cy='0' r='21'/%3E%3Ccircle cx='28' cy='0' r='14'/%3E%3Ccircle cx='28' cy='0' r='7'/%3E%3C/g%3E%3C/svg%3E");

  --shadow-panel: 0 1px 2px rgba(15,37,71,.06), 0 12px 32px rgba(15,37,71,.08);
  --shadow-panel-lg: 0 2px 4px rgba(15,37,71,.08), 0 20px 48px rgba(15,37,71,.14);
  /* モーダル用の多層影（2026-07-14 デザイン格上げ方針・施策9） */
  --shadow-modal: 0 1px 2px rgba(15,37,71,.10), 0 12px 28px rgba(15,37,71,.14), 0 36px 90px rgba(15,37,71,.24);
}

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

html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  background:var(--bg);
  color:var(--ink-body);
  font-family:var(--font-body);
  line-height:1.8;
  font-size:15px;
  overflow-x:hidden;
}

h1, h2, h3, h4{ font-family:var(--font-body); margin:0; }

/* 数字表示の等幅化（2026-07-14 デザイン格上げ方針・施策1）:
   font-variant-numeric:tabular-nums と併せて OpenType "tnum" を明示指定する */
.counter-num b, .tray-count-row b, .mobile-deck-bar-row b, .result-line b,
.stepper-bar .cnt, .cm-cnt, .deck-list-row .qty, .card .cost-badge,
.cc-val, .cost-curve-axis span, .mini-curve-axis span{
  font-feature-settings:"tnum" 1;
}

button, input, select, textarea{ font-family:var(--font-body); }

.skip-link{
  position:absolute; left:-999px; top:0; background:var(--navy); color:#fff;
  padding:10px 16px; z-index:200; border-radius:0 0 8px 0;
}
.skip-link:focus{ left:0; }

/* ===== ヘッダー（2026-07-14 デザイン格上げ・施策2: フローティング・ガラス化） =====
   PC(960px以上)ではstickyで追従し、カウンターバーがその直下(top:56px)に連結して止まる。
   960px未満は従来どおり非固定（カウンターバー＋下部デッキバーと重なると
   スマホの可視領域を圧迫するため。カウンターバーのstickyは従来どおり維持）。
   スクロール影はJSのscrollリスナー1本が .is-scrolled を付け外しするだけ */
.head{
  background:rgba(255,255,255,.86);
  -webkit-backdrop-filter:blur(12px) saturate(1.4); backdrop-filter:blur(12px) saturate(1.4);
  border-bottom:1px solid var(--line-soft);
  box-shadow:0 1px 0 rgba(15,37,71,.03), 0 4px 16px rgba(15,37,71,.04);
  position:relative; z-index:30;
  transition:box-shadow .25s ease;
}
.head.is-scrolled{
  box-shadow:0 1px 0 rgba(15,37,71,.05), 0 10px 28px rgba(15,37,71,.12);
}
.head-inner{
  max-width:1200px; margin:0 auto; padding:12px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
@media (min-width:960px){
  .head{ position:sticky; top:0; }
  /* stickyヘッダー時は1行構成を保証する（高さ56pxを前提にカウンターバーが連結するため） */
  .head-inner{ flex-wrap:nowrap; }
  .head .nav{ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
  .head .nav::-webkit-scrollbar{ display:none; }
}
.logo{
  font-family:var(--font-display); font-weight:800; color:var(--navy);
  letter-spacing:.08em; font-size:18px;
  display:flex; align-items:center; gap:8px; white-space:nowrap;
}
/* ロゴの金の落款風ワンポイント（方針書・施策2） */
.logo::before{
  content:''; flex:0 0 auto; width:9px; height:9px; border-radius:2px;
  background:linear-gradient(135deg, #D8BC7A, var(--gold-accent) 70%);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);
}
.nav{ display:flex; gap:6px; flex-wrap:wrap; }
.nav-link{
  background:none; border:none; color:var(--ink-soft); font-size:12.5px; font-weight:600;
  cursor:pointer; padding:6px 8px; border-radius:6px; white-space:nowrap;
  text-decoration:none; display:inline-block; transition:color .15s ease, background-color .15s ease;
}
.nav-link:hover, .nav-link:focus-visible{ color:var(--navy); background:var(--bg-section); }
.nav-link-external{ color:var(--accent); }
.nav-link-external:visited{ color:var(--accent); }
@media (max-width:480px){
  .nav{
    flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch;
    scrollbar-width:none; max-width:100%;
  }
  .nav::-webkit-scrollbar{ display:none; }
}

/* ===== FV ===== */
.hero{
  position:relative; overflow:hidden; padding:44px 20px 34px; text-align:center;
  background:
    radial-gradient(720px 320px at 50% -60px, rgba(30,99,200,.10), rgba(30,99,200,0) 70%),
    linear-gradient(180deg, #FFFFFF 0%, #EFF4FA 100%);
}
.hero::before{
  content:''; position:absolute; inset:0; background-image:var(--seigaiha-navy);
  background-repeat:repeat; opacity:.045; pointer-events:none;
}
/* 動的キービジュアル用canvas（app.jsのrenderHeroKv()が毎回ランダムに描画）。
   canvasはDOM順で.hero::beforeの後・.hero-innerの前に置かれるため、
   z-index指定なしでも自然にパターンの上・見出しの下に重なる */
.hero-canvas{
  position:absolute; inset:0; width:100%; height:100%; display:block; pointer-events:none;
}
.hero-inner{ position:relative; z-index:1; max-width:720px; margin:0 auto; }
.hero-inner::before{
  content:''; display:block; width:48px; height:2px; margin:0 auto 16px;
  background:linear-gradient(90deg, var(--gold-deep), var(--gold));
}
.hero h1{
  margin:0 0 10px; font-family:var(--font-display); font-weight:800;
  font-size:32px; color:var(--navy); letter-spacing:.08em; line-height:1.5;
  text-wrap:balance;
}
.hero-sub{ margin:0 0 22px; font-size:13px; color:var(--ink-soft); letter-spacing:.04em; }
/* 2段構成（2026-07-14本人指示）: 1段目=デッキを組む（主役）/ 2段目=入門ガイド・対戦アプリ */
.hero-entry{ display:flex; flex-direction:column; gap:12px; align-items:center; }
.hero-entry-row{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.entry-btn{
  display:block; border-radius:14px; padding:14px 22px; font-weight:800; font-size:14px;
  min-width:220px; cursor:pointer; border:1.5px solid transparent; font-family:var(--font-body);
  text-align:center; transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.entry-btn small{ display:block; font-weight:500; font-size:11px; margin-top:3px; opacity:.85; }
/* entry-soft: カードコラージュ背景（.hero.kv-active）の上に乗るため、配色に関わらず
   文字が読めるよう不透明に近い白＋濃紺の太字＋強めの境界線・影で背景から浮かせる
   （2026-07-14 本人指摘: 半透明白のままだと配色によって文字が読めなくなるため） */
.entry-soft{
  background:rgba(255,255,255,.96); color:var(--navy-deep); border-color:rgba(23,50,92,.22);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  box-shadow:0 1px 2px rgba(15,37,71,.10), 0 8px 20px rgba(15,37,71,.14);
}
.entry-hard{
  background:linear-gradient(180deg, #234E85, var(--navy) 60%, var(--navy-deep));
  color:#fff; border-color:var(--navy-deep);
  box-shadow:0 1px 2px rgba(15,37,71,.12), 0 10px 24px rgba(15,37,71,.22);
}
.entry-soft:hover{ filter:brightness(1.03); transform:translateY(-1px); }
.entry-hard:hover{
  transform:translateY(-1px);
  box-shadow:0 2px 4px rgba(15,37,71,.16), 0 14px 30px rgba(15,37,71,.28);
}
.entry-soft:active, .entry-hard:active{ transform:translateY(0); filter:brightness(.98); }

/* kv-active: renderHeroKv()がcanvas描画に成功した時だけ.heroに付与されるクラス。
   JS失敗・画像0枚などのときはこのブロックが一切当たらず、上の淡色ヒーローがそのままフォールバックになる */
.hero.kv-active h1{
  color:#fff; text-shadow:0 2px 14px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.35);
}
.hero.kv-active .hero-sub{
  color:rgba(255,255,255,.9); text-shadow:0 1px 6px rgba(0,0,0,.4);
}
.hero.kv-active .hero-inner::before{
  background:linear-gradient(90deg, var(--gold), #F3E3B8);
}
/* entry-soft（kv-active時）: カードコラージュはカードごとに配色がバラバラなため、
   半透明白＋白文字だと明るい絵柄の上でほぼ読めなくなっていた（2026-07-14本人指摘）。
   不透明に近い白地＋濃紺の太字にして、collageのどんな配色の上でも文字を確実に読ませる。
   entry-hard（紺の実塗り＋強い影）との主従関係は、hard側の重い影・彩度で維持する */
.hero.kv-active .entry-soft{
  background:rgba(255,255,255,.96); color:var(--navy-deep); border-color:rgba(23,50,92,.16);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  box-shadow:0 1px 2px rgba(0,0,0,.14), 0 8px 22px rgba(0,0,0,.22);
}
.hero.kv-active .entry-soft:hover{ background:#fff; }
.hero.kv-active .entry-hard{
  border-color:rgba(255,255,255,.28);
  box-shadow:0 2px 4px rgba(0,0,0,.25), 0 14px 30px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08) inset;
}

/* ===== 固定カウンターバー（2026-07-14 デザイン格上げ・施策3: ガラス化＋数字の存在感UP） ===== */
.counter-bar{
  position:sticky; top:0; z-index:20;
  background:rgba(255,255,255,.72);
  -webkit-backdrop-filter:blur(16px) saturate(1.5); backdrop-filter:blur(16px) saturate(1.5);
  border-bottom:1px solid var(--line-soft);
  box-shadow:0 1px 0 rgba(15,37,71,.03), 0 8px 20px rgba(15,37,71,.05);
}
/* stickyヘッダー(高さ57px)の直下に連結して止まる。1px重ねて隙間を出さない */
@media (min-width:960px){
  .counter-bar{ top:56px; }
}
.counter-bar-inner{
  max-width:1200px; margin:0 auto; padding:10px 20px;
  display:flex; align-items:center; gap:14px; flex-wrap:wrap; font-size:13px;
}
.counter-num{ font-size:14px; font-weight:700; color:var(--ink-soft); }
.counter-num b{
  font-family:var(--font-num); font-variant-numeric:tabular-nums; font-size:32px; line-height:1;
  font-weight:700; color:var(--navy); margin:0 3px;
  padding-bottom:2px;
  background:linear-gradient(90deg, var(--gold-accent), #D8BC7A) left bottom / 100% 2px no-repeat;
}
.counter-msg{ font-size:12px; font-weight:700; }
.counter-msg.is-warn{ color:var(--warn); }
.counter-msg.is-ok{ color:var(--ok); }
.counter-tools{ margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }

/* 達成演出（施策3）: 50/50・15/15到達時、JSが差し込む金のチェック＋控えめな輝き1回 */
.done-check{
  display:inline-grid; place-items:center; width:15px; height:15px; border-radius:50%;
  background:linear-gradient(135deg, #D8BC7A, var(--gold-accent) 70%);
  color:#fff; font-size:10px; font-weight:800; line-height:1;
  vertical-align:-2px;
  animation:doneShine .9s ease-out 1;
}
@keyframes doneShine{
  0%{ box-shadow:0 0 0 0 rgba(184,147,62,.45); }
  100%{ box-shadow:0 0 0 9px rgba(184,147,62,0); }
}
@media (prefers-reduced-motion: reduce){
  .done-check{ animation:none; }
}

/* ボタン（2026-07-14 デザイン格上げ・施策6: 主=紺グラデ＋押下沈み／ゴースト=hoverで金縁） */
.btn{
  background:linear-gradient(180deg, #234E85, var(--navy) 60%, var(--navy-deep));
  color:#fff; border:none; border-radius:999px;
  padding:8px 16px; font-weight:700; font-size:12.5px; cursor:pointer;
  box-shadow:0 1px 2px rgba(15,37,71,.12), 0 6px 16px rgba(15,37,71,.20), inset 0 1px 0 rgba(255,255,255,.14);
  transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover{ transform:translateY(-1px); box-shadow:0 2px 4px rgba(15,37,71,.16), 0 10px 22px rgba(15,37,71,.26), inset 0 1px 0 rgba(255,255,255,.14); }
.btn:active{ transform:translateY(1px); filter:brightness(.95); box-shadow:0 1px 2px rgba(15,37,71,.14), inset 0 1px 0 rgba(255,255,255,.10); }
.btn.ghost{
  background:#fff; color:var(--navy); border:1.5px solid rgba(23,50,92,.30);
  box-shadow:0 1px 2px rgba(15,37,71,.04);
}
.btn.ghost:hover{ background:#fff; border-color:var(--gold-deep); box-shadow:0 2px 8px rgba(168,135,63,.18); }
.btn.ghost:active{ transform:translateY(1px); }
.btn:disabled{ opacity:.45; cursor:not-allowed; filter:none; transform:none; box-shadow:none; }
.btn.ghost.btn-danger{ color:var(--warn); border-color:var(--warn); }
.btn.ghost.btn-danger:hover{ background:#FBEAE9; }

/* ===== メイン領域（PCではサイドのデッキトレイと横並び） ===== */
.layout-wrap{
  max-width:1200px; margin:0 auto; padding:0 20px 40px;
  display:flex; align-items:flex-start; gap:24px;
}
.main-inner{ min-width:0; flex:1 1 auto; }

/* ===== 絞り込みバー ===== */
.filter-bar{ padding:14px 0 4px; }
.filter-row{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-bottom:8px; }
.filter-row-tools{ gap:10px; }

.chip{
  border:1.5px solid var(--line-soft); background:#fff; border-radius:999px; padding:6px 14px;
  font-size:12.5px; font-weight:700; cursor:pointer; color:#33404F;
  min-height:34px; transition:background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.chip:hover{ background:var(--bg-section); border-color:#C8D2DE; }
.chip.on{
  background:var(--navy); border-color:var(--navy); color:#fff;
  box-shadow:0 2px 8px rgba(23,50,92,.25);
}
.chip.on:hover{ background:var(--navy-deep); }
.chip:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.keyword-input{
  flex:1 1 220px; min-width:0; border:1.5px solid var(--line-soft); border-radius:999px;
  padding:8px 16px; font-size:13px; color:var(--ink); transition:border-color .15s ease;
}
.keyword-input:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.sort-select{
  border:1.5px solid var(--line-soft); border-radius:999px; padding:8px 14px; font-size:12.5px;
  color:var(--ink); background:#fff; cursor:pointer;
}
.parallel-chip{ background:#fff; }
.parallel-chip.on{ background:#7A4FBF; border-color:#7A4FBF; color:#fff; }
/* 「デッキのカードだけ」トグル（疎結合な実装のため差し替え・削除しやすいよう単独ルールにまとめる） */
.deck-only-chip{ background:#fff; }
.deck-only-chip.on{ background:var(--gold-deep); border-color:var(--gold-deep); color:#fff; }

/* ===== 選択中条件タグチップ ===== */
.active-tags{
  padding:6px 0 0; display:flex; gap:6px; flex-wrap:wrap; align-items:center;
  font-size:12px; color:var(--ink-soft); min-height:0;
}
.tagchip{
  background:#EAF2FC; color:var(--soft-ink); border-radius:999px; padding:3px 10px 3px 12px;
  font-weight:700; display:inline-flex; align-items:center; gap:6px; border:none; cursor:pointer;
  font-size:12px;
}
.tagchip .x{ opacity:.6; font-weight:800; }
.clear-link{
  color:var(--accent); font-weight:700; cursor:pointer; background:none; border:none; font-size:12px;
  padding:3px 4px;
}

/* ===== 結果件数 ===== */
.result-line{ padding:10px 0 8px; font-size:12.5px; color:var(--ink-soft); }
.result-line b{ font-family:var(--font-num); color:var(--ink); font-size:15px; font-weight:700; }
.result-line.is-empty{ color:var(--warn); font-weight:700; }
.result-clear-inline{
  margin-left:8px; color:var(--accent); font-weight:700; cursor:pointer; background:none; border:none;
  font-size:12.5px; text-decoration:underline;
}

/* ===== カードグリッド ===== */
.card-grid{
  display:grid; grid-template-columns:repeat(5, 1fr); gap:12px; padding-bottom:20px;
}
@media (max-width:1024px){ .card-grid{ grid-template-columns:repeat(4, 1fr); } }
/* 640px以下は2列に変更（旧3列だとステッパーの−／＋が26px程度まで縮み誤タップの原因になるため。
   2列にしてカード自体の表示面積も広げつつ、タップ領域を確保する） */
@media (max-width:640px){ .card-grid{ grid-template-columns:repeat(2, 1fr); gap:10px; } }

.card-cell{ display:flex; flex-direction:column; }

.card{
  position:relative; border-radius:10px; aspect-ratio:63/88; overflow:hidden;
  border:1px solid var(--line-soft); display:flex; flex-direction:column; justify-content:flex-end;
  user-select:none; cursor:pointer;
  box-shadow:0 1px 2px rgba(15,37,71,.05);
  transition:transform .25s ease, box-shadow .25s ease;
}
/* hoverで浮く演出（施策5）。タッチデバイスではhoverが残留するため無効化する */
@media (hover:hover) and (pointer:fine){
  .card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-panel-lg); }
}
.card:focus-visible{ outline:3px solid var(--accent); outline-offset:2px; }
.card .glyph{
  position:absolute; inset:0; display:grid; place-items:center;
  font-size:36px; font-weight:800; opacity:.28; color:#fff; font-family:var(--font-display);
  pointer-events:none;
}
.card .cost-badge{
  position:absolute; top:6px; left:6px; width:22px; height:22px; border-radius:50%;
  background:rgba(0,0,0,.65); color:#fff; font-size:11.5px; font-weight:700;
  display:grid; place-items:center; font-family:var(--font-num); font-variant-numeric:tabular-nums; z-index:2;
}
.card .name-plate{
  background:rgba(255,255,255,.94); color:#1a1a1a; font-size:9.5px; font-weight:700;
  padding:4px 6px 2px; line-height:1.25; z-index:2;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.card .bp-plate{
  background:rgba(0,0,0,.8); color:#fff; font-size:9px; padding:2px 6px 3px;
  display:flex; justify-content:space-between; font-family:var(--font-num); font-variant-numeric:tabular-nums; z-index:2;
}
/* 実カード画像タイル: 絵を切らない（contain）。情報はカード自体に印刷済みなのでオーバーレイは非表示にする */
.card img.card-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:contain; z-index:1; background:transparent; }
.card.has-image .cost-badge,
.card.has-image .name-plate,
.card.has-image .bp-plate{ display:none; }
/* 画像ロード失敗時（img-fail付与）のみ、従来のオーバーレイ情報を復活させる */
.card.has-image.img-fail .cost-badge{ display:grid; }
.card.has-image.img-fail .name-plate{ display:block; }
.card.has-image.img-fail .bp-plate{ display:flex; }

.card .parallel-badge{
  position:absolute; top:6px; right:6px; width:20px; height:20px; border-radius:50%;
  background:rgba(255,255,255,.92); font-size:11px; display:grid; place-items:center; z-index:3;
}
.card .name-plate small{ display:block; font-weight:600; font-size:8.5px; opacity:.75; white-space:normal; }

/* カード番号（公式ナンバー）: 画像タイル・非画像タイルどちらでも常に表示する控えめなバッジ */
.card .card-number{
  position:absolute; bottom:4px; right:4px; z-index:3;
  background:rgba(0,0,0,.55); color:#e4e4e4; font-family:var(--font-num); font-variant-numeric:tabular-nums;
  font-size:9px; font-weight:600; padding:1px 5px; border-radius:4px; letter-spacing:.02em; pointer-events:none;
}

.card.blue{ background:linear-gradient(160deg,#4d84dd,#173a75); }
.card.red{ background:linear-gradient(160deg,#e06a51,#8c1f12); }
.card.yellow{ background:linear-gradient(160deg,#ecc258,#a06d05); }
.card.green{ background:linear-gradient(160deg,#5cbb84,#175c34); }
.card.purple{ background:linear-gradient(160deg,#a077e0,#452274); }

/* ===== ＋／−操作バー（タイルの絵の外・直下の独立バー） ===== */
.stepper-bar{
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  height:36px; margin-top:5px; padding:0 5px; border-radius:8px;
  background:var(--bg-section); transition:background-color .2s ease;
}
.stepper-bar.has-qty{ background:linear-gradient(180deg, #2A72DC, var(--accent)); }
.stepper-bar button{
  width:28px; height:28px; border-radius:6px; border:none; cursor:pointer; flex:0 0 auto;
  background:rgba(255,255,255,.95); color:#111; font-weight:800; font-size:15px; line-height:1;
}
.stepper-bar.has-qty button{ background:rgba(255,255,255,.92); color:#111; }
.stepper-bar button:disabled{ opacity:.35; cursor:not-allowed; }
.stepper-bar .cnt{
  font-family:var(--font-num); font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--ink);
  min-width:1.4em; text-align:center;
}
.stepper-bar.has-qty .cnt{ color:#fff; }
.stepper-bar button.plus4{
  width:auto; min-width:0; padding:0 6px; font-size:10.5px; letter-spacing:-.02em; white-space:nowrap;
}
/* 0にするボタン: −／＋と同系だが「消す操作」と分かるよう、押せる状態のときだけ文字色を控えめな警告色に */
.stepper-bar button.zero{ width:22px; font-size:13px; }
.stepper-bar button.zero:not(:disabled){ color:var(--warn); }

/* 375px幅（card-grid 2列）でステッパー5要素（0／−／枚数／＋／＋4）は横1列だとタップ領域が
   最低ラインを割り込むため、2段構成に変更: 上段=−／枚数／＋、下段=0にする／＋4（半々幅）。
   各ボタンの高さは36〜40pxを確保。横スクロールは発生させない */
@media (max-width:640px){
  .stepper-bar{
    display:grid; grid-template-columns:repeat(6, 1fr); grid-template-areas:
      "minus minus cnt cnt plus plus"
      "zero zero zero plus4 plus4 plus4";
    gap:6px; height:auto; padding:6px; align-items:stretch;
  }
  .stepper-bar .minus{ grid-area:minus; }
  .stepper-bar .cnt{ grid-area:cnt; }
  .stepper-bar .plus{ grid-area:plus; }
  .stepper-bar .zero{ grid-area:zero; }
  .stepper-bar .plus4{ grid-area:plus4; }
  .stepper-bar button{ width:auto; min-width:0; height:38px; font-size:14px; border-radius:6px; }
  .stepper-bar .cnt{ min-width:0; font-size:14px; }
  .stepper-bar button.plus4{ padding:0 4px; font-size:11px; }
  .stepper-bar button.zero{ width:auto; font-size:13px; }
}

/* ===== デッキトレイ（PC: 常時表示サイドパネル） ===== */
.deck-tray{ display:none; }
@media (min-width:960px){
  .deck-tray{
    display:flex; flex-direction:column; flex:0 0 260px; width:260px;
    /* stickyヘッダー(約57px)＋カウンターバー(約53px)の下に止まる */
    position:sticky; top:124px; max-height:calc(100vh - 140px); overflow-y:auto;
    background:#fff; border:1px solid var(--line-soft); border-radius:14px; padding:16px; gap:2px;
    box-shadow:var(--shadow-panel);
  }
}
.tray-counts{ display:flex; flex-direction:column; gap:4px; }
.tray-count-row{ display:flex; align-items:baseline; gap:6px; font-size:13px; font-weight:700; color:var(--ink-soft); }
.tray-count-row b{ font-family:var(--font-num); font-size:25px; font-weight:700; color:var(--navy); font-variant-numeric:tabular-nums; }
.tray-count-row i{ font-style:normal; font-size:12px; color:var(--ink-soft); }
.tray-msgs{ display:flex; flex-direction:column; gap:2px; margin:6px 0 10px; font-size:11.5px; }
.tray-sub-h{
  font-family:var(--font-display); font-size:13px; color:var(--navy); margin:12px 0 7px; font-weight:800;
  letter-spacing:.08em; display:flex; align-items:center; gap:6px;
}
.tray-sub-h::before{ content:''; display:inline-block; width:2px; height:12px; background:linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.tray-sub-h::after{ content:''; flex:1; height:1px; background:linear-gradient(90deg, var(--line-soft), transparent); }

/* ===== デッキトレイのミニコストカーブ（PC／スマホ共通・常設・控えめな表示）
   2026-07-14 デザイン格上げ・施策4: モーダル版と同じ質感（紺→青グラデ＋上端丸め＋金キャップ＋アニメ） ===== */
.tray-mini-curve{ margin:8px 0 2px; }
.mini-curve-bars{
  display:flex; align-items:stretch; gap:3px; height:44px;
  border-bottom:1px solid rgba(23,50,92,.16);
  background:repeating-linear-gradient(to top, transparent 0 13px, rgba(23,50,92,.06) 13px 14px);
}
.mini-curve-axis{ display:flex; gap:3px; font-family:var(--font-num); font-size:8.5px; color:var(--ink-soft); margin-top:2px; }
.mini-curve-axis span{ flex:1; text-align:center; font-variant-numeric:tabular-nums; }
.tray-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }
.tray-empty{ grid-column:1/-1; font-size:11.5px; color:var(--ink-soft); margin:0; }
.tray-actions{ display:flex; flex-direction:column; gap:8px; margin-top:16px; }
.tray-actions .btn{ width:100%; text-align:center; }
.tray-storage-note{ margin:10px 0 0; font-size:10.5px; line-height:1.6; color:var(--ink-soft); opacity:.85; }

/* ===== デッキトレイ（スマホ: 下部固定バー＋展開パネル） ===== */
.mobile-deck-bar{ display:none; }
@media (max-width:959px){
  .mobile-deck-bar{
    display:block; position:fixed; left:0; right:0; bottom:0; z-index:60;
    background:rgba(255,255,255,.92); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
    border-top:1px solid var(--line-soft); box-shadow:0 -6px 24px rgba(15,37,71,.14);
  }
  .mobile-deck-bar-row{
    width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px;
    background:none; border:none; padding:10px 16px; font-size:12.5px; font-weight:700; color:var(--ink);
    cursor:pointer;
  }
  .mobile-deck-bar-row b{ font-family:var(--font-num); font-size:18px; font-weight:700; color:var(--navy); font-variant-numeric:tabular-nums; margin:0 2px; }
  .mobile-tray-toggle{ color:var(--accent); display:flex; align-items:center; gap:4px; white-space:nowrap; }
  .mobile-tray-panel{ max-height:60vh; overflow-y:auto; padding:14px 16px 6px; border-bottom:1px solid var(--line-soft); }
  .mobile-tray-panel[hidden]{ display:none; }
  body{ padding-bottom:54px; }
}

/* ===== フッター（2026-07-14 デザイン格上げ・施策8: メガフッター縮小版・2カラム） ===== */
.site-footer{
  position:relative; overflow:hidden;
  border-top:1px solid var(--gold);
  background:linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%);
  padding:36px 20px 24px; font-size:11.5px; color:rgba(255,255,255,.72);
}
.site-footer::before{
  content:''; position:absolute; inset:0; background-image:var(--seigaiha-gold);
  background-repeat:repeat; opacity:.05; pointer-events:none;
}
.footer-cols{
  position:relative; max-width:680px; margin:0 auto 22px;
  display:flex; gap:40px; justify-content:center; flex-wrap:wrap; text-align:left;
}
.footer-col{ flex:1 1 240px; min-width:200px; max-width:320px; }
.footer-h{
  font-family:var(--font-display); font-weight:800; font-size:13px; color:#fff;
  letter-spacing:.08em; margin:0 0 10px; display:flex; align-items:center; gap:7px;
}
.footer-h::before{ content:''; display:inline-block; width:14px; height:2px; background:linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.footer-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.footer-list a, .footer-list .footer-link-btn{
  display:inline-block; padding:4px 0; font-size:12px; color:rgba(255,255,255,.82);
  text-decoration:none; background:none; border:none; cursor:pointer; text-align:left;
  font-family:var(--font-body); transition:color .15s ease;
}
.footer-list a:visited{ color:rgba(255,255,255,.82); }
.footer-list a:hover, .footer-list .footer-link-btn:hover{ color:var(--gold); }
.footer-copy{
  position:relative; margin:0; text-align:center; padding-top:16px;
  border-top:1px solid rgba(255,255,255,.14);
}

/* ===== モーダル ===== */
.modal-overlay{
  position:fixed; inset:0; background:rgba(15,37,71,.45);
  -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  z-index:100;
  display:flex; align-items:flex-start; justify-content:center; padding:24px 16px; overflow-y:auto;
}
.modal-overlay[hidden]{ display:none; }
.modal{
  background:#fff; border-radius:20px; max-width:640px; width:100%; padding:26px 24px;
  position:relative; box-shadow:var(--shadow-modal), 0 0 0 1px var(--line-soft);
}
.modal h2{
  margin:0 0 16px; font-family:var(--font-display); font-weight:800; font-size:22px;
  color:var(--navy); letter-spacing:.08em; padding-right:28px;
}
/* モーダルタイトル下の金ルール線（施策9） */
.modal h2::after{
  content:''; display:block; width:44px; height:2px; margin-top:8px;
  background:linear-gradient(90deg, var(--gold-deep), var(--gold));
}
.modal-close{
  position:absolute; top:14px; right:14px; width:32px; height:32px; border-radius:50%;
  border:none; background:var(--bg-section); font-size:18px; cursor:pointer; color:var(--ink-soft);
  transition:background-color .15s ease;
}
.modal-close:hover{ background:var(--line); }

/* カード拡大モーダル */
.card-modal .cm-body{ display:flex; gap:18px; flex-wrap:wrap; }
.card-modal .cm-visual{ width:140px; flex:0 0 140px; }
.card-modal .cm-info{ flex:1 1 220px; min-width:0; }
.card-modal .cm-info h3{ margin:0 0 4px; font-size:16px; font-weight:700; color:var(--ink); }
.card-modal .cm-info h3 .cm-number{
  font-family:var(--font-num); font-variant-numeric:tabular-nums; font-size:11px; font-weight:600;
  color:var(--ink-soft); margin-left:4px; vertical-align:middle;
}
.card-modal .cm-meta{ font-size:12px; color:var(--ink-soft); margin-bottom:8px; }
.card-modal .cm-traits{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.card-modal .cm-traits span{
  background:var(--bg-section); border-radius:999px; padding:2px 10px; font-size:11px; color:var(--ink-soft);
}
.card-modal .cm-variant-switch{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.card-modal .cm-variant-switch button{
  border:1.5px solid var(--line-soft); background:#fff; border-radius:999px; padding:5px 12px;
  font-size:11.5px; font-weight:700; cursor:pointer; color:#33404F;
}
.card-modal .cm-variant-switch button.is-active{ background:#7A4FBF; border-color:#7A4FBF; color:#fff; }
.card-modal .cm-text{ font-size:13px; line-height:1.7; white-space:pre-wrap; }
.card-modal .cm-stepper{ margin-top:14px; display:flex; align-items:center; gap:10px; }
.card-modal .cm-stepper button{
  width:34px; height:34px; border-radius:8px; border:1.5px solid var(--accent); background:#fff;
  color:var(--accent); font-weight:800; font-size:16px; cursor:pointer;
}
.card-modal .cm-stepper button:disabled{ opacity:.35; cursor:not-allowed; }
.card-modal .cm-stepper .cm-cnt{ font-family:var(--font-num); font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; min-width:2em; text-align:center; }
.card-modal .cm-stepper button.cm-plus4{ width:auto; padding:0 10px; font-size:12px; }
/* 0にするボタン: −／＋と同系だが、押せる状態のときだけ控えめな警告色にして「消す操作」と分かるように */
.card-modal .cm-stepper button.cm-zero{ width:30px; }
.card-modal .cm-stepper button.cm-zero:not(:disabled){ color:var(--warn); border-color:var(--warn); }
@media (max-width:480px){
  .card-modal .cm-stepper{ gap:6px; flex-wrap:wrap; }
  .card-modal .cm-stepper button.cm-plus4{ padding:0 8px; font-size:11px; }
}

/* デッキ確認モーダル */
.deck-modal{ max-width:720px; }
.deck-name-field{
  display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-soft); margin-bottom:14px;
}
.deck-name-field input{
  flex:1; border:1.5px solid var(--line-soft); border-radius:8px; padding:6px 10px; font-size:13px; color:var(--ink);
}
.deck-view-toggle{ display:flex; gap:8px; margin-bottom:14px; }
.view-btn{
  border:1.5px solid var(--line-soft); background:#fff; border-radius:999px; padding:6px 14px;
  font-size:12.5px; font-weight:700; cursor:pointer; color:#33404F; transition:background-color .15s ease, color .15s ease;
}
.view-btn.is-active{ background:var(--navy); border-color:var(--navy); color:#fff; }

.deck-check-list{ font-size:13px; line-height:1.9; margin-bottom:10px; }
.deck-check-list .ng{ color:var(--warn); font-weight:700; }
.deck-check-list .ok{ color:var(--ok); font-weight:700; }

.deck-sub-h{
  font-family:var(--font-display); font-size:15px; color:var(--navy); margin:18px 0 9px; font-weight:800;
  letter-spacing:.08em; display:flex; align-items:center; gap:7px;
}
.deck-sub-h::before{ content:''; display:inline-block; width:2px; height:14px; background:linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.deck-sub-h::after{ content:''; flex:1; height:1px; background:linear-gradient(90deg, var(--line-soft), transparent); }

.color-bars{ display:flex; flex-direction:column; gap:6px; }
.color-bar-row{
  display:grid; grid-template-columns:2.6em 1fr 2.4em; gap:8px; align-items:center;
  font-size:12px; font-variant-numeric:tabular-nums;
}
.color-bar-row span:last-child{ font-family:var(--font-num); }
.color-bar-track{ height:9px; border-radius:99px; background:var(--bg-section); overflow:hidden; }
.color-bar-fill{ display:block; height:100%; }

/* コストカーブ（2026-07-14 デザイン格上げ・施策4=最重要）
   構造: .cost-curve > .cc-col（枚数ラベル.cc-val ＋ 棒.cc-bar）×7。
   app.jsは初回のみ列DOMを生成し、以後はheight／クラス／ラベルだけ更新して
   CSS transitionで棒の伸縮をアニメーションさせる */
.cost-curve{
  display:flex; align-items:stretch; gap:6px; height:104px;
  border-bottom:1px solid rgba(23,50,92,.18);
  background:repeating-linear-gradient(to top, transparent 0 25px, rgba(23,50,92,.07) 25px 26px);
}
.cc-col{
  flex:1; min-width:0; height:100%; padding-top:16px;
  display:flex; flex-direction:column; justify-content:flex-end; align-items:center;
}
.cc-val{
  font-family:var(--font-num); font-variant-numeric:tabular-nums;
  font-size:11px; font-weight:700; color:var(--navy); line-height:1; margin-bottom:3px;
}
.cc-bar{
  display:block; position:relative; width:100%;
  border-radius:5px 5px 0 0;
  background:linear-gradient(180deg, #3E7BE0 0%, #1E4E9E 55%, var(--navy-deep) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28);
  transition:height .45s cubic-bezier(.22,.8,.3,1);
}
/* 0枚の棒: ベースラインの気配だけ残す */
.cc-bar.is-zero{ background:rgba(23,50,92,.12); box-shadow:none; }
/* 最大値の棒だけ金のキャップ（アクセント限定使用） */
.cc-bar.is-max::after{
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  border-radius:5px 5px 0 0;
  background:linear-gradient(90deg, #D8BC7A, var(--gold-accent) 55%, #9A7A33);
}
.mini-curve-bars .cc-col{ padding-top:0; }
.mini-curve-bars .cc-bar{ border-radius:3px 3px 0 0; }
.mini-curve-bars .cc-bar.is-max::after{ height:2px; border-radius:3px 3px 0 0; }
@media (prefers-reduced-motion: reduce){
  .cc-bar{ transition:none; }
}
.cost-curve-axis{ display:flex; gap:6px; font-family:var(--font-num); font-size:10px; color:var(--ink-soft); margin-top:3px; }
.cost-curve-axis span{ flex:1; text-align:center; font-variant-numeric:tabular-nums; }

.deck-contents{ font-size:13px; }
.deck-list-row{
  display:flex; justify-content:space-between; padding:4px 0; border-bottom:1px solid var(--line-soft);
}
.deck-list-row:last-child{ border-bottom:none; }
.deck-list-row .qty{ font-family:var(--font-num); font-weight:700; font-variant-numeric:tabular-nums; }
.deck-list-row .row-num{
  font-family:var(--font-num); font-variant-numeric:tabular-nums; font-size:10px; font-weight:600;
  color:var(--ink-soft); margin-right:6px;
}
/* デッキ確認モーダル・リストビュー内、助太刀2000カウンター（レイキの色に合わないカード）グループの見出し */
.deck-assist-tail-h{
  font-size:11px; font-weight:700; color:var(--ink-soft); margin:10px 0 2px; padding-top:6px;
  border-top:1px dashed var(--line-soft);
}
.deck-mini-grid{ display:grid; grid-template-columns:repeat(8,1fr); gap:4px; }

/* ===== ミニカード（実画像＋枚数バッジ／失敗時のみ色矩形フォールバック）
   デッキ確認モーダルの画像ビューとデッキトレイで共通利用 ===== */
.mini-card{
  aspect-ratio:63/88; border-radius:5px; position:relative; overflow:hidden; cursor:pointer;
  border:1px solid var(--line-soft); background:none; padding:0;
}
.mini-card .mini-fallback{
  position:absolute; inset:0; display:flex; align-items:flex-end; justify-content:center;
  font-size:8px; color:#fff; font-weight:700; padding:2px; text-align:center; line-height:1.15;
}
.mini-card .mini-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.mini-card .mini-qty{
  position:absolute; top:2px; right:2px; background:rgba(0,0,0,.65); color:#fff; border-radius:4px;
  padding:0 3px; font-family:var(--font-num); font-size:8px; font-weight:700; z-index:2;
}
.mini-card:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }

.deck-modal-actions{ display:flex; gap:10px; margin-top:18px; flex-wrap:wrap; }

/* デッキ読み込みモーダル */
.load-desc{ font-size:12.5px; color:var(--ink-soft); margin:0 0 10px; }
.load-textarea{
  width:100%; border:1.5px solid var(--line-soft); border-radius:10px; padding:10px; font-size:12.5px;
  resize:vertical; color:var(--ink);
}
.load-modal-actions{ margin-top:12px; }
.load-error{ color:var(--warn); font-size:12.5px; margin-top:10px; }

/* デッキ読み込みモーダル: 画像からの読み込み（PNGメタデータ方式・2026-07-14追加） */
.load-image-zone{
  border:1.5px dashed var(--line-soft); border-radius:12px; padding:16px; text-align:center;
  margin-bottom:14px; transition:background-color .15s ease, border-color .15s ease;
}
.load-image-zone.is-dragover{ background:var(--bg-section); border-color:var(--accent); }
.load-image-zone-text{ margin:0 0 10px; font-size:12.5px; color:var(--ink-soft); font-weight:700; }
.load-image-pick-btn{
  display:inline-block; background:#fff; color:var(--accent); border:1.5px solid var(--accent);
  border-radius:999px; padding:8px 16px; font-size:12.5px; font-weight:700; cursor:pointer;
}
.load-image-pick-btn:hover{ background:var(--bg-section); }
.load-image-note{ margin:10px 0 0; font-size:11px; color:var(--ink-soft); }
@media (max-width:480px){
  /* スマホはドラッグ操作がないため、ドロップ指示文だけ隠して「画像を選ぶ」ボタンのみ見せる */
  .load-image-zone-text{ display:none; }
}

/* サンプルデッキ選択モーダル */
.sample-modal-list{ display:flex; flex-direction:column; gap:10px; }
.sample-deck-btn{
  display:flex; flex-direction:row; align-items:center; gap:12px; width:100%;
  border:1.5px solid var(--line-soft); background:#fff; border-radius:12px; padding:10px 14px;
  cursor:pointer; text-align:left; transition:border-color .15s ease, background-color .15s ease;
}
.sample-deck-btn:hover{ border-color:var(--accent); background:var(--bg-section); }
/* 顔カードのサムネイル枠。実物画像はそのまま表示し、バッジ・文字は重ねない（当サイトの設計原則）。
   faceCards 1〜3枚に対応: 2枚以上は左右にわずかに回転させ扇状に重ねる（n2/n3クラス） */
.sample-deck-thumbs{ flex:0 0 auto; display:flex; align-items:center; padding:4px 2px; }
.sdt-card{
  height:72px; aspect-ratio:63/88; border-radius:6px; overflow:hidden;
  border:1px solid var(--line-soft); background:var(--bg-section);
  box-shadow:0 2px 6px rgba(15,37,71,.18);
}
.sdt-card img{ display:block; width:100%; height:100%; object-fit:contain; }
.sample-deck-thumbs .sdt-card + .sdt-card{ margin-left:-26px; }
/* 重なり順は「1枚目が表」（2026-07-14本人指示: faceCardsの先頭カードが手前に来る） */
.sample-deck-thumbs .sdt-card{ position:relative; }
.sample-deck-thumbs .sdt-card:nth-child(1){ z-index:3; }
.sample-deck-thumbs .sdt-card:nth-child(2){ z-index:2; }
.sample-deck-thumbs .sdt-card:nth-child(3){ z-index:1; }
.sample-deck-thumbs.n2 .sdt-card:nth-child(1){ transform:rotate(-5deg); }
.sample-deck-thumbs.n2 .sdt-card:nth-child(2){ transform:rotate(5deg); }
.sample-deck-thumbs.n3 .sdt-card:nth-child(1){ transform:rotate(-8deg); }
.sample-deck-thumbs.n3 .sdt-card:nth-child(3){ transform:rotate(8deg); }
.sample-deck-text{ display:flex; flex-direction:column; gap:4px; min-width:0; flex:1 1 auto; }
.sample-deck-label{ font-size:14px; font-weight:700; color:var(--ink); }
.sample-deck-note{ font-size:12px; color:var(--ink-soft); }
.sample-modal-warn{ font-size:12px; color:var(--warn); margin:10px 0 0; }

@media (max-width:480px){
  .sample-deck-btn{ gap:10px; padding:10px 12px; }
  .sdt-card{ height:64px; }
  .sample-deck-thumbs .sdt-card + .sdt-card{ margin-left:-24px; }
  .sample-deck-label{ font-size:13px; }
}

/* ===== トースト ===== */
.toast{
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%);
  background:var(--navy-deep); color:#fff; padding:11px 20px; border-radius:999px;
  font-size:13px; font-weight:700; z-index:300; box-shadow:0 10px 30px rgba(0,0,0,.3);
  max-width:90vw; text-align:center;
  display:flex; align-items:center; gap:10px;
}
.toast[hidden]{ display:none; }
.toast-msg{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1 1 auto; min-width:0; }
.toast-undo{
  background:rgba(255,255,255,.18); color:#fff; border:1px solid rgba(255,255,255,.45);
  border-radius:999px; padding:4px 12px; font-size:12px; font-weight:700; cursor:pointer;
  flex:0 0 auto; white-space:nowrap;
}
.toast-undo:hover{ background:rgba(255,255,255,.3); }
.toast-undo[hidden]{ display:none; }

/* ===== レスポンシブ細部 ===== */
@media (max-width:480px){
  .hero{ padding:34px 16px 26px; }
  .hero h1{ font-size:24px; }
  .entry-btn{ min-width:0; width:100%; }
  .counter-bar-inner{ font-size:12px; gap:10px; }
  .counter-tools{ width:100%; margin-left:0; }
  .deck-mini-grid{ grid-template-columns:repeat(5,1fr); }
}
