:root {
  color-scheme: dark;
  --brand-lime: #a6e600;
  --brand-white: #f5f5f2;
  --brand-black: #050505;
  --brand-divider: #2b2b2b;
  --ink: var(--brand-white);
  --muted: #bdbdb8;
  --panel: var(--brand-black);
  --panel-2: var(--brand-divider);
  --gold: var(--brand-lime);
  --cream: var(--brand-white);
  --shadow: rgba(0, 0, 0, 0.4);
  --surface-1: rgba(5, 5, 5, 0.52);
  --surface-2: rgba(5, 5, 5, 0.72);
  --surface-3: rgba(5, 5, 5, 0.88);
  --surface-border: rgba(245, 245, 242, 0.14);
  --surface-pad-y: 0.35rem;
  --surface-pad-x: 0.65rem;
  --lime-border-color: rgba(166, 230, 0, 0.32);
  --container-border-lime: 1px solid var(--lime-border-color);
  --hud-label-size: 0.95rem;
  --hud-value-size: 1.9rem;
  --btn-action-min-h: 2.8rem;
  --btn-action-pad-x: 1rem;
  --btn-action-font-size: 0.95rem;
  --btn-segment-min-h: 2.35rem;
  --btn-segment-pad-x: 0.45rem;
  --btn-segment-pad-y: 0.4rem;
  --btn-segment-font-size: clamp(0.72rem, 2.45vw, 0.82rem);
  --btn-compact-min-h: 2.4rem;
  --btn-compact-pad-x: 0.7rem;
  --btn-compact-font-size: 0.88rem;
  --setup-stack-gap: 0.7rem;
  --setup-container-pad: 0.7rem;
  --board-dark: #050505;
  --board-light: #f5f5f2;
  --board-accent-a: #a6e600;
  --board-accent-b: #2b2b2b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(166, 230, 0, 0.13), transparent 34rem),
    linear-gradient(140deg, #050505 0%, #2b2b2b 54%, #050505 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}

button:disabled {
  cursor: default;
  opacity: 0.52;
}

input {
  -webkit-user-select: text;
  user-select: text;
  min-width: 0;
  min-height: 2.8rem;
  padding: 0 0.85rem;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
  font-weight: 800;
}

input::placeholder {
  color: var(--muted);
}

select {
  width: 100%;
  min-height: 2.8rem;
  padding: 0 2.2rem 0 0.75rem;
  appearance: auto;
  -webkit-appearance: menulist;
  background: #000;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 34rem;
  overflow: hidden;
}

.auth-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 10, 10, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.auth-overlay.visible {
  display: flex;
  z-index: 100000;
}

.auth-card {
  --auth-control-gap: 0.42rem;
  --auth-heading-gap: 0.2rem;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 0;
  width: 26rem;
  max-width: 92vw;
  width: min(26rem, 92vw);
  padding: 1.2rem;
  background: var(--surface-3);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: 0 2rem 5rem var(--shadow);
}

.auth-card > * {
  margin-top: 0;
  margin-bottom: 0;
}

.auth-card > * + * {
  margin-top: var(--auth-control-gap);
}

.auth-card > .eyebrow + h2 {
  margin-top: var(--auth-heading-gap);
}

/* iPad/tablet touch surfaces: give auth card the same breathing room as
   the updated standard spacing guidance. */
@media (pointer: coarse) and (min-width: 700px) {
  .auth-overlay {
    padding: 1.5rem;
  }

  .auth-card {
    --auth-control-gap: 0.7rem;
    --auth-heading-gap: 0.25rem;
    width: min(28rem, 92vw);
    padding: 1.6rem;
  }

  .auth-card button {
    min-height: 3rem;
    padding: 0.75rem 1.15rem;
  }
}

.auth-card h2 {
  margin: 0;
  font-size: 2rem;
}

.auth-card button {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: var(--btn-action-min-h);
  padding: 0.65rem var(--btn-action-pad-x);
  background: var(--gold);
  border-radius: 8px;
  color: #17120b;
  font-size: var(--btn-action-font-size);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.auth-card .auth-secondary-button {
  background: #202326;
  border: 1px solid rgba(242, 222, 193, 0.14);
  color: var(--ink);
}

.auth-agreement {
  display: none;
  gap: 0.45rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(242, 222, 193, 0.12);
  border-radius: 8px;
}

.auth-agreement p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
}

.auth-message {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

/* score-strip, board-stage, throw-strip are direct children of .app-shell */

.board-stage {
  position: absolute;
  top: 6.3rem;
  right: 0;
  bottom: 6.5rem;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  overflow: hidden;
}

.board-wrap {
  position: relative;
  width: min(98vw, calc(100dvh - 13.4rem), 72rem);
  height: min(98vw, calc(100dvh - 13.4rem), 72rem);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  transform-origin: 50% 50%;
  will-change: transform;
}

.board-art {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.board-shroud {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  display: block;
  width: 142.857%;
  height: 142.857%;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
  user-select: none;
}

.board-shroud svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}

.board-shroud,
.board-shroud * {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.board-art svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}

#dartboard {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  background: transparent;
}

body.board-aim-loupe-enabled.playing-mode .board-stage,
body.board-pinch-zoom-enabled.playing-mode .board-stage {
  touch-action: none;
}

body.board-aim-loupe-enabled.playing-mode #dartboard,
body.board-pinch-zoom-enabled.playing-mode #dartboard,
body.board-pinch-zoom-enabled.playing-mode .board-wrap,
body.board-pinch-zoom-enabled.playing-mode .legacy-targets {
  touch-action: none;
}

body.board-pinch-zoomed.playing-mode .board-wrap {
  filter: drop-shadow(0 1rem 1.5rem rgba(0, 0, 0, 0.35));
}

.board-aim-loupe {
  position: fixed;
  z-index: 120;
  width: 148px;
  height: 148px;
  pointer-events: none;
}

.board-aim-loupe-lens {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 3px solid rgba(223, 180, 82, 0.95);
  border-radius: 50%;
  background: #0d1111;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.55);
}

.board-aim-loupe-mirror {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.board-aim-loupe-mirror .legacy-targets {
  display: none;
}

.board-aim-loupe-mirror svg,
.board-aim-loupe-mirror .board-art {
  pointer-events: none;
}

.board-aim-loupe-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  pointer-events: none;
}

.board-aim-loupe-crosshair::before,
.board-aim-loupe-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(12, 14, 15, 0.92);
}

.board-aim-loupe-crosshair::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  margin-top: -1px;
}

.board-aim-loupe-crosshair::after {
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  margin-left: -1px;
}

.board-segment,
.board-bull,
.board-miss {
  fill: rgba(255, 255, 255, 0.001);
  stroke: transparent;
  stroke-width: 0;
}

.board-segment:active,
.board-bull:active {
  fill: rgba(223, 180, 82, 0.24);
}

body.board-aim-loupe-enabled.playing-mode .board-segment:active,
body.board-aim-loupe-enabled.playing-mode .board-bull:active {
  fill: rgba(255, 255, 255, 0.001);
}

.legacy-targets {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: none;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

body.legacy-board-touch .legacy-targets {
  display: block;
  pointer-events: auto;
}

body.modern-board-touch .legacy-targets {
  display: none;
  pointer-events: none;
}

body.legacy-board-touch #dartboard {
  pointer-events: none;
}

body.modern-board-touch #dartboard {
  pointer-events: auto;
}

.hit-radio {
  position: absolute;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.825rem 0 0 -0.825rem;
}

.hit-button {
  width: 1.65rem;
  height: 1.65rem;
  min-height: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  opacity: 0;
  outline: 0;
  z-index: 1;
}

.hit-button:active,
.hit-button-treble:active,
.hit-button-double:active {
  background: var(--gold);
  box-shadow: 0 0 0 0.18rem rgba(17, 20, 21, 0.7);
  opacity: 1;
}

.hit-button-treble,
.hit-button-double {
  width: 2.2rem;
  height: 2.2rem;
  margin: -1.1rem 0 0 -1.1rem;
  z-index: 2;
}

.hit-button span {
  pointer-events: none;
}

.hit-radio input {
  position: absolute;
  inset: 0;
  width: 1.65rem;
  height: 1.65rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0.56;
}

body.board-pinch-zoom-enabled.playing-mode .legacy-targets .hit-radio input {
  opacity: 0;
}

.hit-radio span {
  position: absolute;
  left: 50%;
  top: 100%;
  display: none;
  padding: 0.12rem 0.25rem;
  background: rgba(16, 18, 19, 0.88);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 900;
  transform: translateX(-50%);
  white-space: nowrap;
}

.hit-radio:active span,
.hit-radio input:checked + span {
  display: block;
}

body.board-pinch-zoom-enabled.playing-mode .legacy-targets .hit-button:active,
body.board-pinch-zoom-enabled.playing-mode .legacy-targets .hit-button-treble:active,
body.board-pinch-zoom-enabled.playing-mode .legacy-targets .hit-button-double:active {
  background: transparent;
  box-shadow: none;
}

body.board-pinch-zoom-enabled.playing-mode .legacy-targets .hit-radio:active span,
body.board-pinch-zoom-enabled.playing-mode .legacy-targets .hit-radio input:checked + span {
  display: none;
}

#dartboard {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2rem 2rem rgba(0, 0, 0, 0.35));
  touch-action: manipulation;
}

.board-segment,
.board-bull,
.board-miss {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.board-number {
  fill: #f7f3e8;
  font: 900 51px Arial, sans-serif;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
}

.board-art-numbers {
  pointer-events: none;
}

.board-art-numbers text {
  text-anchor: middle;
  dominant-baseline: central;
  alignment-baseline: middle;
}

.last-marker {
  fill: #dfb452;
  stroke: #17120b;
  pointer-events: none;
}

.score-strip,
.throw-strip,
.rank-panel,
.details-panel {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  box-shadow: 0 1.5rem 4rem var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.rank-panel {
  position: absolute;
  top: 0.85rem;
  top: max(0.85rem, env(safe-area-inset-top));
  right: 0.85rem;
  right: max(0.85rem, env(safe-area-inset-right));
  z-index: 3;
  display: none;
  width: 10rem;
  padding: 0.65rem;
  border-radius: 8px;
}

.playing-brand-mark {
  display: none;
}

.rank-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0.4rem;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.1);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 900;
}

.rank-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta {
  display: flex;
  align-items: center;
  min-width: 0;
}

.rank-position {
  flex: 0 0 auto;
}

.rank-avatar {
  display: none;
  flex: 0 0 auto;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  overflow: hidden;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.2);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 950;
}

.rank-avatar::before {
  content: attr(data-initials);
}

.rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-avatar.has-image::before {
  content: "";
}

.rank-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row strong {
  color: var(--gold);
}

.rank-row.active {
  border-color: var(--lime-border-color);
}

