/* 見た目の仕上げ（style.css の後に読み込む）。
   藍墨の地・青磁のフェルト・山吹のチップ。角丸は3段階（10 / 14 / 22）、影は2段階。
   style.css の部品を、この順序で上書きする。 */

html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { font-feature-settings: 'palt' 1; letter-spacing: 0.01em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r-s); }
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- ボタン ---------- */
.btn {
  min-height: 52px; border-radius: var(--r-m); border: 1px solid var(--line);
  background: linear-gradient(180deg, #243756, var(--panel-2)); color: var(--text);
  box-shadow: inset 0 1px 0 #ffffff14, var(--shadow-1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  transition: transform 0.08s, filter 0.12s;
}
.btn.primary { background: linear-gradient(180deg, #5fd3a1, var(--primary)); color: var(--primary-ink); box-shadow: inset 0 1px 0 #ffffff55, var(--shadow-1); }
.btn.raise { background: linear-gradient(180deg, #f2a64f, var(--raise)); color: #2a1500; box-shadow: inset 0 1px 0 #ffffff44, var(--shadow-1); }
.btn.fold { background: linear-gradient(180deg, #3b2a3a, #2f2233); border-color: #5a3a50; color: #ffc9d3; }
.btn.danger { background: linear-gradient(180deg, #ee5d62, var(--danger)); }
.btn.small { min-height: 38px; border-radius: var(--r-s); }
.btn:disabled { box-shadow: none; }
.btn .btn-sub { display: block; }
.icon-btn { border-radius: 50%; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:active { background: var(--panel-2); }

/* ---------- 画面の見出し・フォーム ---------- */
.page-head { padding: 10px 12px 6px 8px; gap: 6px; }
.page-head h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.02em; }
.page-head .icon-btn { background: var(--panel); border: 1px solid var(--line); }
.form-body { gap: 16px; padding: 10px 16px 20px; }
.form-body .field {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 16px; box-shadow: var(--shadow-1);
}
.field > label { font-size: 0.95rem; font-weight: 800; margin-bottom: 12px; letter-spacing: 0.02em; }
.sub-label { font-size: 0.85rem; color: var(--muted); font-weight: 700; margin: 18px 0 10px; }
.hint { line-height: 1.55; }
.static-value { background: var(--bg-deep); border-radius: var(--r-m); }
.segmented { background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-m); padding: 4px; gap: 4px; }
.seg { background: transparent; border: 0; border-radius: 11px; min-height: 46px; color: var(--muted); }
.seg.on { background: linear-gradient(180deg, #5fd3a1, var(--primary)); color: var(--primary-ink); box-shadow: 0 1px 4px #0006; }
.select, .text-input, .textarea {
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-m); color: var(--text);
}
.notice { border-radius: var(--r-m); }
.form-foot { background: linear-gradient(180deg, transparent, var(--bg) 40%); }

/* ---------- ホーム ---------- */
.home { justify-content: flex-start; padding: calc(28px + env(safe-area-inset-top, 0px)) 18px calc(28px + var(--safe-bottom)); gap: 20px; overflow-y: auto; }
.brandbar { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.brandmark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; line-height: 1;
  background: radial-gradient(circle at 35% 30%, var(--felt-1), var(--felt-2)); color: #f7fbff;
  box-shadow: inset 0 0 0 2px #f2bb4d99, var(--shadow-1);
}
.brandbar h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: 0.03em; line-height: 1.15; }
.brandbar p { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }

.hero-card {
  position: relative; overflow: hidden; border-radius: var(--r-l); padding: 20px 18px 18px; text-align: left;
  background: radial-gradient(120% 140% at 85% 0%, #2a8f98 0%, var(--felt-2) 55%, #0c3038 100%);
  border: 1px solid #3aa0a866; box-shadow: var(--shadow-2); color: #f4fbff; width: 100%;
}
.hero-card::after {
  content: '♠'; position: absolute; right: -6px; bottom: -34px; font-size: 9rem; line-height: 1; color: #ffffff10; pointer-events: none;
}
.hero-eyebrow { font-size: 0.78rem; color: #bfe8ea; font-weight: 700; }
.hero-title { font-size: 1.35rem; font-weight: 800; margin: 4px 0 6px; line-height: 1.3; }
.hero-text { font-size: 0.88rem; color: #d3eef0; line-height: 1.55; max-width: 28em; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.hero-actions .btn { min-height: 54px; }
.hero-actions .btn.ghost { background: #ffffff14; border-color: #ffffff33; box-shadow: none; color: #f4fbff; }

.menu { gap: 18px; }
.menu-group { display: flex; flex-direction: column; gap: 8px; }
.menu-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; padding: 0 6px; letter-spacing: 0.04em; }
.menu-list { border-radius: var(--r-l); overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.menu-row {
  width: 100%; display: grid; grid-template-columns: 40px 1fr 20px; align-items: center; gap: 12px; text-align: left;
  padding: 13px 14px; min-height: 64px; background: transparent; border: 0; border-top: 1px solid var(--line); color: var(--text);
}
.menu-row:first-child { border-top: 0; }
.menu-row:active { background: var(--panel-2); }
.menu-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-deep); color: var(--accent); }
.menu-ico.mint { color: var(--primary); }
.menu-title { font-weight: 800; font-size: 1rem; }
.menu-desc { font-size: 0.78rem; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.menu-chev { color: var(--muted); }
.update-slot .notice { margin-top: 0; }

/* ---------- テーブル ---------- */
.hud { background: linear-gradient(180deg, #14213a, var(--panel)); border-bottom: 1px solid var(--line); }
.hud-main strong { background: var(--accent); color: #2a1d00; border-radius: 6px; padding: 1px 7px; font-size: 0.85rem; margin-right: 6px; }
.hud-main { font-weight: 700; }
.felt-area { background: radial-gradient(120% 90% at 50% 40%, #12203a, var(--bg-deep)); }
.felt {
  border: 7px solid #1a2946;
  background:
    radial-gradient(ellipse at 50% 38%, #2b929b 0%, var(--felt-1) 38%, var(--felt-2) 82%);
  box-shadow: inset 0 0 0 2px #f2bb4d55, inset 0 0 38px #0009, 0 10px 26px #000a;
}
.pot {
  top: 31%; background: #07131d99; color: var(--accent); border: 1px solid #f2bb4d55; border-radius: 999px;
  padding: 3px 12px; font-size: 0.85rem; letter-spacing: 0.02em;
}
.pot:empty { display: none; }
.card { background: #fcfaf4; border-radius: 7px; box-shadow: 0 1px 0 #fff inset, 0 2px 5px #0009; }
.card.back {
  background: repeating-linear-gradient(45deg, #2f56b8 0 4px, #1f3d8f 4px 8px); border: 2px solid #fcfaf4;
}
.card.slot { background: #ffffff0d; border: 1px dashed #ffffff40; }
.seat-box { background: #0c182bd9; border: 1px solid #3a5280; border-radius: var(--r-m); backdrop-filter: blur(4px); box-shadow: var(--shadow-1); }
.seat-name { letter-spacing: 0.02em; }
.seat.turn .seat-box { border-color: var(--accent); box-shadow: 0 0 0 2px #f2bb4d77, 0 0 18px #f2bb4d55; }
.seat-stack { color: var(--accent); font-weight: 700; }
.dealer { background: #fcfaf4; color: #1a2946; border: 2px solid var(--accent); font-weight: 800; }
.tag.act, .tag.think { background: #07131dee; border: 1px solid #3a5280; }
.bet {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 3px; border-radius: 999px;
  background: #07131dee; border: 1px solid #f2bb4d66; color: #fff; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.bet::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, #ffe7a8 0 28%, var(--accent) 30% 62%, #c98f1f 64%); box-shadow: 0 0 0 1px #0006;
}
.hero-strip { background: linear-gradient(180deg, #121f37, var(--panel)); border-top: 1px solid var(--line); }
.hero-stack { color: var(--accent); }
.hand-name { color: #bfe8ea; }
.log { background: var(--bg-deep); }
.actions { background: linear-gradient(180deg, var(--panel), #101b2e); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px #0006; }
.actions .btn-row .btn { border-radius: 16px; font-size: 1.05rem; }
.raise-panel .step-btn { border-radius: 14px; }
.chip-btn { border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.chip-btn.on { background: var(--accent); color: #2a1d00; border-color: transparent; }

/* ---------- シート（下から出る面）---------- */
.sheet { background: var(--sheet); border-top: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--shadow-2); }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -6px auto 12px; }
.sheet.result::before { margin-top: 8px; }
.scrim { background: #050b16b3; backdrop-filter: blur(2px); }
.sheet h2 { letter-spacing: 0.02em; }

/* ---------- 答え合わせ・統計 ---------- */
.dec { background: var(--panel); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.stat-card, .hand-row, .tour-row, .export-row { border-radius: var(--r-m); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.chip-filter { border-radius: 999px; }
.tag-chip { background: var(--panel-2); }
.badge { border-radius: 999px; }
.bar-track { background: var(--bg-deep); }

/* ---------- 動き（カードが配られる、1か所だけ）---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-strip.deal .hero-cards .card { animation: deal 0.42s cubic-bezier(.2, .8, .3, 1) both; }
  .hero-strip.deal .hero-cards .card:nth-child(2) { animation-delay: 0.1s; }
  @keyframes deal { from { opacity: 0; transform: translate(-30px, -50px) rotate(-14deg) scale(0.9); } }
}

/* ---------- ガイド ---------- */
.guide-tabs { display: flex; gap: 6px; padding: 4px 14px 10px; overflow-x: auto; flex: none; min-height: 52px; scrollbar-width: none; }
.guide-tabs::-webkit-scrollbar { display: none; }
.guide-tab {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); font-weight: 700; font-size: 0.9rem;
}
.guide-tab.on { background: var(--accent); color: #2a1d00; border-color: transparent; }
.guide-body { gap: 14px; }
.guide-body > * { flex-shrink: 0; }
.guide-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; box-shadow: var(--shadow-1); }
.guide-card h2 { font-size: 1.05rem; margin-bottom: 8px; }
.guide-card p { line-height: 1.7; margin-bottom: 8px; color: var(--text); font-size: 0.92rem; }
.guide-card p:last-child { margin-bottom: 0; }
.sample { display: flex; flex-wrap: wrap; gap: 14px 16px; margin: 10px 0 6px; padding: 12px; border-radius: var(--r-m); background: radial-gradient(ellipse at 50% 30%, var(--felt-1), var(--felt-2)); box-shadow: inset 0 0 0 2px #f2bb4d44; }
.sample-stage { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sample-cards { display: flex; gap: 4px; }
.sample-label { font-size: 0.72rem; color: #d3eef0; font-weight: 700; }
.steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; position: relative; }
.step::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: -14px; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step-no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; background: var(--accent); color: #2a1d00; }
.step-title { font-weight: 800; margin-bottom: 2px; }
.step p { font-size: 0.88rem; color: var(--muted); }
.bullets { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; line-height: 1.65; }

/* 役のはしご */
.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rung {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 12px 12px 10px; border-radius: var(--r-m);
  background: var(--panel); border: 1px solid var(--line); border-left-width: 5px;
  border-left-color: var(--tone);
  margin-left: calc(var(--i) * 3px); box-shadow: var(--shadow-1);
}
.rung-rank {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 0.95rem;
  background: var(--bg-deep); color: var(--tone);
}
.rung-name { font-weight: 800; font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rung-sum { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.rung-cards { display: flex; gap: 3px; margin: 8px 0 6px; }
.rung-freq { font-size: 0.78rem; color: #bfe8ea; font-weight: 700; }
.rung-tip { font-size: 0.82rem; line-height: 1.6; margin-top: 6px; color: var(--text); opacity: 0.9; }
.rung.on { background: linear-gradient(90deg, #2a3a1f, var(--panel) 70%); border-color: var(--accent); box-shadow: 0 0 0 2px #f2bb4d66, var(--shadow-1); }
.rung-you { font-size: 0.7rem; background: var(--accent); color: #2a1d00; border-radius: 999px; padding: 1px 9px; font-weight: 800; }
.ladder.compact { gap: 6px; }
.ladder.compact .rung { padding: 7px 10px 7px 8px; margin-left: 0; box-shadow: none; grid-template-columns: 28px 1fr; }
.ladder.compact .rung-rank { width: 24px; height: 24px; font-size: 0.8rem; border-radius: 7px; }
.ladder.compact .rung-name { font-size: 0.88rem; }

/* ボタン・ルール・用語 */
.action-guide { display: flex; flex-direction: column; gap: 10px; }
.action-item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: var(--r-m); background: var(--panel); border: 1px solid var(--line); }
.action-pill { width: 100%; min-height: 44px; pointer-events: none; font-size: 0.95rem; }
.action-pill.fold { background: linear-gradient(180deg, #3b2a3a, #2f2233); border-color: #5a3a50; color: #ffc9d3; }
.action-pill.primary { background: linear-gradient(180deg, #5fd3a1, var(--primary)); color: var(--primary-ink); border-color: transparent; }
.action-pill.raise { background: linear-gradient(180deg, #f2a64f, var(--raise)); color: #2a1500; border-color: transparent; }
.action-pill.danger { background: linear-gradient(180deg, #ee5d62, var(--danger)); color: #fff; border-color: transparent; }
.action-when { font-size: 0.75rem; color: var(--accent); font-weight: 800; margin-bottom: 2px; }
.action-item p { font-size: 0.86rem; line-height: 1.6; color: var(--text); }
.qa { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0 14px; }
.qa summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px; font-weight: 800; font-size: 0.95rem; cursor: pointer; }
.qa summary::-webkit-details-marker { display: none; }
.qa-chev { color: var(--muted); transition: transform 0.15s; }
.qa[open] .qa-chev { transform: rotate(90deg); }
.qa p { font-size: 0.88rem; line-height: 1.7; margin-bottom: 10px; }
.qa[open] { padding-bottom: 4px; }
.term-group h3 { font-size: 0.85rem; color: var(--muted); margin: 6px 0 8px; font-weight: 800; }
.term-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.term-chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 0.9rem; }
.term-chip:active { background: var(--panel-2); }
.home .brand { margin: auto; text-align: center; }

/* ---------- ヒント・状況の一言 ---------- */
.hud-tap { background: transparent; border: 0; color: inherit; text-align: left; padding: 0; font: inherit; }
.hero-strip { align-items: center; }
.hint-btn {
  margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid #f2bb4d88; background: #f2bb4d1f; color: var(--accent); font-weight: 800; font-size: 0.88rem;
}
.hint-btn:active { background: #f2bb4d38; }
.coach-line { font-size: 0.8rem; line-height: 1.55; color: var(--muted); padding: 0 4px 8px; text-align: center; }
.coach-line .term { color: var(--text); font-weight: 700; }
.hint-root { position: absolute; inset: 0; z-index: 30; }
.hint-sheet { max-height: 84%; display: flex; flex-direction: column; }
.hint-head h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.hint-head h2 .ico { color: var(--accent); }
.hint-head small { color: var(--muted); font-size: 0.78rem; }
.hint-scroll { overflow: auto; flex: 1; min-height: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 12px; }
.hint-sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; flex-shrink: 0; }
.hint-sec h3 { font-size: 0.82rem; color: var(--accent); margin-bottom: 6px; font-weight: 800; }
.hint-sec p { font-size: 0.88rem; line-height: 1.65; margin-bottom: 6px; }
.hint-sec p:last-child { margin-bottom: 0; }
.hint-hand { font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; }
.hint-small { color: var(--muted); font-size: 0.78rem; margin-bottom: 6px; }
.strength-pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; font-weight: 800; margin: 2px 0 8px; background: var(--panel-2); }
.strength-pill.lv6, .strength-pill.lv5 { background: #3b3417; color: var(--accent); }
.strength-pill.lv4 { background: var(--ok-bg); color: var(--win); }
.strength-pill.lv3 { background: var(--panel-2); color: var(--text); }
.strength-pill.lv2, .strength-pill.lv1 { background: #33202b; color: var(--lose); }
.hint-sec .ladder { margin-top: 8px; }
