/* 公開用のタイトル・待ち画面。卓まわりは shared/client/table.css */
/* ---------- タイトル・待ち画面 ---------- */
.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center; /* 画面より長いときは上から並べる（上が切れて見えなくならないように） */
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}
.screen > * { flex-shrink: 0; } /* 画面より長いときに、表などが縮んで重ならないように */
h1 { margin: 0; font-size: 30px; letter-spacing: .08em; text-shadow: 0 2px 8px #0008; }
.lead, .muted { color: var(--muted); margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; width: min(280px, 100%); }
.field input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid #ffffff40; background: #00000040; color: var(--ink); }
.screen .primary { width: min(280px, 100%); padding: 14px; font-size: 18px; }
.error { color: var(--danger); margin: 0; }
/* 対局待ち：広告の枠と、その下に「お待ちください」とキャンセル */
.ad-box { width: 300px; height: 250px; max-width: 100%; display: grid; place-items: center; border: 1px dashed #ffffff40; border-radius: 8px; color: #ffffff50; font-size: 12px; }
.ad-box[hidden], .countdown[hidden] { display: none; }
.countdown { width: 300px; height: 250px; max-width: 100%; display: grid; place-items: center; font-size: 96px; font-weight: 700; color: var(--accent); }
.waiting-row { display: flex; align-items: center; gap: 10px; width: min(300px, 100%); }
.waiting-status { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; background: #ffffff10; font-size: 12px; text-align: left; white-space: nowrap; }
.waiting-row #cancel { flex: none; width: auto; min-width: 0; padding: 10px 12px; font-size: 14px; }
.spinner.small { width: 18px; height: 18px; border-width: 3px; flex: none; }
.spinner { width: 36px; height: 36px; border: 4px solid #ffffff30; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


.small { font-size: 13px; }
button.link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 4px; }

/* ログイン */
.account { width: min(320px, 100%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.account p { margin: 0; }
#google-button { min-height: 44px; display: flex; justify-content: center; }
.dev-login { display: flex; gap: 8px; width: 100%; }
.dev-login input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid #ffffff40; background: #00000040; color: var(--ink); }

.leave-bots { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 50; min-width: 0; width: auto; padding: 6px 14px; font-size: 13px; border-radius: 999px; background: #000000b0; }
.play-area { display: contents; } /* 中身はトップ画面の並びにそのまま入れる（ログインしていなければ隠す） */
.play-area > * { flex-shrink: 0; }
.player-name { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: center; }
.player-name b { font-size: 20px; }
/* 名前の登録 */
#register { --muted: #b9d3c3; background: radial-gradient(ellipse at 50% 30%, #1f6e48 0%, #0a2a1b 80%); }
.register-lead { max-width: 320px; margin: 0; line-height: 1.7; }
.register-confirm { width: min(280px, 100%); background: #00000033; border: 1px solid #ffffff30; border-radius: 12px; padding: 10px 12px; }
.register-confirm p { margin: 0; }
.register-confirm b { color: var(--accent); font-size: 18px; }

/* 牌譜 */
#paifu { justify-content: flex-start; overflow-y: auto; }
#title { overflow-y: auto; } /* 画面が低い端末ではスクロールできるように */
.paifu-list { width: min(640px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: left; }
.paifu-list h2 { margin: 0 0 6px; font-size: 15px; color: var(--muted); font-weight: 600; }
.paifu-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #ffffff0d; border: 1px solid #ffffff22; }
.paifu-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.paifu-row .info b { font-size: 15px; font-variant-numeric: tabular-nums; }
.paifu-row .info span { font-size: 12px; color: var(--muted); }
.paifu-row button { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
.paifu-row button.primary { width: auto; padding: 8px 12px; font-size: 13px; }
.paifu-row button.star { font-size: 18px; padding: 4px 10px; background: none; border-color: transparent; color: var(--muted); }
.paifu-row button.star.on { color: var(--accent); }

/* 牌譜ビューア：上に操作バー、その下に卓 */
#viewer { position: fixed; inset: 0; }
.viewer-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 52px; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px;
  background: #08200ff2; box-shadow: 0 2px 12px #000a;
}
.viewer-bar button { padding: 6px 10px; font-size: 16px; min-width: 40px; }
.viewer-bar button:disabled { opacity: .35; }
.viewer-bar .viewer-step { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.viewer-bar .viewer-seat { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.viewer-table { position: absolute; top: 52px; left: 0; right: 0; bottom: 0; }
/* ビューアでは対局用の設定（鳴きなしなど）は使わない */
.viewer-table .prefs-bar { display: none; }
@media (max-width: 420px) {
  .viewer-bar { gap: 3px; padding: 0 4px; }
  .viewer-bar button { padding: 6px 7px; min-width: 34px; font-size: 14px; }
  .viewer-bar .viewer-step { min-width: 48px; font-size: 12px; }
  .viewer-bar .viewer-seat { max-width: 5.5em; font-size: 12px; }
}

/* 結果のカードのブックマーク・お知らせ */
.result-star { display: block; margin: 10px auto 0; background: none; border: 1px solid #ffffff33; color: var(--muted); }
.result-star.on { color: var(--accent); border-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 50; padding: 10px 18px; border-radius: 999px; background: #08200ff2; box-shadow: 0 6px 20px #000a; font-size: 15px; }

/* ランキング */
#ranking { justify-content: flex-start; overflow-y: auto; }
.tabs { display: flex; gap: 8px; }
.tab { padding: 8px 18px; border-radius: 999px; }
.tab.on { background: var(--accent); color: #2a1d00; border-color: transparent; font-weight: 700; }
.ranking-table { width: min(640px, 100%); overflow-x: auto; }
.ranking-table table, .my-stats table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.ranking-table th, .ranking-table td { padding: 7px 6px; border-top: 1px solid #ffffff1f; text-align: right; white-space: nowrap; }
.ranking-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.ranking-table td:nth-child(2), .ranking-table th:nth-child(2) { text-align: left; }
.ranking-table tr.me td { font-weight: 800; color: var(--accent); }
.plus { color: #8fe3a8; }
.minus { color: var(--danger); }
.my-stats { width: min(640px, 100%); background: #ffffff0d; border: 1px solid #ffffff22; border-radius: 12px; padding: 12px; text-align: left; }
.my-stats h2 { margin: 0 0 8px; font-size: 16px; }
.my-stats .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.my-stats .stat { background: #00000030; border-radius: 10px; padding: 8px 10px; }
.my-stats .stat span { display: block; font-size: 12px; color: var(--muted); }
.my-stats .stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.my-stats .stat small { display: block; font-size: 11px; color: var(--accent); margin-top: 2px; }
.my-stats > p { margin: 8px 0 0; }
.charts h2 + .chart, .charts h2 + p { margin-bottom: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart .base { stroke: #ffffff40; stroke-dasharray: 4 4; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; }
.chart .dot { fill: var(--accent); }
.chart text { fill: var(--muted); font-size: 22px; font-variant-numeric: tabular-nums; }

/* トップ画面の下：遊び方・プライバシーポリシー・言語 */
.title-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 13px; }
.title-footer a { color: var(--muted); }
#title { position: relative; padding-top: 112px; } /* 右上の言語ボタン・アイコンと重ならないように */
.lang-switch { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: flex; gap: 4px; }
.lang-switch button { background: #00000040; color: var(--muted); border: 1px solid #ffffff30; border-radius: 999px; padding: 4px 12px; font-size: 13px; min-width: 0; width: auto; }
.lang-switch button.on { background: var(--accent); color: #2a1d00; border-color: transparent; font-weight: 700; cursor: default; }

/* ---------- トップ画面：雀卓の緑 × 金（アプリのアイコンと同じ色） ---------- */
#title {
  --muted: #b9d3c3;
  background: radial-gradient(ellipse at 50% 30%, #1f6e48 0%, #0a2a1b 80%);
  gap: 12px;
}
/* トップ画面のふつうのボタン（色付きのボタンは下でそれぞれ上書きする。:where で弱くしておく） */
:where(#title) button { background: #00000038; border-color: #ffffff30; }
.title-hero { width: min(420px, 100%); margin-bottom: -18px; }
.title-hero svg, .title-logo svg { display: block; width: 100%; height: auto; }
.title-logo { width: min(400px, 100%); }
#title .lead { font-family: "Noto Serif JP", serif; font-weight: 900; letter-spacing: .3em; margin: -6px 0 6px; }
#title .lead:lang(en) { letter-spacing: .06em; }
.title-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(320px, 100%); }
.title-links button { min-width: 0; padding: 10px 4px; white-space: nowrap; font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- トップ画面：対局の選び方（1. バトルの種類 → 2. 人数）。色付きの大きなボタン ---------- */
.pick { display: flex; flex-direction: column; gap: 10px; width: min(320px, 100%); }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pick-head .back-pill, .kind-pill, .mode-pill { border-radius: 999px; padding: 7px 16px; color: #fff; font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 14px; text-shadow: 0 1px 2px #0005; box-shadow: 0 3px 0 #0005; }
:where(#title) .pick-head .back-pill { min-width: 0; width: auto; border: none; background: linear-gradient(135deg, #6b7c99, #3f4d68); }
/* バトルの種類・人数のラベル（人数を選ぶ画面・待ち画面）。色はトップ画面の大きなボタンと同じ */
.kind-pill.casual { background: linear-gradient(135deg, #43a8ff, #1c5fd0); }
.kind-pill.ranked { background: linear-gradient(135deg, #ff8a4c, #d52c4b); }
.mode-pill.sanma { background: linear-gradient(135deg, #f7a83a, #d2620f); }
.mode-pill.yonma { background: linear-gradient(135deg, #2fbfa9, #13806e); }
.big-choice {
  position: relative; width: 100%; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  padding: 14px 18px 13px; border: none; border-radius: 16px; color: #fff;
  box-shadow: 0 5px 0 #0006, inset 0 1px 0 #ffffff55; transition: transform .08s, box-shadow .08s;
}
.big-choice:active { transform: translateY(3px); box-shadow: 0 2px 0 #0006, inset 0 1px 0 #ffffff55; }
.big-choice b { font-size: 21px; letter-spacing: .04em; text-shadow: 0 1px 2px #0005; }
.big-choice small { font-size: 12px; margin-top: 3px; opacity: .92; line-height: 1.5; padding-right: 64px; }
.big-choice .choice-wait { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #00000040; }
.big-choice .choice-wait:empty { display: none; }
.big-choice.casual { background: linear-gradient(135deg, #43a8ff, #1c5fd0); }
.big-choice.ranked { background: linear-gradient(135deg, #ff8a4c, #d52c4b); }
/* 人数のボタン：三人麻雀はオレンジ、四人麻雀は青緑（どちらも白い文字） */
.big-choice.sanma { background: linear-gradient(135deg, #f7a83a, #d2620f); }
.big-choice.yonma { background: linear-gradient(135deg, #2fbfa9, #13806e); }
/* 下のリンクのボタンも色付きに（落ち着いた色） */
.title-links button { color: #fff; border: none; box-shadow: 0 3px 0 #0005; }
.title-links .l-rules { background: linear-gradient(135deg, #9b7bf0, #6545d0); }
.title-links .l-ranking { background: linear-gradient(135deg, #e3b52a, #b07f08); }
.title-links button { text-shadow: 0 1px 2px #0005; }
.title-links .l-paifu { background: linear-gradient(135deg, #5f8dff, #3557c9); }

/* ---------- トップ画面を開いたときのアニメーション（.intro は app.js が最初だけ付ける） ---------- */
#title.intro .title-logo svg { animation: fade-in .9s ease-out both; }
#title.intro .lead { animation: fade-in .6s ease-out .7s both; }
#title.intro .ta-runner { animation: runner-in .9s cubic-bezier(.2, .8, .25, 1) .6s both; }
@keyframes runner-in {
  from { opacity: 0; transform: translateX(-280px); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #title.intro .title-logo svg, #title.intro .lead, #title.intro .ta-runner { animation: none; }
}

/* ---------- 左上：自分のアイコン（正方形の絵を入れる枠）と名前（押すとプロフィール） ---------- */
.avatar { flex: none; width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(160deg, #f6e7c8, #d9b77a); border: 2px solid var(--accent); box-shadow: 0 2px 6px #0006; }
.avatar svg { width: 76%; height: 76%; fill: #7a5a2a; margin-top: 18%; }
.avatar.big { width: 72px; height: 72px; border-width: 3px; border-radius: 12px; }
:where(#title) .profile-chip {
  position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 190px); padding: 3px 12px 3px 3px; border-radius: 10px; min-width: 0; width: auto;
  background: #00000055; border: 1px solid #ffffff30;
}
.profile-chip .chip-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- プロフィール ---------- */
#profile { justify-content: flex-start; overflow-y: auto; }
.profile-head { display: flex; align-items: center; gap: 14px; width: min(640px, 100%); text-align: left; }
.profile-head h1 { font-size: 24px; margin: 0; }
.profile-head .link { padding: 2px 0; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge.locked { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #ffffff55;
  background: #00000040; border: 1px dashed #ffffff33; }

/* ---------- ランキングの上：自分のレーティングと順位 ---------- */
.ranking-me { width: min(640px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(135deg, #f6c45333, #f6c4530d); border: 1px solid #f6c45366; text-align: left; }
.ranking-me .ranking-me-name { grid-column: 1 / -1; margin: 0; font-weight: 800; color: var(--accent); }
.ranking-me span { display: block; font-size: 11px; color: var(--muted); }
.ranking-me b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ボタンの文字は丸ゴシックの太字（読み込めなければふつうの太字） */
.big-choice b, .title-links button { font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; letter-spacing: .04em; }
.title-links button { font-size: 15px; }
.title-links .wide { grid-column: 1 / -1; padding: 12px 4px; font-size: 16px; }

/* ---------- 待ち画面：何を待っているか（バトル・人数）と、丸ゴシックの文字 ---------- */
.waiting-match { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.waiting-match .kind-pill, .waiting-match .mode-pill { font-size: 16px; padding: 8px 18px; }
#waiting .waiting-status, #waiting #cancel, #waiting .countdown { font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; }
#waiting .waiting-status { font-size: 13px; }
#waiting .waiting-status .muted { font-weight: 700; }

/* 待ち画面もトップ画面と同じ雀卓の緑 */
#waiting { --muted: #b9d3c3; background: radial-gradient(ellipse at 50% 30%, #1f6e48 0%, #0a2a1b 80%); }
#waiting .waiting-status { background: #00000035; }
#waiting #cancel { background: #00000038; border-color: #ffffff30; }
#waiting .ad-box { border-color: #ffffff45; background: #00000020; }

/* ---------- はじめての人向け（ログインしていないとき）：「ようこそ」のポップアップ・4つのちがい・Google で登録 ---------- */
.welcome-modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: #000000a6; }
.welcome-card { position: relative; width: min(380px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 16px 18px; border-radius: 22px;
  background: radial-gradient(ellipse at 50% 0%, #1f6e48, #0a2a1b 85%); border: 2px solid #f6c45399; box-shadow: 0 20px 60px #000c;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.welcome-logo { width: min(300px, 100%); }
.welcome-logo svg { display: block; width: 100%; height: auto; }
:where(#title) .welcome-close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; min-width: 0; padding: 0; border-radius: 50%; font-size: 20px; line-height: 1; }
:where(#title) .welcome-open { width: min(300px, 100%); padding: 14px; border: none; border-radius: 14px; color: #fff; font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 16px;
  background: linear-gradient(135deg, #43a8ff, #1c5fd0); box-shadow: 0 4px 0 #0006; }
.welcome-title { margin: 0; font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 22px; letter-spacing: .04em; color: var(--accent); text-shadow: 0 2px 6px #0008; }
.welcome-lead { margin: 0; line-height: 1.7; font-size: 14px; }
.welcome-lead.small { font-size: 13px; color: var(--muted); }
.welcome-lead b { color: var(--ink); }
.welcome-points { list-style: none; counter-reset: pt; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.welcome-points li { counter-increment: pt; position: relative; padding: 10px 12px 10px 50px; border-radius: 14px; background: #00000035; border: 1px solid #ffffff22; }
.welcome-points li::before { content: counter(pt); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #2a1d00; font-weight: 800; }
.welcome-points li:first-child { border-color: var(--accent); background: linear-gradient(135deg, #f6c45326, #00000035); }
.welcome-points b { display: block; font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 15px; }
.welcome-points span { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.welcome-cta { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 12px; border-radius: 16px;
  background: linear-gradient(135deg, #f6c45333, #f6c45310); border: 1px solid #f6c45380; }
.welcome-cta p { margin: 0; }
.welcome-cta .cta-lead { font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 16px; }
.welcome-cta #google-button:empty { display: none; }
/* 開いたときの順番：枠 → ロゴ → 「ようこそ」 → 文章（4つのちがいは1つずつ） → 登録の欄 */
#title.intro .welcome-modal { animation: fade-in .35s ease-out both; }
#title.intro .welcome-card { animation: pop-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
#title.intro .welcome-logo { animation: fade-in .9s ease-out .35s both; }
#title.intro .welcome-title { animation: rise-in .6s ease-out 1.25s both; }
#title.intro .welcome-card > .welcome-lead:not(.small) { animation: rise-in .5s ease-out 1.75s both; }
#title.intro .welcome-points li { animation: rise-in .45s ease-out both; }
#title.intro .welcome-points li:nth-child(1) { animation-delay: 1.95s; }
#title.intro .welcome-points li:nth-child(2) { animation-delay: 2.1s; }
#title.intro .welcome-points li:nth-child(3) { animation-delay: 2.25s; }
#title.intro .welcome-points li:nth-child(4) { animation-delay: 2.4s; }
#title.intro .welcome-lead.small { animation: rise-in .45s ease-out 2.6s both; }
#title.intro .welcome-cta, #title.intro .welcome-close { animation: rise-in .5s ease-out 2.8s both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #title.intro .welcome-modal, #title.intro .welcome-card, #title.intro .welcome-card * { animation: none !important; }
}

/* 利用規約への同意（チェックするまで登録のボタンを押せない） */
.agree { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 13px; line-height: 1.6; cursor: pointer; }
.agree input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.agree a { color: var(--accent); font-weight: 700; }
.signup { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; transition: opacity .2s; }
.signup.locked { opacity: .35; pointer-events: none; filter: grayscale(.6); }
#register .agree { width: min(280px, 100%); }

/* 利用規約などを重ねて開く枠（「ようこそ」・名前の登録から） */
.doc-viewer { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); }
.doc-bar { flex: none; display: flex; align-items: center; padding: 10px 12px; background: #00000055; border-bottom: 1px solid #ffffff22; }
.doc-bar .back-pill { min-width: 0; width: auto; border: none; border-radius: 999px; padding: 7px 16px; color: #fff; font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, #6b7c99, #3f4d68); box-shadow: 0 3px 0 #0005; }
.doc-viewer iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* ---------- 卓で名前を押したときの成績のカード ---------- */
.player-card { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: 16px; background: #000000a0; }
.card-box { position: relative; width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 14px 14px; border-radius: 20px;
  background: radial-gradient(ellipse at 50% 0%, #1f6e48, #0a2a1b 85%); border: 2px solid #f6c45399; box-shadow: 0 20px 60px #000c;
  display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; }
.card-head h2 { margin: 0; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; min-width: 0; padding: 0; border-radius: 50%; font-size: 20px; line-height: 1; }
.card-box .tabs { justify-content: center; }
.card-stats { width: 100%; min-height: 470px; transition: opacity .15s; } /* タブを切り替えても枠の高さが変わらないように */
.card-stats.loading { opacity: .5; }
.card-stats .grid { grid-template-columns: 1fr 1fr; }
.avatar.bot { background: linear-gradient(160deg, #cfd8e3, #8d9bb0); border-color: #c8d2df; }
.avatar.bot svg { fill: #3d4a5e; margin-top: 4%; }

/* ---------- 通報（結果の画面の小さいボタン → 相手・理由・内容 → お礼） ---------- */
.result-actions .report-link { min-width: 0; width: auto; padding: 4px 10px; border: none; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; }
.report-box h2, .thanks-box h2 { margin: 0; font-size: 20px; }
.report-field { display: flex; flex-direction: column; gap: 6px; border: none; margin: 0; padding: 0; text-align: left; font-size: 14px; }
.report-field legend { padding: 0; margin-bottom: 6px; }
.report-field select, .report-field textarea { font: inherit; padding: 9px 10px; border-radius: 10px; border: 1px solid #ffffff40; background: #00000040; color: var(--ink); resize: vertical; }
.report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.report-reasons label { display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 10px; background: #00000030; border: 1px solid #ffffff22; font-size: 13px; cursor: pointer; }
.report-reasons input { accent-color: var(--accent); }
.report-box .primary, .thanks-box .primary { width: 100%; padding: 12px; font-size: 16px; }
.thanks-box { text-align: center; align-items: center; }
.thanks-box p { margin: 0; line-height: 1.8; }

/* ブラウザの「戻る」を押したときのお知らせ（対局中） */
.back-notice { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 60; width: max-content; max-width: calc(100% - 48px); padding: 16px 22px; border-radius: 16px;
  background: #08200ff2; border: 2px solid var(--accent); box-shadow: 0 10px 40px #000c; text-align: center; white-space: pre-line; font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 16px; line-height: 1.6; }

/* ---------- 右上のアイコン：メール・お知らせ・目安箱 ---------- */
.top-icons { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 40px); right: max(12px, env(safe-area-inset-right)); display: flex; gap: 8px; z-index: 2; }
:where(#title) .top-icon { position: relative; width: 52px; min-width: 0; padding: 6px 0 4px; border-radius: 12px; border: 1px solid #ffffff30; background: #00000045;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); }
.top-icon svg { width: 24px; height: 24px; fill: var(--accent); }
.top-icon span { font-family: "M PLUS Rounded 1c", system-ui, sans-serif; font-weight: 800; font-size: 10px; }
.top-icon .dot { position: absolute; top: -5px; right: -5px; min-width: 12px; height: 12px; border-radius: 999px; background: var(--danger); box-shadow: 0 0 0 2px #0a2a1b; }
.top-icon .dot.count { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; color: #fff; text-align: center; }
/* メール・お知らせの一覧 */
.list-box { min-height: 320px; }
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg { border-radius: 12px; background: #00000035; border: 1px solid #ffffff22; overflow: hidden; }
.msg > button { width: 100%; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border: none; border-radius: 0; background: none; text-align: left; color: var(--ink); }
.msg > button b { font-size: 15px; }
.msg > button small { flex: none; color: var(--muted); font-size: 11px; }
.msg.unread > button b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: middle; }
.msg .msg-body { padding: 0 12px 12px; white-space: pre-wrap; line-height: 1.7; font-size: 14px; color: var(--muted); }

/* アカウントの削除（プロフィールのいちばん下・確認の画面） */
#profile .delete-account { margin-top: 24px; color: #ff9d92; font-size: 13px; }
.delete-list { margin: 0; padding-left: 1.3em; text-align: left; line-height: 1.8; font-size: 14px; }
.report-box p { margin: 0; text-align: left; line-height: 1.7; }
.danger-button { background: linear-gradient(135deg, #e0574b, #b52c22) !important; color: #fff !important; }
.danger-button:disabled { opacity: .45; }

/* トップ画面のいちばん下の版 */
.app-version { margin: 4px 0 0; font-size: 11px; color: #ffffff59; letter-spacing: .05em; }

/* アプリの中のブラウザで開いたときの案内（ようこその登録欄） */
.in-app-notice { margin: 0; padding: 10px 12px; border-radius: 12px; background: #ff6b5b26; border: 1px solid #ff6b5b80; font-size: 13px; line-height: 1.7; text-align: left; }
