:root {
  color-scheme: dark;
  --bg: #151612;
  --panel: #20211a;
  --line: #3a3b30;
  --line-soft: #313329;
  --text: #f0eadc;
  --muted: #bbb6a4;
  --accent: #e7b66f;
  --accent-dim: #b69060;
  --green: #a6c58e;
  --danger: #f0a08a;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', system-ui, sans-serif;
  font: 15px/1.48 var(--sans);
}

* { box-sizing: border-box }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 42% 0, #25251b 0, var(--bg) 62%);
  color: var(--text);
}
button, input, select { font: inherit }
button { cursor: pointer; color: inherit }
button:disabled { cursor: default }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #f4cf90;
  outline-offset: 3px;
}
h1, h2, p { margin: 0 }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.025em }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.03 }
h2 { font-size: 1.45rem; line-height: 1.2 }
label { display: block; color: var(--muted); font-weight: 600; font-size: .82rem }
input, select {
  max-width: 100%;
  min-width: 0;
  color: var(--text);
  border: 1px solid #4d4d3e;
  border-radius: 6px;
  padding: .67rem .79rem;
  background: #171913;
}
input::placeholder { color: #a19e8e; opacity: 1 }
input[readonly] { color: #d3c4a8 }
[hidden] { display: none !important }

.mast {
  height: 67px;
  border-bottom: 1px solid #37362a;
  background: #181914de;
}
.mast-inner {
  width: min(1510px, 100% - 3.2rem);
  margin: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  gap: .75rem;
  align-items: center;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 3.5vw, 1.5rem);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  aspect-ratio: 1;
  background: #362d20;
  border: 1px solid #816441;
  border-radius: 8px;
  color: var(--accent);
  font: 1.45rem/1 var(--sans);
}
.shell { width: min(1510px, 100% - 3.2rem); margin: 0 auto; padding: 1.2rem 0 2rem }
.loading { padding: 2.8rem 0; color: var(--muted) }
.muted { color: var(--muted) }
.small-caps { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 650 }
.eyebrow { color: #e7bf86 }
.eyebrow i, .link-state i, .seat-status i {
  display: inline-block;
  vertical-align: .12em;
  width: .43rem;
  height: .43rem;
  border-radius: 50%;
  background: currentColor;
  margin-right: .38rem;
}
.panel {
  background: linear-gradient(155deg, #24251d, var(--panel) 70%);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.panel-title > span { color: var(--muted); font-variant-numeric: tabular-nums }
.btn, .text-btn, .icon-btn {
  border-radius: 6px;
  font-weight: 650;
}
.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  border: 1px solid transparent;
  padding: .61rem .9rem;
  text-align: center;
}
.btn.primary { background: var(--accent); color: #251803; border-color: #efc383 }
.btn.primary:hover:enabled { background: #f4cb8d }
.btn.secondary { background: #2e2f26; border-color: #4b4c3f }
.btn.secondary:hover:enabled { background: #3a3b2e; border-color: #84806a }
.btn.quiet, .text-btn { background: transparent; border: 1px solid transparent; color: var(--muted) }
.btn.quiet:hover:enabled, .text-btn:hover:enabled { color: var(--text); background: #282921 }
.btn:disabled { opacity: .46 }
.text-btn { padding: .44rem .64rem }
.icon-btn {
  border: 1px solid var(--line);
  padding: 0;
  background: #2a2a21;
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
  line-height: 1;
}
.icon-btn:hover:enabled { background: #3c3025 }

.entry {
  min-height: min(665px, calc(100dvh - 105px));
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, .75fr);
  gap: clamp(1.25rem, 6vw, 6rem);
  max-width: 1210px;
  margin: auto;
}
.entry-story {
  isolation: isolate;
  overflow: hidden;
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: end;
  border: 1px solid #504232;
  border-radius: 14px;
  background: #272419;
}
.entry-copy { position: relative; padding: clamp(1.4rem, 5vw, 3.65rem); z-index: 1 }
.entry-copy h1 { margin: .85rem 0 1.15rem; font-size: clamp(3.2rem, 6vw, 6rem); letter-spacing: -.055em; line-height: .9 }
.entry-copy em { color: var(--accent); font-style: normal }
.entry-copy p { max-width: 34ch; color: #ddd2bd; font-size: 1.04rem }
.landscape {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg,#1c1b15 0%, #211d14d9 18%, #25211635 53%, transparent),
    radial-gradient(ellipse at 72% 33%, #ba764c 0%, #6f4831 17%, #382a20 37%, #202119 74%);
}
.landscape::before, .landscape::after, .rift-base {
  position: absolute;
  inset: 0;
  content: '';
}
.landscape::before {
  background: linear-gradient(142deg, #4a433700, #151612 65%), #353326;
  clip-path: polygon(0 53%, 17% 36%, 29% 42%, 42% 62%, 63% 70%, 48% 80%, 75% 100%, 0 100%);
}
.landscape::after {
  background: linear-gradient(230deg, #4d3c2a, #1d1d16 65%);
  clip-path: polygon(100% 42%, 89% 31%, 83% 45%, 91% 50%, 77% 65%, 65% 84%, 100% 100%);
}
.rift-ring {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  left: 56%;
  top: 10%;
  border: 1px solid #ecd09a65;
  transform: rotate(45deg);
}
.ring-two { scale: .76; rotate: 13deg; border-style: dashed }
.rift-core {
  position: absolute;
  width: 14%;
  height: 65%;
  left: 66%;
  top: 2%;
  rotate: 10deg;
  clip-path: polygon(54% 3%, 42% 29%, 61% 45%, 43% 55%, 58% 69%, 43% 98%, 78% 69%, 65% 55%, 83% 43%, 65% 27%);
  background: linear-gradient(#de955d00, #f8ae73 25%, #f8cf95 44%, #e98845 71%, transparent);
}
.rift-base {
  background:
    linear-gradient(0deg, #1c1b15, transparent 53%),
    repeating-linear-gradient(169deg, transparent 0 18px, #ac765d1f 19px, transparent 20px 30px);
  opacity: .92;
  mask-image: linear-gradient(0deg, #000 31%, transparent 85%);
}
.entry-panel { padding: clamp(1.25rem, 3.5vw, 2.45rem) }
.entry-panel h2 { font-size: 2.15rem; margin-bottom: 1.5rem }
.entry-panel input { width: 100%; margin-top: .37rem }
.entry-panel form > .btn { width: 100%; margin-top: .8rem; justify-content: space-between }
.separator { display: flex; align-items: center; gap: .65rem; margin: 1.05rem 0; color: var(--muted); font-size: .78rem }
.separator::before, .separator::after { content: ''; height: 1px; background: var(--line); flex: 1 }
.join-row, .invite-row { display: flex; gap: .52rem; align-items: stretch; margin-top: .37rem }
.join-row input { margin-top: 0 }
.code-field { text-transform: uppercase; letter-spacing: .11em }
.form-error { color: var(--danger); font-size: .83rem }
.form-error:not(:empty) { padding-top: .75rem }
.new-room { margin: .45rem 0 0 -.5rem }

.room-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1.15rem }
.room-code { display: flex; align-items: center; gap: .52rem; color: var(--muted); font-size: .82rem }
.room-code b {
  border: 1px solid #6c573e;
  background: #32291d;
  padding: .17rem .53rem;
  border-radius: 5px;
  letter-spacing: .13em;
  color: #efc180;
  font-family: Consolas, monospace;
}
.link-state { color: var(--green); font-size: .82rem }
.link-state.waiting { color: var(--accent) }
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(305px, 350px); align-items: start; gap: clamp(1.15rem, 4vw, 3.5rem); max-width: 1250px; margin: 1.2rem auto 0 }
.page-heading { margin: .5rem 0 1.35rem }
.page-heading p { color: var(--muted); margin-top: .7rem }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .62rem }
.role-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  padding: .8rem .85rem;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #23241d;
  text-align: left;
}
.role-card.chosen { border-color: color-mix(in srgb, var(--role) 63%, #24251d); background: color-mix(in srgb, var(--role) 10%, #24251d) }
.role-card:hover:enabled { border-color: var(--role) }
.role-card:disabled:not(.chosen) { opacity: .66 }
.role-card b { display: block }
.role-card small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.31 }
.role-tag { grid-column: 2; color: var(--role); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.role-tag:empty { display: none }
.glyph {
  display: grid;
  place-items: center;
  flex: none;
  width: 37px;
  aspect-ratio: 1;
  border-radius: 7px;
  color: var(--role);
  background: color-mix(in srgb, var(--role) 13%, #23221b);
  border: 1px solid color-mix(in srgb, var(--role) 42%, #303125);
  font-size: 1.3rem;
  line-height: 1;
}
.lobby-controls { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.05rem }
.lobby-controls p { font-size: .82rem }
.lobby-side { padding: 1rem }
.roster { list-style: none; margin: .8rem 0; padding: 0 }
.roster li { min-height: 48px; display: flex; align-items: center; gap: .63rem; padding: .4rem 0; border-top: 1px solid var(--line-soft) }
.seat > div { min-width: 0; flex: 1 }
.seat b { display: block; overflow-wrap: anywhere; line-height: 1.25 }
.seat > div > span, .seat b small, .seat-status { color: var(--muted); font-size: .74rem }
.seat-status { white-space: nowrap }
.seat-status.is-ready { color: var(--green) }
.seat-status i { color: var(--green) }
.seat-status i.offline { color: #817c6c }
.empty-seat { color: var(--muted); font-size: .83rem }
.seat-icon { width: 37px; display: grid; place-items: center; color: #a5a18e; font-size: 1.16rem }
.invite { border-top: 1px solid var(--line); padding-top: .85rem }
.invite input { flex: 1; width: 100%; font-size: .76rem; padding: .48rem }
.invite .btn { font-size: .77rem; padding-inline: .62rem }
.invite select { margin: .33rem 0 .76rem; width: 100%; font-size: .8rem }
.error { margin: .6rem 0; padding: .63rem .8rem; border: 1px solid #774839; border-radius: 6px; background: #35251e; color: #ffc0ad }

.field-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: baseline; margin-bottom: .75rem }
.field-heading h1 { font-size: clamp(1.85rem, 4vw, 3.05rem) }
.field-heading > span { flex: none; color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums }
.field-heading b { color: var(--accent) }
.turn-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  padding: .6rem .9rem;
  margin-bottom: .85rem;
  background: #21221b;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.turn-card.your-turn, .result-card.won { border-color: #9c7647; background: #32281c }
.result-card.lost { border-color: #94583f }
.turn-hero, .turn-meters, .ap, .clock { display: flex; align-items: center; gap: .72rem }
.turn-hero div { overflow-wrap: anywhere }
.turn-card p, .turn-meters span { color: var(--muted); font-size: .75rem }
.turn-meters { justify-content: end; gap: clamp(.85rem, 2.6vw, 2rem) }
.pips { display: flex; gap: .28rem }
.pips i { width: 11px; height: 11px; border-radius: 2px; border: 1px solid #8e7555; transform: rotate(45deg); background: #2d2b20 }
.pips i.full { background: var(--accent); border-color: #efc58d }
.clock time { display: block; text-align: right; font: 700 1rem/1.15 Consolas, monospace; color: #e9bd7a }
.clock time.urgent { color: #f2a58c }
.clock-track { width: 59px; height: 3px; margin-top: .15rem; background: #4b3c2a }
.clock-track i { display: block; height: 100%; background: #d5a469 }
.battle-grid {
  display: grid;
  grid-template-columns: minmax(195px, .98fr) minmax(0, 3.5fr) minmax(195px, 1fr);
  grid-template-areas: 'actions board aside';
  align-items: start;
  gap: .82rem;
}
.board-zone { grid-area: board; min-width: 0 }
.board-pan-hint { display: none }
.board-frame {
  position: relative;
  border: 1px solid #524d38;
  border-radius: 8px;
  padding: 17px 7px 7px 17px;
  background: #1a1b15;
}
.board {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
  aspect-ratio: 13 / 9;
  contain: layout paint;
}
.axis {
  display: grid;
  align-items: center;
  text-align: center;
  position: absolute;
  font: 600 .65rem/1 Consolas, monospace;
  color: #aaa38e;
  pointer-events: none;
}
.x-axis { inset: 0 7px auto 17px; height: 17px; grid-template-columns: repeat(13, 1fr) }
.y-axis { inset: 17px auto 7px 0; width: 17px; grid-template-rows: repeat(9, 1fr) }
.tile {
  width: 100%;
  padding: 0;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #39392e;
  background: #303125;
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  isolation: isolate;
}
.tile.alt { background-color: #343528 }
.tile:focus-visible { z-index: 3; outline-offset: -3px }
.tile.floor {
  background-image: linear-gradient(147deg,#ffffff06,transparent 58%,#00000012 60%,transparent 90%);
}
.tile.wall {
  background:
    linear-gradient(0deg, #10120e 0 12%, transparent 13% 91%, #58554545 92%),
    repeating-linear-gradient(126deg,#27291f 0 8px,#2c2d23 9px 15px,#292a21 16px 21px);
  border: 1px solid #1d1f18;
  box-shadow: inset 0 0 0 1px #34362a;
}
.tile.ash {
  border-color: #684536;
  background:
    radial-gradient(ellipse at 69% 63%, #ce805133 0 10%, transparent 12%),
    repeating-linear-gradient(155deg, #432c23 0 5px, #60402b 6px 7px, #4b3025 8px 13px);
}
.tile.seal, .tile.exit { background: radial-gradient(ellipse, #6c5431, #3e3827 65%, #303125) }
.tile.charged { background: radial-gradient(ellipse, #5c6635, #39442b 65%, #303125); border-color: #7e9a54 }
.terrain-mark { position: absolute; z-index: 0; color: #f3bb6f; font-size: clamp(.9rem, 2.5vw, 1.75rem); line-height: 1 }
.charged .terrain-mark { color: #c0dc8a }
.tile.target { background: #465e3d; border-color: #87a16a; box-shadow: inset 0 0 0 1px #b1c78737 }
.tile.target-move::after, .tile.target-skill[data-unit=""]::after {
  content: '';
  position: absolute;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d4dfaa;
}
.tile.target.ash { background-image: repeating-linear-gradient(150deg, transparent 0 6px, #d4864e66 7px 8px, transparent 9px 13px) }
.tile.target-attack { background: #6a3d32; border-color: #d78871 }
.tile.target-skill { background: #584263; border-color: #bf9dd1 }
.tile.target-interact { background: #735633; border-color: #f0c077 }
.tile.target:hover { filter: brightness(1.26); z-index: 2 }
.tile.inspected { border-color: #e7b66f; z-index: 2 }
.tile.acting { box-shadow: inset 0 0 0 2px #f1c47c }
.piece {
  position: absolute;
  z-index: 1;
  inset: 15%;
  display: grid;
  place-items: center;
  border: 1px solid var(--role);
  border-radius: 33%;
  box-shadow: 0 2px 6px #000b, inset 0 0 8px #0004;
  background: color-mix(in srgb, var(--role) 23%, #25231c);
  color: var(--role);
  font: 700 clamp(.73rem, 2.15vw, 1.65rem)/1 'Segoe UI Symbol', var(--sans);
}
.piece.boss { inset: 10%; border: 2px solid #f3a177; background: #683d2c }
.piece.fallen { opacity: .5; filter: grayscale(.8) }
.piece i, .health { display: block; background: linear-gradient(90deg, var(--role) var(--hp), #181811 var(--hp)); height: 3px; border-radius: 2px }
.piece i { position: absolute; width: 87%; bottom: -5px; box-shadow: 0 1px 2px #111 }
.board-key { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .92rem; color: var(--muted); font-size: .72rem; padding: .39rem .18rem 0 }
.board-key i { display: inline-block; vertical-align: -.02em; width: 9px; height: 9px; margin-right: .25rem; border-radius: 2px; background: #8faa72 }
.board-key .legend-enemy { background: #ef956c }
.board-key .legend-ash { background: #9a5d40 }
.board-key .legend-seal { background: #e6b165 }

.action-panel { grid-area: actions; padding: .8rem; display: grid; gap: .7rem }
.self-card { display: flex; align-items: center; gap: .62rem; overflow-wrap: anywhere }
.self-card b, .self-card span { display: block }
.self-card .glyph { display: grid }
.self-card span:not(.glyph), .self-stats { color: var(--muted); font-size: .72rem }
.battle-actions { display: grid; gap: .33rem }
.battle-action {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: .38rem;
  padding: .32rem .45rem;
  min-height: 38px;
  border: 1px solid #45463a;
  border-radius: 6px;
  background: #2d2e25;
  text-align: left;
  font-size: .82rem;
}
.battle-action:hover:enabled { border-color: #b28b56 }
.battle-action.selected:enabled { background: #423624; border-color: #926d41 }
.battle-action:disabled { opacity: .5 }
.battle-action small { color: #d3bd9e; font-size: .7rem; white-space: nowrap }
.action-glyph { color: var(--accent); font-size: 1.12rem; text-align: center }
.action-hint { color: var(--muted); font-size: .73rem; min-height: 2.1em }
.action-panel .btn { width: 100%; justify-content: space-between; font-size: .81rem; gap: .22rem }
.field-side { grid-area: aside; display: grid; gap: .7rem; min-width: 0 }
.field-side .panel { padding: .77rem }
.objectives ul, .journal ol { list-style: none; margin: .49rem 0 0; padding: 0 }
.objectives li { display: flex; gap: .48rem; align-items: baseline; color: #ddd3bd; font-size: .81rem; padding: .18rem 0 }
.objectives li span { color: var(--accent); width: .85rem }
.objectives li.done, .objectives li.done span { color: var(--green) }
.journal ol {
  overflow: auto;
  height: clamp(126px, 25vw, 275px);
  scrollbar-width: thin;
  scrollbar-color: #68624c transparent;
}
.journal li { border-top: 1px solid var(--line-soft); padding: .37rem .14rem; font-size: .74rem; color: var(--muted); overflow-wrap: anywhere }
.journal li:first-child { color: var(--text) }
.journal li.good { color: #b2cc92 }
.journal li.danger { color: #f2a587 }
.party { margin-top: .85rem; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .49rem }
.party-member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .35rem .52rem;
  align-items: center;
  padding: .44rem;
  background: #23241d;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow-wrap: anywhere;
}
.party-member.active { border-color: #b08a54 }
.party-member.down { opacity: .64 }
.party-member .glyph { width: 29px; font-size: .98rem }
.party-member b { font-size: .78rem; display: block }
.party-member div span { color: var(--muted); display: block; font-size: .69rem }
.health { grid-column: 1 / -1 }

dialog {
  width: min(530px, 100% - 2rem);
  max-height: 90dvh;
  color: var(--text);
  background: #24251c;
  border: 1px solid #70634b;
  border-radius: 10px;
  padding: 1.45rem;
  box-shadow: 0 12px 70px #000a;
}
dialog::backdrop { background: #0b0c09b9 }
dialog .close { position: absolute; top: .8rem; right: .8rem }
.rules-list { margin: .8rem 0; padding-left: 1.28rem }
.rules-list li { margin-bottom: .62rem }
.toast {
  position: fixed;
  z-index: 9;
  right: 1.2rem;
  bottom: 1.15rem;
  color: #f7ebd8;
  background: #343025;
  border: 1px solid #796144;
  border-radius: 7px;
  max-width: min(380px, 92vw);
  padding: .6rem .9rem;
  box-shadow: 0 5px 25px #0008;
  pointer-events: none;
}

@media (max-width: 1120px) {
  .battle-grid { grid-template-columns: minmax(175px, 1fr) minmax(0, 3.1fr); grid-template-areas: 'actions board' 'aside aside' }
  .field-side { grid-template-columns: 1fr 2fr }
  .journal ol { height: 123px }
}
@media (max-width: 900px) {
  .battle-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'actions' 'board' 'aside'; gap: .6rem }
  .board-viewport { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 8px }
  .board-frame { min-width: calc(13 * 44px + 26px) }
  .action-panel { gap: .45rem }
  .battle-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .battle-action { min-height: 44px }
  .action-hint { min-height: 0 }
}
@media (max-width: 760px) {
  .mast { height: 52px }
  .mast-inner, .shell { width: calc(100% - 1.35rem) }
  .shell { padding-top: .8rem }
  .brand { gap: .52rem }
  .brand-mark { width: 29px }
  .entry { grid-template-columns: 1fr; min-height: auto; gap: .75rem }
  .entry-story { min-height: 235px }
  .entry-copy h1 { font-size: clamp(2.85rem, 10vw, 4.7rem) }
  .entry-copy p { font-size: .86rem }
  .entry-panel h2 { margin-bottom: .75rem }
  .lobby { grid-template-columns: 1fr; gap: 1rem }
  .page-heading { margin-block: .1rem .85rem }
  .role-card { gap: .38rem; padding: .5rem; min-height: 79px }
  .role-card .glyph { width: 27px; font-size: .99rem }
  .role-card small { font-size: .69rem }
  .room-bar { margin-bottom: .6rem }
  .field-heading { margin-bottom: .5rem }
  .turn-card { padding: .5rem .62rem; margin-bottom: .6rem }
  .turn-meters { gap: .63rem }
  .turn-meters span { font-size: .68rem }
  .ap, .clock { flex-direction: column; gap: .22rem; align-items: flex-end }
  .clock-track { width: 47px }
  .action-panel .panel-title { display: none }
  .party { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .piece { font-size: clamp(.72rem, 4vw, 1.4rem) }
  .piece i { bottom: -3px; height: 2px }
}
@media (max-width: 618px) {
  .board-pan-hint { display: block; color: var(--muted); font-size: .79rem; margin-bottom: .35rem }
}
@media (max-width: 510px) {
  .action-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center }
  .battle-actions { display: contents }
  .battle-action b { overflow-wrap: anywhere }
  .action-hint { grid-column: 1 / -1; order: 1 }
  .action-panel > .btn:not(.end-turn) { grid-column: 1 / -1; order: 2 }
  .end-turn span { display: none }
}
@media (max-width: 390px) {
  .field-heading { gap: .4rem }
  .field-heading h1 { font-size: 1.67rem }
  .field-heading > span { font-size: .76rem }
  .field-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) }
  .role-grid { gap: .35rem }
  .role-card { padding: .45rem .33rem }
}

@media (any-pointer: coarse) {
  .btn, .text-btn, .icon-btn, .battle-action { min-height: 44px; touch-action: manipulation }
  .icon-btn { width: 44px }
  input, select, .invite input, .invite select { font-size: 16px }
}
