/* 遊び方・ルール・役・プライバシーポリシーのページ（読み物）。色はアプリと同じ雀卓の緑 */
:root {
  --bg: #0a2a1b;
  --panel: #0f3324;
  --ink: #f3f4ef;
  --muted: #b9d3c3;
  --accent: #f6c453;
  --line: #ffffff1f;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse at top, #1f6e48, var(--bg) 70%) fixed, var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.75;
}
.page { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head a { color: var(--muted); font-size: 14px; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.lang-switch button.on { background: var(--accent); color: #2a1d00; border-color: transparent; font-weight: 700; }
h1 { font-size: 26px; margin: 16px 0 4px; letter-spacing: .04em; }
h2 { font-size: 19px; margin: 36px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
h3 { font-size: 16px; margin: 20px 0 4px; color: var(--accent); }
p, li { font-size: 15px; }
ul, ol { padding-left: 1.4em; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--panel); white-space: nowrap; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.page-foot { margin-top: 48px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.page-foot a { color: var(--muted); }
[lang][hidden] { display: none; }

/* ルール：ふつうの麻雀とちがうところ（大きく見せる） */
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 16px 0 8px; }
.point { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px 58px; }
.point .num { position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #2a1d00; font-weight: 800; }
.point h3 { margin: 4px 0 6px; font-size: 17px; color: var(--ink); }
.point p { margin: 0; font-size: 14px; color: var(--muted); }
.point p b { color: var(--ink); }
.point.big { grid-column: 1 / -1; border-color: var(--accent); background: linear-gradient(135deg, #1f6e4855, var(--panel)); }
.point.big h3 { font-size: 21px; color: var(--accent); }
.point.big p { font-size: 15px; }
/* 役の一覧：役ごとのカードと牌姿 */
.yaku-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; }
.yaku-card h3 { margin: 0 0 2px; font-size: 17px; color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.yaku-card h3 small { font-weight: 400; color: var(--muted); font-size: 13px; }
.yaku-card p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.yaku-card .free { font-size: 13px; margin: 0; }
.yaku-card .note-small { font-size: 12px; margin: 6px 0 0; }
.badge { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #ffffff14; border: 1px solid var(--line); color: var(--ink); }
.badge.ym { background: var(--accent); color: #2a1d00; border-color: transparent; }
/* 牌姿（牌の画像は shared/client/tiles）。--tw で牌の幅 */
.hand { --tw: clamp(15px, 4.8vw, 28px); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 0; padding: 4px 0 2px; }
.hand .g { display: flex; align-items: flex-end; margin-right: calc(var(--tw) * .3); }
.hand .g.win { margin-left: calc(var(--tw) * .25); }
.hand .g.win .t .face { box-shadow: 0 2px 0 #d7c49a, 0 calc(var(--tw) * .2) 0 var(--accent); }
.t { position: relative; flex: none; width: var(--tw); height: calc(var(--tw) * 1.36); margin-right: 1px; }
.t .face { position: absolute; inset: 0; border-radius: calc(var(--tw) * .12); background: #fbf8f0 url(shared/client/tiles/Front.svg) center / 100% 100% no-repeat; box-shadow: 0 2px 0 #d7c49a; }
.t .face img { position: absolute; left: 10%; top: 8%; width: 80%; height: 84%; }
.t.back .face { background: linear-gradient(160deg, #f2a93b, #d9861a); box-shadow: 0 2px 0 #f4efe2; }
/* 鳴いた牌は横向き（幅と高さを入れかえて、絵を90度回す） */
.t.side { width: calc(var(--tw) * 1.36); height: var(--tw); }
.t.side .face { inset: auto; width: var(--tw); height: calc(var(--tw) * 1.36); left: calc(var(--tw) * .18); top: calc(var(--tw) * -.18); transform: rotate(90deg); }
.win-mark { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }

/* アプリの中に重ねて開いたとき（?embed）：上と下のリンクは出さない */
.embed .page-head > a, .embed .page-foot { display: none; }
.embed .page-head { justify-content: flex-end; }

/* ルールのページ：役の一覧へのボタン */
.yaku-button { display: flex; flex-direction: column; align-items: center; margin: 18px auto 4px; width: min(360px, 100%); padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(135deg, #f0709a, #c13d6a); color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 #0006; text-shadow: 0 1px 2px #0005; }
.yaku-button small { font-weight: 700; font-size: 12px; opacity: .9; margin-top: 2px; }