.score-strip {
  position: absolute;
  top: 0.85rem;
  top: max(0.85rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 3;
  width: calc(100vw - 1.5rem);
  max-width: 58rem;
  width: min(calc(100vw - 1.5rem), 58rem);
  min-height: 4.7rem;
  padding: 0.42rem;
  border-radius: 8px;
  transform: translateX(-50%);
}

.hud-panel {
  display: flex;
}

.hud-header {
  align-items: stretch;
}

.hud-cell,
.hud-section {
  min-width: 0;
  margin-right: 0.42rem;
  padding: 0.42rem;
  background: var(--surface-1);
  border: 1px solid rgba(242, 222, 193, 0.1);
  border-radius: 4px;
}

.hud-cell:last-child,
.hud-section:last-child {
  margin-right: 0;
}

.hud-cell {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
}

.hud-cell > * + * {
  margin-top: 0.38rem;
}

.hud-label {
  display: block;
  margin: 0;
  padding: var(--surface-pad-y) var(--surface-pad-x);
  background: var(--surface-3);
  color: var(--ink);
  font-size: var(--hud-label-size);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.hud-value {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 2.15rem;
  padding: var(--surface-pad-y) var(--surface-pad-x);
  overflow: hidden;
  background: var(--surface-3);
  color: var(--ink);
  font-size: var(--hud-value-size);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-value-player {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

.hud-active-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.94rem;
  height: 2.94rem;
  overflow: hidden;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.2);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 950;
}

.hud-active-avatar::before {
  content: attr(data-initials);
}

.hud-active-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-active-avatar.has-image::before {
  content: "";
}

.hud-hints,
.hud-hints-line {
  color: var(--gold);
  font-size: var(--hud-value-size);
}

.hud-header-top {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.hud-header-hints {
  display: none;
  align-items: center;
  width: 100%;
  margin-top: 0.42rem;
  padding: 0.42rem 0.55rem;
  background: var(--surface-1);
  border: 1px solid rgba(223, 180, 82, 0.28);
  border-radius: 4px;
  gap: 0.45rem;
}

.hud-hints-prefix {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: var(--hud-label-size);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.hud-hints-line {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: clamp(1rem, 3.2vw, 1.45rem);
  font-weight: 950;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-hint-item {
  display: inline;
}

.hud-hint-item + .hud-hint-item::before {
  content: " / ";
}

.profile-toggle-field small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: none;
}

body.enhance-dtb-board .hit-button-treble,
body.enhance-dtb-board .hit-button-double {
  width: 2.55rem;
  height: 2.55rem;
  margin: -1.275rem 0 0 -1.275rem;
}

body.enhance-dtb-board .hit-radio input {
  width: 2.55rem;
  height: 2.55rem;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0.12rem 0 0;
  line-height: 0.95;
}

h1 {
  font-size: clamp(2rem, 8vw, 3.4rem);
}

.recommendation {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.recommendation strong {
  color: var(--gold);
}

h2 {
  font-size: 3.4rem;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.8rem;
  height: 2.8rem;
  background: var(--panel-2);
  border: 1px solid rgba(242, 222, 193, 0.16);
  border-radius: 8px;
  font-weight: 900;
}

.throw-strip {
  position: absolute;
  bottom: 0.85rem;
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 3;
  width: calc(100vw - 1.5rem);
  max-width: 58rem;
  width: min(calc(100vw - 1.5rem), 58rem);
  padding: 0.42rem;
  border-radius: 8px;
  transform: translateX(-50%);
}

.hud-footer {
  align-items: stretch;
}

.throws-section {
  display: flex;
  flex: 0 0 30%;
  flex-direction: column;
}

.actions-section {
  display: flex;
  flex: 1 1 70%;
  flex-direction: column;
}

.throws-section > * + *,
.actions-section > * + * {
  margin-top: 0.42rem;
}

.throw-table {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-3);
  border: 0;
  border-radius: 0;
}

.throw-title {
  grid-column: 1 / -1;
  padding: var(--surface-pad-y) var(--surface-pad-x);
  background: var(--surface-3);
  border-radius: 6px;
}

.throw-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.15rem;
  padding: var(--surface-pad-y) var(--surface-pad-x);
}

.throw-head,
.throw-score {
  display: inline;
  min-height: 0;
  padding: 0.2rem;
  text-align: center;
}

.throw-head {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.throw-score {
  font-size: var(--hud-value-size);
  font-weight: 950;
}

.throw-item + .throw-item {
  border-left: 1px solid rgba(242, 222, 193, 0.12);
}

.action-row {
  display: flex;
  flex: 1 1 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.turn-action-slot {
  display: flex;
  flex: 1 1 0;
  flex-direction: row;
  align-items: stretch;
  min-width: 0;
}

.quick-pad {
  display: none;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.miss-button {
  min-height: 2.5rem;
  background: #b7332c;
  border: 1px solid rgba(255, 210, 205, 0.22);
  border-radius: 8px;
  color: #fff4f1;
  font-weight: 900;
}

.quick-pad button {
  min-height: 2.35rem;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
}

.primary-button,
.secondary-button {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  min-height: var(--btn-action-min-h);
  padding: 0 var(--btn-action-pad-x);
  border-radius: 8px;
  font-size: var(--btn-action-font-size);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.primary-button {
  background: var(--gold);
  color: #16120a;
}

.turn-countdown {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 18;
  min-width: 9rem;
  padding: 0.65rem 1rem;
  transform: translate(-50%, -50%);
  background: rgba(12, 14, 14, 0.86);
  border: 1px solid rgba(230, 188, 77, 0.44);
  border-radius: 8px;
  box-shadow: 0 0.8rem 2.2rem rgba(0, 0, 0, 0.35);
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.turn-countdown.visible {
  display: block;
}

.secondary-button {
  background: var(--panel-2);
  border: 1px solid rgba(242, 222, 193, 0.14);
}

.details-panel {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  bottom: 0.85rem;
  top: max(0.85rem, env(safe-area-inset-top));
  right: max(0.85rem, env(safe-area-inset-right));
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: calc(100vw - 1.5rem);
  max-width: 26rem;
  width: min(26rem, calc(100vw - 1.5rem));
  padding: 1rem;
  overflow: hidden;
  overflow-x: hidden;
  border-radius: 8px;
  transform: translateX(calc(100% + 1.5rem));
  transition: transform 170ms ease;
}

.details-panel > * {
  margin-bottom: 0;
}

.details-panel > *:last-child {
  margin-bottom: 0;
}

body.details-open .details-panel {
  transform: translateX(0);
}

body.setup-mode.details-open .details-panel {
  transform: translateX(-50%);
}

.scrim {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: none;
  background: rgba(0, 0, 0, 0.24);
}

body.details-open .scrim {
  display: block;
}

.win-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.42);
}

body.winner-open .win-overlay {
  display: flex;
}

.win-card {
  width: min(28rem, calc(100vw - 2rem));
  padding: 1.2rem;
  background: rgba(17, 20, 21, 0.94);
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 2rem 5rem var(--shadow);
  text-align: center;
}

.win-avatar {
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  margin: 0.5rem auto 0.75rem;
  overflow: hidden;
  background: #101213;
  border: 2px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-size: 1.45rem;
  font-weight: 950;
}

.win-avatar::before {
  content: attr(data-initials);
}

.win-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.win-avatar.has-image::before {
  content: "";
}

.win-card h2 {
  margin: 0.4rem 0 1rem;
  font-size: clamp(2.5rem, 9vw, 4.6rem);
}

.win-card .primary-button {
  width: 100%;
}

.win-card .secondary-button {
  width: 100%;
  margin-bottom: 0.6rem;
}

.details-panel .brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 0 0.65rem;
}

.setup-app-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: var(--setup-stack-gap);
}

body.setup-mode .setup-app-header {
  padding-bottom: 0.15rem;
}

.setup-app-header .app-brand-wordmark {
  display: block;
  width: auto;
  max-width: min(13.5rem, calc(100% - 6rem));
  height: 2.4rem;
  object-fit: contain;
  object-position: left center;
}

.setup-app-header h2 {
  margin: 0.2rem 0 0;
  font-size: 3.1rem;
  line-height: 0.95;
}

/* iPhone: keep menu on top row, give title full width below,
   and prevent title wrapping from shifting the layout. */
@media (max-width: 700px) {
  .setup-app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-items: start;
  }

  .setup-app-header > div {
    display: contents;
  }

  .setup-app-header .eyebrow {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .setup-app-header .menu-button {
    grid-column: 2 / 3;
    grid-row: 1;
    align-self: start;
  }

  .setup-app-header h2 {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0.3rem;
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 0.98;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .setup-app-header .game-subtitle {
    grid-column: 1 / -1;
    grid-row: 3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Tablet portrait: same header stack as phone so subtitle clears body content. */
@media (orientation: portrait) and (min-width: 700px) {
  .setup-app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-items: start;
    margin-bottom: var(--setup-stack-gap);
  }

  .setup-app-header > div {
    display: contents;
  }

  .setup-app-header .app-brand-wordmark {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .setup-app-header .menu-button {
    grid-column: 2 / 3;
    grid-row: 1;
    align-self: start;
  }

  .setup-app-header h2 {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0.3rem;
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 0.98;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .setup-app-header .game-subtitle {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.menu-button {
  flex: 0 0 auto;
}

.settings-menu {
  position: absolute;
  top: 4.8rem;
  right: 1rem;
  left: 1rem;
  z-index: 12;
  display: none;
  flex-direction: column;
  padding: 0.85rem;
  background: rgba(17, 20, 21, 0.98);
  border: var(--container-border-lime);
  border-radius: 8px;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.42);
}

body.settings-menu-open .settings-menu {
  display: flex;
}

.settings-menu > * {
  margin-top: 0;
  margin-bottom: 0;
}

.settings-menu > * + * {
  margin-top: var(--setup-stack-gap);
}

.account-summary {
  display: flex;
  flex-direction: column;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  border: var(--container-border-lime);
  border-radius: 8px;
  font-weight: 900;
}

.account-summary > * + * {
  margin-top: 0.15rem;
}

.account-summary small {
  color: var(--muted);
  font-size: 0.78rem;
}

.space-create-form {
  display: none;
  flex-direction: column;
  padding: 0.65rem;
  background: rgba(166, 230, 0, 0.06);
  border: var(--container-border-lime);
  border-radius: 8px;
}

.space-create-form > * + * {
  margin-top: 0.45rem;
}

.space-create-form label,
.space-menu-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.space-create-form input {
  width: 100%;
  min-height: 2.7rem;
  padding: 0 0.75rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(242, 222, 193, 0.18);
  border-radius: 6px;
  font: inherit;
  font-weight: 900;
}

.close-menu-button {
  width: 100%;
}

.settings-menu > button,
.settings-menu > a {
  width: 100%;
  text-align: center;
}

body.playing-mode .details-panel {
  padding: 0.7rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: var(--container-border-lime);
}

body.playing-mode .details-panel .setup-app-header,
body.playing-mode .details-panel .setup-page-body {
  display: none;
}

body.playing-mode .details-panel .settings-menu {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  z-index: auto;
  display: flex;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.playing-mode .details-panel .dropdown-row {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
}

body.playing-mode .details-panel .dropdown-row select {
  width: 100%;
  margin-top: 0.3rem;
}

body.playing-mode .details-panel .settings-remote-code-panel {
  padding: 0.65rem;
  border: var(--container-border-lime);
  border-radius: 8px;
}

.details-panel .brand-row h2 {
  flex: 0 0 100%;
  margin: 0.35rem 0 0;
  line-height: 1;
}

.game-subtitle {
  display: block;
  flex: 0 0 100%;
  min-height: 1.15rem;
  margin: 0.25rem 0 0;
  padding-bottom: 0.1rem;
  overflow: hidden;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-box {
  display: none;
}

body.setup-mode .details-panel {
  border: var(--container-border-lime);
}

.setup-page-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
}

body.setup-mode .setup-page-brand-row {
  display: none;
}

.setup-view.setup-game-view,
.setup-view.setup-remote-join-view,
.setup-view.setup-player-view,
.setup-view.setup-profile-view {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.setup-game-view,
.setup-remote-join-view,
.setup-player-view {
  gap: var(--setup-stack-gap);
}

body.setup-game-screen .setup-app-header {
  margin-bottom: 0.55rem;
}

body.setup-game-screen .setup-game-view {
  gap: 0.85rem;
}

.setup-view .setup-panel {
  padding: 0.7rem;
  background: rgba(10, 12, 13, 0.52);
  border: var(--container-border-lime);
  border-radius: 8px;
}

.setup-game-view .setup-panel > .label,
.setup-remote-join-view .setup-panel > .label {
  display: block;
  margin: 0 0 0.55rem;
  padding: 0;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.setup-rule-summary .setup-helper-text {
  margin-top: 0;
}

.setup-instructions-button {
  margin-bottom: 0.55rem;
}

body.setup-game-screen .setup-game-view > .setup-panel:not(.setup-rule-summary) {
  flex: 0 0 auto;
}

body.setup-game-screen .setup-game-view .setup-rule-summary {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

body.setup-game-screen .setup-game-view .setup-rule-summary .setup-helper-text {
  flex: 1 1 auto;
  min-height: 0;
}

.setup-game-view #gameTypeHelp,
.setup-game-view #remoteRoleHelp {
  display: none;
}

.setup-view {
  display: none;
}

body.setup-game-screen .setup-page-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.setup-game-screen .setup-game-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-start;
  align-content: flex-start;
  min-height: 0;
  padding-top: 0.1rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view {
  display: flex;
  overflow: hidden;
}

body.setup-mode .setup-page-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

/* Screen-local headers sit above scrollable body content (no divider lines). */
.setup-player-view .players-screen-header,
.setup-remote-join-view .players-screen-header,
.setup-profile-view .players-screen-header {
  flex: 0 0 auto;
  margin-bottom: var(--setup-stack-gap);
}

/* Child containers inside setup body (lime borders). */
body.setup-mode .setup-page-body .setup-panel,
body.setup-mode .setup-player-view .player-action-row,
body.setup-mode .setup-player-view .player-suggestions .suggestion-section,
body.setup-mode .setup-player-view .player-suggestions .suggestion-chip-panel,
body.setup-mode .setup-remote-join-view .options-scroll > .setup-panel,
body.setup-mode .setup-profile-view .player-profile-form,
body.setup-mode .setup-profile-view .claim-profile-form {
  padding: var(--setup-container-pad);
  background: rgba(10, 12, 13, 0.52);
  border: var(--container-border-lime);
  border-radius: 8px;
}

body.setup-mode .setup-player-view .suggestion-section .suggestion-chip-panel {
  margin-top: 0;
  padding: var(--setup-container-pad);
  background: rgba(10, 12, 13, 0.35);
}

.setup-player-view .players-screen-header .label,
.setup-player-view .suggestion-heading,
.setup-player-view .add-player-dialog-form .label,
.setup-player-view .players-screen-header + .options-scroll > .label {
  color: var(--gold);
}

/* Players page uses the game title above; hide duplicate "Players" page label. */
body.setup-player-screen .players-screen-header .label {
  display: none;
}

.setup-player-view .player-grid {
  margin-top: var(--setup-stack-gap);
}

.setup-player-view .player-card,
.setup-player-view .empty-player-card {
  margin-bottom: 0.65rem;
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view .player-suggestions {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: var(--setup-stack-gap);
  margin-top: 0;
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view .player-suggestions .suggestion-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
}

body.setup-player-screen .setup-player-view .suggestion-heading {
  margin: 0;
}

/* Keep player controls visible; scroll only long available-player lists (modern UI). */
body.setup-player-screen:not(.ui-legacy) .setup-player-view .options-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  gap: var(--setup-stack-gap);
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view .available-players-section {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view .staged-players-section,
body.setup-player-screen:not(.ui-legacy) .setup-player-view .available-players-section {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view .staged-players-section .suggestion-chip-panel,
body.setup-player-screen:not(.ui-legacy) .setup-player-view .available-players-section .suggestion-chip-panel {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view .staged-players-section .suggestion-chip-panel {
  display: block;
}

body.setup-player-screen:not(.ui-legacy) .setup-player-view .available-players-section .suggestion-chip-panel {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.75rem;
}

body.setup-player-screen #statusLine {
  display: block;
  order: 1;
  margin: 0;
  min-height: 0;
}

/* Paired action rows: flex + sibling margin (grid gap is unreliable on legacy WebKit). */
.dialog-actions,
.confirm-actions,
.player-action-row,
.invite-actions,
body.setup-game-screen .setup-game-nav.setup-footer-nav,
body.setup-player-screen .setup-player-nav.setup-footer-nav {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-align-items: stretch;
  align-items: stretch;
  width: 100%;
}

.dialog-actions {
  margin-top: 0.15rem;
}

.confirm-actions {
  margin-top: 0;
}

.dialog-actions > *,
.confirm-actions > *,
.player-action-row > *,
.invite-actions > *,
body.setup-game-screen .setup-game-nav.setup-footer-nav > *,
body.setup-player-screen .setup-player-nav.setup-footer-nav > * {
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
  min-width: 0;
}

.dialog-actions > * + *,
.confirm-actions > * + *,
.player-action-row > * + *,
.invite-actions > * + *,
body.setup-game-screen .setup-game-nav.setup-footer-nav > *:not([hidden]) + *,
body.setup-player-screen .setup-player-nav.setup-footer-nav > * + * {
  margin-left: var(--setup-stack-gap);
}

.confirm-actions > * + * {
  margin-left: 0.5rem;
}

.dialog-actions > [hidden],
body.setup-game-screen .setup-game-nav.setup-footer-nav > [hidden] {
  display: none !important;
}

.dialog-actions > [hidden] + *,
body.setup-game-screen .setup-game-nav.setup-footer-nav > [hidden] + * {
  margin-left: 0;
}

/* Setup paired buttons: equal columns + centered labels (incl. legacy WebKit). */
.player-action-row > .primary-button,
.player-action-row > .secondary-button,
.dialog-actions > .footer-action-button,
.dialog-actions > .primary-button,
.dialog-actions > .secondary-button,
.confirm-actions > .primary-button,
.confirm-actions > .secondary-button,
body.setup-player-screen .setup-footer-nav > .footer-action-button,
body.setup-game-screen .setup-footer-nav > .footer-action-button {
  -webkit-appearance: none;
  appearance: none;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  box-sizing: border-box;
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  text-align: center;
  line-height: 1.15;
}

.confirm-actions > .primary-button,
.confirm-actions > .secondary-button,
.dialog-actions > .primary-button,
.dialog-actions > .secondary-button {
  width: 0;
}

.player-action-row > .primary-button,
.player-action-row > .secondary-button,
.dialog-actions > .footer-action-button {
  width: 0;
}

.setup-footer-nav {
  display: none;
  margin-top: 0;
}

.footer-action-button,
.release-close-button {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  min-height: var(--btn-action-min-h);
  padding: 0 var(--btn-action-pad-x);
  border-radius: 8px;
  font-size: var(--btn-action-font-size);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
  cursor: pointer;
}

.release-shell > .footer-action-button,
.release-shell > .release-close-button {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-box-pack: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  width: 100%;
  -webkit-flex: none;
  flex: none;
  text-align: center;
}

.footer-action-button.setup-footer-back {
  background: var(--panel-2);
  border: 1px solid rgba(242, 222, 193, 0.14);
  color: var(--ink);
}

.footer-action-button.setup-footer-forward,
.release-close-button.setup-footer-forward {
  background: var(--gold);
  border: 0;
  color: #16120a;
}

body.setup-game-screen .options-footer,
body.setup-player-screen .options-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--setup-stack-gap);
  padding-top: 0;
  border-top: 0;
  background: transparent;
}

body.setup-remote-join-screen .setup-remote-join-view,
body.setup-profile-screen .setup-profile-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.playing-mode .setup-view {
  display: none;
}

.players-screen-header {
  display: grid;
  flex: 0 0 auto;
  gap: 0.65rem;
  padding: 0;
}

.full-width-button {
  width: 100%;
  margin-top: 0.85rem;
}

.options-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0.8rem -0.25rem;
  padding: 0 0.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.options-footer {
  flex: 0 0 auto;
  margin-top: 0.75rem;
  padding-top: 0;
}

body.setup-game-screen .options-footer,
body.setup-player-screen .options-footer {
  display: flex;
}

body.setup-game-screen .setup-game-nav.setup-footer-nav,
body.setup-player-screen .setup-player-nav.setup-footer-nav {
  display: -webkit-flex !important;
  display: flex !important;
  order: 2;
}

body.setup-game-screen .setup-game-nav #whatsNewMenuButton[hidden] + #addPlayersNavButton {
  -webkit-flex: 1 1 100%;
  flex: 1 1 100%;
  margin-left: 0;
}

body.setup-game-screen .setup-player-nav,
body.setup-player-screen .setup-game-nav {
  display: none !important;
}

body.setup-profile-screen .options-footer {
  display: none;
}

body.setup-remote-join-screen .options-footer {
  display: none;
}

.panel-actions {
  display: -webkit-flex;
  display: flex;
  flex: 0 0 auto;
}

.panel-actions > * + * {
  margin-left: 0.45rem;
}

.compact-button {
  min-height: var(--btn-compact-min-h);
  padding: 0 var(--btn-compact-pad-x);
  font-size: var(--btn-compact-font-size);
}

/* Segmented choice controls (What's New tabs + game setup toggles) */
.mode-tabs {
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.mode-tabs > * {
  margin-bottom: 0.35rem;
}

.mode-tabs > * + * {
  margin-left: 0.35rem;
}

.release-tab-button,
.mode-button,
.game-type-button,
.remote-role-button,
.round-button,
.race-round-button,
.around-rule-button,
.around-toggle-button,
.killer-toggle-button,
.killer-lives-button,
.x01-toggle-button {
  -webkit-appearance: none;
  appearance: none;
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--btn-segment-min-h);
  box-sizing: border-box;
  padding: 0 var(--btn-segment-pad-x);
  border: var(--container-border-lime);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: var(--btn-segment-font-size);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.release-tab-button.is-active,
.mode-button.active,
.game-type-button.active,
.remote-role-button.active,
.round-button.active,
.race-round-button.active,
.around-rule-button.active,
.around-toggle-button.active,
.killer-toggle-button.active,
.killer-lives-button.active,
.x01-toggle-button.active {
  border-color: var(--lime-border-color);
  background: rgba(166, 230, 0, 0.1);
  color: var(--gold);
}

.around-options {
  display: none;
}

.remote-game-only {
  display: none;
}

body.remote-game-selected .remote-game-only {
  display: block;
}

body.remote-game-selected.remote-join-selected .host-game-setup {
  display: none !important;
}

.join-code-row {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-align-items: stretch;
  align-items: stretch;
  width: 100%;
}

.join-code-row > * {
  min-width: 0;
}

.join-code-row > input {
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
}

.join-code-row > * + * {
  margin-left: 0.65rem;
}

.join-code-row input {
  text-align: center;
  letter-spacing: 0.08em;
}

.remote-join-status {
  margin-bottom: 0;
}

body:not(.around-mode) .around-options {
  display: none !important;
}

body.around-mode .around-options {
  display: block;
}

.killer-options {
  display: none;
}

.race-options {
  display: none;
}

.best-of-options[hidden],
.race-options[hidden] {
  display: none !important;
}

.x01-options {
  display: none;
}

body:not(.killer-mode) .killer-options {
  display: none !important;
}

body.killer-mode .killer-options {
  display: block;
}

body.race-mode .race-options {
  display: block;
}

.around-toggle-button:disabled,
.game-type-button:disabled,
.race-round-button:disabled,
.killer-toggle-button:disabled,
.killer-lives-button:disabled,
.x01-toggle-button:disabled {
  opacity: 0.45;
}

.setup-helper-text {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.target-highlight {
  fill: none;
  stroke: rgba(223, 180, 82, 0.95);
  stroke-width: 8;
  pointer-events: none;
}

body.board-margin-compact .target-highlight,
body.board-margin-compact .killer-target-highlight {
  stroke-width: 6;
}

.killer-target-highlight {
  fill: none;
  stroke: rgba(223, 180, 82, 0.9);
  stroke-width: 8;
  pointer-events: none;
}

.killer-target-highlight.opponent {
  stroke: rgba(210, 55, 48, 0.9);
}

.setup-panel {
  display: block;
}

.select-row {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.dropdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--btn-compact-min-h);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.dropdown-row span {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.dropdown-row select {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--btn-compact-min-h);
  min-height: var(--btn-compact-min-h);
  padding: 0 2.25rem 0 0.75rem;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
  background-color: var(--panel-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23bdbdb8' d='M2.2 4.2 6 8l3.8-3.8-.9-.9L6 6.2l-2.9-2.9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 0.75rem;
  color: var(--ink);
  font-size: var(--btn-compact-font-size);
  font-weight: 900;
  line-height: 1.15;
  appearance: none;
  -webkit-appearance: none;
}

.options-bottom .dropdown-row + .dropdown-row {
  margin-top: 0.65rem;
}

.options-bottom {
  display: none;
}

body.setup-game-screen .options-bottom {
  display: none;
}

.danger-button {
  color: #ffcbc1;
}

.add-player-launch {
  display: none;
  width: 100%;
  margin-bottom: 0.55rem;
}

body.setup-player-screen .add-player-launch {
  display: none;
}

body.setup-game-screen .add-player-launch {
  display: none;
}

.player-grid {
  display: block;
}

body.setup-player-screen .player-grid {
  display: none;
}

.player-card {
  display: flex;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  background: var(--panel-2);
  border: 1px solid rgba(242, 222, 193, 0.12);
  border-radius: 8px;
  text-align: left;
}

.player-card-main {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 0.2rem;
}

.player-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.player-card.active {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.empty-player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  padding: 1.2rem;
  margin-bottom: 0.5rem;
  background: var(--panel-2);
  border: 1px dashed rgba(242, 222, 193, 0.24);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  width: 100%;
  cursor: pointer;
}

.empty-player-action {
  border: 1px dashed rgba(242, 222, 193, 0.24);
}

.empty-player-action:hover,
.empty-player-action:active {
  border-color: var(--gold);
  background: rgba(223, 180, 82, 0.08);
}

.empty-player-card strong {
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 950;
}

.empty-player-card span {
  max-width: 18rem;
  margin-top: 0.45rem;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.player-name {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.player-name small {
  display: inline-block;
  margin-left: 0.3rem;
  color: var(--accent);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.player-score {
  margin-left: auto;
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.player-detail {
  display: block;
  margin-bottom: 0.45rem;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-section {
  margin-top: 0.55rem;
}

.suggestion-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.72;
}

.suggestion-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.suggestion-section-locked {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.suggestion-button.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.remote-game-only[hidden] {
  display: none !important;
}

.stats-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin-top: 0.7rem;
  padding: 0.4rem 0;
  border-top: 1px solid rgba(242, 222, 193, 0.1);
  border-bottom: 1px solid rgba(242, 222, 193, 0.1);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.stats-line span {
  display: block;
  flex: 1 1 50%;
  min-width: 50%;
}

.stats-line small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-right: 0.35rem;
}

.stats-line strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.remove-player {
  width: auto;
  min-height: 2rem;
  padding: 0 0.55rem;
  background: #101213;
  border: 1px solid rgba(255, 203, 193, 0.24);
  border-radius: 8px;
  color: #ffcbc1;
  font-size: 0.78rem;
  font-weight: 900;
}

.order-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-self: stretch;
  justify-content: center;
  gap: 0.25rem;
  padding-right: 0.55rem;
  border-right: 1px solid rgba(242, 222, 193, 0.14);
}

.order-button {
  width: 2.05rem;
  height: 50%;
  min-height: 2.05rem;
  padding: 0;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.round-box {
  padding: 0.9rem;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.11);
  border-radius: 8px;
}

.round-box > div {
  min-width: 4rem;
}

.round-box strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
}

.status-line {
  min-height: 2.6rem;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.confirm-overlay,
.dialog-overlay,
.scoreboard-screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  display: none;
}

.confirm-overlay {
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.46);
}

.dialog-overlay {
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.48);
}

body.add-player-open .dialog-overlay {
  display: flex;
}

.dialog-card {
  width: min(25rem, calc(100vw - 2rem));
  padding: 1rem;
  background: rgba(17, 20, 21, 0.98);
  border: 1px solid rgba(242, 222, 193, 0.2);
  border-radius: 8px;
  box-shadow: 0 2rem 5rem var(--shadow);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dialog-header h2 {
  margin: 0;
  font-size: 2rem;
}

.add-player-dialog-form {
  display: grid;
  gap: 0.6rem;
}

.dialog-purpose {
  margin: -0.2rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.invite-player-panel {
  text-align: center;
}

.invite-code {
  display: block;
  padding: 0.7rem 0.85rem;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.18);
  border-radius: 8px;
  color: var(--cream);
  font-size: 2.8rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

.remote-reconnect-countdown {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 12px 0 4px;
}

.player-connection-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.player-connection-pill.is-reconnecting {
  color: #f5d76e;
  background: rgba(245, 215, 110, 0.16);
}

.player-connection-pill.is-disconnected {
  color: #ff8f8f;
  background: rgba(255, 80, 80, 0.16);
}

body.remote-reconnect-open #remoteReconnectOverlay {
  display: flex;
}

body.remote-game-ended-open #remoteGameEndedOverlay {
  display: block;
}

.settings-remote-code-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--lime-border-color);
}

.settings-remote-code-panel[hidden] {
  display: none !important;
}

.settings-remote-code-panel .invite-code {
  display: block;
  margin: 8px 0;
}

.invite-code-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.35;
}

.remote-lobby-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.remote-lobby-empty,
.remote-lobby-player {
  margin: 0;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(242, 222, 193, 0.1);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.25;
}

.remote-lobby-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  text-align: left;
}

.remote-ready-pill {
  flex: 0 0 auto;
  color: var(--cream);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.invite-dialog-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.remote-player-chip {
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(125, 211, 252, 0.08);
}

.remote-player-chip .remote-ready-pill {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(242, 222, 193, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.remote-player-chip .remote-ready-pill.is-ready {
  border-color: rgba(158, 240, 181, 0.35);
  color: #9ef0b5;
}

.remote-ready-pill.is-disconnected,
.remote-player-chip.is-disconnected {
  border-color: rgba(255, 158, 158, 0.35);
}

.remote-ready-pill.is-disconnected {
  color: #ffb0b0;
}

.remote-player-chip.is-disconnected {
  background: rgba(255, 120, 120, 0.08);
}

.remote-remove-button {
  flex: 0 0 auto;
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
}

.player-action-row {
  margin-bottom: 0;
}

.player-action-row .primary-button,
.player-action-row .secondary-button {
  min-width: 0;
}

.player-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
}

body.add-player-open .player-dialog-overlay#addPlayerDialog,
body.import-player-open .player-dialog-overlay#importPlayerDialog,
body.invite-player-open .player-dialog-overlay#invitePlayerDialog {
  display: grid;
}

.player-dialog-card {
  width: min(26rem, calc(100vw - 2rem));
  padding: 1rem;
  background: rgba(17, 20, 21, 0.98);
  border: var(--container-border-lime);
  border-radius: 8px;
  box-shadow: 0 2rem 5rem var(--shadow);
}

#addPlayerDialog .add-player-dialog-form input,
#importPlayerDialog .add-player-dialog-form input {
  border: var(--container-border-lime);
}

.add-player-inline-form {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(242, 222, 193, 0.12);
  border-radius: 8px;
}

body.setup-player-screen .add-player-inline-form {
  border: var(--container-border-lime);
  background: rgba(10, 12, 13, 0.52);
}

.import-player-form {
  display: grid;
  gap: 0.6rem;
}

.add-player-dialog-form .label,
.suggestion-heading {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.95;
}

.add-player-dialog-form input {
  width: 100%;
  box-sizing: border-box;
  font-size: 1.15rem;
}

.input-error {
  min-height: 1.35rem;
  margin: 0.45rem 0 0;
  color: #ff2b2b;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.suggestion-section {
  margin-top: 1.15rem;
}

.suggestion-chip-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
}

body.setup-mode .setup-player-view .suggestion-chip-panel {
  background: rgba(10, 12, 13, 0.35);
}

.suggestion-chip {
  min-height: 2.25rem;
  padding: 0.25rem 0.65rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 0.45rem;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}

.available-player-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  min-height: 0;
  padding: 0;
  border-width: 0;
  border-radius: 999px;
}

.available-player-chip::after {
  content: "";
  position: absolute;
  inset: -0.2rem;
  border-radius: 999px;
}

.suggestion-chip:active {
  transform: scale(0.98);
}

.suggestion-chip-locked {
  opacity: 0.42;
  cursor: not-allowed;
}

.suggestion-chip-panel-locked {
  background: rgba(255, 255, 255, 0.07);
}

.suggestion-chip-panel-staged {
  display: block;
  background: rgba(255, 255, 255, 0.1);
}

body.setup-mode .setup-player-view .suggestion-chip-panel-staged,
body.setup-mode .setup-player-view .suggestion-chip-panel-locked {
  background: rgba(10, 12, 13, 0.35);
}

.suggestion-chip-staged {
  opacity: 0.7;
  cursor: default;
}

.suggestion-chip-staged {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.45rem;
  opacity: 0.9;
  cursor: default;
}

.setup-player-chip {
  min-height: 2.8rem;
  padding: 0.35rem 0.45rem;
}

.setup-player-chip .player-chip-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-player-chip .staged-edit-button {
  margin-left: auto;
}

.chip-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  overflow: hidden;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.2);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 950;
}

.available-avatar {
  width: 2.45rem;
  height: 2.45rem;
  font-size: 0.82rem;
}

.chip-avatar::before {
  content: attr(data-initials);
}

.chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chip-avatar.has-image::before {
  content: "";
}

body.ui-legacy .chip-avatar img {
  display: none;
}

body.ui-legacy .chip-avatar.has-image::before {
  content: attr(data-initials);
}

body.ui-legacy .available-player-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.65rem;
  height: 4.65rem;
  min-width: 4.65rem;
  min-height: 4.65rem;
  border: 2px solid rgba(242, 222, 193, 0.28);
  background: rgba(0, 0, 0, 0.36);
}

body.ui-legacy .available-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 3.05rem;
  height: 3.05rem;
  min-width: 3.05rem;
  min-height: 3.05rem;
  font-size: 1rem;
  line-height: 3.05rem;
  text-align: center;
  transform: translate(-50%, -50%);
}

body.ui-legacy .suggestion-chip {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.ui-legacy .suggestion-chip-panel {
  gap: 0;
  padding: 0.7rem 0.55rem 0.5rem;
}

body.ui-legacy .suggestion-chip {
  margin: 0 0.55rem 0.55rem 0;
}

body.ui-legacy .suggestion-chip-staged {
  display: flex;
  width: 100%;
  min-height: 3.65rem;
  align-items: center;
  justify-content: flex-start;
  padding: 0.35rem 0.45rem;
  border-color: rgba(242, 222, 193, 0.5);
  background: rgba(12, 14, 15, 0.72);
  opacity: 1;
}

body.ui-legacy .setup-player-chip .setup-player-order,
body.ui-legacy .setup-player-chip .chip-avatar,
body.ui-legacy .setup-player-chip .player-chip-name,
body.ui-legacy .setup-player-chip .staged-edit-button {
  margin-right: 0.55rem;
}

body.ui-legacy .setup-player-chip .setup-player-order {
  padding-right: 0.55rem;
}

body.ui-legacy .setup-player-chip .chip-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-width: 2px;
  font-size: 0.78rem;
}

body.ui-legacy .setup-player-chip .player-chip-name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 1.15rem;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-legacy .setup-player-chip .staged-edit-button {
  margin-left: auto;
}

body.ui-legacy .setup-player-chip .staged-remove-button {
  margin-left: 0;
}

body.ui-legacy .setup-player-chip .staged-edit-button,
body.ui-legacy .setup-player-chip .staged-remove-button {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
}

body.ui-legacy .setup-player-chip .staged-order-button {
  width: 1.75rem;
  height: 1.25rem;
}

body.ui-legacy.setup-player-screen .details-panel {
  position: absolute;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  overflow: hidden;
}

body.ui-legacy.setup-player-screen .setup-app-header {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
}

body.ui-legacy.setup-player-screen .setup-page-body {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
}

body.ui-legacy.setup-player-screen .setup-game-view,
body.ui-legacy.setup-player-screen .setup-remote-join-view,
body.ui-legacy.setup-player-screen .setup-profile-view {
  display: none !important;
}

body.ui-legacy.setup-game-screen .setup-game-view {
  gap: 0;
}

body.ui-legacy.setup-game-screen .setup-game-view > .setup-panel + .setup-panel {
  margin-top: var(--setup-stack-gap);
}

body.ui-legacy.setup-player-screen .setup-player-view {
  position: static;
  display: -webkit-flex;
  display: flex;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

body.ui-legacy.setup-player-screen .setup-player-view .options-scroll {
  position: static;
  display: -webkit-flex;
  display: flex;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0 0.15rem;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

body.ui-legacy.setup-player-screen .options-footer {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  display: block;
  margin-top: 0;
  padding-top: 0.75rem;
  background: rgba(17, 20, 21, 0.96);
}

body.ui-legacy.setup-player-screen .add-player-inline-form {
  position: static;
  margin: 0 0 0.8rem;
}

body.ui-legacy.setup-player-screen .setup-player-view .player-action-row {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  align-items: stretch;
  height: auto;
  min-height: 0;
  margin-bottom: var(--setup-stack-gap);
}

body.ui-legacy.setup-player-screen .setup-player-view .player-suggestions {
  display: -webkit-flex;
  display: flex;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

body.ui-legacy.setup-player-screen .setup-player-view .player-suggestions .suggestion-section {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  margin: 0 0 var(--setup-stack-gap);
}

body.ui-legacy.setup-player-screen .setup-player-view .player-suggestions .suggestion-section:last-child {
  margin-bottom: 0;
}

body.ui-legacy.setup-player-screen .setup-player-view .staged-players-section,
body.ui-legacy.setup-player-screen .setup-player-view .available-players-section {
  display: -webkit-flex;
  display: flex;
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.ui-legacy.setup-player-screen .setup-player-view .staged-players-section .suggestion-chip-panel,
body.ui-legacy.setup-player-screen .setup-player-view .available-players-section .suggestion-chip-panel {
  display: block;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.ui-legacy.setup-player-screen .setup-player-view .available-players-section .suggestion-chip-panel {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.75rem;
}

/* Legacy iPad / coarse tablet: generous touch targets and centered button labels. */
@media (pointer: coarse) and (min-width: 700px) {
  body.ui-legacy .mode-button,
  body.ui-legacy .game-type-button,
  body.ui-legacy .remote-role-button,
  body.ui-legacy .round-button,
  body.ui-legacy .race-round-button,
  body.ui-legacy .around-rule-button,
  body.ui-legacy .around-toggle-button,
  body.ui-legacy .killer-toggle-button,
  body.ui-legacy .killer-lives-button,
  body.ui-legacy .x01-toggle-button {
    display: -webkit-inline-flex !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.65rem;
    padding: 0 0.7rem !important;
    font-size: 0.88rem;
    line-height: 1 !important;
    text-align: center !important;
  }

  body.ui-legacy.playing-mode .throw-strip {
    padding: 0.65rem;
  }

  body.ui-legacy.playing-mode .actions-section > * + * {
    margin-top: 0.55rem;
  }

  /* In-game action-row layout: see legacy flex rules at end of stylesheet. */

  body.ui-legacy .player-action-row .primary-button,
  body.ui-legacy .player-action-row .secondary-button,
  body.ui-legacy .setup-footer-nav .footer-action-button,
  body.ui-legacy .confirm-actions > .primary-button,
  body.ui-legacy .confirm-actions > .secondary-button,
  body.ui-legacy .dialog-actions > .primary-button,
  body.ui-legacy .dialog-actions > .secondary-button,
  body.old-ios-device .confirm-actions > .primary-button,
  body.old-ios-device .confirm-actions > .secondary-button,
  body.old-ios-device .dialog-actions > .primary-button,
  body.old-ios-device .dialog-actions > .secondary-button {
    min-height: var(--btn-action-min-h);
    padding: 0 var(--btn-action-pad-x) !important;
    font-size: var(--btn-action-font-size);
    -webkit-appearance: none;
    appearance: none;
    display: -webkit-box !important;
    -webkit-box-pack: center !important;
    -webkit-box-align: center !important;
    -webkit-box-flex: 1 !important;
    width: 0 !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  body.ui-legacy .compact-button {
    min-height: var(--btn-compact-min-h);
    padding: 0.5rem var(--btn-compact-pad-x);
    font-size: var(--btn-compact-font-size);
  }
}

.setup-player-order {
  display: inline-grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.12rem;
  padding-right: 0.45rem;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.staged-order-button {
  width: 1.45rem;
  height: 1.05rem;
  min-height: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}

.staged-remove-button {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  flex: 0 0 auto;
}

.staged-edit-button {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(223, 180, 82, 0.24);
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  flex: 0 0 auto;
}

@media (pointer: coarse), (max-width: 430px) {
  .setup-player-chip {
    min-height: 3.35rem;
    padding: 0.5rem 0.55rem;
    gap: 0.6rem;
  }

  .setup-player-chip .staged-order-button {
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    font-size: 1rem;
  }

  .setup-player-chip .staged-remove-button,
  .setup-player-chip .staged-edit-button {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    font-size: 1.2rem;
  }

  .remote-player-chip .remote-ready-pill {
    font-size: 0.82rem;
    padding: 0.35rem 0.55rem;
  }

  .remote-player-chip .remote-remove-button {
    min-height: 2.5rem;
    padding: 0.45rem 0.7rem;
  }

  .player-action-row .primary-button,
  .player-action-row .secondary-button {
    min-height: var(--btn-action-min-h);
    font-size: var(--btn-action-font-size);
  }
}

.staged-remove-button:active {
  transform: scale(0.94);
}

.staged-edit-button:active {
  transform: scale(0.94);
}

.suggestion-empty {
  margin: 0;
  opacity: 0.55;
  font-size: 0.9rem;
}

.player-suggestions {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 0.5rem;
}

.setup-player-view .player-suggestions {
  gap: var(--setup-stack-gap);
  margin-top: 0;
}

.player-suggestions .suggestion-section {
  width: 100%;
  margin-top: 0;
}

body.setup-player-screen .setup-player-view .player-suggestions .suggestion-section {
  margin-top: 0;
}

.player-profile-form {
  display: grid;
  gap: 0.85rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(242, 222, 193, 0.12);
  border-radius: 8px;
}

body.setup-profile-screen .profile-toggle-field {
  border: var(--container-border-lime);
  background: rgba(10, 12, 13, 0.35);
}

.profile-toggle-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(242, 222, 193, 0.12);
  border-radius: 8px;
  color: var(--text);
  font-weight: 900;
}

.profile-toggle-field input {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--gold);
}

.claim-profile-form {
  border-color: rgba(223, 180, 82, 0.28);
  background: rgba(223, 180, 82, 0.08);
}

.avatar-picker {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0 0.25rem;
}

.avatar-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  overflow: hidden;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.18);
  border-radius: 999px;
  object-fit: cover;
}

.avatar-preview:not([src])::before {
  content: attr(data-initials);
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 950;
}

.avatar-upload-button {
  width: 100%;
}

.profile-form-actions {
  margin-top: 0;
}

.profile-form-actions > * {
  flex: 1 1 0;
  min-width: 0;
}

.profile-form-actions > * + * {
  margin-left: var(--setup-stack-gap);
}

.profile-field {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-field small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: none;
}

.suggestions-title {
  margin-top: 1rem;
}

.suggestion-button {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
}

.suggestion-skeleton {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
}

.suggestion-skeleton span {
  display: block;
  width: 6rem;
  height: 2.25rem;
  background: rgba(242, 222, 193, 0.14);
  border: 1px solid rgba(242, 222, 193, 0.1);
  border-radius: 8px;
  animation: suggestionSkeletonPulse 1.1s ease-in-out infinite;
}

@keyframes suggestionSkeletonPulse {
  0% { opacity: 0.45; }
  50% { opacity: 1; }
  100% { opacity: 0.45; }
}

.board-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.72));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.board-loading-overlay[hidden] {
  display: none !important;
}

.board-loading-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.1rem 1.25rem;
  background: rgba(17, 20, 21, 0.86);
  border: 1px solid rgba(166, 230, 0, 0.22);
  border-radius: 14px;
  box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.55);
}

.board-loading-spinner {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 4px solid rgba(242, 222, 193, 0.18);
  border-top-color: var(--gold);
  animation: boardLoadingSpin 900ms linear infinite;
}

.board-loading-label {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

@keyframes boardLoadingSpin {
  to { transform: rotate(360deg); }
}

body.board-loading .board-stage {
  pointer-events: none;
}

.players-loading-overlay {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 7rem;
  padding: 1rem 0.25rem;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.players-loading-overlay[hidden] {
  display: none !important;
}

.players-loading-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: rgba(17, 20, 21, 0.92);
  border: 1px solid rgba(166, 230, 0, 0.22);
  border-radius: 14px;
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.55);
}

.players-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(242, 222, 193, 0.18);
  border-top-color: var(--gold);
  animation: boardLoadingSpin 900ms linear infinite;
}

.players-loading-label {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

body.players-loading .setup-player-view {
  pointer-events: none;
}

.release-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 8vh, 4rem) 1rem 1rem;
  background: rgba(0, 0, 0, 0.52);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body.release-open .release-overlay {
  display: flex;
  pointer-events: auto;
}

.release-shell {
  --release-container-gap: 0.7rem;
  --release-tab-gap: 0.35rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--release-container-gap);
  width: min(30rem, calc(100vw - 2rem));
  height: min(42rem, calc(100vh - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1rem 1rem 0.9rem;
  overflow: hidden;
  background: rgba(17, 20, 21, 0.98);
  border: var(--container-border-lime);
  border-radius: 10px;
  box-shadow: 0 2rem 5rem var(--shadow);
}

@supports (height: 100dvh) {
  .release-shell {
    height: min(42rem, calc(100dvh - clamp(1rem, 8vh, 4rem) - 1rem));
    max-height: calc(100dvh - clamp(1rem, 8vh, 4rem) - 1rem);
  }
}

@media (min-width: 600px) {
  .release-shell {
    width: min(500px, calc(100vw - 2rem));
    max-width: 500px;
  }
}

.release-shell-header {
  min-width: 0;
}

.release-shell-header {
  text-align: center;
}

.release-shell-header .eyebrow {
  margin: 0 0 0.2rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.release-shell-header h2 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.1;
}

.release-tab-table {
  width: 100%;
  margin: var(--release-container-gap) 0 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.release-tab-table td {
  width: 33.333%;
  padding: 0;
  vertical-align: top;
}

.release-tab-table td + td {
  padding-left: var(--release-tab-gap);
}

.release-tab-button {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-box-pack: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  width: 100%;
  min-height: var(--btn-segment-min-h);
  line-height: 1.1;
  cursor: pointer;
}

.release-shell-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.release-feed-scroll {
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.release-feed {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  align-content: start;
  padding: 0.15rem 0.1rem 0.25rem;
}

.release-feed > * + * {
  margin-top: var(--release-container-gap);
}

html.old-ios-device .release-shell {
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
}

html.old-ios-device .release-feed-scroll {
  overflow-y: scroll;
}

.release-feature-card {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  padding: 0.85rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.22);
  border: var(--container-border-lime);
  border-radius: 8px;
}

.release-feature-card.is-unseen {
  border-color: var(--lime-border-color);
  box-shadow: none;
}

.release-feature-card.is-coming-soon {
  border-color: rgba(125, 178, 255, 0.32);
  box-shadow: none;
}

.release-feature-card.is-coming-soon .eyebrow {
  color: #9ec8ff;
}

.release-feature-card.is-superseded {
  border-color: rgba(220, 38, 38, 0.48);
}

.release-feature-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.release-feature-card .eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.release-feature-card h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.release-artwork {
  position: relative;
  width: min(100%, 400px);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  border: var(--container-border-lime);
  flex-shrink: 0;
}

.release-artwork.is-contained-artwork {
  width: min(100%, 400px);
  background: rgba(5, 5, 5, 0.45);
}

@media (max-height: 720px) {
  .release-artwork {
    width: min(100%, 320px);
  }
}

.release-artwork img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.release-artwork.is-contained-artwork img {
  box-sizing: border-box;
  padding: 0.55rem;
  object-fit: contain;
}

.release-superseded-stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  padding: 0.18rem 0.8rem 0.22rem;
  border: 0.16rem solid #c91818;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #ff2f2f;
  font-size: clamp(1.45rem, 7vw, 3.25rem);
  font-weight: 950;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-11deg);
  box-shadow: 0 0 0 0.08rem rgba(201, 24, 24, 0.38) inset;
  opacity: 0.9;
}

.release-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.release-superseded-note {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(220, 38, 38, 0.42);
  border-radius: 8px;
  background: rgba(90, 0, 0, 0.2);
  color: #ffd4d4;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.4;
  text-align: left;
}

.release-superseded-note strong {
  color: #ff6f6f;
  font-weight: 950;
  text-transform: uppercase;
}

.release-fix-item {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  padding: 0.75rem 0.85rem;
  text-align: left;
  background: rgba(0, 0, 0, 0.22);
  border: var(--container-border-lime);
  border-radius: 8px;
}

.release-fix-when {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.release-fix-feature {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.release-fix-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.release-vote-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.15rem;
}

.release-vote-row.is-artwork-overlay {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  z-index: 2;
  width: auto;
  margin-top: 0;
  padding: 0;
  justify-content: flex-end;
}

.release-vote-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 2.35rem;
  min-width: 3.15rem;
  padding: 0.35rem 0.72rem;
  border: var(--container-border-lime);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.release-vote-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.release-vote-icon {
  color: var(--brand-lime);
  display: inline-flex;
  width: 1.14rem;
  height: 1.14rem;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(166, 230, 0, 0.48));
}

.release-vote-icon::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  -webkit-mask: var(--release-vote-mask) center / contain no-repeat;
  mask: var(--release-vote-mask) center / contain no-repeat;
}

.release-vote-icon-dislike {
  --release-vote-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z'/%3E%3C/svg%3E");
}

.release-vote-icon-like {
  --release-vote-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h4V9H1v12zM23 10c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z'/%3E%3C/svg%3E");
}

.release-vote-icon-love {
  --release-vote-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

.release-vote-count {
  min-width: 0.9rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
}

.release-vote-dislike {
  border-color: rgba(165, 165, 165, 0.36);
}

.release-vote-dislike .release-vote-icon {
  color: #a9adb3;
  filter: none;
}

.release-vote-love .release-vote-icon {
  color: var(--brand-lime);
}

.release-vote-button.is-chosen {
  border-color: var(--lime-border-color);
  background: rgba(166, 230, 0, 0.16);
  color: var(--brand-lime);
  opacity: 1;
}

.release-vote-dislike.is-chosen {
  border-color: rgba(185, 190, 198, 0.55);
  background: rgba(62, 66, 72, 0.62);
  color: #d5d8de;
}

.release-vote-love.is-chosen {
  border-color: var(--lime-border-color);
  background: rgba(166, 230, 0, 0.18);
  color: var(--brand-lime);
}

body.app-awaiting-whats-new .app-shell {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.release-open .app-shell {
  pointer-events: none;
}

body.release-open .release-overlay,
body.release-open .release-overlay * {
  pointer-events: auto;
}

body.confirm-open #confirmOverlay {
  display: block;
}

body.remote-leave-open #remoteLeaveConfirmOverlay {
  display: block;
}

body.bust-open #bustOverlay {
  display: block;
}

.game-instructions-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(0.75rem, 5vh, 2rem) 1rem 1rem;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.game-instructions-open .game-instructions-overlay {
  display: flex;
}

.game-instructions-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(42rem, calc(100vw - 2rem));
  height: min(44rem, calc(100vh - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  background: rgba(17, 20, 21, 0.98);
  border: var(--container-border-lime);
  border-radius: 8px;
  box-shadow: 0 2rem 5rem var(--shadow);
}

@supports (height: 100dvh) {
  .game-instructions-shell {
    height: min(44rem, calc(100dvh - 2rem));
    max-height: calc(100dvh - 2rem);
  }
}

.game-instructions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(242, 222, 193, 0.12);
}

.game-instructions-header h2 {
  margin: 0.15rem 0 0;
  font-size: 2rem;
  line-height: 1;
}

.game-instructions-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.65rem;
  min-height: 0;
  padding: 0 1rem 1rem;
  overflow: hidden;
  overscroll-behavior: contain;
}

