/* Settings panel, proposal banner, lobby and room-page extras.
   Uses the tokens defined in table.css. */

/* the settings panel uses (almost) the whole window, at a fixed size: switching sections never resizes it */
.yy-dialog-wide { width: min(1600px, calc(100vw - 24px)); max-width: none; height: calc(100dvh - 24px); max-height: none; margin: auto; }
.sp { display: flex; flex-direction: column; height: 100%; }
.sp-head { padding: 12px 22px 10px; border-bottom: 1px solid var(--gold-line); }
.sp-head h2 { margin: 0 6px 0 0; font-family: var(--font-mincho); font-weight: 800; font-size: 20px; letter-spacing: 0.1em; white-space: nowrap; }
.sp-base-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sp-sub-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 28px; margin-top: 8px; }
.sp-sub-row:empty { display: none; }
.sp-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.sp-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px 10px 12px; overflow-y: auto; border-right: 1px solid oklch(40% 0.03 70 / 0.35); }
.sp-tab {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px;
  background: none; color: var(--text-dim); font-family: var(--font-mincho); font-weight: 800; font-size: 14.5px; text-align: left; cursor: pointer;
}
.sp-tab:hover { background: oklch(100% 0 0 / 0.05); color: var(--text); }
.sp-tab.on { background: oklch(80% 0.12 85 / 0.12); color: var(--gold-hi); box-shadow: inset 3px 0 0 var(--gold); }
.sp-tab:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: -2px; }
.sp-tab-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--ink); font-family: var(--font-gothic); font-size: 11px; line-height: 18px; text-align: center; }
.sp-total { margin-left: auto; font-size: 13px; color: var(--text-dim); }
.sp-total b { color: var(--gold); font-family: var(--font-mincho); }
.sp-bundle { display: inline-flex; align-items: center; gap: 6px; }
.sp-bundle i { font-style: normal; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.sp-bundle select { max-width: 14em; font-size: 12.5px; padding: 4px 6px; }
.sp-bundle-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--text-dim); }
.sp-extra { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sp-extra label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text-dim); }
.sp-extra label.sp-inline-check { justify-content: flex-end; }
.sp-inline-check span { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; color: var(--text); font-size: 12.5px; cursor: pointer; }
.sp-inline-check input { width: 16px; height: 16px; accent-color: var(--gold); }
.sp-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.sp-saved .btn { padding: 4px 10px; font-size: 12px; }
.sp-saved select, .sp-saved input { font-size: 12px; padding: 4px 6px; }
.sp-body { overflow: auto; padding: 8px 24px 16px; min-height: 0; }
.sp-note { margin: 6px 0 8px; font-size: 12.5px; color: var(--gold); }
.sp-foot { display: flex; align-items: center; gap: 10px; padding: 10px 22px 12px; border-top: 1px solid var(--gold-line); }
.sp-msg { flex: 1; font-size: 12.5px; color: var(--text-dim); }
.sp-msg.err { color: oklch(78% 0.15 35); font-weight: 700; }
.sp-foot.is-asking { background: oklch(23% 0.05 38); }
.sp-ask { font-weight: 700; color: oklch(84% 0.1 45); }

.sp-group[hidden] { display: none !important; }
.sp-ghead { display: flex; align-items: center; gap: 10px; padding: 6px 2px 10px; }
.sp-gname { margin: 0; font-family: var(--font-mincho); font-weight: 800; font-size: 18px; letter-spacing: 0.06em; }
.sp-count { font-family: var(--font-gothic); font-size: 11.5px; font-weight: 700; color: var(--ink); background: var(--gold); padding: 1px 8px; border-radius: 999px; }
.sp-reset { margin-left: auto; font-size: 11.5px; padding: 3px 9px; font-family: var(--font-gothic); font-weight: 400; }
.sp-rows { display: flex; flex-direction: column; padding: 0 0 10px; }
.sp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 18px; padding: 7px 8px; border-radius: 4px; }
.sp-row:nth-child(odd) { background: oklch(100% 0 0 / 0.02); }
.sp-row.is-mod { box-shadow: inset 3px 0 0 var(--gold); background: oklch(80% 0.12 85 / 0.06); }
.sp-row.is-pending .sp-name { color: var(--gold-hi); }
.sp-row.is-locked { opacity: 0.55; }
.sp-row[hidden] { display: none; }
/* a sub-option (dependsOn) hangs under its parent */
.sp-row.is-sub { margin-left: 18px; border-left: 1px dashed oklch(70% 0.04 85 / 0.4); }
.sp-label { display: flex; flex-direction: column; min-width: 0; }
.sp-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); display: inline-block; }
.sp-desc { font-size: 11.5px; color: var(--text-dim); }
.sp-base { color: var(--gold-dim); margin-left: 4px; }
.sp-lock { color: oklch(78% 0.1 40); margin-left: 4px; font-size: 11px; font-family: var(--font-gothic); font-weight: 700; }
.sp-ctl { display: flex; justify-content: flex-end; }

