:root {
  color-scheme: dark;
  --ink: #0b0d0c;
  --surface: #111512;
  --surface-raised: #171c18;
  --line: rgba(225, 218, 190, 0.14);
  --line-strong: rgba(225, 218, 190, 0.28);
  --paper: #e8e2cf;
  --muted: #8e948b;
  --amber: #f0a629;
  --amber-bright: #ffc85e;
  --amber-wash: rgba(240, 166, 41, 0.12);
  --red: #e15f4f;
  --green: #71c998;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  background: var(--ink);
  color: var(--paper);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 8%, rgba(240, 166, 41, 0.09), transparent 28rem),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

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

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 3px;
}

.app-shell { width: min(1600px, 100%); margin: 0 auto; padding: 0 24px 32px; }

.topbar {
  min-height: 104px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-block { display: flex; align-items: center; gap: 14px; }
.brand-block h1 { font-size: 25px; letter-spacing: .22em; margin: 0 0 3px; }
.brand-block p { color: var(--muted); font-size: 12px; letter-spacing: .16em; margin: 0; }
.brand-seal {
  display: grid;
  place-items: center;
  width: 47px;
  aspect-ratio: 1;
  border: 1px solid rgba(240, 166, 41, .75);
  color: var(--amber-bright);
  background: var(--amber-wash);
  box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 5px rgba(240, 166, 41, .25);
  font-size: 23px;
  transform: rotate(-3deg);
}

.eyebrow {
  display: block;
  color: var(--amber);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.round-block { text-align: center; padding-top: 9px; }
.round-block strong {
  display: block;
  color: var(--amber-bright);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 44px;
  line-height: 1;
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 28px rgba(240, 166, 41, .25);
}

.top-actions { display: flex; justify-content: flex-end; gap: 9px; }
.ghost-button, .round-button, .primary-button {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 0 17px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.ghost-button:hover:not(:disabled) { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.35); }
.ghost-button:disabled { opacity: .32; cursor: not-allowed; }
.round-button, .primary-button {
  border-color: var(--amber);
  color: #1a1307;
  background: var(--amber);
  font-weight: 800;
}
.round-button:hover, .primary-button:hover { background: var(--amber-bright); transform: translateY(-1px); }
.round-button:disabled, .primary-button:disabled { opacity: .34; cursor: not-allowed; transform: none; }

.room-bar {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(240,166,41,.055), transparent 52%);
}
.room-bar[hidden] { display: none; }
.room-identity { display: flex; align-items: center; gap: 10px; }
.room-identity button { display: flex; align-items: baseline; gap: 8px; border: 0; padding: 0; color: var(--paper); background: transparent; cursor: pointer; }
.room-identity strong { color: var(--amber-bright); font-family: ui-monospace, monospace; font-size: 22px; letter-spacing: .12em; }
.room-identity small { color: var(--muted); font-size: 8px; }
.room-live { display: flex; align-items: center; gap: 9px; }
.room-phase { border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; color: var(--muted); font-size: 10px; }
.room-phase.active { border-color: rgba(113,201,152,.34); color: var(--green); background: rgba(113,201,152,.07); }
.connection-state { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 9px; }
.connection-state i, .participant-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.connection-state.offline { color: #f18477; }
.participant-list { display: flex; min-width: 0; flex-wrap: wrap; gap: 6px; }
.participant-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 8px; color: #666c66; font-size: 9px; }
.participant-chip.online { color: var(--muted); }
.participant-chip.online i { color: var(--green); }
.participant-chip.self { border-color: rgba(240,166,41,.32); color: var(--amber-bright); }

main { padding-top: 27px; }
.section-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-heading h2, .panel-heading h2 { margin: 3px 0 0; font-size: 21px; letter-spacing: .08em; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.certain { background: var(--green); box-shadow: 0 0 9px rgba(113, 201, 152, .65); }
.dot.possible { background: var(--amber); box-shadow: 0 0 9px rgba(240, 166, 41, .55); }
.dot.unavailable { background: #525852; }

.roster-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.character-card {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255,255,255,.03), transparent 45%),
    var(--surface);
  padding: 17px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.character-card::after {
  content: attr(data-position);
  position: absolute;
  right: -3px;
  bottom: -20px;
  color: rgba(255,255,255,.025);
  font-family: ui-monospace, monospace;
  font-size: 104px;
  font-weight: 900;
  pointer-events: none;
}
.character-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.character-card.selected {
  border-color: rgba(240, 166, 41, .78);
  background: linear-gradient(145deg, rgba(240,166,41,.11), transparent 48%), var(--surface-raised);
  box-shadow: 0 0 0 1px rgba(240,166,41,.08), 0 18px 45px rgba(0,0,0,.22);
}
.character-card.owned { box-shadow: inset 0 0 0 1px rgba(113,201,152,.06); }
.assignment-row { position: relative; z-index: 2; display: flex; min-height: 27px; margin: -5px 0 7px; }
.assignment-badge { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; overflow: hidden; border: 1px solid var(--line); border-radius: 99px; padding: 5px 8px; color: var(--muted); background: rgba(255,255,255,.018); text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-size: 9px; }
.assignment-badge.open { border-style: dashed; color: var(--amber); }
.assignment-badge.mine { border-color: rgba(113,201,152,.38); color: var(--green); background: rgba(113,201,152,.07); }
.assignment-badge.other { color: #a4a89f; }
.assignment-badge:disabled { cursor: default; opacity: .72; }
.lock-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.card-top { position: relative; z-index: 1; display: flex; min-height: 34px; justify-content: space-between; align-items: center; gap: 10px; }
.position-tag { color: var(--amber); font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .12em; }
.card-name {
  display: block;
  width: max-content;
  max-width: 110px;
  overflow: hidden;
  border: 0;
  margin: 0;
  padding: 0;
  color: var(--paper);
  background: transparent;
  font-size: 20px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}
.card-name:hover { color: var(--amber-bright); }

.anger-health-row { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 9px; margin-top: 17px; }
.anger-readout { display: flex; min-width: 0; align-items: baseline; gap: 6px; }
.anger-value { color: var(--paper); font-family: ui-monospace, "SFMono-Regular", monospace; font-size: clamp(27px, 2.5vw, 39px); line-height: 1; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.anger-unit { color: var(--muted); font-size: 10px; }
.health-display {
  display: grid;
  flex: 0 0 auto;
  min-width: 83px;
  min-height: 47px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--muted);
  text-align: right;
  background: rgba(255,255,255,.018);
  cursor: pointer;
}
.health-display:hover { border-color: rgba(240,166,41,.52); background: var(--amber-wash); }
.health-display small { font-size: 8px; letter-spacing: .1em; }
.health-display strong { margin-top: 2px; color: #7d837c; font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.health-display.has-value { border-color: rgba(240,166,41,.34); }
.health-display.has-value small { color: var(--amber); }
.health-display.has-value strong { color: var(--paper); font-size: 17px; }
.health-display:disabled, .card-name:disabled { cursor: default; opacity: .58; }
.anger-track { position: relative; z-index: 1; display: block; height: 5px; margin-top: 11px; border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.07); }
.anger-track > span { display: block; width: 0; height: 5px; border-radius: inherit; background: linear-gradient(90deg, #9e5b16, var(--amber-bright)); box-shadow: 0 0 12px rgba(240,166,41,.4); transition: width .25s ease; }
.card-meta { position: relative; z-index: 1; display: block; min-height: 20px; margin-top: 8px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 10px; }
.thresholds { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.threshold-chip { border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; color: #656b65; font-size: 10px; }
.threshold-chip.certain { border-color: rgba(113,201,152,.28); color: var(--green); background: rgba(113,201,152,.06); }
.threshold-chip.possible { border-color: rgba(240,166,41,.3); color: var(--amber-bright); background: var(--amber-wash); }
.tower-indicator { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--amber); box-shadow: 0 0 15px var(--amber); }

.control-deck { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(310px, .8fr); gap: 13px; margin-top: 22px; }
.action-panel, .timeline-panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,21,18,.86); box-shadow: var(--shadow); }
.action-panel { padding: 20px; }
.timeline-panel { min-height: 390px; padding: 20px; }
.selection-hint { color: var(--muted); font-size: 11px; }
.damage-label-row, .event-label-row { display: flex; justify-content: space-between; margin: 3px 0 8px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.event-label-row { margin-top: 14px; }
.damage-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.damage-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  text-align: left;
  background: #0d100e;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.damage-range {
  display: block;
  min-width: 0;
  color: var(--paper);
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.damage-gain { color: var(--muted); font-family: ui-monospace, monospace; font-size: 8px; }
.damage-key {
  grid-column: 2;
  grid-row: 1 / 3;
  justify-self: end;
  border: 0;
  color: var(--amber-bright);
  background: transparent;
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 25px;
  font-weight: 800;
}
.damage-button:hover { border-color: rgba(240,166,41,.55); background: var(--amber-wash); }
.damage-button:active, .event-button:active { transform: scale(.975); }
.damage-button:disabled, .event-button:disabled { cursor: not-allowed; opacity: .3; filter: saturate(.55); }
.damage-button:disabled:hover, .event-button:disabled:hover { border-color: var(--line); background: #0d100e; transform: none; }

.event-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.event-button {
  position: relative;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  text-align: left;
  background: rgba(255,255,255,.018);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.event-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.event-button.danger:hover { border-color: rgba(225,95,79,.55); background: rgba(225,95,79,.06); }
.event-button.positive:hover { border-color: rgba(113,201,152,.48); background: rgba(113,201,152,.06); }
.event-icon { display: grid; flex: 0 0 33px; place-items: center; height: 33px; border: 1px solid rgba(240,166,41,.3); color: var(--amber-bright); background: var(--amber-wash); font-size: 16px; }
.danger .event-icon { border-color: rgba(225,95,79,.35); color: #ff8d7f; background: rgba(225,95,79,.09); }
.positive .event-icon { border-color: rgba(113,201,152,.35); color: var(--green); background: rgba(113,201,152,.08); }
.event-copy { min-width: 0; }
.event-button strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.event-button small { display: block; margin-top: 5px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 9px; line-height: 1.5; }
.event-button small span { display: block; }
.event-key {
  justify-self: end;
  border: 0;
  color: rgba(240,166,41,.82);
  background: transparent;
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(240,166,41,.13);
}
.danger .event-key { color: rgba(225,95,79,.88); }
.positive .event-key { color: rgba(113,201,152,.88); }

.panel-heading.compact { align-items: center; }
.text-button { border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 11px; }
.text-button:hover { color: var(--red); }
.timeline { display: flex; flex-direction: column; gap: 0; max-height: 302px; overflow: auto; margin: 0; padding: 0; list-style: none; scrollbar-width: thin; }
.timeline-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; min-height: 51px; border-top: 1px solid var(--line); }
.timeline-round { color: var(--muted); font-family: ui-monospace, monospace; font-size: 10px; }
.timeline-copy strong { display: block; font-size: 12px; font-weight: 600; }
.timeline-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.timeline-delta { font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700; }
.timeline-delta.positive { color: var(--green); }
.timeline-delta.negative { color: #f18477; }
.empty-log { display: grid; place-items: center; min-height: 230px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.8; }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  border: 1px solid rgba(240,166,41,.35);
  border-radius: 7px;
  padding: 11px 16px;
  color: var(--paper);
  background: rgba(15,18,16,.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-size: 12px;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.modal {
  width: min(520px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 0;
  color: var(--paper);
  background: #121613;
  box-shadow: 0 40px 100px rgba(0,0,0,.65);
}
.modal::backdrop { background: rgba(3,5,4,.78); backdrop-filter: blur(4px); }
.modal form { padding: 24px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 5px 0 0; font-size: 23px; }
.close-button { border: 1px solid var(--line); width: 39px; height: 39px; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; font-size: 23px; line-height: 1; }
.modal-description { color: var(--muted); margin: 16px 0 20px; font-size: 12px; line-height: 1.7; }
.field-label { display: block; color: var(--muted); margin-bottom: 7px; font-size: 11px; }
.number-input-wrap { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: #0b0e0c; padding-left: 17px; }
.number-input-wrap span { color: var(--amber); font-family: ui-monospace, monospace; font-size: 25px; }
.number-input-wrap input { width: 100%; border: 0; outline: 0; color: var(--paper); background: transparent; padding: 13px 15px; font-family: ui-monospace, monospace; font-size: 28px; }
.health-calculation-fields { display: grid; grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); align-items: end; gap: 8px; }
.health-calculation-fields label { min-width: 0; }
.health-formula { display: grid; place-items: center; height: 49px; color: var(--amber); font-family: ui-monospace, monospace; line-height: 1; }
.health-formula b { font-size: 20px; }
.health-formula small { margin-top: -8px; color: var(--muted); font-size: 8px; }
.total-health-input { border-color: rgba(240,166,41,.42); background: var(--amber-wash); }
.calculation-preview { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; color: var(--muted); font-size: 12px; }
.calculation-preview strong { color: var(--amber-bright); font-family: ui-monospace, monospace; font-size: 22px; }
.technique-presets { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 17px; }
.technique-preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.technique-preset-grid button { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--paper); text-align: left; background: rgba(255,255,255,.018); cursor: pointer; }
.technique-preset-grid button:hover { border-color: rgba(240,166,41,.5); background: var(--amber-wash); }
.technique-preset-grid strong { display: block; color: var(--amber-bright); font-size: 14px; }
.technique-preset-grid small { display: block; margin-top: 4px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 8px; white-space: nowrap; }
.text-input { width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 13px; color: var(--paper); background: #0b0e0c; }
.round-confirm-modal { width: min(460px, calc(100vw - 28px)); }
.round-confirm-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 22px;
  border: 1px solid rgba(240,166,41,.28);
  border-radius: 10px;
  padding: 16px;
  background: var(--amber-wash);
}
.round-confirm-summary > span { color: var(--muted); font-size: 12px; }
.round-confirm-summary strong { color: var(--amber-bright); font-size: 24px; }
.round-confirm-summary b { font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 34px; }
.rule-note { border-left: 1px solid var(--line); padding-left: 16px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.preset-button { min-height: 37px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: transparent; padding: 0 12px; cursor: pointer; }
.preset-button:hover { color: var(--paper); border-color: var(--line-strong); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 24px 0 0; padding: 0; }
.split-actions { align-items: center; }
.action-spacer { flex: 1; }
.danger-text { color: #f18477; }
.danger-text:disabled { color: #555b55; cursor: not-allowed; }

.room-modal { width: min(860px, calc(100vw - 28px)); }
.room-entry { padding: 30px; }
.room-entry-head { max-width: 570px; }
.room-entry-head h2 { margin: 7px 0 8px; font-size: 29px; letter-spacing: .08em; }
.room-entry-head p, .room-entry-grid form > p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.room-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.room-entry-grid form { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 22px; background: rgba(255,255,255,.018); }
.room-entry-grid form:first-child { border-color: rgba(240,166,41,.3); background: var(--amber-wash); }
.room-entry-grid h3 { margin: 0 0 4px; font-size: 18px; }
.entry-number { position: absolute; top: 8px; right: 12px; color: rgba(255,255,255,.035); font-family: ui-monospace, monospace; font-size: 64px; font-weight: 900; }
.room-entry-grid .field-label { margin-top: 15px; }
.room-code-input { color: var(--amber-bright); font-family: ui-monospace, monospace; font-size: 20px; font-weight: 800; letter-spacing: .16em; }
.full-button { width: 100%; margin-top: 17px; }
.room-error { min-height: 20px; margin: 14px 0 0; color: #f18477; text-align: center; font-size: 11px; }

@media (max-width: 1080px) {
  .app-shell { padding-inline: 16px; }
  .topbar { grid-template-columns: 1fr auto; }
  .round-block { grid-row: 1; grid-column: 2; }
  .top-actions { grid-column: 1 / -1; padding-bottom: 14px; }
  .top-actions .round-button { margin-left: auto; }
  .roster-grid { grid-template-columns: repeat(5, minmax(170px, 1fr)); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .character-card { scroll-snap-align: start; }
  .control-deck { grid-template-columns: 1fr; }
  .timeline-panel { min-height: 240px; }
  .timeline { max-height: 220px; }
  .room-bar { grid-template-columns: auto 1fr auto; padding: 10px 0; }
  .participant-list { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 760px) {
  .app-shell { padding: 0 12px 20px; }
  .topbar { min-height: 84px; gap: 10px; }
  .brand-block p { display: none; }
  .brand-seal { width: 40px; }
  .round-block strong { font-size: 34px; }
  .round-block { position: relative; z-index: 2; justify-self: end; }
  .top-actions { display: grid; grid-template-columns: .8fr 1.35fr; width: 100%; overflow: visible; }
  .top-actions .round-button { margin-left: 0; }
  .top-actions button { min-width: 0; min-height: 44px; padding-inline: 8px; white-space: nowrap; font-size: 12px; }
  main { padding-top: 20px; }
  .legend { display: none; }
  .character-card { min-height: 222px; }
  .health-display { min-width: 69px; min-height: 43px; padding-inline: 7px; }
  .health-display.has-value strong { font-size: 14px; }
  .damage-grid { grid-template-columns: repeat(4, 1fr); }
  .damage-button { position: relative; display: block; min-height: 68px; padding: 9px 6px; overflow: hidden; }
  .damage-range { padding-right: 14px; font-size: 11px; }
  .damage-gain { display: block; margin-top: 7px; font-size: 6.5px; white-space: nowrap; }
  .damage-key { position: absolute; top: 8px; right: 5px; font-size: 20px; opacity: .55; }
  .event-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .event-button { display: block; min-height: 106px; padding: 10px 7px; overflow: hidden; }
  .event-icon { display: none; }
  .event-copy { position: relative; z-index: 1; display: block; padding-right: 18px; }
  .event-button strong { min-height: 34px; white-space: normal; font-size: 11px; line-height: 1.4; }
  .event-button small { margin-top: 9px; font-size: 7px; line-height: 1.6; }
  .event-key { position: absolute; z-index: 0; top: 8px; right: 6px; font-size: 30px; opacity: .38; }
  .room-bar { gap: 8px; }
  .room-identity { display: block; }
  .room-identity .eyebrow { margin-bottom: 3px; }
  .room-identity small, .connection-state { display: none; }
  .room-live { justify-self: end; }
  .room-bar > .text-button { justify-self: end; }
  .room-entry { padding: 21px; }
  .room-entry-head h2 { font-size: 23px; }
  .room-entry-grid { grid-template-columns: 1fr; }
  .technique-preset-grid { grid-template-columns: repeat(2, 1fr); }
  .health-calculation-fields { grid-template-columns: 1fr; }
  .health-formula { height: 25px; grid-template-columns: auto auto; gap: 5px; }
  .health-formula small { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