.game-instructions-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
}

.game-instructions-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.game-instructions-frame {
  width: 100%;
  min-height: 0;
  height: 100%;
  background: #0d1111;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
}

.game-instructions-summary,
.game-instruction-block {
  padding: 0.85rem;
  background: #101213;
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
}

.game-instructions-tabs {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem 0;
  overflow-x: auto;
  background: rgba(17, 20, 21, 0.96);
}

.game-instructions-tabs a {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  background: rgba(166, 230, 0, 0.08);
  border: 1px solid rgba(166, 230, 0, 0.2);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.game-instructions-summary h3,
.game-instruction-block h3 {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-size: 0.95rem;
  line-height: 1.15;
}

.game-instructions-summary p,
.game-instruction-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.45;
}

.game-instruction-block p + p {
  margin-top: 0.55rem;
}

.game-instruction-block ul,
.game-instruction-block ol {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
}

.game-instruction-block li::marker {
  color: var(--gold);
  font-weight: 900;
}

.confirm-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24rem;
  max-width: calc(100vw - 2rem);
  padding: 1rem;
  background: rgba(17, 20, 21, 0.96);
  border: 1px solid rgba(242, 222, 193, 0.2);
  border-radius: 8px;
  box-shadow: 0 2rem 5rem var(--shadow);
  transform: translate(-50%, -50%);
}

