/* 大富豪クラシック。色はポータルのテーマ「インク＆オレンジ」(src/styles/global.css) に合わせる */
:root {
  --bg: #f4f5f9; --surface: #fff; --text: #161b2e; --muted: #5a6178; --line: #e3e5ee;
  --ink: #161b2e; --accent: #ff7a1a; --accent-ink: #b84a00; --accent-shadow: #c85a08; --accent-soft: #fff1e6;
  --link: #2456d3; --pop: #ffcc00; --ok: #13804a; --danger: #d4343a; --felt: #13804a; --felt-dark: #0d5c35;
  --card-w: 46px; --card-h: 66px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Hiragino Sans', 'Noto Sans JP', system-ui, sans-serif; }
body { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; touch-action: manipulation; }
.top { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--ink); color: #fff; }
.top a { color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
.top .pub { margin-left: auto; font-size: 12px; background: rgb(255 255 255 / 15%); padding: 2px 10px; border-radius: 999px; }
section { width: 100%; max-width: 560px; padding: 12px 16px 16px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; }
.btn.main { background: var(--accent); color: var(--ink); box-shadow: 0 3px 0 var(--accent-shadow); width: 100%; font-size: 17px; }
.btn.sub { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }
.note { min-height: 1.2em; color: var(--danger); font-size: 13px; text-align: center; margin: 4px 0; }
.note.info { color: var(--muted); }
.fine { font-size: 11px; color: var(--muted); text-align: center; margin: 14px 0 0; }
.lead { text-align: center; font-size: 14px; color: var(--muted); margin: 0 0 14px; }
h2 { font-size: 15px; margin: 20px 0 8px; }
.rooms { list-style: none; margin: 0; padding: 0; }
.rooms li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border-radius: 12px; margin-bottom: 8px; }
.rooms li.empty { color: var(--muted); justify-content: center; }
.rooms a { margin-left: auto; font-weight: 800; color: var(--link); text-decoration: none; white-space: nowrap; }
.rooms .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rooms .n { flex: none; font-size: 12px; font-weight: 800; color: var(--muted); }
.rooms .rec { flex: none; font-size: 10px; font-weight: 800; background: var(--pop); border-radius: 999px; padding: 1px 6px; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; background: #999; flex: none; }

/* 札 (絵は使わず、数字とマークだけで描く) */
.card { position: relative; width: var(--card-w); height: var(--card-h); border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px #c9cedb, 0 2px 0 #b7bdcc; color: var(--ink);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; line-height: 1; font-style: normal; flex: none; user-select: none; }
.card b { font-size: 20px; margin-top: 2px; }
.card.red { color: var(--danger); }
.card.back { background: repeating-linear-gradient(45deg, var(--ink) 0 4px, #2b3352 4px 8px); box-shadow: inset 0 0 0 2px #fff, 0 2px 0 #0b0e19; }
.hero { display: flex; justify-content: center; gap: 8px; margin: 14px 0 10px; }
.hero .card:nth-child(odd) { transform: rotate(-6deg); }
.hero .card:nth-child(even) { transform: rotate(5deg) translateY(4px); }

/* ほかの 3 席と自分の席 */
.opps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seat { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--surface); border: 2px solid transparent; min-width: 0; }
.seat .av { grid-row: span 2; }
.seat .nm { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.seat .nm.empty { color: var(--muted); font-weight: 400; }
.seat .info { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 0; }
.seat .cnt { font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.seat .cnt::before { content: '🂠 '; font-weight: 400; }
.seat .pt { font-variant-numeric: tabular-nums; }
.seat.turn { border-color: var(--accent); background: var(--accent-soft); }
.seat.done { opacity: .6; }
.seat .tag { position: absolute; top: -9px; right: 6px; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 7px; background: var(--ink); color: #fff; white-space: nowrap; }
.seat .tag.t0 { background: var(--pop); color: var(--ink); }
.seat .tag.me { background: var(--accent); color: var(--ink); left: 6px; right: auto; }
.seat .st { position: absolute; bottom: -9px; right: 6px; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 7px; background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.seat .st.pass { color: var(--muted); }
.seat .st.out { background: var(--ok); color: #fff; box-shadow: none; }
.seat .st.away { background: var(--danger); color: #fff; box-shadow: none; }
.seat .timer { font-variant-numeric: tabular-nums; color: var(--accent-ink); font-weight: 900; }
.me-seat { margin-bottom: 8px; }

/* 場 */
.felt { position: relative; margin-top: 12px; border-radius: 16px; background: radial-gradient(ellipse at 50% 40%, var(--felt), var(--felt-dark)); min-height: 150px; padding: 30px 8px 12px; display: grid; place-items: center; }
.badges { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; justify-content: space-between; }
.badges span { font-size: 11px; font-weight: 800; color: #fff; background: rgb(0 0 0 / 25%); border-radius: 999px; padding: 2px 9px; }
.badges .rev { background: var(--danger); }
.field { display: flex; gap: 4px; min-height: var(--card-h); align-items: center; justify-content: center; }
.field .card { --card-w: 52px; --card-h: 74px; width: var(--card-w); height: var(--card-h); font-size: 20px; animation: drop .25s ease-out; }
.field .empty { color: rgb(255 255 255 / 55%); font-size: 13px; }
.field .by { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 11px; color: rgb(255 255 255 / 80%); }
@keyframes drop { from { transform: translateY(-14px) scale(1.06); opacity: .3; } }
.flash { min-height: 1.3em; margin: 6px 0 0; font-weight: 900; color: var(--pop); font-size: 16px; text-align: center; }
.status { text-align: center; font-weight: 800; margin: 10px 0 8px; min-height: 1.4em; font-size: 15px; }

/* 手札。重ねて並べ、幅に合わせて間を詰める (幅 375 で 13〜15 枚が 1 行に入る) */
.hand { position: relative; height: calc(var(--card-h) + 16px); margin: 4px 0 10px; }
.hand .card { position: absolute; bottom: 0; cursor: pointer; transition: transform .12s; border: 0; font-family: inherit;
  /* 重なっても見えるように、数字とマークは左上に寄せる */
  justify-content: flex-start; align-items: flex-start; padding: 6px 0 0 5px; font-size: 17px; }
.hand .card b { font-size: 17px; margin-top: 3px; }
.hand .card.back { padding: 0; }
.hand .card.sel { transform: translateY(-14px); box-shadow: inset 0 0 0 3px var(--accent), 0 2px 0 var(--accent-shadow); }
.hand .card.dim { filter: grayscale(.2) brightness(.92); }
.hand .card.new::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.play-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.actions { display: grid; gap: 8px; margin-top: 12px; }
.watch { text-align: center; color: var(--muted); font-size: 13px; }

/* 終わり・ラウンドの結果 */
.result { margin-top: 12px; background: var(--surface); border-radius: 14px; padding: 12px; }
.result h3 { margin: 0 0 8px; font-size: 15px; text-align: center; }
.result table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result td, .result th { padding: 6px 4px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.result td.nm { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9em; }
.result tr.first td { background: #fff7d6; font-weight: 800; }

@media (min-width: 600px) { :root { --card-w: 54px; --card-h: 78px; } .card { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .field .card { animation: none; } .hand .card { transition: none; } }