.sp-step { display: inline-flex; align-items: stretch; border: 1px solid oklch(45% 0.03 70 / 0.6); border-radius: 4px; overflow: hidden; }
.sp-step input { width: 56px; text-align: center; border: 0; border-radius: 0; font-family: var(--font-mincho); font-weight: 800; font-size: 16px; -moz-appearance: textfield; }
.sp-step input::-webkit-inner-spin-button, .sp-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sp-btn { width: 32px; border: 0; background: oklch(24% 0.02 50); color: var(--gold-hi); cursor: pointer; font-size: 16px; }
.sp-btn:hover:not(:disabled) { background: oklch(32% 0.03 60); }
.sp-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sp-pair { display: flex; gap: 12px; }
.sp-pair label { display: flex; align-items: center; gap: 5px; }
.sp-pair i { font-style: normal; font-size: 11px; color: var(--text-dim); }
.sp-list { width: 120px; text-align: center; }
.sp-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid oklch(45% 0.03 70 / 0.6); border-radius: 4px; overflow: hidden; }
.sp-seg label { position: relative; cursor: pointer; }
.sp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.sp-seg span { display: block; padding: 5px 11px; font-size: 12.5px; color: var(--text-dim); border-left: 1px solid oklch(45% 0.03 70 / 0.4); white-space: nowrap; }
.sp-seg label:first-child span { border-left: 0; }
.sp-seg label.on span { background: linear-gradient(170deg, var(--gold-hi), var(--gold)); color: var(--ink); font-weight: 700; }
.sp-seg label:hover:not(.on) span { color: var(--text); background: oklch(100% 0 0 / 0.05); }
.sp-seg input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: -2px; }
.sp-seg input:disabled + span { cursor: not-allowed; }
.sp-toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.sp-toggle input { position: absolute; opacity: 0; }
.sp-knob { width: 44px; height: 24px; border-radius: 12px; background: oklch(28% 0.02 260); box-shadow: inset 0 0 0 1px oklch(50% 0.03 260 / 0.6); position: relative; transition: background-color var(--t-fast); }
.sp-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-dim); transition: transform var(--t-mid) var(--ease-out), background-color var(--t-fast); }
.sp-toggle input:checked + .sp-knob { background: oklch(52% 0.08 80); }
.sp-toggle input:checked + .sp-knob::after { transform: translateX(20px); background: var(--gold-hi); }
.sp-toggle input:focus-visible + .sp-knob { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.sp-toggle-text { font-size: 12.5px; min-width: 2.5em; }

.sp-table-wrap { overflow-x: auto; padding: 0 0 12px; }
/* the table fits once the dialog is wide; without its own scroller the sticky header follows the dialog scroll */
@media (min-width: 640px) { .sp-table-wrap { overflow: visible; } }
.sp-table { border-collapse: collapse; font-size: 13px; }
.sp-table th, .sp-table td { padding: 3px 6px; border-bottom: 1px solid oklch(40% 0.02 260 / 0.3); text-align: center; }
.sp-table thead th { font-family: var(--font-mincho); color: var(--gold-dim); font-weight: 800; position: sticky; top: -8px; z-index: 1; background: oklch(16% 0.012 40); } /* -8px: .sp-body top padding */
.sp-table tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.sp-card-id { display: inline-block; width: 3.4em; color: var(--text-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.sp-reigu { font-style: normal; font-size: 10px; color: var(--amber); margin-left: 6px; }
.sp-table input { width: 52px; text-align: center; font-family: var(--font-mincho); font-weight: 800; padding: 3px 4px; }
.sp-table td.is-mod input { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); color: var(--gold-hi); background: oklch(30% 0.05 80 / 0.4); }
.sp-table td.na { color: oklch(50% 0.02 260); }

/* card section: pick, change all at once, paint the range */
.ce-bulk { margin: 0 0 12px; padding: 10px 12px; border: 1px solid oklch(50% 0.05 75 / 0.45); border-radius: 6px; background: oklch(22% 0.02 55 / 0.55); }
.ce-bulk.is-off .ce-bulk-stats, .ce-bulk.is-off .ce-bulk-foot { opacity: 0.55; }
.ce-bulk.is-closed { padding: 4px 12px; }
.ce-bulk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ce-bulk-toggle { display: inline-flex; align-items: baseline; gap: 8px; min-height: 32px; padding: 4px 6px 4px 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.ce-bulk-toggle:hover .ce-bulk-title { text-decoration: underline; text-underline-offset: 3px; }
.ce-bulk-toggle:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 3px; }
.ce-bulk-caret { color: var(--gold); font-size: 12px; }
.ce-bulk-hint { font-size: 11.5px; color: var(--text-dim); }
.ce-bulk-title { font-family: var(--font-mincho); font-weight: 800; color: var(--gold-hi); }
.ce-filter-rows { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.ce-filter-rows > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ce-flabel { width: 6.5em; font-size: 12px; color: var(--text-dim); }
.ce-chip { display: inline-flex; align-items: baseline; gap: 4px; min-width: 34px; justify-content: center; padding: 3px 10px; border-radius: 999px; border: 1px solid oklch(50% 0.04 75 / 0.6); background: oklch(22% 0.02 50); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.ce-chip small { font-size: 10px; color: var(--text-dim); }
.ce-chip:hover:not(:disabled) { border-color: var(--gold); }
.ce-chip.on { background: linear-gradient(170deg, var(--gold-hi), var(--gold)); color: var(--ink); border-color: var(--gold-hi); font-weight: 700; }
.ce-chip.on small { color: oklch(35% 0.05 70); }
.ce-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.ce-quick { padding-left: calc(6.5em + 4px); }
/* 初手の見込み: two numbers per side, the one the talk is about (2体) in bold */
.ce-odds { margin: 4px 0 12px; padding: 10px 14px; border: 1px solid var(--gold-line); border-radius: 6px; background: oklch(16% 0.014 260 / 0.6); width: fit-content; max-width: 100%; }
.ce-odds h4 { margin: 0 0 6px; font-size: 14px; }
.ce-odds h4 small { margin-left: 8px; font-weight: 400; font-size: 11.5px; color: var(--text-dim); }
.ce-odds table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ce-odds th, .ce-odds td { padding: 2px 12px 2px 0; text-align: left; font-size: 13.5px; }
.ce-odds thead th { font-weight: 400; font-size: 11.5px; color: var(--text-dim); }
.ce-odds td b { font-size: 16px; color: var(--gold-hi); }
.ce-odds small { margin-left: 4px; font-size: 11px; color: var(--text-dim); }
.ce-deck-total { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.ce-deck-total b { font-size: 17px; color: var(--gold, currentColor); margin: 0 1px; }
.ce-deck-total small { margin-left: 3px; font-size: 11px; }
.ce-odds-deck { margin: 6px 0 0; font-size: 11.5px; color: var(--text-dim); }
.ce-quick .btn { padding: 3px 9px; font-size: 12px; }
.ce-fhint { margin-left: 6px; font-size: 11px; color: var(--text-dim); }
.ce-selcount { margin-left: auto; font-size: 12.5px; color: var(--text-dim); }
.ce-selcount b { color: var(--gold-hi); font-family: var(--font-mincho); font-size: 16px; margin-right: 2px; }
.ce-bulk-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 6px 12px; margin: 8px 0 6px; }
.ce-bulk-stat { display: flex; flex-direction: column; gap: 3px; }
.ce-bulk-label { font-size: 12px; color: var(--text-dim); }
/* 霊力価: the print kit's blue flame in the table head and before the bulk bar's label */
.ce-flame { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.ce-bulk-label .ce-flame { margin-right: 2px; }
.ce-th-flame .ce-flame { display: block; width: 18px; height: 18px; margin: 0 auto; }
.ce-bulk-btns { display: inline-flex; align-items: stretch; border: 1px solid oklch(45% 0.03 70 / 0.6); border-radius: 4px; overflow: hidden; width: fit-content; }
.ce-bulk-btns .sp-btn { width: auto; min-width: 34px; padding: 3px 7px; font-size: 13px; }
.ce-bulk-btns input { width: 48px; border: 0; border-radius: 0; text-align: center; font-family: var(--font-mincho); font-weight: 800; }
.ce-bulk-btns .ce-set { font-size: 12px; }
.ce-bulk-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.ce-bulk-foot .btn { font-size: 12px; padding: 4px 10px; }

.ce-layout { display: grid; grid-template-columns: max-content minmax(470px, 560px); justify-content: start; align-items: start; gap: 20px; }
.ce-layout > .sp-table-wrap { padding-left: 0; }
.ce-table .ce-check { width: 26px; padding: 0 2px; }
.ce-table .ce-check input { width: 16px; height: 16px; accent-color: var(--gold); }
.ce-table tr.is-focus > * { background: oklch(80% 0.12 85 / 0.1); }
.ce-table tr.is-focus th { box-shadow: inset 3px 0 0 var(--gold); }
.ce-name { display: flex; align-items: center; gap: 2px; width: 100%; padding: 2px 4px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; border-radius: 3px; white-space: nowrap; }
.ce-name:hover { background: oklch(100% 0 0 / 0.06); color: var(--gold-hi); }
.ce-shape-cell { padding: 2px 4px; }
.ce-mini { display: inline-block; padding: 2px; border-radius: 3px; background: var(--washi); line-height: 0; }
.ce-mini .fu-range { width: 30px; }
.ce-mini.is-mod { box-shadow: 0 0 0 2px var(--gold); }

.ce-editor { position: sticky; top: -8px; padding: 10px 12px 12px; border: 1px solid var(--gold-line); border-radius: 6px; background: oklch(17% 0.014 45 / 0.97); box-shadow: 0 12px 28px oklch(0% 0 0 / 0.45); }
.ce-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ce-head b { font-family: var(--font-mincho); font-size: 17px; }
.ce-body { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 12px; align-items: start; }
.ce-preview { width: 196px; min-height: 300px; display: grid; place-items: start center; }
.ce-preview .fu-lg { --fu-w: 192px; }
.ce-note { margin: 0; font-size: 12.5px; }
.ce-shape { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ce-tools { display: flex; gap: 4px; }
.ce-tool { flex: 1; padding: 5px 0; border-radius: 4px; border: 1px solid oklch(45% 0.03 70 / 0.6); background: oklch(22% 0.02 50); color: var(--text-dim); font: inherit; font-size: 12.5px; cursor: pointer; }
.ce-tool.on { color: var(--ink); font-weight: 700; }
.ce-tool-attack.on { background: var(--sym-verm); color: var(--washi-hi); }
.ce-tool-blind.on { background: var(--sym-khaki); }
.ce-tool-gap.on { background: var(--sym-amber); }
.ce-tool-erase.on { background: var(--text-dim); }
.ce-tool:disabled { opacity: 0.4; cursor: not-allowed; }
.ce-grid { display: grid; grid-template-columns: repeat(5, 34px); grid-template-rows: repeat(5, 34px); gap: 3px; width: fit-content; }
.ce-cell { display: grid; place-items: center; border-radius: 3px; border: 1px solid var(--sym-ink); background: var(--washi-hi); color: var(--sym-ink); font-size: 18px; font-weight: 800; padding: 0; cursor: pointer; }
.ce-cell.ce-outer { background: oklch(88% 0.02 85); border-style: dashed; }
.ce-cell:hover:not(:disabled) { outline: 2px solid var(--gold-hi); outline-offset: -1px; }
/* attack = a vermilion square at half the cell, gap = the provisional amber ring round it, blind = khaki, self = ink */
.ce-cell.ce-attack { background: linear-gradient(var(--sym-verm), var(--sym-verm)) center / 50% 50% no-repeat, var(--washi-hi); }
.ce-cell.ce-gap { background: linear-gradient(var(--sym-verm), var(--sym-verm)) center / 50% 50% no-repeat, var(--washi-hi); box-shadow: inset 0 0 0 3px var(--washi-hi), inset 0 0 0 5.5px var(--sym-amber); }
.ce-cell.ce-blind { background: var(--sym-khaki); color: oklch(30% 0.02 60); }
.ce-cell.ce-ctr { box-shadow: inset 0 0 0 3px var(--sym-sage); }
.ce-cell.ce-gap.ce-ctr { box-shadow: inset 0 0 0 3px var(--sym-sage), inset 0 0 0 5.5px var(--sym-amber); }
.ce-tool-counter.on { background: var(--sym-sage); }
.ce-cell.ce-self { background: var(--sym-ink); border-color: var(--gold); color: var(--washi-hi); cursor: default; font-size: 14px; }
.ce-cell:disabled { cursor: not-allowed; }
.ce-hint { margin: 0; font-size: 11px; color: var(--text-dim); }
.ce-text { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 8px; margin: 0; font-size: 12px; }
.ce-text dt { color: var(--text-dim); }
.ce-text dd { margin: 0; }
.ce-rows { display: flex; flex-direction: column; gap: 5px; }
.ce-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-dim); }
.ce-seg button { display: block; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.ce-seg button:disabled { cursor: not-allowed; }
.ce-seg button:focus-visible span { outline: 2px solid var(--gold-hi); outline-offset: -2px; }

@media (max-width: 760px), (max-height: 520px) {
  .yy-dialog-wide { width: calc(100vw - 8px); height: calc(100dvh - 8px); }
  .sp-head { padding: 8px 10px 6px; }
  .sp-head h2 { font-size: 16px; flex-basis: 100%; }
  .sp-body { padding: 6px 10px 12px; }
  .sp-foot { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .sp-msg { flex-basis: 100%; order: -1; }
  .sp-row { grid-template-columns: minmax(0, 1fr); }
  .sp-ctl { justify-content: flex-start; }
  .sp-seg span { padding: 5px 8px; }
  /* on a phone the whole panel scrolls (the header scrolls away), the tabs and the buttons stay */
  .sp { overflow-y: auto; }
  .sp-main { display: block; flex: none; }
  .sp-nav { position: sticky; top: 0; z-index: 3; background: oklch(17% 0.015 45); }
  .sp-body { overflow: visible; }
  .sp-foot { position: sticky; bottom: 0; z-index: 3; margin-top: auto; background: oklch(15% 0.013 42); }
  .sp-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid oklch(40% 0.03 70 / 0.35); padding: 6px 10px; }
  .sp-tab { width: auto; white-space: nowrap; }
}

/* card editor at phone widths (360-390px): preview on top, a finger-sized grid, rows that wrap */
@media (max-width: 760px) {
  .ce-editor { padding: 8px; }
  .ce-head { flex-wrap: wrap; }
  .ce-head .sp-reset { margin-left: auto; }
  .ce-body { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ce-preview { width: 100%; min-height: 0; place-items: start center; }
  .ce-preview .fu-lg { --fu-w: min(230px, 64vw); }
  .ce-grid { grid-template-columns: repeat(5, 42px); grid-template-rows: repeat(5, 42px); gap: 4px; margin: 0 auto; }
  .ce-tools { flex-wrap: wrap; }
  .ce-tool { min-height: 36px; }
  .ce-rows > div { flex-wrap: wrap; justify-content: flex-start; }
  .ce-rows > div > span:first-child { flex: 0 0 6.5em; white-space: nowrap; }
  .ce-seg button span, .ce-rows .sp-seg span { padding: 7px 10px; }
  .ce-filter-rows > div { row-gap: 6px; }
  .ce-flabel { width: 100%; }
  .ce-quick { padding-left: 0; }
  .ce-chip { min-height: 32px; }
}

/* the table beside the editor needs about 1340px (nav + table + editor): narrower, the editor
   goes above the table instead of running off the right edge */
@media (max-width: 1339.98px) {
  .ce-layout { grid-template-columns: minmax(0, 1fr); }
  .ce-editor { position: static; order: -1; }
}

/* diff list / proposal */
.diff-list { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.diff-list li { padding: 1px 0; }
.diff-dialog { min-width: min(420px, 90vw); }
.badge-pack { color: var(--text-dim); margin-left: 6px; }
.badge-plain { color: var(--text-dim); margin-left: 6px; }
.rules-badge .mod { margin-left: 6px; }

.yy-slot-notice { position: relative; z-index: 12; flex: 0 0 auto; width: min(900px, 100%); margin: 0 auto 6px; }
.proposal {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head btns" "list list"; align-items: center; gap: 2px 12px;
  padding: 6px 12px; border-radius: 6px; background: linear-gradient(180deg, oklch(26% 0.04 70 / 0.97), oklch(18% 0.02 50 / 0.97));
  border: 1px solid var(--gold); box-shadow: 0 8px 22px oklch(0% 0 0 / 0.5);
}
.proposal-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 12.5px; min-width: 0; }
.proposal-head b { font-family: var(--font-mincho); font-size: 15px; color: var(--gold-hi); }
/* the owner replaced a proposal that was still waiting: the other seat is answering something new */
.proposal-replaced { grid-column: 1 / -1; margin: 2px 0 0; font-size: 12px; font-weight: 700; color: oklch(84% 0.12 45); }
/* the waiting card of a tab that mirrors a seat another tab of this browser holds */
.waiting-second { margin: 10px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--text-dim); }
.waiting-second[hidden] { display: none; }
.waiting-second .btn { margin-top: 4px; }
.proposal .diff-list { grid-area: list; display: flex; flex-wrap: wrap; gap: 0 14px; margin: 2px 0 0; padding: 0; list-style: none; font-size: 12.5px; max-height: 3.4em; overflow-y: auto; scrollbar-width: thin; }
.proposal .diff-list li { padding: 0; }
.proposal .diff-list li::before { content: "・"; color: var(--gold-dim); }
.proposal > p { grid-area: list; margin: 0; font-size: 12.5px; }
.proposal-btns { grid-area: btns; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 8px; }
.proposal-btns .btn { padding: 5px 14px; }
.proposal-btns:empty { display: none; }
/* the seat that has to answer: a slow gold pulse around the banner */
.proposal:has([data-proposal="accept"])::after {
  content: ""; position: absolute; inset: -3px; border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--gold-hi), 0 0 18px 2px oklch(80% 0.12 85 / 0.6); animation: proposal-pulse 1.6s ease-in-out infinite;
}
.proposal:has([data-proposal="accept"]) .proposal-head::before { content: "返答してください"; order: 3; font-size: 11px; font-weight: 700; color: var(--ink); background: var(--gold); padding: 0 6px; border-radius: 2px; }
@keyframes proposal-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
/* the proposer's short notice of the answer: one slim line, green when accepted, vermilion when declined */
.proposal.proposal-answer { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head btns"; padding: 3px 6px 3px 10px; box-shadow: none; }
.proposal-answer .proposal-head b { font-size: 13.5px; }
.proposal-answer .proposal-head b::before { display: inline-block; width: 1.2em; font-family: var(--font-gothic); }
.proposal-answer[data-answer="accepted"] { border-color: oklch(70% 0.1 165 / 0.8); background: linear-gradient(180deg, oklch(25% 0.045 165 / 0.95), oklch(17% 0.025 170 / 0.95)); }
.proposal-answer[data-answer="accepted"] .proposal-head b { color: var(--jade); }
.proposal-answer[data-answer="accepted"] .proposal-head b::before { content: "✓"; }
.proposal-answer[data-answer="declined"] { border-color: oklch(62% 0.14 35 / 0.8); background: linear-gradient(180deg, oklch(25% 0.05 35 / 0.95), oklch(17% 0.03 35 / 0.95)); }
.proposal-answer[data-answer="declined"] .proposal-head b { color: oklch(80% 0.12 40); }
.proposal-answer[data-answer="declined"] .proposal-head b::before { content: "✕"; }
.proposal-answer .proposal-btns .btn { padding: 2px 10px; font-size: 12px; }
/* phones (upright or sideways): full width with a small side margin */
@media (max-width: 700px), (max-height: 520px) and (min-aspect-ratio: 4/3) {
  .yy-slot-notice { width: auto; margin: 4px 6px 0; }
}
/* sideways phones: one scrolling line of changes, and the hand shrinks while a banner is up */
@media (max-height: 520px) and (min-aspect-ratio: 4/3) {
  .proposal { padding: 3px 8px; gap: 0 8px; }
  .proposal-head { font-size: 11.5px; }
  .proposal-head b { font-size: 13px; }
  .proposal .diff-list { max-height: 1.7em; font-size: 11.5px; }
  .proposal-btns .btn { padding: 3px 10px; font-size: 12px; }
  .yy:has(.yy-slot-notice > .proposal:not(.proposal-answer)) .hand-card { zoom: 0.72; }
}
@media (max-width: 700px) {
  .proposal { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "list" "btns"; padding: 6px 8px; }
  .proposal-btns { justify-content: flex-start; }
  .proposal-btns .muted { flex-basis: 100%; font-size: 12px; }
  .proposal.proposal-answer { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head btns"; padding: 3px 6px; }
}

/* room page */
.room-brand { align-items: center; }
.room-brand a.brand-mark { text-decoration: none; }
.room-code { font-family: var(--font-mincho); font-weight: 800; font-size: 20px; letter-spacing: 0.18em; color: var(--gold-hi); }
.room-seats { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.seat-dot { width: 10px; height: 10px; border: 1.5px solid; opacity: 0.45; }
.seat-dot.o0 { border-color: var(--p0); border-radius: 1px; }
.seat-dot.o1 { border-color: var(--p1); border-radius: 50%; }
.seat-dot.on { opacity: 1; }
.seat-dot.o0.on { background: var(--p0); }
.seat-dot.o1.on { background: var(--p1); }
.room-you { font-size: 12px; color: var(--text-dim); }
.lbl-short { display: none; }
@media (max-width: 700px) { .lbl-long { display: none; } .lbl-short { display: inline; } }
.conn { position: fixed; right: 12px; bottom: 8px; z-index: 50; margin: 0; font-size: 11px; color: var(--text-dim); pointer-events: none; }
.conn:empty { display: none; }
.conn.bad { color: oklch(80% 0.14 40); font-weight: 700; }
/* over the hand on a phone: on its own dark pill, so it reads and the card text under it does not bleed through */
.conn.bad { max-width: calc(100vw - 24px); padding: 2px 9px; border-radius: 999px; background: oklch(12% 0.012 260 / 0.94); border: 1px solid oklch(62% 0.12 40 / 0.6); }
/* a broken connection is not a footnote: top centre, readable, while the table under it is dimmed and still */
.conn.bad { top: 8px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: max-content; padding: 6px 14px; font-size: 13.5px; box-shadow: 0 8px 22px oklch(0% 0 0 / 0.55); }
/* the other seat lost its connection: said under the top bar, so a long wait is not a mystery */
.away { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 49; margin: 0; width: max-content; max-width: calc(100vw - 24px);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: oklch(90% 0.08 85); background: oklch(14% 0.015 260 / 0.94);
  border: 1px solid var(--gold-line); box-shadow: 0 8px 22px oklch(0% 0 0 / 0.55); pointer-events: none; }
.away[hidden] { display: none; }
#table.is-offline { filter: saturate(0.35) brightness(0.62); pointer-events: none; transition: filter 0.3s; }
/* the room is gone for good: nothing on the table can be answered any more */
.gone { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: oklch(8% 0.01 260 / 0.78); backdrop-filter: blur(3px); }
.gone[hidden] { display: none; }
.gone-code b { font-family: var(--font-mincho); font-size: 24px; letter-spacing: 0.22em; color: var(--gold-hi); }
.gone-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 0; }
.gone-actions .btn { min-height: 44px; min-width: 140px; display: inline-grid; place-items: center; text-decoration: none; }
.gone .waiting-card a.btn-gold { color: var(--ink, oklch(15% 0.02 60)); }
/* a message, not a control: taps go through to the board and plates under it */
.page-error { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 60; margin: 0; padding: 8px 14px; border-radius: 6px; background: oklch(40% 0.14 30 / 0.95); color: oklch(97% 0.01 85); font-weight: 700; box-shadow: 0 10px 24px oklch(0% 0 0 / 0.5); pointer-events: none; width: max-content; max-width: calc(100vw - 16px); }
.page-error[hidden] { display: none; }
/* a phone has the board right under the plates: say it over the plates, not over the top row of the board */
@media (max-width: 700px) { .page-error { top: 50px; font-size: 13px; } }

.waiting { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.waiting[hidden] { display: none; }
.waiting-card { width: min(560px, 100%); padding: 28px 30px; text-align: center; border-radius: 10px; background: linear-gradient(170deg, oklch(21% 0.02 50), oklch(14% 0.012 40)); border: 1px solid var(--gold-line); box-shadow: 0 30px 80px oklch(0% 0 0 / 0.6); }
.waiting-card h1 { margin: 12px 0 4px; font-family: var(--font-mincho); font-size: 24px; letter-spacing: 0.12em; }
/* a phone: the heading on one line, not with its last character alone on the next */
@media (max-width: 420px) { .waiting-card { padding: 24px 18px; } .waiting-card h1 { font-size: 19px; letter-spacing: 0.04em; } }
.waiting-code b { font-family: var(--font-mincho); font-size: 30px; letter-spacing: 0.25em; color: var(--gold-hi); }
.waiting-invite { display: flex; gap: 8px; margin: 12px 0; }
.waiting-invite input { flex: 1; min-width: 0; }
.waiting a { color: var(--gold); }

/* lobby extras (the page itself is the entry shell below) */
.lobby-code { font-family: var(--font-mincho); font-weight: 800; font-size: 34px; letter-spacing: 0.25em; color: var(--gold-hi); }
.lobby-created[hidden] { display: none; }
.join-row { display: flex; flex-wrap: wrap; gap: 10px; }
.join-row .join-code { flex: 1 1 150px; min-width: 0; min-height: 44px; text-transform: uppercase; letter-spacing: 0.12em; }
.join-row .btn { flex: 0 0 auto; min-height: 44px; padding: 8px 18px; }
@media (max-width: 420px) {
  .join-row .join-code { flex-basis: 100%; }
  .join-row .btn { flex: 1 1 0; }
}

/* ------------------------------------------------------------ settings page */
/* /rules (play/rules.html): the panel is the page. The document scrolls: the
   header scrolls away, the tabs and the footer stick. The panel measures the
   sticky heights into --sp-stick (tab row on phones) and --sp-foot-h. */
.rp-body { height: auto; min-height: 100%; }
.rp-head { display: flex; align-items: center; gap: 14px; width: min(1600px, 100%); margin: 0 auto; padding: 14px 22px 12px; }
a.rp-home { flex: none; text-decoration: none; }
.rp-titles { flex: 1 1 auto; min-width: 0; }
.rp-titles h1 { margin: 0; font-family: var(--font-mincho); font-weight: 800; font-size: 22px; letter-spacing: 0.1em; line-height: 1.3; }
.rp-titles p { margin: 2px 0 0; font-size: 12.5px; }
.rp-titles p:empty { display: none; }
.rp-back { flex: none; min-height: 38px; padding: 7px 16px 7px 12px; }
.rp-back::before { content: "‹"; margin-right: 2px; color: var(--gold); font-size: 20px; line-height: 0.8; }
.rp-notice { width: min(1600px, 100%); margin: 0 auto; padding: 0 22px 10px; color: oklch(84% 0.12 45); font-size: 13px; font-weight: 700; }
.rp-notice[hidden] { display: none; }
/* the room's proposal still waiting for an answer, above the editor */
.rp-pending { width: min(1600px, 100%); margin: 0 auto 6px; padding: 14px 22px; box-sizing: border-box; }
.rp-pending[hidden] { display: none; }
.rp-pending h2 { margin: 0 0 4px; font-family: var(--font-mincho); font-weight: 800; font-size: 16px; letter-spacing: 0.06em; color: var(--gold); }
.rp-pending p { margin: 4px 0; font-size: 13px; }
.rp-pending-list { margin: 6px 0; padding: 8px 12px 8px 28px; border-radius: 6px; background: var(--lacquer); border: 1px solid var(--gold-line); font-size: 13px; }
.rp-pending-list li { margin: 2px 0; }
.rp-panel { width: min(1600px, 100%); margin: 0 auto; }
.rp-loading { margin: 0; padding: 24px 22px; }
.rp-message { margin: 12px 22px 40px; padding: 22px 26px; border-radius: 8px; background: var(--lacquer); border: 1px solid var(--gold-line); box-shadow: 0 14px 36px oklch(0% 0 0 / 0.4); }
.rp-message h2 { margin: 0 0 8px; font-family: var(--font-mincho); font-weight: 800; font-size: 19px; letter-spacing: 0.08em; }
.rp-message p { margin: 8px 0; }
a.btn { text-decoration: none; }

.sp-page { height: auto; border-top: 1px solid var(--gold-line); background: linear-gradient(180deg, oklch(17% 0.016 48 / 0.94), oklch(14% 0.012 40 / 0.9) 360px); overflow-anchor: none; }
.sp-page .sp-main { align-items: start; }
.sp-page .sp-nav { position: sticky; top: 0; align-self: start; max-height: calc(100dvh - var(--sp-foot-h, 64px)); border-right: 0; }
.sp-page .sp-body { overflow: visible; min-height: calc(100dvh - var(--sp-foot-h, 64px)); border-left: 1px solid oklch(40% 0.03 70 / 0.35); }
.sp-page .sp-foot { position: sticky; bottom: 0; z-index: 4; background: oklch(15% 0.013 42); box-shadow: 0 -12px 26px oklch(0% 0 0 / 0.4); }
.sp-page .sp-foot.is-asking { background: oklch(23% 0.05 38); }
.sp-page .sp-table thead th { top: var(--sp-stick, 0px); }
/* narrower, the table scrolls sideways in its own box: a sticky header could only stick inside
   that box (which never scrolls up and down) and would sit over the first rows. It stays put. */
@media (max-width: 639.98px) { .sp-table thead th, .sp-page .sp-table thead th { top: 0; } }
.sp-page .ce-editor { top: calc(var(--sp-stick, 0px) + 8px); }
/* anything scrolled into view (a focused field, the editor) stops clear of the sticky tabs and footer */
.sp-page :is(input, select, button, .ce-editor) { scroll-margin-top: calc(var(--sp-stick, 0px) + 8px); scroll-margin-bottom: calc(var(--sp-foot-h, 64px) + 8px); }
.sp-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sp-actions .btn { min-height: 38px; }

@media (max-width: 760px), (max-height: 520px) {
  .sp.sp-page { overflow: visible; }
  .sp-page .sp-nav { max-height: none; }
  .sp-page .sp-body { border-left: 0; min-height: calc(100dvh - var(--sp-foot-h, 64px) - var(--sp-stick, 46px)); }
  .sp-page .sp-msg:empty { display: none; }
  .sp-page .sp-foot { gap: 6px 8px; }
  .sp-page .sp-foot > .btn { padding: 6px 10px; font-size: 12.5px; }
  .sp-page .sp-actions { flex: 1 1 auto; }
  .sp-page .sp-actions .btn { flex: 1 1 auto; }
  .rp-head { gap: 10px; padding: 10px 12px 8px; }
  .rp-titles h1 { font-size: 17px; letter-spacing: 0.06em; }
  .rp-titles p { font-size: 11.5px; }
  .rp-notice { padding: 0 12px 8px; }
  .rp-message { margin: 8px 10px 24px; padding: 16px; }
}
@media (max-height: 520px) {
  .rp-titles p { display: none; }
  .rp-head { padding-top: 6px; padding-bottom: 6px; }
  .sp-page .sp-actions .btn, .rp-back { min-height: 34px; }
}

/* ------------------------------------------------------------ entry shell */
/* The three entry screens (play/entry-shell.ts): AIと対戦 /ai, オンライン対戦 /,
   観戦 /watch share this page — header, mode switch, one panel (fields, the
   rules-and-cards block, one gold button, quiet buttons under it). */
.entry { width: min(640px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 56px; }
.entry[hidden] { display: none; }
.entry-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.entry-head .brand-mark { flex: none; width: 40px; height: 40px; font-size: 25px; }
.entry-titles { min-width: 0; }
.entry-titles h1 { margin: 0; font-family: var(--font-mincho); font-weight: 800; font-size: 28px; line-height: 1.25; letter-spacing: 0.12em; }
.entry-titles h1 small { margin-left: 2px; font-size: 0.5em; font-weight: 500; letter-spacing: 0.04em; color: var(--text-dim); }
.entry-titles p { margin: 2px 0 0; font-size: 13px; color: var(--text-dim); }

.entry-panel {
  display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 18px; margin-bottom: 16px; border-radius: 8px;
  background: var(--lacquer); border: 1px solid oklch(45% 0.04 70 / 0.45); box-shadow: 0 14px 36px oklch(0% 0 0 / 0.4);
}
.entry-panel[hidden] { display: none; }
.entry-panel h2 { margin: 0; font-family: var(--font-mincho); font-weight: 800; font-size: 19px; letter-spacing: 0.1em; }
.entry-panel > p { margin: 0; }
.entry a { color: var(--gold); }
.entry a.btn { color: var(--text); }
.entry a.btn-gold { color: var(--ink); }

/* fields: labelled controls in a grid, every control a full-height tap target */
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.entry-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-grid > label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; color: var(--text-dim); }
.entry-grid select, .entry-grid input[type="text"], .entry-grid input[type="number"] { width: 100%; min-width: 0; min-height: 44px; }
.entry-grid > .entry-check { grid-column: 1 / -1; flex-direction: row; }
.entry-grid > label:only-child { grid-column: 1 / -1; }
.entry-inline input { width: auto; }
.entry-inline { display: flex; gap: 8px; }
.entry-inline input { flex: 1 1 auto; }
.entry-inline .btn { flex: none; min-height: 44px; }
.entry-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; color: var(--text); cursor: pointer; }
.entry-check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }

/* folds: 詳細, ルールの説明, 基準からの変更点 — one look */
.entry-more, .entry-fold { font-size: 12.5px; }
.entry-more summary, .entry-fold summary { display: flex; align-items: center; gap: 6px; min-height: 36px; width: fit-content; cursor: pointer; color: var(--text-dim); list-style: none; }
.entry-more summary::-webkit-details-marker, .entry-fold summary::-webkit-details-marker { display: none; }
.entry-more summary::before, .entry-fold summary::before { content: "›"; display: inline-block; width: 0.8em; color: var(--gold); font-size: 16px; line-height: 1; transition: transform var(--t-fast) var(--ease-out); }
.entry-more[open] summary::before, .entry-fold[open] summary::before { transform: rotate(90deg); }
/* the AI table's recent results (play/result-history.ts) */
.entry-history-list { margin: 4px 0 8px; padding-left: 1.4em; font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.entry-history-list time { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.entry-history-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.entry-more summary:hover, .entry-fold summary:hover { color: var(--text); }
.entry-more summary:focus-visible, .entry-fold summary:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 3px; }
.entry-more > .entry-grid { margin-top: 6px; }
.entry-fold > p, .entry-fold > .diff-list { margin: 4px 0 6px; padding: 10px 12px; border-radius: 6px; background: oklch(11% 0.01 40 / 0.6); border: 1px solid oklch(45% 0.04 70 / 0.3); line-height: 1.7; }
.entry-fold > .diff-list { padding-left: 28px; max-height: 30dvh; overflow-y: auto; }
.entry-fold > p.muted { background: none; border: 0; padding: 2px 0; }

/* the shared rules-and-cards block */
.entry-rules { display: flex; flex-direction: column; gap: 0; padding-top: 14px; border-top: 1px solid oklch(45% 0.04 70 / 0.35); }
.entry-label { font-size: 12px; color: var(--text-dim); }
.entry-rules-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 2px 0 4px; }
.entry-rules-row .rules-badge { flex: 1 1 auto; max-width: 100%; min-height: 36px; white-space: normal; flex-wrap: wrap; line-height: 1.35; border-radius: 18px; }
.entry-rules-row .btn { flex: none; min-height: 44px; }

/* the foot: one gold button across the panel, quiet text buttons under it */
.entry-panel .err { margin: 0; }
.entry-primary { width: 100%; min-height: 50px; font-size: 16px; letter-spacing: 0.12em; white-space: normal; text-wrap: balance; } /* a long label wrapped off both edges on a 390px phone */
.entry-secondary { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: -6px; }
.entry-secondary:empty { display: none; }
.btn-text {
  min-height: 44px; padding: 6px 10px; border: 0; background: none; cursor: pointer;
  color: var(--text-dim); font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 4px;
}
.btn-text:hover { color: var(--text); text-decoration-color: var(--gold); }
.btn-text:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 3px; }

@media (max-width: 560px) {
  .entry { width: calc(100% - 32px); padding: 20px 0 40px; }
  .entry-head { gap: 12px; margin-bottom: 14px; }
  .entry-titles h1 { font-size: 24px; }
  .entry-titles p { font-size: 12.5px; }
  .entry-panel { padding: 16px 16px 14px; gap: 12px; }
  .entry-grid, .entry-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  /* two columns: a last field left alone takes the whole row (no empty cell beside it) */
  .entry-grid-3 > label:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .entry-more summary, .entry-fold summary { min-height: 44px; }
  .entry-rules-row .btn { flex: 1 1 100%; }
}
@media (max-height: 520px) and (min-aspect-ratio: 4/3) {
  .entry { padding: 12px 0 24px; }
  .entry-head { margin-bottom: 10px; }
}

/* 遊び方の切り替え (play/mode-switch.ts): AIと対戦 / オンライン対戦 / 観戦, at the top of each entry screen */
.mode-switch {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px;
  border: 1px solid var(--gold-line); border-radius: 8px; overflow: hidden;
  background: oklch(11% 0.012 40 / 0.7); box-shadow: inset 0 1px 0 oklch(80% 0.12 85 / 0.08);
}
.mode-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; min-height: 52px; padding: 7px 6px; text-align: center; text-decoration: none;
  color: var(--text-dim); transition: background-color var(--t-fast), color var(--t-fast);
}
.mode-item + .mode-item { border-left: 1px solid var(--gold-line); }
.entry .mode-item, .mode-item:visited { color: var(--text-dim); }
.mode-label { font-family: var(--font-mincho); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; line-height: 1.2; }
.mode-hint { font-size: 11px; line-height: 1.3; color: var(--text-dim); opacity: 0.85; }
.mode-item:hover { background: oklch(80% 0.12 85 / 0.1); color: var(--text); }
.mode-item:active { background: oklch(80% 0.12 85 / 0.16); }
.mode-item:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: -3px; z-index: 1; }
.mode-item.is-current, .entry .mode-item.is-current { background: linear-gradient(170deg, oklch(80% 0.12 85 / 0.24), oklch(80% 0.12 85 / 0.1)); color: var(--gold-hi); cursor: default; }
.mode-item.is-current .mode-label { font-weight: 800; }
.mode-item.is-current .mode-hint { color: var(--text); opacity: 1; }
.mode-item.is-current::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--gold); }
.mode-slot { min-height: 54px; margin-bottom: 16px; }
.mode-slot .mode-switch { margin: 0; }
@media (max-width: 420px) {
  .mode-label { font-size: 13.5px; letter-spacing: 0.02em; }
  .mode-hint { font-size: 10.5px; }
  .mode-item { padding: 6px 4px; }
}
@media (max-height: 520px) {
  .mode-switch { margin-bottom: 10px; }
  .mode-item { min-height: 44px; padding: 4px 6px; }
  .mode-hint { display: none; }
}

/* the entry screens' title: the title logo in place of 符 + 式神符陣 (11/08) */
.entry-logo { display: block; height: 64px; width: auto; max-width: 100%; }
@media (max-width: 480px) { .entry-logo { height: 52px; } }
