/* 数字ゲーム計算機。色はすべてここの変数で管理する（土台は jinsei のすごろく計算機と同じ）。 */
:root {
  color-scheme: dark;
  --bg: #121419;
  --surface: #1b1e26;
  --surface-2: #232733;
  --surface-3: #2d3241;
  --line: #3a4152;
  --text: #eef1f6;
  --muted: #a0a8b6;
  --accent: #ffcf3d;
  --accent-text: #1c1500;
  --focus: #8db8ff;
  --plus: #5fd896;
  --minus: #ff7b7b;
  --danger: #ff6161;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--focus);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
}

h2 {
  font-size: 1.05rem;
}

h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.82rem;
}

.plus {
  color: var(--plus);
}

.minus {
  color: var(--minus);
}

.zero {
  color: var(--muted);
}

.plus,
.minus,
.zero,
.amount-input,
.player-points,
.standing-points,
.catalog-value,
.shop-price,
time {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- ボタン・入力 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover:not(:disabled) {
  background: var(--surface-3);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.button-primary:hover:not(:disabled) {
  background: #ffdb6b;
}

.button-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.button-ghost {
  background: transparent;
  border-color: transparent;
}

.button-small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.85rem;
}

.button-block {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.icon-button:disabled {
  opacity: 0.35;
}

.text-input,
.amount-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #586178;
  border-radius: 10px;
  background: var(--bg);
}

.amount-input {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: right;
}

.unit-input {
  max-width: 120px;
}

textarea.text-input {
  resize: vertical;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.field-label {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.inline-label .amount-input {
  max-width: 180px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.form-error {
  margin: 0;
  min-height: 0;
  color: var(--minus);
  font-weight: 600;
}

.form-error:empty {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.inline-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-tools .amount-input {
  max-width: 150px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 600;
}

.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.quick-adds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-adds .chip {
  min-height: 32px;
  font-size: 0.85rem;
  padding: 0 10px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.seg {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.seg + .seg {
  border-left: 1px solid var(--line);
}

.seg.on {
  background: var(--accent);
  color: var(--accent-text);
}

.signed-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.badge-live {
  border-color: var(--accent);
  color: var(--accent);
}

.empty {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.empty p {
  margin: 4px 0;
}

/* ---------------------------------------------------------------- 上のバー */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  background: rgba(18, 20, 25, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  gap: 4px;
}

@media (max-width: 560px) {
  .brand {
    font-size: 0;
    gap: 0;
  }

  .topbar-title {
    color: var(--text);
  }
}

/* ---------------------------------------------------------------- 共通のページ */

.page {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head p {
  margin: 0;
}

/* ---------------------------------------------------------------- 合言葉 */

.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 16px;
}

.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 12px;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}

.login-card p {
  margin: 0;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.game-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.game-card:hover {
  border-color: var(--accent);
}

.game-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

/* ---------------------------------------------------------------- ゲームの作成・設定 */

/* ---------------------------------------------------------------- ダイアログ */

.sheet {
  width: min(520px, 100%);
  max-width: 100%;
  max-height: min(92dvh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
}

.sheet-wide {
  width: min(760px, 100%);
}

.sheet::backdrop {
  background: rgba(5, 6, 10, 0.66);
}

@media (max-width: 640px) {
  .sheet,
  .sheet-wide {
    width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  font-size: 1.1rem;
}

.sheet-body {
  display: grid;
  gap: 12px;
  padding: 14px 18px max(18px, env(safe-area-inset-bottom));
}

.sheet-body p {
  margin: 0;
}

.confirm-text {
  white-space: pre-wrap;
}

/* ---------------------------------------------------------------- トースト */

/* スマホでは画面の上に出す（下はマスのボタンがあるため隠さない） */
.toast-host {
  position: fixed;
  inset: 62px 0 auto 0;
  width: min(520px, calc(100% - 24px));
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  display: grid;
  gap: 8px;
}

.toast-host:not(:popover-open) {
  display: none;
}

@media (min-width: 1000px) {
  .toast-host {
    inset: auto 0 24px 0;
  }
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #2a2f3c;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-weight: 600;
}

.toast-error {
  border-color: var(--danger);
}

.toast-action {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.viewer {
  min-height: 100dvh;
}

.viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 6px;
  width: min(900px, 100%);
  margin: 0 auto;
}

.viewer-head h1 {
  font-size: 1.3rem;
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--plus);
  box-shadow: 0 0 0 4px rgba(95, 216, 150, 0.2);
}

.live-dot.off {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 97, 97, 0.2);
}

.viewer-main {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: grid;
  gap: 12px;
}

/* ================================================================ ここから数字ゲーム計算機の部品 */

:root {
  /* 数字 1〜5 の色（小さい数字ほど寒色、大きい数字ほど暖色） */
  --n1: #7d9bff;
  --n2: #4fd1d9;
  --n3: #7ddc8f;
  --n4: #ffbe5c;
  --n5: #ff7a6b;
  --num-text: #10131a;
  --big: #c08bff;
  --big-text: #1a0f26;
  --accuse: #5fb4ff;
  --accuse-text: #08182a;
  --ban: #ff9b6b;
  --coop: #5fd896;
}

.n1 {
  --num: var(--n1);
}

.n2 {
  --num: var(--n2);
}

.n3 {
  --num: var(--n3);
}

.n4 {
  --num: var(--n4);
}

.n5 {
  --num: var(--n5);
}

/* ---------------------------------------------------------------- ブランド（1〜5 の棒） */

.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}

.brand-mark span {
  width: 5px;
  border-radius: 2px;
  background: var(--num);
}

.brand-mark .n1 {
  height: 8px;
}

.brand-mark .n2 {
  height: 11px;
}

.brand-mark .n3 {
  height: 14px;
}

.brand-mark .n4 {
  height: 17px;
}

.brand-mark .n5 {
  height: 20px;
}

.login-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.login-mark .brand-mark {
  height: 44px;
  gap: 5px;
}

.login-mark .brand-mark span {
  width: 12px;
  border-radius: 4px;
}

.login-mark .n1 {
  height: 16px;
}

.login-mark .n2 {
  height: 23px;
}

.login-mark .n3 {
  height: 30px;
}

.login-mark .n4 {
  height: 37px;
}

.login-mark .n5 {
  height: 44px;
}

/* ---------------------------------------------------------------- 数字の札・キー */

.num {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--num);
  color: var(--num-text);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.num-sm {
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.num-pad {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.num-key {
  min-height: 48px;
  border: 2px solid color-mix(in srgb, var(--num) 55%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--num) 14%, var(--surface-2));
  color: var(--num);
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
}

.num-key:hover:not(:disabled) {
  background: color-mix(in srgb, var(--num) 26%, var(--surface-2));
}

.num-key.on {
  border-color: var(--num);
  background: var(--num);
  color: var(--num-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--num) 35%, transparent);
}

.num-key.banned {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.num-pad-sm {
  gap: 4px;
}

.num-pad-sm .num-key {
  min-height: 36px;
  font-size: 1.05rem;
  border-radius: 9px;
}

/* ---------------------------------------------------------------- バッジ */

.badge-big {
  border-color: var(--big);
  color: var(--big);
}

.badge-accuse {
  border-color: var(--accuse);
  color: var(--accuse);
}

.badge-ban {
  border-color: var(--ban);
  color: var(--ban);
}

.badge-coop {
  border-color: var(--coop);
  color: var(--coop);
}

.badge.used {
  opacity: 0.55;
}

.x-badge {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--big);
  color: var(--big-text);
  font-size: 0.78rem;
  font-weight: 900;
}

/* ---------------------------------------------------------------- GM の画面のレイアウト */

.game-main {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 12px 12px 32px;
  display: grid;
  gap: 14px;
  align-items: start;
}

.game-col {
  display: grid;
  gap: 14px;
  min-width: 0;
}

@media (min-width: 1000px) {
  .game-main {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    padding: 16px 20px 40px;
  }

  .game-main .panel-history {
    position: sticky;
    top: 70px;
    max-height: calc(100dvh - 86px);
    overflow: auto;
  }
}

.panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head .button-small {
  white-space: normal;
  text-align: right;
}

.panel > p {
  margin: 0;
}

/* ---------------------------------------------------------------- 進み具合 */

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 2px 2px 0;
}

.status-round {
  font-size: 1.15rem;
}

.progress {
  display: flex;
  flex: 1;
  min-width: 140px;
  gap: 4px;
}

.pip {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
}

.pip.done {
  background: var(--accent);
}

.pip.big {
  background: var(--big);
}

.pip.now {
  background: transparent;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---------------------------------------------------------------- 得点板 */

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.player-card {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}

.player-card.rank-1 {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

.pc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 6px;
  min-width: 0;
}

.pc-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-rank {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.rank-1 .pc-rank {
  color: var(--accent);
}

.pc-total {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.pc-total small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.pc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pc-reveal {
  min-height: 32px;
  padding: 0 6px;
  font-size: 0.78rem;
  white-space: normal;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .board {
    gap: 12px;
  }

  .player-card {
    padding: 14px;
  }

  .pc-total {
    font-size: 2.3rem;
  }
}

/* ---------------------------------------------------------------- 結果 */

.result {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.result-coop {
  border-color: var(--coop);
  background: color-mix(in srgb, var(--coop) 10%, var(--surface));
}

.coop-message {
  margin: 0;
}

.coop-message strong {
  color: var(--coop);
}

.podium {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.podium-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}

.podium-rank {
  font-weight: 800;
  color: var(--muted);
}

.podium-row.rank-1 .podium-rank {
  color: var(--accent);
}

.podium-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-total {
  font-size: 1.3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.podium-total small {
  margin-left: 2px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- ラウンドの入力 */

.round-form {
  display: grid;
  gap: 12px;
}

.rf-rows {
  display: grid;
  gap: 10px;
}

.rf-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  min-width: 0;
}

.rf-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.rf-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rf-options:empty {
  display: none;
}

.chip-big.on {
  background: var(--big);
  border-color: var(--big);
  color: var(--big-text);
}

.chip:disabled,
.seg:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.segmented.seg-sm {
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
}

.seg-sm .seg {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg-sm .seg.on {
  background: var(--accuse);
  color: var(--accuse-text);
}

.rf-accuse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--accuse);
  border-radius: 10px;
}

.rf-accuse .num-pad {
  grid-template-columns: repeat(5, 38px);
}

.rf-preview {
  display: grid;
  gap: 6px;
}

.rf-preview p {
  margin: 0;
}

.rf-multiplier {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--big);
}

.rf-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.rf-result-cell {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg);
  min-width: 0;
}

.rf-result-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  font-weight: 900;
}

.rf-accuse-result {
  font-size: 0.9rem;
  color: var(--muted);
}

.rf-accuse-result.hit {
  color: var(--accuse);
  font-weight: 700;
}

/* ---------------------------------------------------------------- 記録の表 */

.table-wrap {
  overflow-x: auto;
}

.history {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.history th,
.history td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.history thead th {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history .h-round {
  width: 44px;
  text-align: center;
}

.history th.h-round {
  font-weight: 800;
}

.h-row.is-big > * {
  background: color-mix(in srgb, var(--big) 9%, transparent);
}

.h-row .x-badge {
  display: block;
  width: fit-content;
  margin: 2px auto 0;
}

.round-edit {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-weight: 800;
  cursor: pointer;
}

.round-edit:hover {
  border-color: var(--accent);
}

.h-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-weight: 800;
}

.big-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--big);
  color: var(--big-text);
  font-size: 0.7rem;
  font-weight: 900;
}

.h-total {
  margin-top: 2px;
}

.h-sub td {
  padding-top: 0;
}

.h-row:has(+ .h-sub) > * {
  border-bottom: 0;
}

.h-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-left: 44px;
  font-size: 0.85rem;
}

.note-accuse {
  color: var(--muted);
}

.note-accuse.hit {
  color: var(--accuse);
  font-weight: 700;
}

.h-reveal td {
  font-size: 0.88rem;
  color: var(--muted);
}

.reveal-icon {
  margin-right: 6px;
}

.h-reveal .muted {
  margin-left: 6px;
}

.h-empty {
  padding: 14px 4px;
  text-align: center;
}

.history tfoot th,
.history tfoot td {
  border-bottom: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

/* ---------------------------------------------------------------- 順位開示のダイアログ */

.reveal-who {
  text-align: center;
  font-weight: 700;
}

.reveal-rank {
  text-align: center;
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.2;
}

/* ---------------------------------------------------------------- ゲームの作成・設定 */

.name-rows {
  display: grid;
  gap: 8px;
}

.form-section.first {
  padding-top: 0;
  border-top: 0;
}

.rules-details summary {
  cursor: pointer;
  font-weight: 700;
}

.rules-details[open] summary {
  margin-bottom: 6px;
}

.rules-editor {
  display: grid;
  gap: 14px;
}

.rule-group {
  display: grid;
  gap: 6px;
}

.rule-group h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 10px;
}

.rule-label {
  display: grid;
  font-size: 0.92rem;
}

.small-input {
  min-height: 38px;
  font-size: 1rem;
}

.inline-tools .text-input {
  min-width: 0;
}

/* 「密告なし」「密告 済」は選んでいても色を付けない */
.seg-sm .seg.seg-none.on {
  background: var(--surface-3);
  color: var(--text);
}