.confirm-card h2 {
  font-size: 2rem;
}

.confirm-card p {
  color: var(--muted);
  font-weight: 700;
}

.scoreboard-screen {
  z-index: 12;
  overflow: auto;
  background: #0e1112;
}

body.scoreboard-mode .scoreboard-screen {
  display: block;
}

body.scoreboard-mode .board-stage,
body.scoreboard-mode .score-strip,
body.scoreboard-mode .throw-strip,
body.scoreboard-mode .score-strip,
body.scoreboard-mode .throw-strip,
body.scoreboard-mode .rank-panel,
body.scoreboard-mode .details-panel,
body.scoreboard-mode .scrim,
body.scoreboard-mode .win-overlay {
  display: none;
}

.scoreboard-inner {
  width: min(72rem, calc(100vw - 3rem));
  margin: 0 auto;
  padding: 4vh 0;
}

.scoreboard-inner h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(3rem, 8vw, 7rem);
}

.scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.scoreboard-card {
  padding: 1.2rem;
  background: var(--panel);
  border: 1px solid rgba(242, 222, 193, 0.14);
  border-radius: 8px;
}

.scoreboard-card.active {
  outline: 4px solid var(--gold);
}

.scoreboard-card .player-name {
  font-size: 1.2rem;
}

.scoreboard-card .player-score {
  display: block;
  margin-top: 0.4rem;
  font-size: clamp(4rem, 10vw, 8rem);
}

