:root {
  --bg: #f7f5f0;
  --panel: #ffffff;
  --ink: #222;
  --muted: #666;
  --line: #d8d3c8;
  --accent: #7a3b12;
  --accent-ink: #fff;
  --ok: #1f6f3a;
  --ng: #a3241c;
  --you: #fff2c9;
  --hide: #eeeae2;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
.top { background: var(--accent); color: var(--accent-ink); padding: 6px 12px; }
.top h1 { margin: 0; font-size: 18px; }
.top small { font-weight: normal; opacity: .85; }
main { padding: 8px; max-width: 1280px; margin: 0 auto; }
h2 { font-size: 17px; margin: 12px 0 6px; }
h3 { font-size: 15px; margin: 10px 0 4px; }
section.box { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; min-width: 0; }
button { font: inherit; padding: 6px 10px; margin: 2px 4px 2px 0; border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 4px; cursor: pointer; min-height: 36px; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button:disabled { opacity: .45; cursor: default; }
button.sel { background: var(--accent); color: var(--accent-ink); }
input, select { font: inherit; padding: 4px 6px; max-width: 100%; }
label { display: inline-block; margin: 2px 8px 2px 0; }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: bold; }
.ng { color: var(--ng); font-weight: bold; }
.scroll-x { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 3px 5px; text-align: left; vertical-align: top; }
th { background: #efe9dc; font-weight: 600; }
tr.you td { background: var(--you); }
.status-bar { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; }
.log { max-height: 340px; overflow-y: auto; font-size: 13px; background: #fbfaf7; border: 1px solid var(--line); padding: 4px 6px; }
.log div { border-bottom: 1px dotted #e3ded3; padding: 1px 0; }
.log .reason { color: #345; }
.log.full { max-height: 520px; }
.cards { display: flex; flex-wrap: wrap; gap: 4px; }
.card { border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; background: #fff; font-size: 13px; }
.card .neg { color: var(--ng); }
.card .pos { color: var(--ok); }
.actions { border: 2px solid var(--accent); }
.actions .prompt { font-weight: 600; margin-bottom: 4px; }
.status-bar.g-status { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin-bottom: 6px; }
table.tight { font-size: 13px; }
table.tight th, table.tight td { padding: 2px 4px; white-space: nowrap; }
td.num { text-align: center; }
.mine { color: var(--muted); font-size: 12px; }
.proph { color: var(--muted); font-size: 11px; white-space: normal; min-width: 12em; max-width: 22em; line-height: 1.3; }
.note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 3px; padding: 0 4px; font-size: 11px; }
.hand-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0; }
.hand-label { font-size: 12px; color: var(--muted); min-width: 5.5em; }
.game section.box { padding: 6px; margin-bottom: 6px; }
.game h3 { margin: 0 0 4px; font-size: 14px; }
/* PC：地域・議員・手札を左、操作と経過を右に並べ、1画面に収める（仕様8章） */
.game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); grid-template-areas: "status status" "board side"; gap: 0 8px; align-items: start; }
.game > .g-status { grid-area: status; }
.game > .g-board { grid-area: board; min-width: 0; }
.game > .g-side { grid-area: side; position: sticky; top: 6px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.g-side .g-actions { flex: 0 0 auto; max-height: 60vh; overflow-y: auto; }
.g-side .g-log { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; overflow: hidden; }
.g-side .g-log .log { flex: 1 1 auto; max-height: none; }
.grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.vote-row { border-bottom: 1px dotted var(--line); padding: 4px 0; }
.version { font-size: 13px; color: var(--muted); }
.progress { font-weight: 600; }
pre.copy { white-space: pre-wrap; word-break: break-all; font-size: 12px; max-height: 200px; overflow: auto; background: #fbfaf7; border: 1px solid var(--line); padding: 4px; }
@media (max-width: 760px) {
  .grid { display: block; }
  main { padding: 6px; }
  .game { display: flex; flex-direction: column; align-items: stretch; }
  .game > .g-side { display: contents; }
  .game > .g-status { order: 1; } .game > .g-board { order: 2; } .g-log { order: 3; } .g-actions { order: 4; }
  .game .g-side .g-log { overflow: visible; }
  .game .g-side .g-log .log { max-height: 240px; }
  table.tight { font-size: 12px; }
  table.tight th, table.tight td { white-space: normal; padding: 2px 3px; }
  .proph { min-width: 7em; font-size: 10px; }
  .actions { position: sticky; bottom: 0; z-index: 5; max-height: 50vh; overflow-y: auto; box-shadow: 0 -2px 8px rgba(0,0,0,.15); }
  body { font-size: 14px; }
  table { font-size: 13px; }
}
