:root { --bg:#F5F8F6; --card:#FFFFFF; --text:#16221C; --sub:#47564E; --muted:#66746C; --border:#D8E2DC; --accent:#1F6B4A; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",sans-serif; line-height:1.8; }
main { max-width:720px; margin:0 auto; padding:32px 16px 64px; }
header { margin-bottom:24px; font-weight:700; font-size:18px; color:var(--accent); }
h1 { font-size:24px; margin:0 0 8px; }
h2 { font-size:16px; margin:28px 0 6px; }
p { margin:0 0 6px; color:var(--sub); font-size:15px; }
ul { margin:0 0 6px; padding-left:1.4em; color:var(--sub); font-size:15px; }
p.item { padding-left:1em; }
.date { color:var(--muted); font-size:13px; margin-bottom:16px; }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:20px; margin-top:20px; }
.btn { display:inline-block; padding:12px 20px; border-radius:10px; background:var(--accent); color:#fff; font-weight:700; text-decoration:none; border:0; font-size:15px; font-family:inherit; cursor:pointer; }
.btn.soon { background:#6B7A72; }
.links a { display:block; padding:12px 0; color:var(--accent); text-decoration:none; font-weight:600; border-top:1px solid var(--border); }
.links a:first-child { border-top:none; }
a { color:var(--accent); word-break:break-all; }
footer { margin-top:40px; color:var(--muted); font-size:12px; text-align:center; }

/* ---- 点数表・符計算機（table.html / fu.html）---- */
header a { color:inherit; text-decoration:none; }
.wide main { max-width:960px; }
.note { font-size:13px; color:var(--muted); margin:6px 0; }
.summary { margin:10px 0 0; }
.ctl { margin:10px 0 0; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ctl label { font-weight:600; font-size:14px; }
.ctl select { font:inherit; font-size:15px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); max-width:100%; }
.switch { display:flex; gap:8px; align-items:center; cursor:pointer; }
.switch input { width:20px; height:20px; accent-color:var(--accent); }
.seg { gap:0; }
.seg-btn { font:inherit; font-size:15px; font-weight:700; padding:9px 22px; border:1px solid var(--accent); background:#fff; color:var(--accent); cursor:pointer; }
.seg-btn:first-child { border-radius:10px 0 0 10px; }
.seg-btn:last-child { border-radius:0 10px 10px 0; margin-left:-1px; }
.seg-btn.on { background:var(--accent); color:#fff; }
.footer nav, footer nav { margin-bottom:4px; }
footer a { word-break:normal; }
.btn.ghost { background:#fff; color:var(--accent); border:1px solid var(--border); }
.btn.big { display:block; width:100%; margin-top:14px; padding:16px; font-size:17px; }

.tablewrap { margin-top:16px; overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--border); border-radius:12px; background:var(--card); }
table.score { border-collapse:separate; border-spacing:0; width:100%; min-width:760px; font-size:14px; font-variant-numeric:tabular-nums; }
table.score caption { text-align:left; padding:10px 12px; font-weight:700; font-size:14px; position:sticky; left:0; }
table.score th, table.score td { padding:8px 10px; border-bottom:1px solid var(--border); border-right:1px solid var(--border); text-align:right; white-space:nowrap; line-height:1.4; }
table.score thead th { background:#EAF1ED; position:sticky; top:0; z-index:1; font-size:13px; }
table.score tbody th { background:#EAF1ED; position:sticky; left:0; z-index:2; text-align:center; font-size:13px; }
table.score thead th.corner { left:0; z-index:3; }
table.score td.lim { background:#FFF1D6; font-weight:700; }
table.score td small { display:block; font-size:11px; font-weight:400; color:#8A5A00; }
table.score td.na { color:#B8C2BC; background:#FAFBFA; }
table.score td.na small { display:none; }

/* 牌（CSS だけで描く）*/
.tiles { display:inline-flex; gap:3px; align-items:flex-end; flex-wrap:nowrap; }
.tile { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; width:30px; height:42px; background:#fff; border:1px solid #9AA8A0; border-bottom-width:3px; border-radius:6px; font-weight:700; line-height:1; flex:none; color:#16221C; }
.tile b { font-size:19px; font-weight:700; }
.tile i { font-style:normal; font-size:11px; margin-top:3px; }
.tile.m { color:#B3261E; } .tile.p { color:#1B5FA8; } .tile.s { color:#1F7A3E; }
.tile.m b { color:#16221C; }
.tile.h b { font-size:21px; }
.tile.h.red b { color:#B3261E; } .tile.h.grn b { color:#1F7A3E; }
.tile.q { background:#EAF1ED; border-style:dashed; color:var(--accent); }
.tile.back { background:var(--accent); border-color:#14503A; }

/* 符ウィザード */
.wiz { position:relative; padding-top:24px; }
.nowfu { position:absolute; top:12px; right:14px; text-align:center; background:#EAF1ED; border-radius:10px; padding:4px 12px; line-height:1.2; }
.nowfu small { display:block; font-size:11px; color:var(--sub); }
.nowfu b { font-size:24px; color:var(--accent); }
.qno { font-size:13px; color:var(--muted); font-weight:700; }
.wiz h2.q { font-size:18px; margin:4px 80px 6px 0; line-height:1.5; color:var(--text); }
.opts { display:grid; gap:10px; margin-top:12px; }
.opt { display:flex; align-items:center; gap:14px; min-height:64px; padding:12px 14px; text-align:left; font:inherit; font-size:16px; font-weight:700; color:var(--text); background:#fff; border:2px solid var(--border); border-radius:14px; cursor:pointer; }
.opt:hover, .opt:active { border-color:var(--accent); background:#F1F7F3; }
.opt .tiles { min-width:70px; }
.counters { margin-top:12px; display:grid; gap:8px; }
.counter { display:grid; grid-template-columns:auto 1fr auto auto auto; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--border); border-radius:12px; }
.counter .tiles { min-width:100px; }
.counter .tile { width:24px; height:34px; } .counter .tile b { font-size:15px; } .counter .tile i { font-size:9px; }
.cl { font-size:13px; font-weight:600; }
.step { width:44px; height:44px; border-radius:10px; border:1px solid var(--accent); background:#fff; color:var(--accent); font-size:22px; font-weight:700; cursor:pointer; }
.counter output { min-width:20px; text-align:center; font-weight:700; font-size:18px; }
.wiz-actions { display:flex; gap:10px; margin-top:18px; flex-wrap:wrap; }
.bigfu { font-size:20px; margin:8px 0; color:var(--sub); } .bigfu b { font-size:56px; color:var(--accent); line-height:1.1; }
table.bd { width:100%; border-collapse:collapse; font-size:15px; margin:6px 0; }
table.bd td { padding:7px 4px; border-bottom:1px solid var(--border); } table.bd td:last-child { text-align:right; font-weight:700; }
table.bd tr.sum td { border-bottom:0; color:var(--sub); }
.result { margin-top:14px; padding:16px; background:#FFF1D6; border-radius:12px; text-align:center; }
.result .lab { font-weight:700; color:#8A5A00; } .result .pts { font-size:34px; font-weight:800; line-height:1.3; } .result .sub { font-size:12px; color:var(--sub); }
@media (max-width:480px) {
  .counter { grid-template-columns:1fr auto auto auto; } .counter .tiles { grid-column:1 / -1; }
  main { padding-left:16px; padding-right:16px; }
}
.opt .tiles { flex:none; min-width:0; }
.opt > span:last-child { flex:1 1 120px; min-width:0; }
.opt { flex-wrap:wrap; }
@media (max-width:480px) { .opt .tile { width:26px; height:38px; } .opt .tile b { font-size:17px; } .opt .tiles { gap:2px; } }