.scoreboard-card .player-detail {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
}

body.setup-mode .details-panel {
  top: max(0.85rem, env(safe-area-inset-top));
  right: auto;
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 6;
  width: min(34rem, calc(100vw - 1.5rem));
  max-width: none;
  transform: translateX(-50%);
}

body.setup-mode .scrim {
  display: none;
}

body.setup-mode .board-stage {
  opacity: 0.18;
  pointer-events: none;
}

body.setup-mode .score-strip,
body.setup-mode .throw-strip {
  display: none;
}

body.remote-guest-live .board-stage,
body.remote-guest-live .score-strip,
body.remote-guest-live .throw-strip {
  opacity: 1;
  pointer-events: auto;
}

body.remote-guest-live .scrim {
  display: none;
}

body.setup-mode .rank-panel {
  display: none;
}

body.playing-mode #startGameButton,
body.setup-mode #endGameButton,
body.setup-mode #undoButton,
body.setup-mode #missButton,
body.setup-mode #nextButton {
  display: none;
}

body.setup-mode #statusLine {
  display: block;
}

body.setup-mode #closeDetailsButton {
  display: none;
}

@media (max-width: 700px) {
  .game-instructions-overlay {
    align-items: stretch;
    padding: 0;
  }

  .game-instructions-shell {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .game-instructions-header {
    padding: 0.9rem 0.9rem 0.7rem;
  }

  .game-instructions-body {
    padding: 0 0.9rem 0.9rem;
  }

  body.setup-mode .details-panel {
    bottom: auto;
    height: calc((100dvh - 1rem) / 0.75);
    min-height: calc((100dvh - 1rem) / 0.75);
    transform: translateX(-50%) scale(0.75);
    transform-origin: top center;
    width: min(34rem, calc((100vw - 1rem) / 0.75));
    max-height: calc((100dvh - 1rem) / 0.75);
  }

  /* Match unscaled dialog/footer buttons inside the 0.75 setup panel scale (phones only). */
  body.setup-mode:not(.ui-legacy) .setup-footer-nav .footer-action-button {
    min-height: calc(var(--btn-action-min-h) / 0.75);
    padding-left: calc(var(--btn-action-pad-x) / 0.75);
    padding-right: calc(var(--btn-action-pad-x) / 0.75);
    font-size: calc(var(--btn-action-font-size) / 0.75);
  }

  body.setup-mode.details-open .details-panel {
    transform: translateX(-50%) scale(0.75);
  }

  .app-shell {
    min-height: 32rem;
  }

  body:not(.playing-mode) .board-stage {
    top: 5.25rem;
    bottom: 8.4rem;
    padding: 0.35rem 0.5rem;
  }

  body:not(.playing-mode) .board-wrap {
    width: min(104vw, calc(100dvh - 13.2rem));
    height: min(104vw, calc(100dvh - 13.2rem));
  }

  .score-strip {
    min-height: 4.6rem;
  }

  .throw-strip {
    flex-direction: column;
  }

  .action-row {
    display: flex;
  }

  #nextButton {
    min-height: 2.1rem;
  }
}

/* Portrait phone: compact action rail (not tablets / legacy iPad). */
@media (orientation: portrait) and (max-width: 699px) {
  .throw-strip {
    flex-direction: row;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    width: 100%;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > .turn-action-slot {
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > * + * {
    margin-left: 0.35rem;
  }

  #nextButton {
    min-height: 2.1rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .primary-button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .secondary-button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .miss-button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row button {
    min-height: 2.1rem;
    padding: 0 0.35rem;
    font-size: 0.78rem;
  }
}

/* In-game landscape: side rails + centered board (phones, tablets, laptop). */
@media (orientation: landscape) {
  .app-shell {
    min-height: 0;
  }

  body.playing-mode .app-shell {
    display: block;
    padding-right: 0;
    padding-left: 0;
    row-gap: 0;
  }

  body.playing-mode .score-strip {
    position: absolute;
    top: max(0.5rem, env(safe-area-inset-top));
    left: max(0.5rem, env(safe-area-inset-left));
    z-index: 3;
    display: flex;
    flex-direction: column;
    width: 9.75rem;
    margin-top: 0;
    padding: 0.45rem;
    transform: none;
  }

  body.playing-mode .throw-strip {
    position: absolute;
    top: auto;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    left: max(0.5rem, env(safe-area-inset-left));
    z-index: 3;
    display: block;
    width: 9.75rem;
    margin-bottom: 0;
    padding: 0.55rem;
    transform: none;
  }

  body.playing-mode .board-stage {
    position: absolute;
    top: 0;
    right: 7.9rem;
    bottom: 0;
    left: 7.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 0;
    padding: 0.3rem;
    container-type: size;
    container-name: playing-board;
  }

  body.playing-mode .board-wrap {
    width: min(100cqw, 100cqh, 72rem);
    height: min(100cqw, 100cqh, 72rem);
    margin: auto;
  }

  body.playing-mode.x01-mode .hud-header {
    flex-direction: column;
  }

  body.playing-mode.x01-mode .hud-header-hints {
    flex: 1 1 auto;
    margin-top: 0.32rem;
  }

  body.playing-mode .score-strip {
    position: absolute;
    top: max(0.5rem, env(safe-area-inset-top));
    left: max(0.5rem, env(safe-area-inset-left));
    z-index: 3;
    display: flex;
    flex-direction: column;
    width: 9.75rem;
    min-height: 0;
    padding: 0.45rem;
    transform: none;
  }

  .hud-cell,
  .hud-section {
    padding: var(--phone-panel-gap);
    background: var(--surface-2);
    border: var(--container-border-lime);
    border-radius: 8px;
    box-sizing: border-box;
  }

  .score-strip .hud-cell,
  .score-strip .hud-section {
    margin-right: 0;
    margin-bottom: 0.42rem;
  }

  .score-strip .hud-cell:last-child,
  .score-strip .hud-section:last-child {
    margin-bottom: 0;
  }

  .hud-label {
    padding: 0.22rem 0.35rem;
    font-size: 0.78rem;
  }

  .hud-value {
    min-height: 1.8rem;
    padding: 0.25rem 0.35rem;
    font-size: 1.55rem;
  }

  .hud-hints,
  .hud-hints-line {
    font-size: 1rem;
  }

  body.playing-mode.x01-mode .hud-header-hints {
    margin-top: 0.32rem;
    padding: 0.32rem 0.4rem;
  }

  h1 {
    font-size: 1.9rem;
  }

  .score-strip .icon-button {
    width: 100%;
    margin-top: 0.8rem;
  }

  body.setup-mode .board-stage {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
  }

  body.setup-mode .board-wrap {
    width: min(98vw, calc(100dvh - 2rem), 72rem);
    height: min(98vw, calc(100dvh - 2rem), 72rem);
    max-width: min(calc(100vw - 2rem), 72rem);
    max-height: min(calc(100dvh - 2rem), 72rem);
  }

  body.max-board.playing-mode .board-stage {
    right: 7.25rem;
    left: 7.25rem;
    padding: 0.1rem;
  }

  body.max-board.playing-mode .board-wrap {
    max-width: calc(100vw - 14.7rem);
    width: min(calc(100vw - 14.7rem), 120vh);
    height: min(calc(100vw - 14.7rem), 120vh);
  }

  body.playing-mode .throw-strip {
    position: absolute;
    top: auto;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    left: max(0.5rem, env(safe-area-inset-left));
    z-index: 3;
    display: block;
    width: 9.75rem;
    padding: 0.55rem;
    transform: none;
  }

  body.playing-mode .hud-footer {
    display: block;
  }

  .throws-section {
    display: flex;
    width: 100%;
    margin-right: 0;
  }

  .actions-section {
    display: block;
    margin-right: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .actions-section > .hud-label {
    display: none;
  }

  body.playing-mode .rank-panel {
    top: 0.5rem;
    top: max(0.5rem, env(safe-area-inset-top));
    right: 0.5rem;
    right: max(0.5rem, env(safe-area-inset-right));
    display: block;
    width: 9.75rem;
    padding-top: 0.9rem;
  }

  body.setup-mode .rank-panel {
    display: none;
  }

  .throw-table {
    flex-direction: column;
  }

  .throw-head,
  .throw-score {
    min-height: 0;
  }

  .throw-score {
    border-bottom: 0;
  }

  .throw-item + .throw-item {
    border-left: 0;
    border-top: 1px solid rgba(242, 222, 193, 0.12);
  }

  body.setup-mode .details-panel {
    top: max(0.5rem, env(safe-area-inset-top));
    right: auto;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    left: 50%;
    width: min(34rem, calc(100vw - 1rem));
    transform: translateX(-50%);
  }

  body.setup-mode.details-open .details-panel {
    transform: translateX(-50%);
  }
}

/*
 * Landscape iPad / laptop in-game rails (rule-driven):
 * board diameter = short viewport side (100dvh in landscape)
 * total side UI   = long side − board diameter (100dvw − 100dvh)
 * each rail       = max(min width, total side UI / 2)
 * When min rails exceed available UI, board shrink is handled in a follow-up pass.
 */
@media (orientation: landscape) {
  body.playing-mode {
    --playing-board-diameter: 100dvh;
    --playing-ui-space-total: max(0px, calc(100dvw - var(--playing-board-diameter)));
    --playing-side-rail-min: 9.75rem;
    --playing-side-rail: max(
      var(--playing-side-rail-min),
      calc(var(--playing-ui-space-total) / 2)
    );
  }

  body.playing-mode .board-stage {
    right: var(--playing-side-rail);
    left: var(--playing-side-rail);
  }

  body.playing-mode .board-wrap {
    width: min(var(--playing-board-diameter), 100cqw, 100cqh);
    height: min(var(--playing-board-diameter), 100cqw, 100cqh);
  }

  body.max-board.playing-mode .board-stage {
    right: var(--playing-side-rail);
    left: var(--playing-side-rail);
    padding: 0.15rem;
  }

  body.max-board.playing-mode .board-wrap {
    width: min(var(--playing-board-diameter), 100cqw, 100cqh);
    height: min(var(--playing-board-diameter), 100cqw, 100cqh);
    max-width: 100%;
    max-height: 100%;
  }

  body.playing-mode .score-strip {
    left: 0;
    width: var(--playing-side-rail);
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: 0.45rem;
    box-sizing: border-box;
  }

  body.playing-mode .throw-strip {
    left: 0;
    width: var(--playing-side-rail);
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: 0.45rem;
    box-sizing: border-box;
  }

  body.playing-mode .rank-panel {
    right: 0;
    width: var(--playing-side-rail);
    padding-right: max(0.85rem, env(safe-area-inset-right));
    padding-left: 0.45rem;
    box-sizing: border-box;
  }

  body.playing-mode .action-row {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Landscape in-game: stacked left HUD, padded action rail, taller rank panel. */
@media (orientation: landscape) {
  body.playing-mode {
    --hud-block-border: var(--container-border-lime);
    --hud-cell-pad: 0.45rem;
    --hud-label-pad-y: 0.32rem;
    --hud-landscape-label-size: 0.88rem;
    --hud-label-value-gap: 0.38rem;
    --hud-landscape-value-size: 1.65rem;
    --hud-value-min-h: 2.5rem;
    --hud-value-pad-y: 0.35rem;
    --hud-stat-block-min-height: calc(
      (var(--hud-cell-pad) * 2) +
      (var(--hud-label-pad-y) * 2) + (var(--hud-landscape-label-size) * 1.1) +
      var(--hud-label-value-gap) +
      var(--hud-value-min-h) + (var(--hud-value-pad-y) * 2)
    );
  }

  body.playing-mode .score-strip .hud-cell,
  body.playing-mode .score-strip .hud-header-hints {
    border: var(--hud-block-border);
    min-height: var(--hud-stat-block-min-height);
    box-sizing: border-box;
  }

  body.playing-mode .score-strip {
    top: max(0.85rem, env(safe-area-inset-top));
    max-height: calc(100dvh - 13.75rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.playing-mode .score-strip .hud-header,
  body.playing-mode .score-strip .hud-header-top {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  body.playing-mode .score-strip .hud-cell {
    flex: 0 0 auto;
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.55rem;
    padding: var(--hud-cell-pad);
  }

  body.playing-mode .score-strip .hud-cell:last-child {
    margin-bottom: 0;
  }

  body.playing-mode .score-strip .hud-header-hints {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 0.55rem;
    padding: var(--hud-cell-pad);
    gap: 0.45rem;
  }

  body.playing-mode .score-strip .hud-label {
    padding: var(--hud-label-pad-y) 0.45rem;
    color: var(--gold);
    font-size: var(--hud-landscape-label-size);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  body.playing-mode .score-strip .hud-value,
  body.playing-mode .score-strip .throw-score {
    min-height: var(--hud-value-min-h);
    padding: var(--hud-value-pad-y) 0.45rem;
    font-size: var(--hud-landscape-value-size);
    font-weight: 950;
    line-height: 1;
  }

  body.playing-mode .score-strip .hud-hints-prefix {
    font-size: var(--hud-landscape-label-size);
    line-height: 1.1;
  }

  body.playing-mode .score-strip .hud-hints-line {
    font-size: var(--hud-landscape-value-size);
    line-height: 1;
  }

  body.playing-mode .hud-cell-throws .throw-table-header {
    flex-direction: row;
    min-height: var(--hud-value-min-h);
  }

  body.playing-mode .hud-cell-throws .throw-item + .throw-item {
    border-top: 0;
    border-left: 1px solid rgba(242, 222, 193, 0.12);
  }

  body.playing-mode .throw-strip {
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    padding-top: 0;
    padding-bottom: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row {
    display: -webkit-flex !important;
    display: flex !important;
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    -webkit-flex-direction: column;
    flex-direction: column;
    width: 100%;
    margin-top: 0;
    padding: 0.7rem 0.75rem;
    background: var(--surface-2);
    border: 1px solid rgba(242, 222, 193, 0.14);
    border-radius: 8px;
    box-shadow: 0 1rem 2.5rem var(--shadow);
    border-spacing: 0;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > .turn-action-slot {
    display: block !important;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 100%;
    min-height: 2.25rem;
    margin: 0;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > * + * {
    margin-left: 0;
    margin-top: 0.45rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .miss-button {
    display: block !important;
    width: 100% !important;
    line-height: 2.25rem !important;
    min-height: 2.25rem;
    text-align: center !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot {
    display: block !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot > button {
    display: block !important;
    width: 100% !important;
    min-height: 2.25rem;
    padding: 0 0.55rem;
    font-size: 0.82rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot > button + button {
    margin-left: 0;
    margin-top: 0.35rem;
  }

  body.playing-mode .rank-panel {
    top: max(0.85rem, env(safe-area-inset-top));
    bottom: auto;
    height: auto;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1.7rem);
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    align-self: flex-start;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }

  body.playing-mode .rank-list {
    display: grid;
    flex: 0 1 auto;
    gap: 0.5rem;
    min-height: 0;
    margin-top: 0.55rem;
    overflow-y: auto;
  }

  body.playing-mode .rank-row {
    padding: 0.52rem 0.58rem;
    font-size: 0.9rem;
  }

  body.playing-mode .rank-panel .eyebrow {
    color: var(--gold);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.03em;
  }

  body.playing-mode.around-mode .score-strip .hud-cell-primary .hud-value {
    min-height: 2.85rem;
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    color: var(--gold);
  }
}

/* Phone landscape: grid shell, vertical left HUD stack, actions pinned in-frame. */
@media (orientation: landscape) and (max-height: 500px) {
  body.playing-mode {
    --phone-panel-gap: 0.42rem;
    --playing-side-rail-min: 5.8rem;
    --playing-layout-width: calc(100dvw - env(safe-area-inset-left) - env(safe-area-inset-right));
    --playing-board-diameter: min(
      calc(min(100svh, 100dvh) - 0.5rem),
      calc(var(--playing-layout-width) - (var(--playing-side-rail-min) * 2) - (var(--phone-panel-gap) * 2))
    );
    --playing-side-rail: max(
      var(--playing-side-rail-min),
      calc((var(--playing-layout-width) - var(--playing-board-diameter) - (var(--phone-panel-gap) * 2)) / 2)
    );
    --hud-cell-pad: 0.32rem;
    --hud-label-pad-y: 0.26rem;
    --hud-landscape-label-size: 0.76rem;
    --hud-label-value-gap: 0.28rem;
    --hud-landscape-value-size: 1.28rem;
    --hud-value-min-h: 1.95rem;
    --hud-value-pad-y: 0.22rem;
    --btn-action-min-h: 2rem;
    --btn-action-font-size: 0.72rem;
    --phone-action-stack-height: calc((var(--btn-action-min-h) * 4) + 3rem);
    --playing-brand-height: 3.2rem;
    --hud-stat-block-min-height: calc(
      (var(--hud-cell-pad) * 2) +
      (var(--hud-label-pad-y) * 2) + (var(--hud-landscape-label-size) * 1.1) +
      var(--hud-label-value-gap) +
      var(--hud-value-min-h) + (var(--hud-value-pad-y) * 2)
    );
  }

  body.playing-mode .app-shell {
    display: grid;
    grid-template-columns: var(--playing-side-rail) var(--playing-board-diameter) var(--playing-side-rail);
    grid-template-rows: minmax(0, 1fr);
    column-gap: var(--phone-panel-gap);
    justify-content: center;
    height: 100svh;
    height: 100dvh;
    max-height: 100svh;
    min-height: 0;
    padding: max(0.25rem, env(safe-area-inset-top)) env(safe-area-inset-right) max(0.25rem, env(safe-area-inset-bottom)) env(safe-area-inset-left);
    box-sizing: border-box;
    overflow: hidden;
  }

  body.playing-mode .score-strip {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    align-self: start;
    justify-self: stretch;
    z-index: 3;
    width: auto;
    max-width: none;
    max-height: calc(
      100svh - env(safe-area-inset-top) -
        env(safe-area-inset-bottom) - 0.5rem
    );
    max-height: calc(
      100dvh - env(safe-area-inset-top) -
        env(safe-area-inset-bottom) - 0.5rem
    );
    margin: 0;
    padding: 0.32rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: none;
  }

  body.playing-mode .score-strip .hud-header,
  body.playing-mode .score-strip .hud-header-top {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  body.playing-mode .score-strip .hud-cell,
  body.playing-mode .score-strip .hud-header-hints {
    flex: 0 0 auto;
    width: 100%;
    min-height: var(--hud-stat-block-min-height);
    margin-right: 0;
    margin-bottom: var(--phone-panel-gap);
    padding: var(--hud-cell-pad);
    border: var(--container-border-lime);
    box-sizing: border-box;
  }

  body.playing-mode .score-strip .hud-cell:last-child,
  body.playing-mode .score-strip .hud-header-hints:last-child {
    margin-bottom: 0;
  }

  body.playing-mode .score-strip .hud-header-top > .hud-cell:last-child {
    margin-bottom: var(--phone-panel-gap);
  }

  body.playing-mode .score-strip .hud-label {
    padding: var(--hud-label-pad-y) 0.35rem;
    line-height: 1.1;
  }

  body.playing-mode .score-strip .hud-value,
  body.playing-mode .score-strip .throw-score {
    min-height: var(--hud-value-min-h);
    padding: var(--hud-value-pad-y) 0.35rem;
    font-size: var(--hud-landscape-value-size);
    line-height: 1;
  }

  body.playing-mode .score-strip .hud-header-hints {
    margin-top: 0;
  }

  body.playing-mode.around-mode .hud-header-top .hud-cell-player,
  body.playing-mode.around-mode .hud-header-top .hud-cell-throws,
  body.playing-mode.around-mode .hud-cell-primary {
    flex: 0 0 auto;
    width: 100%;
  }

  body.playing-mode.around-mode .hud-cell-primary {
    min-height: var(--hud-stat-block-min-height);
  }

  body.playing-mode.around-mode .score-strip .hud-cell-primary .hud-value {
    min-height: 2.15rem;
    font-size: 1.65rem;
    line-height: 1;
  }

  body.playing-mode .hud-cell-throws .throw-table-header {
    min-height: var(--hud-value-min-h);
  }

  body.playing-mode .hud-active-avatar {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 0.78rem;
  }

  body.playing-mode .throw-strip {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    align-self: end;
    justify-self: stretch;
    z-index: 8;
    width: auto;
    min-height: 0;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0.3rem 0.55rem 0.22rem;
    overflow: visible;
    box-sizing: border-box;
    transform: none;
  }

  body.playing-mode .board-stage {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body.playing-mode .board-wrap {
    width: min(100cqw, 100cqh, var(--playing-board-diameter));
    height: min(100cqw, 100cqh, var(--playing-board-diameter));
  }

  body.playing-mode .rank-panel {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    align-self: start;
    justify-self: stretch;
    width: auto;
    max-height: calc(100% - var(--phone-action-stack-height) - var(--phone-panel-gap));
    margin: 0;
    padding: 0.38rem 0.42rem;
    border: var(--container-border-lime);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.playing-mode .rank-panel .eyebrow {
    font-size: 0.72rem;
  }

  body.playing-mode .rank-row {
    padding: 0.38rem 0.42rem;
    font-size: 0.78rem;
  }

  body.playing-mode .playing-brand-mark {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-self: end;
    display: block;
    z-index: 7;
    width: min(9rem, calc(100% - 0.8rem));
    height: auto;
    max-height: none;
    margin-bottom: 0.25rem;
    margin-right: 0.4rem;
    opacity: 0.9;
    pointer-events: none;
  }

  body.playing-mode .details-panel {
    display: none;
  }

  body.playing-mode.details-open .scrim {
    display: none;
  }

  /* Compact vertical action rail (right side; always in frame). */
  body.playing-mode .action-row {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
    width: 100%;
    margin: 0;
    gap: 0.35rem !important;
    padding: 0.55rem !important;
    background: var(--surface-2);
    border: var(--container-border-lime);
    border-radius: 8px;
    border-spacing: 0;
    box-shadow: 0 0.65rem 1.4rem var(--shadow);
    box-sizing: border-box;
  }

  body.playing-mode .action-row > button,
  body.playing-mode .action-row > .turn-action-slot {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-flex: 0 0 auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0;
    min-height: var(--btn-action-min-h) !important;
    margin: 0 !important;
  }

  body.playing-mode .action-row > * + * {
    margin-top: 0 !important;
    margin-left: 0 !important;
  }

  body.playing-mode .action-row .turn-action-slot {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    min-height: 0;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .miss-button {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-align-items: center !important;
    align-items: center !important;
    -webkit-justify-content: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: var(--btn-action-min-h) !important;
    padding: 0 0.5rem !important;
    font-size: var(--btn-action-font-size) !important;
    line-height: 1.1 !important;
    text-align: center !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot > button {
    -webkit-flex: 0 0 auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot > button + button {
    margin-top: 0 !important;
    margin-left: 0 !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot > .turn-action-slot-hidden,
  body.playing-mode .action-row .turn-action-slot > .turn-action-slot-hidden {
    display: none !important;
  }
}

/* Legacy iPad landscape: mirror the iPhone rail pattern with a centered board. */
@media (orientation: landscape) and (min-width: 700px) and (max-height: 820px) {
  body.ui-legacy.playing-mode,
  body.old-ios-device.playing-mode {
    --legacy-landscape-rail: 8rem;
    --legacy-landscape-gap: 0.42rem;
    --legacy-landscape-board: calc(
      100vw - var(--legacy-landscape-rail) - var(--legacy-landscape-rail) -
        var(--legacy-landscape-gap) - var(--legacy-landscape-gap) -
        env(safe-area-inset-left) - env(safe-area-inset-right)
    );
  }

  body.ui-legacy.playing-mode .app-shell,
  body.old-ios-device.playing-mode .app-shell {
    display: grid;
    grid-template-columns: var(--legacy-landscape-rail) var(--legacy-landscape-board) var(--legacy-landscape-rail);
    grid-template-rows: minmax(0, 1fr);
    column-gap: var(--legacy-landscape-gap);
    justify-content: center;
    height: 100vh;
    min-height: 0;
    padding: max(0.25rem, env(safe-area-inset-top)) env(safe-area-inset-right) max(0.25rem, env(safe-area-inset-bottom)) env(safe-area-inset-left);
    box-sizing: border-box;
    overflow: hidden;
  }

  body.ui-legacy.playing-mode .score-strip,
  body.old-ios-device.playing-mode .score-strip {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    align-self: start;
    justify-self: stretch;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 0.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: 0;
    padding: 0.32rem;
    border: var(--container-border-lime);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: none;
  }

  body.ui-legacy.playing-mode .board-stage,
  body.old-ios-device.playing-mode .board-stage {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body.ui-legacy.playing-mode .board-wrap,
  body.old-ios-device.playing-mode .board-wrap {
    width: var(--legacy-landscape-board);
    height: var(--legacy-landscape-board);
    max-width: 100%;
    max-height: calc(100vh - 0.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: auto;
  }

  body.ui-legacy.playing-mode .rank-panel,
  body.old-ios-device.playing-mode .rank-panel {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    align-self: start;
    justify-self: stretch;
    width: auto;
    max-width: none;
    max-height: calc(100% - var(--phone-action-stack-height) - var(--legacy-landscape-gap));
    margin: 0;
    padding: 0.38rem 0.42rem;
    border: var(--container-border-lime);
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.ui-legacy.playing-mode .throw-strip,
  body.old-ios-device.playing-mode .throw-strip {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    align-self: end;
    justify-self: stretch;
    width: auto;
    min-height: 0;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0.3rem 0.55rem 0.22rem;
    background: transparent;
    border: var(--container-border-lime);
    box-shadow: none;
    box-sizing: border-box;
    transform: none;
  }
}

.release-fix-item > * + * {
  margin-top: 0.35rem;
}

.release-feature-card > * + * {
  margin-top: 0.55rem;
}

/* In-game portrait: header (score + hints) | board | action footer */
@media (orientation: portrait) {
body.playing-mode .app-shell {
  display: grid;
  grid-template-areas:
    "header"
    "board"
    "footer";
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: stretch;
  height: 100dvh;
  padding-right: env(safe-area-inset-right, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  row-gap: 0.15rem;
}

body.playing-mode .score-strip {
  position: static;
  grid-area: header;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0.35rem;
  margin-top: max(0.35rem, env(safe-area-inset-top));
  transform: none;
}

body.playing-mode .board-stage {
  position: relative;
  grid-area: board;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  overflow: hidden;
  container-type: size;
  container-name: playing-board;
}

body.playing-mode .board-wrap {
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  margin: 0;
  flex: 0 0 auto;
}

@supports not (display: grid) {
  body.playing-mode .app-shell {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  body.playing-mode .score-strip {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 100%;
    margin-top: 0.35rem;
  }

  body.playing-mode .board-stage {
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: auto;
    margin-left: 0;
    margin-right: 0;
  }

  body.playing-mode .throw-strip {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0.35rem;
  }
}

body.playing-mode .throw-strip {
  position: static;
  grid-area: footer;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  align-self: end;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.35rem;
  margin-bottom: max(0.35rem, env(safe-area-inset-bottom));
  transform: none;
}

body.playing-mode .hud-cell-throws .throw-table-header {
  -webkit-flex-direction: column;
  flex-direction: column;
}

body.playing-mode .hud-cell-throws .throw-table-header .throw-item {
  min-height: 1.4rem;
  padding-top: 0.08rem;
  padding-bottom: 0.08rem;
}

body.playing-mode .hud-cell-throws .throw-item + .throw-item {
  border-top: 1px solid rgba(242, 222, 193, 0.12);
  border-left: 0;
}

body.playing-mode .hud-cell-throws .throw-score {
  font-size: clamp(1.15rem, 5.2vw, 1.55rem);
  line-height: 1;
}

body.playing-mode .action-row .turn-action-slot {
  min-height: var(--btn-action-min-h);
}

body.playing-mode .action-row .turn-action-slot > button {
  min-height: var(--btn-action-min-h);
  width: 100%;
}
}

/* Legacy Safari (e.g. iPad iOS 10): no container queries, min(), dvh, or aspect-ratio */
@supports not (width: 1cqw) {
  .app-shell {
    height: 100vh;
    min-height: 100vh;
  }

  .board-wrap {
    width: 107vmin;
    height: 107vmin;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: auto;
  }

  body:not(.playing-mode) .board-stage {
    top: 5.25rem;
    bottom: 8.4rem;
  }

  body.playing-mode .app-shell {
    height: 100vh;
    min-height: 100vh;
  }

  body.playing-mode .board-stage {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  body.playing-mode .board-wrap {
    width: 107vmin;
    height: 107vmin;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: auto;
  }

  .board-art,
  #dartboard {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  @media (orientation: landscape) {
    body.playing-mode .board-stage {
      width: auto;
      margin-left: 0;
      margin-right: 0;
    }

    body.playing-mode .board-wrap {
      width: 107vmin;
      height: 107vmin;
      max-width: 100%;
      max-height: 100%;
    }
  }
}

body.old-ios-device .app-shell {
  height: 100vh;
  min-height: 100vh;
}

body.old-ios-device .board-wrap {
  width: 107vmin;
  height: 107vmin;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
}

body.old-ios-device .board-art,
body.old-ios-device #dartboard {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* In-game HUD: [Player][Score][Throws] + hints (501/301) */
body.playing-mode .hud-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

body.playing-mode .hud-header-top {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
}

body.playing-mode.x01-mode .hud-header-hints {
  display: flex;
}

body.playing-mode.around-mode .hud-label-primary.is-hidden {
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
}

body.playing-mode .hud-cell-throws .throw-table-header {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 2.15rem;
}

body.playing-mode .hud-cell-throws .throw-table-header .throw-item {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
}

body.playing-mode .hud-cell-throws .throw-score {
  font-size: clamp(0.95rem, 3.4vw, 1.25rem);
  font-weight: 950;
}

body.playing-mode .hud-footer {
  display: block;
}

body.playing-mode .hud-actions-only {
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
}

body.playing-mode .hud-actions-only > .hud-label {
  display: none;
}

body.playing-mode .hud-footer .action-row {
  width: 100%;
}

/* In-game horizontal action rail (modern): flex + sibling margins. */
body.playing-mode .action-row {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-align-items: stretch;
  align-items: stretch;
  width: 100%;
  flex: none;
  margin: 0;
  padding: 0;
}

body.playing-mode .action-row > button,
body.playing-mode .action-row > .turn-action-slot {
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  margin: 0;
}

body.playing-mode .action-row > * + * {
  margin-left: 0.35rem;
}

body.playing-mode .action-row .turn-action-slot {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-align-items: stretch;
  align-items: stretch;
  min-height: 0;
}

body.playing-mode .action-row .turn-action-slot .turn-action-slot-hidden {
  display: none !important;
}

body.playing-mode .action-row button,
body.playing-mode .action-row .miss-button {
  -webkit-appearance: none;
  appearance: none;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: var(--btn-action-min-h);
  margin: 0;
  padding: 0 0.35rem;
  border-radius: 8px;
  font-size: var(--btn-action-font-size);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.playing-mode .action-row .turn-action-slot > button {
  -webkit-flex: 1 1 0;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

body.playing-mode .action-row .turn-action-slot > button + button {
  margin-left: 0.35rem;
}

body.playing-mode:not(.ui-legacy):not(.old-ios-device) .hud-footer .action-row button {
  min-height: 2.1rem;
}

@media (orientation: landscape) and (max-height: 500px) {
  body.playing-mode .score-strip,
  body.playing-mode .rank-panel,
  body.playing-mode .action-row {
    border: var(--container-border-lime) !important;
  }

  body.playing-mode .score-strip {
    padding: var(--phone-panel-gap) !important;
    box-sizing: border-box !important;
  }
}

@media (orientation: portrait) and (max-width: 699px) {
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 0.35rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > button,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > .turn-action-slot {
    width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row > * + * {
    margin-left: 0 !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-align-items: stretch !important;
    align-items: stretch !important;
    min-height: 2.1rem !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .action-row .turn-action-slot > button:not(.turn-action-slot-hidden) {
    -webkit-flex: 1 1 100% !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 2.1rem !important;
    margin-left: 0 !important;
  }
}

/* Legacy iPad / old iOS: flex row + sibling margins (table-cell + block button rules broke layout). */
body.ui-legacy.playing-mode .action-row,
body.old-ios-device.playing-mode .action-row {
  display: -webkit-flex !important;
  display: flex !important;
  -webkit-flex-direction: row !important;
  flex-direction: row !important;
  -webkit-align-items: stretch !important;
  align-items: stretch !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-spacing: 0 !important;
}

body.ui-legacy.playing-mode .action-row > button,
body.ui-legacy.playing-mode .action-row > .turn-action-slot,
body.old-ios-device.playing-mode .action-row > button,
body.old-ios-device.playing-mode .action-row > .turn-action-slot {
  display: -webkit-flex !important;
  display: flex !important;
  -webkit-flex: 1 1 0 !important;
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

body.ui-legacy.playing-mode .action-row > * + *,
body.old-ios-device.playing-mode .action-row > * + * {
  margin-top: 0 !important;
  margin-left: 0.35rem !important;
}

body.ui-legacy.playing-mode .action-row .turn-action-slot,
body.old-ios-device.playing-mode .action-row .turn-action-slot {
  -webkit-flex-direction: row !important;
  flex-direction: row !important;
}

body.ui-legacy.playing-mode .action-row > button,
body.ui-legacy.playing-mode .action-row .turn-action-slot > button,
body.ui-legacy.playing-mode .action-row .turn-action-slot > .miss-button,
body.old-ios-device.playing-mode .action-row > button,
body.old-ios-device.playing-mode .action-row .turn-action-slot > button,
body.old-ios-device.playing-mode .action-row .turn-action-slot > .miss-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: -webkit-box !important;
  display: -webkit-flex !important;
  display: flex !important;
  -webkit-box-align: center !important;
  -webkit-box-pack: center !important;
  -webkit-align-items: center !important;
  align-items: center !important;
  -webkit-justify-content: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: var(--btn-action-min-h) !important;
  margin: 0 !important;
  padding: 0 0.5rem !important;
  font-size: var(--btn-action-font-size) !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.ui-legacy.playing-mode .action-row .turn-action-slot > button,
body.old-ios-device.playing-mode .action-row .turn-action-slot > button {
  -webkit-flex: 1 1 0 !important;
  flex: 1 1 0 !important;
  width: 0 !important;
}

body.ui-legacy.playing-mode .action-row .turn-action-slot > .turn-action-slot-hidden,
body.old-ios-device.playing-mode .action-row .turn-action-slot > .turn-action-slot-hidden {
  display: none !important;
}

body.ui-legacy.playing-mode .action-row .turn-action-slot > button + button,
body.old-ios-device.playing-mode .action-row .turn-action-slot > button + button {
  margin-top: 0 !important;
  margin-left: 0.35rem !important;
}

/* Legacy tablet landscape side-rail: stack actions vertically in the narrow column. */
@media (orientation: landscape) and (min-width: 700px) {
  body.ui-legacy.playing-mode .action-row,
  body.old-ios-device.playing-mode .action-row {
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
    padding: 0.7rem 0.75rem !important;
    background: var(--surface-2) !important;
    border: 1px solid rgba(242, 222, 193, 0.14) !important;
    border-radius: 8px !important;
    box-shadow: 0 1rem 2.5rem var(--shadow) !important;
  }

  body.ui-legacy.playing-mode .action-row > button,
  body.ui-legacy.playing-mode .action-row > .turn-action-slot,
  body.old-ios-device.playing-mode .action-row > button,
  body.old-ios-device.playing-mode .action-row > .turn-action-slot {
    -webkit-flex: 0 0 auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
  }

  body.ui-legacy.playing-mode .action-row > * + *,
  body.old-ios-device.playing-mode .action-row > * + * {
    margin-left: 0 !important;
    margin-top: 0.45rem !important;
  }

  body.ui-legacy.playing-mode .action-row .turn-action-slot,
  body.old-ios-device.playing-mode .action-row .turn-action-slot {
    -webkit-flex-direction: row !important;
    flex-direction: row !important;
  }

  body.ui-legacy.playing-mode .action-row .turn-action-slot > button,
  body.old-ios-device.playing-mode .action-row .turn-action-slot > button {
    -webkit-flex: 1 1 0 !important;
    flex: 1 1 0 !important;
    width: 0 !important;
  }

  body.ui-legacy.playing-mode .action-row .turn-action-slot > * + *,
  body.old-ios-device.playing-mode .action-row .turn-action-slot > * + * {
    margin-top: 0 !important;
    margin-left: 0.35rem !important;
  }
}

/* Legacy iPad portrait: one horizontal action rail (override landscape side-rail column). */
@media (orientation: portrait) and (min-width: 700px) {
  body.ui-legacy.playing-mode .action-row,
  body.old-ios-device.playing-mode .action-row {
    -webkit-flex-direction: row !important;
    flex-direction: row !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.ui-legacy.playing-mode .action-row > button,
  body.ui-legacy.playing-mode .action-row > .turn-action-slot,
  body.old-ios-device.playing-mode .action-row > button,
  body.old-ios-device.playing-mode .action-row > .turn-action-slot {
    -webkit-flex: 1 1 0 !important;
    flex: 1 1 0 !important;
    width: 0 !important;
  }

  body.ui-legacy.playing-mode .action-row > * + *,
  body.old-ios-device.playing-mode .action-row > * + * {
    margin-top: 0 !important;
    margin-left: 0.35rem !important;
  }

  body.ui-legacy.playing-mode .action-row .turn-action-slot > button:not(.turn-action-slot-hidden),
  body.old-ios-device.playing-mode .action-row .turn-action-slot > button:not(.turn-action-slot-hidden) {
    -webkit-box-flex: 1 !important;
    -webkit-flex: 1 1 100% !important;
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* Legacy: centered labels on confirm / dialog paired buttons. */
body.ui-legacy .confirm-actions > .primary-button,
body.ui-legacy .confirm-actions > .secondary-button,
body.ui-legacy .dialog-actions > .primary-button,
body.ui-legacy .dialog-actions > .secondary-button,
body.old-ios-device .confirm-actions > .primary-button,
body.old-ios-device .confirm-actions > .secondary-button,
body.old-ios-device .dialog-actions > .primary-button,
body.old-ios-device .dialog-actions > .secondary-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: -webkit-box !important;
  -webkit-box-pack: center !important;
  -webkit-box-align: center !important;
  -webkit-box-flex: 1 !important;
  box-sizing: border-box !important;
  width: 0 !important;
  min-width: 0 !important;
  min-height: var(--btn-action-min-h) !important;
  padding: 0 var(--btn-action-pad-x) !important;
  font-size: var(--btn-action-font-size) !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  text-align: center !important;
}

body.playing-mode.around-mode .quick-pad {
  display: none !important;
}

body.playing-mode.around-mode .hud-header-top .hud-cell-player,
body.playing-mode.around-mode .hud-header-top .hud-cell-throws {
  flex: 1 1 0;
}

body.playing-mode.around-mode .hud-cell-primary {
  flex: 1.35 1 0;
}

body.ui-legacy.playing-mode.around-mode .hud-cell-primary .hud-value,
body.old-ios-device.playing-mode.around-mode .hud-cell-primary .hud-value {
  min-height: 3.5rem;
  font-size: 4.75rem;
  line-height: 0.95;
}

body.playing-mode.around-mode .hud-cell-primary .hud-value {
  min-height: 2.75rem;
  color: var(--gold);
  font-size: 3.25rem;
  font-size: clamp(2.75rem, 14vw, 4.5rem);
  font-weight: 950;
  line-height: 0.95;
}

@media (orientation: landscape) {
  body.playing-mode .score-strip,
  body.playing-mode .rank-panel,
  body.playing-mode .action-row,
  body.ui-legacy.playing-mode .action-row,
  body.old-ios-device.playing-mode .action-row,
  body.playing-mode .score-strip .hud-cell,
  body.playing-mode .score-strip .hud-header-hints {
    border: var(--container-border-lime) !important;
  }
}

/* around-mode uses the same header / board / footer grid sizing as other games */

body.scoreboard-overlay-open .scoreboard-screen {
  z-index: 14;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  background: rgba(6, 8, 9, 0.84);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

body.scoreboard-overlay-open .scoreboard-inner {
  width: min(72rem, 100%);
  max-height: min(88dvh, 100%);
  margin: 0;
  padding: 1rem 1.1rem 1.25rem;
  overflow: auto;
  background: #0e1112;
  border: 1px solid rgba(242, 222, 193, 0.16);
  border-radius: 10px;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.45);
}

body.scoreboard-overlay-open .scoreboard-inner h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
}

.scoreboard-overlay-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.scoreboard-overlay-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

@media (orientation: portrait) {
  body.playing-mode .hud-active-avatar {
    width: 3.44rem;
    height: 3.44rem;
    font-size: 1.05rem;
  }

  body.playing-mode.around-mode .hud-cell-primary .hud-value {
    min-height: 3.1rem;
    font-size: 3.5rem;
    font-size: clamp(3rem, 16vw, 4.75rem);
  }

  /* Tablet portrait: match iPhone large target score (clamp may be ignored on legacy WebKit). */
  @media (min-width: 700px) {
    body.playing-mode.around-mode .hud-cell-primary .hud-value {
      min-height: 3.5rem;
      font-size: 4.75rem;
    }
  }

  body.playing-mode.around-mode .score-strip {
    position: static;
    left: auto;
    right: auto;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transform: none;
    padding: 0.5rem 0.6rem;
  }

  body.playing-mode.around-mode .throw-strip {
    position: static;
    left: auto;
    right: auto;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transform: none;
    padding: 0.45rem 0.55rem;
  }

  body.playing-mode.around-mode .action-row {
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body.playing-mode.around-mode .action-row button,
  body.playing-mode.around-mode .action-row .miss-button {
    min-height: 2.1rem;
    font-size: 0.78rem;
  }
}

@media (orientation: portrait) and (max-width: 699px) {
  body.playing-mode .score-strip,
  body.playing-mode .throw-strip,
  body.playing-mode .action-row,
  body.playing-mode .score-strip .hud-cell,
  body.playing-mode .score-strip .hud-header-hints {
    border: var(--container-border-lime) !important;
  }

  body.playing-mode .action-row {
    padding: 0.42rem !important;
    background: var(--surface-2) !important;
    border-radius: 8px !important;
    box-shadow: 0 1.5rem 4rem var(--shadow) !important;
    box-sizing: border-box !important;
    column-gap: 0.35rem !important;
  }

  body.playing-mode .action-row > * + * {
    margin-left: 0 !important;
  }

  body.playing-mode .action-row button,
  body.playing-mode .action-row .miss-button,
  body.playing-mode .action-row .turn-action-slot > button:not(.turn-action-slot-hidden) {
    min-height: 2.1rem !important;
    padding: 0 0.5rem !important;
    font-size: 0.78rem !important;
    line-height: 1.15 !important;
  }
}

@media (orientation: portrait) {
  body.playing-mode .score-strip,
  body.playing-mode .throw-strip,
  body.playing-mode .action-row,
  body.ui-legacy.playing-mode .action-row,
  body.old-ios-device.playing-mode .action-row,
  body.playing-mode .score-strip .hud-cell,
  body.playing-mode .score-strip .hud-header-hints {
    border: var(--container-border-lime) !important;
  }

  body.ui-legacy.playing-mode .action-row > button,
  body.ui-legacy.playing-mode .action-row .turn-action-slot > button:not(.turn-action-slot-hidden),
  body.old-ios-device.playing-mode .action-row > button,
  body.old-ios-device.playing-mode .action-row .turn-action-slot > button:not(.turn-action-slot-hidden) {
    display: -webkit-box !important;
    -webkit-box-align: center !important;
    -webkit-box-pack: center !important;
    text-align: center !important;
  }
}

/* Modern iPhone portrait: keep one visible action container, owned by the footer rail. */
@media (orientation: portrait) and (max-width: 699px) {
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .throw-strip {
    border: var(--container-border-lime) !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .throw-strip .actions-section,
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .throw-strip .action-row {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .throw-strip .action-row {
    column-gap: 0.35rem !important;
  }
}

/* Modern iPhone landscape: mirror the compact iPad rank treatment. */
@media (orientation: landscape) and (max-height: 500px) {
  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .hud-active-avatar {
    width: 3.44rem;
    height: 3.44rem;
    font-size: 1.05rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip {
    flex-direction: column;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip .hud-header-top {
    display: contents;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .hud-cell-player {
    order: 1;
    position: relative;
    min-height: calc(var(--hud-stat-block-min-height) + 1.75rem);
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .hud-cell-player::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border: var(--container-border-lime);
    border-radius: inherit;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .hud-cell-primary {
    order: 2;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip .hud-header-hints {
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: var(--hud-label-value-gap);
    margin-top: 0;
    margin-bottom: var(--phone-panel-gap);
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .hud-cell-throws {
    order: 4;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .hud-value-player {
    min-height: 4.45rem;
    overflow: hidden;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip .hud-hints-prefix {
    display: block;
    padding: var(--hud-label-pad-y) 0.35rem;
    background: var(--surface-3);
    text-align: center;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip .hud-hints-line {
    display: flex;
    align-items: stretch;
    min-height: var(--hud-value-min-h);
    padding: 0;
    background: var(--surface-3);
    text-align: center;
    white-space: nowrap;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip .hud-hint-item {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: var(--hud-value-pad-y) 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip .hud-hint-item + .hud-hint-item {
    border-left: 1px solid rgba(242, 222, 193, 0.12);
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .score-strip .hud-hint-item + .hud-hint-item::before {
    content: "";
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    padding: 0.3rem 0.42rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0;
    width: 100%;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-position {
    position: relative;
    padding-right: 0.62rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-position::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 0;
    bottom: 3px;
    width: 1px;
    background: var(--lime-border-color);
    opacity: 0.75;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-row strong {
    position: relative;
    padding-left: 0.62rem;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-row strong::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 1px;
    background: var(--lime-border-color);
    opacity: 0.75;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-avatar {
    display: grid;
    justify-self: center;
  }

  body.playing-mode:not(.ui-legacy):not(.old-ios-device) .rank-player-name {
    display: none;
  }
}

/* Legacy iPad landscape: avoid CSS grid so old WebKit cannot collapse the board column. */
@media (orientation: landscape) and (min-width: 700px) and (max-height: 820px) {
  body.ui-legacy.playing-mode,
  body.old-ios-device.playing-mode {
    --legacy-ipad-rail-width: 140px;
    --legacy-ipad-gap: 0.42rem;
    --legacy-ipad-board-size: calc(
      100vw - var(--legacy-ipad-rail-width) - var(--legacy-ipad-rail-width) -
        var(--legacy-ipad-gap) - var(--legacy-ipad-gap) - 0.5rem
    );
    --phone-action-stack-height: calc((var(--btn-action-min-h) * 4) + 3rem);
  }

  body.ui-legacy.playing-mode .app-shell,
  body.old-ios-device.playing-mode .app-shell {
    position: relative;
    display: block !important;
    width: 100vw;
    height: 100vh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  body.ui-legacy.playing-mode .score-strip,
  body.old-ios-device.playing-mode .score-strip {
    position: absolute !important;
    top: 0.25rem !important;
    left: 0.25rem !important;
    right: auto !important;
    bottom: auto !important;
    top: max(0.25rem, env(safe-area-inset-top)) !important;
    left: max(0.25rem, env(safe-area-inset-left)) !important;
    z-index: 5;
    width: var(--legacy-ipad-rail-width);
    max-width: var(--legacy-ipad-rail-width);
    max-height: calc(100vh - 0.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: 0;
    padding: 0.32rem;
    border: var(--container-border-lime) !important;
    border-radius: 8px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    transform: none !important;
  }

  body.ui-legacy.playing-mode .board-stage,
  body.old-ios-device.playing-mode .board-stage {
    position: absolute !important;
    top: 0;
    bottom: auto;
    left: 50%;
    right: auto;
    z-index: 2;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: var(--legacy-ipad-board-size);
    height: 100vh;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    transform: translateX(-50%) !important;
  }

  body.ui-legacy.playing-mode .board-wrap,
  body.old-ios-device.playing-mode .board-wrap {
    width: var(--legacy-ipad-board-size);
    height: var(--legacy-ipad-board-size);
    max-width: var(--legacy-ipad-board-size);
    max-height: var(--legacy-ipad-board-size);
    margin: 0;
  }

  body.ui-legacy.playing-mode .rank-panel,
  body.old-ios-device.playing-mode .rank-panel {
    position: absolute !important;
    top: 0.25rem !important;
    right: 0.25rem !important;
    left: auto !important;
    bottom: auto !important;
    top: max(0.25rem, env(safe-area-inset-top)) !important;
    right: max(0.25rem, env(safe-area-inset-right)) !important;
    z-index: 5;
    display: block;
    width: var(--legacy-ipad-rail-width);
    max-width: var(--legacy-ipad-rail-width);
    max-height: calc(100vh - var(--phone-action-stack-height) - var(--legacy-ipad-gap) - 0.5rem);
    margin: 0;
    padding: 0.38rem 0.42rem;
    border: var(--container-border-lime) !important;
    border-radius: 8px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.ui-legacy.playing-mode .throw-strip,
  body.old-ios-device.playing-mode .throw-strip {
    position: absolute !important;
    top: auto !important;
    right: 0.25rem !important;
    bottom: 0.25rem !important;
    left: auto !important;
    right: max(0.25rem, env(safe-area-inset-right)) !important;
    bottom: max(0.25rem, env(safe-area-inset-bottom)) !important;
    z-index: 6;
    width: var(--legacy-ipad-rail-width);
    max-width: var(--legacy-ipad-rail-width);
    min-height: 0;
    margin: 0;
    padding: 0.48rem 0.55rem;
    background: transparent;
    border: var(--container-border-lime) !important;
    border-radius: 8px;
    box-shadow: none;
    box-sizing: border-box;
    transform: none !important;
  }

  body.ui-legacy.playing-mode .score-strip .hud-header-hints,
  body.old-ios-device.playing-mode .score-strip .hud-header-hints {
    -webkit-box-ordinal-group: 3;
    -webkit-order: 2;
    order: 2;
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
    -webkit-align-items: stretch !important;
    align-items: stretch !important;
    min-height: var(--hud-stat-block-min-height);
    padding: var(--hud-cell-pad);
  }

  body.ui-legacy.playing-mode .score-strip .hud-hints-prefix,
  body.old-ios-device.playing-mode .score-strip .hud-hints-prefix {
    display: block;
    padding: var(--hud-label-pad-y) 0.35rem;
    background: var(--surface-3);
    color: var(--gold);
    font-size: var(--hud-landscape-label-size);
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
  }

  body.ui-legacy.playing-mode .score-strip .hud-hints-line,
  body.old-ios-device.playing-mode .score-strip .hud-hints-line {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: stretch;
    -webkit-box-pack: start;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    min-height: var(--hud-value-min-h);
    margin-top: var(--hud-label-value-gap);
    padding: 0;
    overflow: hidden;
    background: var(--surface-3);
    color: var(--gold);
    text-align: center;
    text-overflow: ellipsis;
    white-space: normal;
  }

  body.ui-legacy.playing-mode .score-strip .hud-hint-item,
  body.old-ios-device.playing-mode .score-strip .hud-hint-item {
    display: block;
    width: 100%;
    min-height: var(--hud-value-min-h);
    padding: var(--hud-value-pad-y) 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.ui-legacy.playing-mode .score-strip .hud-hint-item + .hud-hint-item,
  body.old-ios-device.playing-mode .score-strip .hud-hint-item + .hud-hint-item {
    border-top: 1px solid rgba(242, 222, 193, 0.12);
  }

  body.ui-legacy.playing-mode .score-strip .hud-hint-item + .hud-hint-item::before,
  body.old-ios-device.playing-mode .score-strip .hud-hint-item + .hud-hint-item::before {
    content: "";
  }

  body.ui-legacy.playing-mode .hud-cell-throws .throw-table-header,
  body.old-ios-device.playing-mode .hud-cell-throws .throw-table-header {
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
  }

  body.ui-legacy.playing-mode .hud-cell-throws,
  body.old-ios-device.playing-mode .hud-cell-throws {
    -webkit-box-ordinal-group: 4;
    -webkit-order: 3;
    order: 3;
  }

  body.ui-legacy.playing-mode .hud-cell-throws .throw-item,
  body.old-ios-device.playing-mode .hud-cell-throws .throw-item {
    width: 100%;
  }

  body.ui-legacy.playing-mode .hud-cell-throws .throw-item + .throw-item,
  body.old-ios-device.playing-mode .hud-cell-throws .throw-item + .throw-item {
    border-top: 1px solid rgba(242, 222, 193, 0.12);
    border-left: 0;
  }

  body.ui-legacy.playing-mode .throw-strip .actions-section,
  body.old-ios-device.playing-mode .throw-strip .actions-section,
  body.ui-legacy.playing-mode .throw-strip .action-row,
  body.old-ios-device.playing-mode .throw-strip .action-row {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.ui-legacy.playing-mode .throw-strip .action-row > * + *,
  body.old-ios-device.playing-mode .throw-strip .action-row > * + * {
    margin-top: var(--setup-stack-gap) !important;
    margin-left: 0 !important;
  }

  body.ui-legacy.playing-mode .throw-strip .action-row > button + button,
  body.ui-legacy.playing-mode .throw-strip .action-row > button + .turn-action-slot,
  body.ui-legacy.playing-mode .throw-strip .action-row > .turn-action-slot + button,
  body.old-ios-device.playing-mode .throw-strip .action-row > button + button,
  body.old-ios-device.playing-mode .throw-strip .action-row > button + .turn-action-slot,
  body.old-ios-device.playing-mode .throw-strip .action-row > .turn-action-slot + button {
    margin-top: var(--setup-stack-gap) !important;
    margin-left: 0 !important;
  }

  body.ui-legacy.playing-mode .rank-row,
  body.old-ios-device.playing-mode .rank-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    padding: 0.3rem 0.42rem;
  }

  body.ui-legacy.playing-mode .rank-meta,
  body.old-ios-device.playing-mode .rank-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0;
    width: 100%;
  }

  body.ui-legacy.playing-mode .rank-position,
  body.old-ios-device.playing-mode .rank-position {
    position: relative;
    padding-right: 0.62rem;
  }

  body.ui-legacy.playing-mode .rank-position::after,
  body.old-ios-device.playing-mode .rank-position::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 0;
    bottom: 3px;
    width: 1px;
    background: var(--lime-border-color);
    opacity: 0.75;
  }

  body.ui-legacy.playing-mode .rank-row strong,
  body.old-ios-device.playing-mode .rank-row strong {
    position: relative;
    padding-left: 0.62rem;
  }

  body.ui-legacy.playing-mode .rank-row strong::before,
  body.old-ios-device.playing-mode .rank-row strong::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 1px;
    background: var(--lime-border-color);
    opacity: 0.75;
  }

  body.ui-legacy.playing-mode .rank-avatar,
  body.old-ios-device.playing-mode .rank-avatar {
    display: grid;
    justify-self: center;
  }

  body.ui-legacy.playing-mode .rank-player-name,
  body.old-ios-device.playing-mode .rank-player-name {
    display: none;
  }

  body.ui-legacy.playing-mode .hud-active-avatar,
  body.old-ios-device.playing-mode .hud-active-avatar {
    width: 5.15rem;
    height: 5.15rem;
    font-size: 1.35rem;
  }
}

/* Legacy iPad portrait: keep one visible action container, owned by the footer rail. */
@media (orientation: portrait) and (min-width: 700px) {
  body.ui-legacy.playing-mode .throw-strip,
  body.old-ios-device.playing-mode .throw-strip {
    border: var(--container-border-lime) !important;
  }

  body.ui-legacy.playing-mode .actions-section,
  body.old-ios-device.playing-mode .actions-section,
  body.ui-legacy.playing-mode .action-row,
  body.old-ios-device.playing-mode .action-row {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.ui-legacy.playing-mode .action-row > * + *,
  body.old-ios-device.playing-mode .action-row > * + * {
    margin-left: var(--setup-stack-gap) !important;
  }

  body.ui-legacy.playing-mode .action-row > button + button,
  body.ui-legacy.playing-mode .action-row > button + .turn-action-slot,
  body.ui-legacy.playing-mode .action-row > .turn-action-slot + button,
  body.old-ios-device.playing-mode .action-row > button + button,
  body.old-ios-device.playing-mode .action-row > button + .turn-action-slot,
  body.old-ios-device.playing-mode .action-row > .turn-action-slot + button {
    margin-left: var(--setup-stack-gap) !important;
  }

  body.ui-legacy.playing-mode .action-row .turn-action-slot > * + *,
  body.old-ios-device.playing-mode .action-row .turn-action-slot > * + * {
    margin-left: var(--setup-stack-gap) !important;
  }

}

@media (min-width: 700px) {
  body.ui-legacy.playing-mode .hud-active-avatar,
  body.old-ios-device.playing-mode .hud-active-avatar {
    width: 5.15rem;
    height: 5.15rem;
    font-size: 1.35rem;
  }
}
