:root {
  --paper: #f5efdf;
  --paper-2: #e8dec6;
  --ink: #201a17;
  --muted: #665c51;
  --line: #b8aa8d;
  --ui-bg: #101916;
  --ui-panel: rgba(246, 240, 226, 0.93);
  --ui-panel-dark: rgba(12, 21, 18, 0.84);
  --ui-line: rgba(255, 248, 232, 0.2);
  --green: #6f8c5d;
  --blue: #3b6f8e;
  --red: #a8423f;
  --yellow: #c19a32;
  --purple: #80629f;
  --white: #d8d2c3;
  --felt: #375446;
  --felt-2: #26382f;
  --accent: #e0b03f;
  --shadow: 0 14px 34px rgba(32, 26, 23, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(238, 216, 142, 0.12), transparent 34rem),
    linear-gradient(rgba(8, 14, 12, 0.18), rgba(8, 14, 12, 0.42)),
    url("public/assets/ui/territory-table-backdrop.png?v=board-props-scale-v4-2026-05-04"),
    var(--ui-bg);
  background-size: auto, auto, cover, auto;
  background-attachment: fixed;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

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

button {
  border: 1px solid rgba(32, 26, 23, 0.24);
  background: #fbf7ed;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.48rem 0.68rem;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

button:hover:not(:disabled) {
  background: #fffaf0;
  border-color: rgba(32, 26, 23, 0.42);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app {
  min-height: 100vh;
}

.access-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.access-panel {
  width: min(100%, 440px);
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  border: 1px solid rgba(255, 248, 232, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(22, 34, 29, 0.92), rgba(8, 14, 12, 0.9));
  color: #fff8e8;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.access-panel h1 {
  margin: 0;
  font-size: clamp(2.2rem, 9vw, 4.2rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}

.access-form {
  display: grid;
  gap: 0.85rem;
}

.access-error {
  margin: 0;
  color: #ffd6d3;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.58rem clamp(0.75rem, 1.5vw, 1.4rem);
  background: rgba(15, 22, 19, 0.92);
  color: #fff8e8;
  border-bottom: 1px solid rgba(255, 248, 232, 0.16);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  min-width: 0;
}

.brand h1 {
  flex: 0 0 auto;
  margin: 0;
  font-size: clamp(1.6rem, 2.5vw, 2.6rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 248, 232, 0.68);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.online-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.08);
  color: #fff8e8;
  font-size: 0.78rem;
  white-space: nowrap;
}

.online-chip.connected {
  border-color: rgba(123, 176, 119, 0.5);
  color: #d8f0cf;
}

.phase-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 0.35rem;
  min-width: 0;
}

.phase-pill {
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 999px;
  padding: 0.32rem 0.52rem;
  text-align: center;
  color: rgba(255, 248, 232, 0.72);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.phase-pill.active {
  background: #cfaa44;
  color: #fff8e8;
  border-color: rgba(255, 248, 232, 0.36);
  box-shadow: 0 0 0 2px rgba(207, 170, 68, 0.18);
}

.game-hud {
  position: sticky;
  top: 3.5rem;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem clamp(0.75rem, 1.5vw, 1.4rem);
  background: rgba(18, 27, 23, 0.86);
  border-bottom: 1px solid rgba(255, 248, 232, 0.12);
  backdrop-filter: blur(10px);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.status-strip span {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.42rem;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.08);
  color: rgba(255, 248, 232, 0.9);
  padding: 0.28rem 0.55rem;
  font-size: 0.84rem;
}

.status-strip strong {
  color: rgba(255, 248, 232, 0.54);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
}

.hud-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  min-width: max-content;
}

.hud-actions span {
  color: rgba(255, 248, 232, 0.68);
  font-size: 0.84rem;
}

.hud-actions button {
  padding: 0.3rem 0.6rem;
  border-color: rgba(255, 248, 232, 0.22);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.setup-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 0.58fr);
  gap: clamp(1rem, 5vw, 4rem);
  align-items: end;
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 58%, rgba(255, 248, 232, 0.08), transparent 32rem),
    linear-gradient(90deg, rgba(6, 10, 9, 0.18), rgba(6, 10, 9, 0.18) 42%, rgba(6, 10, 9, 0.82)),
    linear-gradient(180deg, rgba(6, 10, 9, 0.04), rgba(6, 10, 9, 0.7)),
    var(--setup-cover) center / cover no-repeat;
}

.cover-panel {
  position: relative;
  z-index: 1;
  background: transparent;
  color: #fff8e8;
  padding: clamp(1rem, 4vw, 4rem) 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1rem;
  min-height: min(46vh, 28rem);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.72);
}

.cover-panel p {
  max-width: 31rem;
  margin: 0;
  padding: 0.72rem 0.86rem;
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 8px;
  background: rgba(7, 11, 10, 0.48);
  color: rgba(255, 248, 232, 0.84);
  font-size: clamp(0.98rem, 1.25vw, 1.18rem);
  line-height: 1.28;
  backdrop-filter: blur(3px);
}

.setup-panel {
  position: relative;
  z-index: 1;
  padding: clamp(1.15rem, 3vw, 2.1rem);
  display: grid;
  align-content: center;
  gap: 1.2rem;
  border: 1px solid rgba(255, 248, 232, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(22, 34, 29, 0.86), rgba(8, 14, 12, 0.84));
  color: #fff8e8;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(6px);
}

.setup-panel h2 {
  margin: 0 0 0.35rem;
  color: #fff8e8;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.setup-panel .note {
  color: rgba(255, 248, 232, 0.7);
}

.online-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.08);
}

.online-panel h3 {
  margin: 0.1rem 0;
  color: #fff8e8;
  font-size: 1.05rem;
}

.online-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.invite-field {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  font-size: 0.82rem;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field input,
.field select,
.field textarea {
  border: 1px solid rgba(255, 248, 232, 0.26);
  background: rgba(255, 250, 240, 0.92);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
}

.note {
  color: var(--muted);
  line-height: 1.45;
}

.table-shell {
  display: grid;
  grid-template-columns: minmax(230px, 285px) minmax(620px, 1fr) minmax(270px, 340px);
  gap: 0.75rem;
  padding: 0.75rem;
  align-items: start;
  min-height: calc(100vh - 7.4rem);
}

.panel,
.table-panel,
.player-panel,
.drawer {
  background: var(--ui-panel);
  border: 1px solid rgba(255, 248, 232, 0.22);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.panel,
.player-panel,
.drawer {
  padding: 0.9rem;
  min-width: 0;
}

.panel h2,
.panel h3,
.player-panel h3,
.drawer h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.command-rail,
.player-rail {
  position: sticky;
  top: 7.6rem;
  max-height: calc(100vh - 8.2rem);
  overflow: auto;
  min-width: 0;
}

.command-rail > .panel,
.player-rail > .drawer {
  background: rgba(246, 240, 226, 0.94);
}

.command-rail .stat-line {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.command-rail .stat-line .stat:first-child {
  grid-column: 1 / -1;
}

.command-rail button {
  width: 100%;
  padding-inline: 0.42rem;
  white-space: normal;
}

.command-rail .note {
  font-size: 0.9rem;
}

.player-rail .drawer {
  border-top: 4px solid #375446;
}

.table-panel {
  overflow: hidden;
}

.board-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.felt {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.08)),
    var(--felt);
  padding: 1rem;
  color: #fff8e8;
}

.board-grid {
  display: grid;
  gap: 0.9rem;
}

.board-playmat {
  position: relative;
  min-width: 0;
  padding: clamp(0.8rem, 1.3vw, 1.2rem);
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 8px;
  color: #fff8e8;
  background:
    radial-gradient(circle at center, rgba(255, 248, 232, 0.08), transparent 34rem),
    linear-gradient(180deg, rgba(10, 15, 13, 0.24), rgba(6, 10, 8, 0.74)),
    var(--board-art),
    url("public/assets/ui/tabletop-texture.png?v=board-props-scale-v4-2026-05-04"),
    linear-gradient(135deg, #263c34, #111c18);
  background-position: center top, center top, center top, center, center;
  background-size: cover, cover, cover, min(100%, 920px), cover;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}

.board-playmat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.18;
}

.board-mat-label {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin: 0 auto 0.65rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid rgba(255, 248, 232, 0.35);
  border-radius: 999px;
  background: rgba(22, 34, 29, 0.68);
  color: rgba(255, 248, 232, 0.78);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.board-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(130px, 0.82fr) minmax(190px, 1.08fr) minmax(130px, 0.82fr);
  grid-template-areas:
    "loc1 promo loc2"
    "loc3 promo loc4"
    "lineup lineup events";
  gap: clamp(0.65rem, 1.4vw, 1rem);
  align-items: stretch;
}

.six-location .board-layout {
  grid-template-areas:
    "loc1 promo loc2"
    "loc3 promo loc4"
    "loc5 lineup loc6"
    "events events events";
}

.board-location-slot.slot-1 { grid-area: loc1; }
.board-location-slot.slot-2 { grid-area: loc2; }
.board-location-slot.slot-3 { grid-area: loc3; }
.board-location-slot.slot-4 { grid-area: loc4; }
.board-location-slot.slot-5 { grid-area: loc5; }
.board-location-slot.slot-6 { grid-area: loc6; }

.board-zone {
  min-width: 0;
}

.board-zone h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.25rem, 2.2vw, 2.1rem);
  line-height: 1;
  color: #fff8e8;
  text-shadow: 0 2px 10px rgba(0,0,0,0.36);
}

.board-promotions-slot {
  grid-area: promo;
  display: grid;
  align-content: center;
}

.board-events-slot {
  grid-area: events;
}

.board-lineup-slot {
  grid-area: lineup;
}

.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 0.8rem;
}

.location-tile,
.event-slot,
.match-track {
  border: 1px solid rgba(255, 248, 232, 0.28);
  border-radius: 8px;
  background: rgba(18, 32, 26, 0.62);
  padding: 0.65rem;
}

.board-location-slot,
.board-promotions-tile,
.board-events-slot .event-slot,
.board-lineup-slot .match-track {
  background: rgba(16, 29, 24, 0.74);
  border-color: rgba(255, 248, 232, 0.3);
  box-shadow: 0 10px 24px rgba(10, 17, 14, 0.18);
}

.board-location-slot {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.35rem;
}

.slot-title {
  color: rgba(255, 248, 232, 0.82);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.location-tile.selected {
  outline: 3px solid var(--accent);
}

.asset-img {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 0;
  background: transparent;
}

.asset-img.card {
  aspect-ratio: 700 / 1015;
  object-fit: contain;
}

.asset-img.square {
  aspect-ratio: 1;
  object-fit: cover;
}

.reminder-frame {
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(rgba(245, 239, 223, 0.36), rgba(245, 239, 223, 0.36)),
    rgba(245, 239, 223, 0.42);
}

.reminder-frame .asset-img {
  border-radius: 0;
}

.reminder-img {
  opacity: 0.5;
  filter: contrast(0.48) saturate(0.66);
}

.location-tile.selected .reminder-img {
  opacity: 0.62;
  filter: contrast(0.58) saturate(0.72);
}

.board-promotions-tile .reminder-img {
  opacity: 0.48;
  filter: contrast(0.46) saturate(0.62);
}

.marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.5rem;
  min-height: 1.44rem;
}

.mark {
  width: 1.32rem;
  height: 1.32rem;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0,0,0,0.45);
  cursor: default;
}

.mark.clickable {
  cursor: pointer;
}

.mark.selected {
  outline: 3px solid var(--accent);
}

.mark.red { background: var(--red); }
.mark.blue { background: var(--blue); }
.mark.green { background: var(--green); }
.mark.yellow { background: var(--yellow); color: #201a17; text-shadow: none; }
.mark.purple { background: var(--purple); }
.mark.white { background: var(--white); color: #201a17; text-shadow: none; }

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.stack {
  display: grid;
  gap: 0.65rem;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 0.65rem;
}

.board-event-grid {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.lineup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.board-lineup-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.match-track.current {
  outline: 3px solid var(--accent);
}

.mini-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.8rem;
}

.small {
  font-size: 0.86rem;
  color: var(--muted);
}

.felt .small {
  color: rgba(255, 248, 232, 0.76);
}

.card-row {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 0.35rem;
}

.card-thumb {
  flex: 0 0 86px;
  display: grid;
  gap: 0.24rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 0.35rem;
}

.card-thumb button {
  padding: 0.25rem 0.35rem;
  font-size: 0.74rem;
}

.card-thumb.selected {
  outline: 3px solid var(--accent);
}

.player-grid {
  display: grid;
  gap: 0.75rem;
}

.player-panel.active {
  border-color: var(--felt);
  box-shadow: 0 0 0 3px rgba(55, 84, 70, 0.18);
}

.stat-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.stat {
  background: #efe5cf;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.1rem;
}

.log {
  max-height: 260px;
  overflow: auto;
  padding-left: 1.1rem;
  margin: 0;
}

.log li {
  margin-bottom: 0.35rem;
}

.inspector {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 18, 16, 0.64);
  place-items: center;
  padding: 1rem;
}

.inspector.open {
  display: grid;
}

.inspector-card {
  width: min(92vw, 560px);
  max-height: 92vh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.inspector-card img {
  width: min(100%, 360px);
  margin: 0 auto 1rem;
}

.danger {
  background: #f5dfd9;
}

.primary {
  background: var(--felt);
  color: #fff8e8;
  border-color: var(--felt-2);
}

.accent {
  background: #f3d179;
}

@media (max-width: 1150px) {
  .table-shell {
    grid-template-columns: 1fr;
  }

  .board-panel {
    order: -1;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .phase-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .game-hud {
    grid-template-columns: 1fr;
    top: 5.8rem;
  }

  .status-strip,
  .hud-actions {
    justify-content: flex-start;
  }

  .command-rail,
  .player-rail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .setup-shell,
  .setup-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .setup-shell {
    align-items: start;
    min-height: 100vh;
    padding: 1rem;
    background:
      linear-gradient(180deg, rgba(6, 10, 9, 0.08), rgba(6, 10, 9, 0.76)),
      var(--setup-cover-mobile) center -17rem / cover no-repeat;
  }

  .cover-panel {
    min-height: auto;
    padding: 42vh 0 0.5rem;
  }

  .cover-panel p {
    font-size: 0.98rem;
  }

  .phase-strip {
    gap: 0.35rem;
    padding-inline: 0.7rem;
  }

  .phase-pill {
    padding-inline: 0.35rem;
    font-size: 0.84rem;
  }

  .brand {
    display: grid;
  }

  .locations-grid,
  .lineup-grid,
  .event-grid {
    grid-template-columns: 1fr;
  }

  .table-shell {
    padding: 0.7rem;
  }

  .board-layout,
  .six-location .board-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "promo"
      "loc1"
      "loc2"
      "loc3"
      "loc4"
      "loc5"
      "loc6"
      "lineup"
      "events";
  }

  .board-mat-label {
    margin-inline: 0;
  }

  .board-event-grid,
  .board-lineup-grid {
    grid-template-columns: 1fr;
  }
}

/* Player-first table pass: remove browser-like chrome and keep tools tucked away. */
.app {
  padding-bottom: clamp(7rem, 18vh, 12rem);
}

.topbar {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.toolbar {
  align-items: center;
}

.table-menu {
  position: relative;
}

.table-menu summary {
  width: 2.35rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 248, 232, 0.22);
  border-radius: 6px;
  background: rgba(245, 239, 223, 0.12);
  cursor: pointer;
  list-style: none;
}

.table-menu summary::-webkit-details-marker {
  display: none;
}

.menu-mark,
.menu-mark::before,
.menu-mark::after {
  width: 1.05rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.82);
}

.menu-mark {
  position: relative;
}

.menu-mark::before,
.menu-mark::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-mark::before {
  top: -0.34rem;
}

.menu-mark::after {
  top: 0.34rem;
}

.table-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 45;
  min-width: 9.5rem;
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(255, 248, 232, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 31, 27, 0.98), rgba(9, 15, 13, 0.98));
  padding: 0.45rem;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
}

.table-menu-panel button {
  width: 100%;
  justify-content: start;
  text-align: left;
}

.table-shell {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  min-height: calc(100vh - 4rem);
  padding: 0.7rem 0.75rem clamp(8rem, 18vh, 13rem);
}

.board-panel {
  width: min(100%, 1180px);
}

.board-stage {
  width: min(100%, 1080px, calc((100vh - 5.5rem) * 1.72));
}

.board-docks {
  width: min(100%, 1080px);
}

.action-tray {
  bottom: clamp(14rem, 25vh, 19rem);
  width: min(92vw, 720px);
  max-height: min(42vh, 310px);
}

.app:has(.hand-tray.collapsed) .action-tray {
  bottom: clamp(7.5rem, 18vh, 11rem);
}

.action-tray .panel {
  gap: 0.48rem;
}

.action-player-slice {
  display: grid;
  gap: 0.34rem;
  min-width: 0;
}

.action-card-row .card-row,
.action-player-slice .card-row {
  padding-bottom: 0.15rem;
}

.action-card-row .card-thumb,
.action-player-slice .card-thumb {
  flex-basis: 74px;
}

.action-card-row .asset-img.card,
.action-player-slice .asset-img.card {
  max-height: 104px;
}

.hand-tray {
  margin-bottom: clamp(7rem, 18vh, 12rem);
}

.hand-tray.collapsed {
  width: min(100% - 1rem, 820px);
}

@media (max-width: 760px) {
  .app {
    padding-bottom: 9rem;
  }

  .topbar {
    position: sticky;
    grid-template-columns: 1fr auto;
  }

  .brand {
    min-width: 0;
  }

  .brand h1 {
    font-size: 1.35rem;
  }

  .brand span {
    display: none;
  }

  .action-tray {
    width: min(96vw, 680px);
    bottom: 12rem;
  }

  .hand-tray {
    margin-bottom: 7rem;
  }
}

/* Digital table v2: board-first stage and compact game rails. */
.topbar {
  padding: 0.42rem clamp(0.65rem, 1.2vw, 1.1rem);
}

.brand h1 {
  font-size: clamp(1.45rem, 2.1vw, 2.25rem);
}

.toolbar {
  gap: 0.36rem;
}

.toolbar button {
  padding: 0.34rem 0.52rem;
}

.phase-pill {
  padding: 0.26rem 0.46rem;
  font-size: 0.82rem;
}

.game-hud {
  top: 2.9rem;
  gap: 0.52rem;
  padding: 0.38rem clamp(0.65rem, 1.2vw, 1.1rem);
}

.status-strip span {
  padding: 0.22rem 0.48rem;
  font-size: 0.78rem;
}

.hud-actions button {
  padding: 0.26rem 0.55rem;
}

.table-shell {
  grid-template-columns: minmax(650px, 1fr) minmax(255px, 320px);
  gap: 0.55rem;
  padding: 0.55rem;
  min-height: calc(100vh - 5.8rem);
}

.panel,
.player-panel,
.drawer {
  padding: 0.68rem;
}

.command-rail,
.player-rail {
  top: 6.1rem;
  max-height: calc(100vh - 6.7rem);
}

.board-panel {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
}

.board-stage {
  position: relative;
  width: min(100%, 940px, calc((100vh - 9rem) * 1.6));
  aspect-ratio: 16 / 10;
  min-height: 320px;
  border-radius: 8px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  background:
    radial-gradient(circle at center, rgba(255, 248, 232, 0.08), transparent 33rem),
    url("public/assets/ui/territory-table-backdrop.png?v=board-props-scale-v4-2026-05-04"),
    #14231e;
  background-size: cover;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.board-art-layer {
  position: absolute;
  inset: 1.2%;
  border-radius: 6px;
  background:
    radial-gradient(circle at center, rgba(245, 239, 223, 0.1), rgba(10, 16, 14, 0.18) 58%, rgba(5, 9, 8, 0.42)),
    var(--board-art);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.7);
  filter: saturate(0.9) contrast(0.96);
}

.board-stage.six-location .board-art-layer {
  clip-path: polygon(8.2% 0, 100% 0, 100% 100%, 0 100%, 0 10.4%);
}

.board-stage.six-location::before {
  content: "";
  position: absolute;
  left: 1.2%;
  top: 1.2%;
  width: 8.2%;
  aspect-ratio: 1;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0) 49%, rgba(255, 248, 232, 0.26) 50%, rgba(32, 25, 19, 0.22) 52%),
    linear-gradient(225deg, rgba(245, 230, 186, 0.34), rgba(12, 20, 17, 0.14) 58%, rgba(5, 9, 8, 0) 60%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.board-piece-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.location-piece,
.board-promotions-piece {
  position: absolute;
  z-index: 2;
  width: 26%;
  min-height: 5.6rem;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.44rem;
  pointer-events: auto;
}

.location-piece {
  display: grid;
  place-items: center;
  aspect-ratio: 1.62;
  min-height: 0;
  overflow: visible;
  isolation: isolate;
  cursor: pointer;
  background: transparent;
}

.location-piece::before,
.location-piece::after,
.board-promotions-piece::before,
.board-promotions-piece::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.location-piece::before {
  inset: -14% -10%;
  z-index: 0;
  background: var(--location-art);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: saturate(0.88) contrast(0.96) brightness(0.72)
    drop-shadow(0 13px 16px rgba(0, 0, 0, 0.42));
  opacity: 0.82;
}

.location-piece::after {
  inset: 12% 8%;
  z-index: 0;
  border: 1px solid rgba(255, 248, 232, 0.2);
  border-radius: 3px;
  background: rgba(10, 17, 14, 0.18);
}

.location-piece:hover {
  filter: brightness(1.08);
}

.location-piece.selected {
  outline: 3px solid var(--accent);
  outline-offset: 0.18rem;
}

.location-command {
  position: absolute;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.38rem;
  width: min(21rem, 30%);
  min-width: 12.5rem;
  padding: 0.42rem 0.48rem;
  border: 1px solid rgba(255, 248, 232, 0.34);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(33, 48, 40, 0.92), rgba(8, 15, 13, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 232, 0.16),
    0 12px 26px rgba(0, 0, 0, 0.42);
  color: #fff8e8;
  pointer-events: auto;
}

.location-command::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.45rem;
  width: 0.8rem;
  height: 0.8rem;
  border-left: 1px solid rgba(255, 248, 232, 0.34);
  border-top: 1px solid rgba(255, 248, 232, 0.34);
  background: rgba(33, 48, 40, 0.94);
  transform: translateX(-50%) rotate(45deg);
}

.location-command-meta {
  display: grid;
  gap: 0.06rem;
  min-width: 0;
}

.location-command-meta span {
  overflow: hidden;
  color: rgba(255, 248, 232, 0.64);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.location-command-meta strong {
  font-size: 0.9rem;
  line-height: 1;
}

.location-command-actions,
.location-pass-confirm {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.location-command button {
  min-width: 0;
  padding: 0.22rem 0.42rem;
  border-radius: 4px;
  font-size: 0.82rem;
}

.location-pass-confirm {
  grid-column: 1 / -1;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 248, 232, 0.14);
  padding-top: 0.34rem;
}

.location-pass-confirm span {
  margin-right: auto;
  color: rgba(255, 248, 232, 0.68);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.location-command.slot-1 { left: 22%; top: 41%; transform: translateX(-50%); }
.location-command.slot-2 { left: 78%; top: 41%; transform: translateX(-50%); }
.location-command.slot-3 { left: 22%; top: 84%; transform: translateX(-50%); }
.location-command.slot-4 { left: 78%; top: 84%; transform: translateX(-50%); }
.location-command.slot-5 { left: 50%; top: 34%; transform: translateX(-50%); }
.location-command.slot-6 { left: 50%; top: 90%; transform: translateX(-50%); }

.piece-title {
  color: rgba(255, 248, 232, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.location-piece.slot-1 { left: 22%; top: 29%; }
.location-piece.slot-2 { left: 78%; top: 29%; }
.location-piece.slot-3 { left: 22%; top: 72%; }
.location-piece.slot-4 { left: 78%; top: 72%; }
.location-piece.slot-5 { left: 50%; top: 22%; }
.location-piece.slot-6 { left: 50%; top: 78%; }

.board-promotions-piece {
  left: 50%;
  top: 49%;
  width: 18%;
  aspect-ratio: 1;
  min-height: 0;
  display: block;
  border-radius: 4px;
  overflow: hidden;
  isolation: isolate;
  transform: translate(-50%, -50%) rotate(45deg);
  background:
    linear-gradient(135deg, rgba(247, 241, 220, 0.2), rgba(15, 23, 19, 0.54)),
    rgba(18, 28, 23, 0.78);
  border: 1px solid rgba(255, 248, 232, 0.22);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 248, 232, 0.12);
}

.board-promotions-piece::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(245, 239, 223, 0.02), rgba(10, 14, 12, 0.2)),
    url("public/assets/ui/promotions-polaroid-ring.png?v=board-props-scale-v4-2026-05-04");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(0.9) contrast(1.02);
  opacity: 0.82;
  transform: rotate(-45deg) scale(1.43);
}

.board-promotions-piece::after {
  inset: 0.34rem;
  z-index: 0;
  border: 1px solid rgba(255, 248, 232, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.26),
    inset 0 0 22px rgba(224, 176, 63, 0.08);
}

.board-promotions-piece > * {
  transform: rotate(-45deg);
}

.board-promotions-piece .piece-title {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 1;
  width: max-content;
  max-width: 78%;
  transform: translate(-50%, -50%) rotate(-45deg);
  padding: 0.12rem 0.34rem 0.14rem;
  border: 1px solid rgba(255, 248, 232, 0.24);
  border-radius: 3px;
  background: rgba(9, 14, 12, 0.58);
  font-size: clamp(0.72rem, 1.05vw, 0.98rem);
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.72);
}

.promo-reminder {
  position: absolute;
  top: 70%;
  left: 50%;
  z-index: 2;
  display: block;
  width: clamp(3.2rem, 4.2vw, 4.25rem);
  aspect-ratio: 320 / 165;
  margin: 0;
  border: 1px solid rgba(255, 248, 232, 0.42);
  border-radius: 4px;
  background-color: rgba(245, 239, 223, 0.78);
  background-image: url("public/assets/ui/promotions-ticket-mark.png?v=board-props-scale-v4-2026-05-04");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 88% auto;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  opacity: 0.96;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.promo-ticket {
  display: none;
}

.promo-mark {
  display: none;
}

.board-promotions-piece .marks {
  position: absolute;
  top: 52%;
  left: 50%;
  z-index: 1;
  justify-content: center;
  width: max-content;
  max-width: 76%;
  transform: translate(-50%, -50%) rotate(-45deg);
  text-align: center;
}

.board-promotions-piece .marks .small {
  display: inline-block;
  padding: 0.1rem 0.32rem 0.14rem;
  border-radius: 3px;
  background: rgba(9, 14, 12, 0.56);
  color: rgba(255, 248, 232, 0.86);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.64);
}

.board-docks {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 0.55rem;
}

.board-side-stack {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-width: 0;
}

.board-dock {
  min-width: 0;
  border: 1px solid rgba(255, 248, 232, 0.2);
  border-radius: 8px;
  background: rgba(11, 19, 16, 0.8);
  color: #fff8e8;
  padding: 0.55rem;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.board-dock h2 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.table-control-dock {
  display: grid;
  gap: 0.46rem;
}

.turn-prompt-dock {
  border-style: dashed;
  background: rgba(11, 19, 16, 0.58);
}

.table-control-dock h2,
.table-control-dock p {
  margin: 0;
}

.table-control-actions,
.pass-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
}

.table-control-actions button,
.pass-confirm button {
  padding: 0.28rem 0.52rem;
}

.pass-confirm {
  border-top: 1px solid rgba(255, 248, 232, 0.14);
  padding-top: 0.42rem;
}

.pass-confirm span {
  color: rgba(255, 248, 232, 0.76);
  font-size: 0.78rem;
}

.board-lineup-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.45rem;
}

.board-event-grid {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0.4rem;
}

.board-event-grid .event-slot {
  padding: 0.35rem;
  min-width: 124px;
}

.event-slot {
  text-align: center;
}

.board-event-grid .mini-title {
  font-size: 0.68rem;
  text-align: center;
  white-space: nowrap;
}

.board-event-grid .small {
  font-size: 0.68rem;
  text-align: center;
}

.board-event-grid .asset-img.card {
  max-height: 112px;
}

.location-piece .marks,
.board-promotions-piece .marks {
  gap: 0.18rem;
  margin-top: 0.34rem;
  min-height: 1.12rem;
}

.location-piece .mark,
.board-promotions-piece .mark {
  width: 1.04rem;
  height: 1.04rem;
  font-size: 0.62rem;
}

.rail-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.player-summary-grid {
  gap: 0.38rem;
}

.player-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  border: 1px solid rgba(32, 26, 23, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  padding: 0.44rem;
}

.player-summary.active {
  border-color: rgba(207, 170, 68, 0.95);
  box-shadow: 0 0 0 3px rgba(207, 170, 68, 0.18);
}

.player-summary h3 {
  margin: 0;
  font-size: 0.86rem;
}

.player-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin-top: 0.18rem;
}

.player-badges span {
  border-radius: 999px;
  background: rgba(55, 84, 70, 0.12);
  color: var(--felt-2);
  padding: 0.1rem 0.34rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-stats {
  display: flex;
  gap: 0.22rem;
}

.summary-stats span {
  min-width: 2.28rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #efe5cf;
  padding: 0.18rem 0.24rem;
  text-align: center;
  font-size: 0.62rem;
}

.summary-stats strong {
  display: block;
  font-size: 0.88rem;
}

.active-drawer {
  display: grid;
  gap: 0.45rem;
}

.active-drawer details {
  border-top: 1px solid rgba(32, 26, 23, 0.12);
  padding-top: 0.36rem;
}

.active-drawer summary {
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.player-rail .card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 0.34rem;
  overflow: visible;
  padding-bottom: 0;
}

.player-rail .card-thumb {
  min-width: 0;
  padding: 0.22rem;
}

.player-rail .card-thumb .mini-title {
  font-size: 0.64rem;
  line-height: 1.05;
  text-transform: none;
  letter-spacing: 0;
}

.player-rail .card-thumb .marks {
  display: none;
}

.player-rail .asset-img.card {
  max-height: 108px;
}

.player-rail .panel {
  background: rgba(255, 250, 240, 0.66);
  box-shadow: none;
}

.log {
  max-height: 132px;
  font-size: 0.78rem;
}

@media (max-width: 1150px) {
  .table-shell {
    grid-template-columns: 1fr;
  }

  .board-stage {
    width: min(100%, 560px);
    min-height: auto;
  }

  .board-docks {
    grid-template-columns: 1fr;
  }

  .game-hud {
    top: 5.1rem;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
  }

  .game-hud {
    position: sticky;
    top: 0;
  }

  .status-strip span:nth-child(3),
  .status-strip span:nth-child(4) {
    display: none;
  }

  .phase-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .board-stage {
    width: min(100%, 560px);
  }

  .location-piece {
    width: 30%;
    min-height: 4.7rem;
  }

  .board-promotions-piece {
    width: 27%;
  }
}

/* Immersive table pass: less browser chrome, stronger game table affordances. */
.topbar {
  grid-template-columns: minmax(240px, 1fr) auto;
  background:
    linear-gradient(180deg, rgba(19, 29, 25, 0.98), rgba(8, 14, 12, 0.96));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.brand {
  gap: 0.7rem;
}

.brand h1 {
  color: #fff8e8;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}

.toolbar button,
.hand-tray button,
.rulebook-panel button {
  border-color: rgba(255, 248, 232, 0.22);
}

.toolbar button {
  background: rgba(245, 239, 223, 0.12);
  color: rgba(255, 248, 232, 0.86);
  box-shadow: none;
}

.toolbar button:hover:not(:disabled) {
  background: rgba(245, 239, 223, 0.2);
  color: #fff8e8;
}

.game-hud {
  grid-template-columns: minmax(300px, 0.72fr) minmax(260px, 1fr) auto;
  background:
    linear-gradient(180deg, rgba(21, 31, 27, 0.94), rgba(14, 22, 19, 0.9));
  border-top: 1px solid rgba(255, 248, 232, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.phase-pill {
  background: rgba(255, 248, 232, 0.06);
  color: rgba(255, 248, 232, 0.58);
}

.phase-pill.active {
  background: #cfaa44;
  color: #17120d;
}

.hud-actions span {
  color: rgba(255, 248, 232, 0.78);
}

.table-shell {
  align-items: stretch;
}

.board-panel {
  align-content: start;
}

.player-rail {
  top: 6.1rem;
}

.player-rail .drawer {
  background:
    linear-gradient(180deg, rgba(245, 239, 223, 0.92), rgba(234, 223, 199, 0.9));
  border: 1px solid rgba(255, 248, 232, 0.28);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.player-summary {
  background: rgba(255, 250, 240, 0.58);
}

.player-summary.active {
  background: rgba(252, 241, 200, 0.88);
}

.active-drawer {
  background: rgba(255, 250, 240, 0.5);
  border: 1px solid rgba(32, 26, 23, 0.14);
  box-shadow: none;
}

.board-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 248, 232, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 248, 232, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.16;
  mix-blend-mode: screen;
}

.location-piece,
.board-promotions-piece {
  width: min(25%, 220px);
  min-height: 5.15rem;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.16), rgba(9, 16, 13, 0.28)),
    rgba(9, 16, 13, 0.78);
  backdrop-filter: blur(1px);
}

.board-promotions-piece {
  width: min(29%, 260px);
}

.location-piece .small,
.board-promotions-piece .small {
  color: rgba(255, 248, 232, 0.62);
}

.location-piece .marks,
.board-promotions-piece .marks,
.board-promotions-piece .piece-title {
  position: relative;
  z-index: 1;
}

.mark {
  --mark-color: var(--white);
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in oklch, var(--mark-color), white 48%);
  border-radius: 3px;
  background:
    linear-gradient(135deg,
      color-mix(in oklch, var(--mark-color), white 34%) 0 28%,
      var(--mark-color) 29% 64%,
      color-mix(in oklch, var(--mark-color), black 30%) 65% 100%);
  color: transparent;
  font-size: 0;
  text-shadow: none;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.18),
    inset -3px -3px 0 rgba(0, 0, 0, 0.24),
    0 2px 0 rgba(0, 0, 0, 0.36);
}

.mark::before,
.mark::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mark::before {
  left: 18%;
  top: 13%;
  width: 50%;
  height: 50%;
  border-top: 1px solid rgba(255, 255, 255, 0.42);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  transform: skew(-14deg, -10deg);
}

.mark::after {
  right: 12%;
  bottom: 12%;
  width: 42%;
  height: 48%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.36);
  border-right: 1px solid rgba(0, 0, 0, 0.32);
  transform: skew(-10deg, -14deg);
}

.mark.clickable:hover {
  transform: translateY(-1px);
}

.mark.selected {
  outline: 2px solid #f4d46d;
  outline-offset: 2px;
}

.mark.red { --mark-color: var(--red); }
.mark.blue { --mark-color: var(--blue); }
.mark.green { --mark-color: var(--green); }
.mark.yellow { --mark-color: var(--yellow); }
.mark.purple { --mark-color: var(--purple); }
.mark.white { --mark-color: var(--white); }

.mark.red,
.mark.blue,
.mark.green,
.mark.yellow,
.mark.purple,
.mark.white {
  background:
    linear-gradient(135deg,
      color-mix(in oklch, var(--mark-color), white 34%) 0 28%,
      var(--mark-color) 29% 64%,
      color-mix(in oklch, var(--mark-color), black 30%) 65% 100%);
  color: transparent;
  text-shadow: none;
}

.lineup-dock {
  max-width: 620px;
}

.board-lineup-grid {
  grid-template-columns: 1fr;
  gap: 0.46rem;
}

.match-track {
  display: grid;
  grid-template-columns: minmax(78px, 0.74fr) minmax(108px, auto) minmax(98px, 0.68fr);
  grid-template-areas:
    "title slots assignment"
    "title info assignment";
  gap: 0.18rem 0.52rem;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(21, 38, 32, 0.82), rgba(8, 15, 13, 0.86));
}

.match-title {
  grid-area: title;
}

.match-info {
  grid-area: info;
  align-self: start;
  max-width: 100%;
  font-size: 0.74rem;
  line-height: 1.08;
  text-align: center;
}

.match-assignment {
  grid-area: assignment;
  align-self: center;
  justify-self: end;
  max-width: 8.4rem;
  text-align: right;
}

.match-track .small {
  color: rgba(255, 248, 232, 0.58);
}

.match-slots {
  grid-area: slots;
  display: flex;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
}

.match-space {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 4px;
}

.match-space.empty {
  opacity: 0.38;
  border: 1px dashed rgba(255, 248, 232, 0.62);
  background:
    repeating-linear-gradient(45deg, rgba(255, 248, 232, 0.16) 0 2px, transparent 2px 6px),
    rgba(255, 248, 232, 0.04);
}

.match-space.filled .mark {
  margin: 0;
}

.action-tray {
  position: fixed;
  left: 50%;
  bottom: 13rem;
  transform: translateX(-50%);
  z-index: 46;
  width: min(94vw, 620px);
  max-height: min(38vh, 240px);
  overflow: auto;
  margin: 0;
  color: #fff8e8;
}

.app:has(.hand-tray.collapsed) .action-tray {
  bottom: 3.8rem;
}

.action-tray .panel {
  background:
    linear-gradient(180deg, rgba(22, 35, 30, 0.94), rgba(8, 15, 13, 0.92));
  border: 1px solid rgba(255, 248, 232, 0.24);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  padding: 0.58rem 0.68rem;
}

.booking-panel .note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-panel {
  gap: 0.5rem;
}

.booking-status {
  display: flex;
  align-items: center;
  min-height: 1.1rem;
  color: rgba(255, 248, 232, 0.72);
}

.booking-status.resolved {
  color: #fff8e8;
}

.booking-panel .fan-cube-row {
  gap: 0.22rem;
  margin-bottom: 0.18rem;
}

.action-tray .fan-mark-button {
  appearance: none;
  padding: 0;
  margin: 0;
}

.action-tray .fan-cube-row-selectable .fan-mark-button {
  cursor: pointer;
}

.action-tray .fan-mark-button.selected {
  outline: 2px solid rgba(244, 212, 109, 0.86);
  outline-offset: 2px;
}

.booking-cashout-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.68rem;
  color: #fff8e8;
}

.booking-cashout-table th,
.booking-cashout-table td {
  padding: 0.18rem 0.22rem;
  border-bottom: 1px solid rgba(255, 248, 232, 0.12);
  vertical-align: middle;
}

.booking-cashout-table th {
  color: rgba(255, 248, 232, 0.58);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.booking-cashout-table tbody tr.selected {
  background: rgba(224, 176, 63, 0.12);
}

.action-tray .booking-suit-cell,
.action-tray .booking-fan-cell {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.26rem 0.32rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 248, 232, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff8e8;
  text-align: left;
}

.action-tray .booking-suit-cell {
  justify-content: flex-start;
}

.action-tray .booking-fan-cell {
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}

.action-tray .booking-suit-cell.selected,
.action-tray .booking-fan-cell.selected {
  border-color: rgba(224, 176, 63, 0.72);
  box-shadow: 0 0 0 2px rgba(224, 176, 63, 0.14);
}

.action-tray .booking-suit-cell:disabled,
.action-tray .booking-fan-cell:disabled,
.action-tray .booking-retain-control input:disabled,
.action-tray .fan-mark-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.booking-fan-cell-count {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
}

.booking-fan-cell-label {
  color: rgba(255, 248, 232, 0.62);
}

.booking-retain-control {
  display: block;
}

.booking-retain-control input {
  width: 3.2rem;
  padding: 0.22rem 0.18rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 248, 232, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
  text-align: center;
  font: inherit;
  font-weight: 700;
}

.booking-retain-control input:focus {
  outline: none;
  border-color: rgba(224, 176, 63, 0.72);
  box-shadow: 0 0 0 2px rgba(224, 176, 63, 0.16);
}

.booking-cashout-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.booking-cashout-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
  min-width: 0;
}

.booking-cashout-preview span {
  white-space: nowrap;
}

.booking-cashout-preview strong {
  color: #fff8e8;
}

.action-tray.phase-booking {
  top: calc(3.6rem + env(safe-area-inset-top, 0px));
  bottom: auto;
}

.action-tray:has(.final-panel) {
  bottom: 1rem;
  width: min(94vw, 760px);
  max-height: min(72vh, 620px);
}

.action-tray .final-panel {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(246, 240, 226, 0.98), rgba(230, 219, 193, 0.96));
  border-color: rgba(255, 248, 232, 0.34);
}

.action-tray .final-panel h2,
.action-tray .final-panel h3 {
  color: var(--ink);
}

.action-tray .final-panel .stat {
  color: var(--ink);
}

.action-tray .final-panel .note,
.action-tray .final-panel .small {
  color: var(--muted);
}

.action-tray .stat-line,
.action-tray details {
  display: none;
}

.action-tray h2 {
  margin-bottom: 0.15rem;
  font-size: 0.92rem;
}

.action-tray h3 {
  margin: 0.22rem 0 0.1rem;
  font-size: 0.82rem;
}

.action-tray .note,
.action-tray .small {
  color: rgba(255, 248, 232, 0.7);
}

.action-tray button {
  width: auto;
  justify-self: start;
  padding: 0.28rem 0.52rem;
}

.hand-tray {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 27;
  width: min(100% - 1rem, 980px);
  margin: 0 auto 0.5rem;
  border: 1px solid rgba(255, 248, 232, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 31, 27, 0.97), rgba(10, 16, 14, 0.96));
  color: #fff8e8;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
}

.hand-tray.needs-choice {
  border-color: rgba(224, 176, 63, 0.68);
  box-shadow:
    0 0 0 2px rgba(224, 176, 63, 0.2),
    0 -16px 44px rgba(0, 0, 0, 0.42);
}

.hand-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.36rem 0.58rem;
  border-bottom: 1px solid rgba(255, 248, 232, 0.12);
}

.hand-tray-header > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.eyebrow {
  color: rgba(255, 248, 232, 0.52);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hand-tray-header span:last-child {
  color: rgba(255, 248, 232, 0.62);
  font-size: 0.8rem;
}

.hand-tray-body {
  padding: 0.42rem 0.58rem 0.48rem;
}

.hand-tray.collapsed {
  position: static;
  left: auto;
  bottom: auto;
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 1rem);
  margin: 0.45rem auto 0.65rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  transform: none;
}

.hand-peek {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: end;
  gap: 0.52rem;
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff8e8;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
}

.hand-tray.collapsed .hand-peek {
  width: max-content;
  grid-template-columns: auto auto;
  gap: 0.42rem;
}

.hand-peek:hover,
.hand-peek:focus-visible {
  background: transparent;
  color: #fff8e8;
}

.hand-peek-cards {
  position: relative;
  display: block;
  width: var(--fan-width);
  height: 24px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

.hand-peek-card,
.hand-peek-empty {
  position: absolute;
  left: calc(var(--i, 0) * 24px);
  bottom: 0;
  display: block;
  width: 46px;
  height: 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.74);
  border-radius: 7px 7px 2px 2px;
  background: rgba(245, 239, 223, 0.9);
  transform-origin: bottom center;
}

.hand-peek-card img {
  display: block;
  width: 100%;
  height: auto;
}

.hand-peek-empty {
  left: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255, 248, 232, 0.14), rgba(255, 248, 232, 0.14) 5px, transparent 5px, transparent 10px),
    rgba(10, 16, 14, 0.78);
}

.hand-peek-label {
  display: flex;
  align-items: baseline;
  gap: 0.28rem;
  margin-bottom: 0.08rem;
  padding: 0.16rem 0.3rem;
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 999px;
  background: rgba(8, 14, 12, 0.62);
  color: rgba(255, 248, 232, 0.72);
  font-size: 0.72rem;
  line-height: 1;
}

.hand-peek-label span:first-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hand-peek-label span:last-child {
  color: #fff8e8;
  font-weight: 800;
}

.hand-card-row {
  overflow-x: auto;
  padding-bottom: 0.22rem;
  max-height: min(50vh, 350px);
}

.hand-card-row .card-thumb {
  flex-basis: 106px;
  background: rgba(255, 250, 240, 0.92);
}

.hand-card-row .asset-img.card {
  max-height: min(42vh, 190px);
}

.rulebook-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(4, 8, 7, 0.74);
  padding: 1rem;
}

.rulebook-overlay.open {
  display: grid;
  place-items: center;
}

.rulebook-panel {
  width: min(96vw, 1040px);
  height: min(92vh, 820px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 248, 232, 0.26);
  background: #121b17;
  color: #fff8e8;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
}

.rulebook-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(255, 248, 232, 0.12);
}

.rulebook-panel h2 {
  margin: 0;
}

.rulebook-panel a {
  color: #f3d179;
}

.rulebook-panel .icon-close {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-color: rgba(255, 248, 232, 0.32);
  font-weight: 800;
  line-height: 1;
}

.rulebook-content {
  overflow: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(232, 222, 198, 0.98));
  color: var(--ink);
}

.rulebook-content section {
  border: 1px solid rgba(32, 26, 23, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  padding: 0.85rem 0.95rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

.rulebook-content h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.rulebook-content ul,
.rulebook-content ol {
  margin: 0;
  padding-left: 1.15rem;
}

.rulebook-content li {
  margin: 0.32rem 0;
  line-height: 1.42;
}

.hover-card-preview {
  position: fixed;
  z-index: 70;
  width: min(260px, 42vw);
  pointer-events: none;
  border: 1px solid rgba(255, 248, 232, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(245, 239, 223, 0.98), rgba(230, 219, 193, 0.98));
  padding: 0.55rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.hover-card-preview img {
  max-height: min(62vh, 430px);
}

.hover-card-preview .mini-title {
  margin-top: 0.35rem;
  color: var(--ink);
}

.playtest-report {
  display: grid;
  gap: 0.58rem;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(32, 26, 23, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.7), rgba(234, 223, 199, 0.72));
  padding: 0.58rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.62) inset;
}

.playtest-report h3,
.playtest-report h4 {
  margin: 0;
}

.playtest-report .small,
.playtest-report p {
  margin: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
  gap: 0.42rem;
  min-width: 0;
}

.report-card {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
  border: 1px solid rgba(32, 26, 23, 0.13);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.88), rgba(239, 229, 207, 0.82));
  padding: 0.44rem 0.5rem;
}

.report-card strong,
.report-metric {
  color: var(--felt-2);
  font-size: 1.06rem;
  line-height: 1;
}

.report-card span,
.report-card small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 0.34rem;
  font-weight: 700;
}

.report-metric small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.report-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(55, 84, 70, 0.22);
  border-radius: 999px;
  background: rgba(55, 84, 70, 0.13);
  color: var(--felt-2);
  padding: 0.14rem 0.42rem;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.report-pill.good,
.report-pill.win,
.report-pill.ok {
  border-color: rgba(111, 140, 93, 0.34);
  background: rgba(111, 140, 93, 0.18);
  color: #31482f;
}

.report-pill.warn,
.report-pill.tie {
  border-color: rgba(193, 154, 50, 0.38);
  background: rgba(193, 154, 50, 0.18);
  color: #6b4f12;
}

.report-pill.bad,
.report-pill.loss {
  border-color: rgba(168, 66, 63, 0.3);
  background: rgba(168, 66, 63, 0.13);
  color: #74302e;
}

.report-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 26, 23, 0.14);
  border-radius: 7px;
  background: rgba(255, 250, 240, 0.62);
  font-size: 0.78rem;
}

.report-table th,
.report-table td {
  padding: 0.34rem 0.42rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(32, 26, 23, 0.1);
}

.report-table th {
  background: rgba(55, 84, 70, 0.12);
  color: var(--felt-2);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.report-table td {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.report-table tbody tr:nth-child(even) td {
  background: rgba(245, 239, 223, 0.42);
}

@media (max-width: 1150px) {
  .table-shell {
    grid-template-columns: 1fr;
  }

  .board-stage {
    width: min(100%, 940px);
  }

  .player-rail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .game-hud {
    grid-template-columns: 1fr;
  }

  .board-stage {
    min-height: 360px;
  }

  .location-piece,
  .board-promotions-piece {
    width: 34%;
    min-height: 4.5rem;
  }

  .location-command {
    width: min(16rem, 42%);
    min-width: 10.5rem;
    grid-template-columns: 1fr;
  }

  .location-command-actions,
  .location-pass-confirm {
    justify-content: flex-start;
  }

  .match-track {
    grid-template-columns: 1fr;
  }

  .hand-card-row .card-thumb {
    flex-basis: 86px;
  }

  .hover-card-preview {
    width: min(240px, 72vw);
  }

  .rulebook-panel {
    width: min(96vw, 720px);
  }

  .rulebook-panel header {
    align-items: flex-start;
  }

  .rulebook-content {
    grid-template-columns: 1fr;
    padding: 0.7rem;
  }

  .playtest-report {
    padding: 0.48rem;
  }

  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-table {
    font-size: 0.74rem;
  }

  .report-table th,
  .report-table td {
    padding: 0.3rem 0.34rem;
  }
}

/* Final player-view overrides must sit after earlier table-pass rules. */
.table-menu:not([open]) .table-menu-panel {
  display: none;
}

:root {
  --preview-bottom-gap: clamp(12rem, 30vh, 19rem);
}

html,
body {
  min-height: calc(100vh + var(--preview-bottom-gap));
}

body {
  padding-bottom: var(--preview-bottom-gap);
}

.app {
  padding-bottom: calc(var(--preview-bottom-gap) + 4rem);
}

.app::after {
  content: "";
  display: block;
  height: var(--preview-bottom-gap);
}

.table-shell {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  min-height: calc(100vh - 4rem);
  padding: 0.7rem 0.75rem calc(var(--preview-bottom-gap) + 5rem);
}

.board-panel {
  width: min(100%, 1480px);
}

.board-table-layout {
  width: min(100%, calc(100vw - 1.5rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 520px);
  align-items: start;
  justify-content: center;
  gap: clamp(0.6rem, 1.2vw, 1rem);
}

.board-stage {
  width: min(100%, 1180px, calc((100vh - 5.5rem) * 1.72));
}

.board-side-stack {
  width: 100%;
  display: grid;
  gap: 0.55rem;
}

.events-dock {
  order: 1;
}

.lineup-dock {
  order: 2;
  max-width: none;
}

.table-control-dock {
  order: 0;
}

.board-lineup-grid {
  grid-template-columns: 1fr;
}

.board-event-grid {
  grid-template-columns: repeat(3, minmax(124px, 1fr));
}

/* Final board-prop pass: generated table objects replace tray chrome. */
.location-piece,
.board-promotions-piece {
  background: transparent;
  backdrop-filter: none;
}

.location-piece {
  width: min(20%, 178px);
  min-height: 4.4rem;
  --prop-width: 100%;
  --prop-aspect: 700 / 430;
  --prop-opacity: 0.9;
  --prop-x: 0%;
  --prop-y: 0%;
  --prop-rotation: 0deg;
}

.location-piece::before {
  left: 50%;
  top: 50%;
  width: var(--prop-width);
  height: auto;
  aspect-ratio: var(--prop-aspect);
  opacity: var(--prop-opacity);
  mix-blend-mode: normal;
  transform: translate(calc(-50% + var(--prop-x)), calc(-50% + var(--prop-y))) rotate(var(--prop-rotation));
  filter: saturate(0.86) contrast(0.94) brightness(0.82)
    drop-shadow(0 8px 9px rgba(0, 0, 0, 0.3));
}

.location-piece::after {
  inset: 21% 16%;
  border-color: rgba(255, 248, 232, 0.13);
  background: rgba(6, 12, 10, 0.07);
}

.location-prop-map {
  --prop-width: 160%;
  --prop-y: 0%;
  --prop-rotation: -30deg;
}

.location-prop-ledger {
  --prop-width: 150%;
  --prop-y: 0%;
}

.location-prop-coaster {
  --prop-width: 142%;
  --prop-y: 2%;
}

.location-prop-poster {
  --prop-width: 108%;
  --prop-aspect: 760 / 713;
  --prop-y: -3%;
}

.board-promotions-piece {
  width: min(24%, 230px);
  background:
    linear-gradient(135deg, rgba(247, 241, 220, 0.2), rgba(15, 23, 19, 0.54)),
    rgba(18, 28, 23, 0.78);
}

.board-event-grid .event-slot {
  min-width: 128px;
}

.board-event-grid .mini-title {
  font-size: 0.72rem;
}

.hand-tray.collapsed .hand-peek {
  grid-template-columns: auto;
  min-height: 26px;
}

.hand-tray.collapsed .hand-peek-label {
  display: none;
}

@media (max-width: 1150px) {
  .board-table-layout {
    width: min(100%, 940px);
    grid-template-columns: 1fr;
  }

  .board-stage {
    width: min(100%, 940px);
  }
}

.action-tray {
  bottom: calc(var(--preview-bottom-gap) + 11rem);
  width: min(92vw, 720px);
  max-height: min(42vh, 310px);
}

.action-tray:has(.hustle-action-panel) {
  top: clamp(3.9rem, 7vh, 5rem);
  bottom: auto;
  width: min(90vw, 560px);
  max-height: calc(100vh - clamp(4.7rem, 9vh, 6rem));
  overflow: auto;
}

.hustle-action-panel {
  min-height: auto;
}

.followup-mark-context {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin: -0.16rem 0 0;
  color: rgba(255, 248, 232, 0.72);
  font-size: 0.78rem;
}

.followup-demand-grid,
.followup-card-grid {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.28rem;
}

.followup-demand-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.followup-demand-choice {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
  width: 100%;
  min-width: 0;
  padding: 0.42rem 0.48rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  background:
    linear-gradient(180deg, rgba(28, 48, 41, 0.86), rgba(9, 15, 13, 0.84));
  color: #fff8e8;
  text-align: left;
}

.followup-demand-choice:hover,
.followup-demand-choice:focus-visible,
.followup-card-choice:hover,
.followup-card-choice:focus-visible {
  border-color: rgba(224, 176, 63, 0.68);
  background:
    linear-gradient(180deg, rgba(48, 69, 54, 0.92), rgba(17, 27, 22, 0.88));
}

.followup-demand-title,
.followup-card-choice > span:first-of-type {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 800;
  line-height: 1;
}

.followup-demand-choice .match-slots {
  justify-content: start;
  gap: 0.18rem;
}

.followup-demand-choice .match-space {
  width: 1.32rem;
  height: 1.32rem;
}

.followup-demand-info,
.followup-demand-note {
  color: rgba(255, 248, 232, 0.62);
  font-size: 0.64rem;
  line-height: 1.05;
}

.followup-demand-note {
  color: rgba(224, 176, 63, 0.76);
}

.followup-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
}

.followup-card-choice {
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: start;
  gap: 0.18rem;
  min-width: 0;
  min-height: 8.3rem;
  padding: 0.38rem 0.32rem 0.34rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  background:
    linear-gradient(180deg, rgba(24, 40, 34, 0.84), rgba(8, 15, 13, 0.86));
  color: #fff8e8;
  text-align: center;
}

.followup-card-choice img {
  width: min(100%, 58px);
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255, 248, 232, 0.32);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.34);
}

.followup-event-choice img {
  width: min(100%, 64px);
  object-fit: contain;
  background: rgba(245, 239, 223, 0.88);
}

.followup-event-choice {
  min-height: 8.9rem;
}

.followup-card-choice .marks {
  justify-content: center;
  gap: 0.12rem;
}

.followup-card-choice .mark {
  width: 0.88rem;
  height: 0.88rem;
  font-size: 0;
}

.followup-card-choice .small {
  font-size: 0.62rem;
  line-height: 1.05;
}

.app:has(.hand-tray.collapsed) .action-tray {
  bottom: calc(var(--preview-bottom-gap) + 3rem);
}

.hand-tray {
  position: static;
  left: auto;
  bottom: auto !important;
  z-index: 1;
  width: min(100% - 1rem, 980px);
  margin: 0.5rem auto 0.75rem;
  transform: none;
}

.hand-tray.collapsed {
  bottom: auto !important;
  margin-bottom: 0.65rem;
}

.app:has(.hand-tray) .table-shell {
  padding-bottom: 0.75rem;
}

@media (max-width: 760px) {
  .app {
    padding-bottom: calc(var(--preview-bottom-gap) + 1rem);
  }

  .topbar {
    position: sticky;
    grid-template-columns: 1fr auto;
  }

  .brand {
    min-width: 0;
  }

  .brand h1 {
    font-size: 1.35rem;
  }

  .brand span {
    display: none;
  }

  .action-tray {
    width: min(96vw, 680px);
    bottom: calc(var(--preview-bottom-gap) + 9rem);
  }

  .hand-tray {
    bottom: auto;
    width: min(100% - 1rem, 980px);
  }

  .hand-tray.collapsed {
    bottom: auto;
  }

  .board-event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .board-event-grid .event-slot {
    min-width: 0;
  }

  .online-panel {
    grid-template-columns: 1fr;
  }

  .online-actions {
    justify-content: flex-start;
  }
}

/* Promotions tile final placement: keep label, empty state, and rules reminder readable. */
.board-promotions-piece .piece-title {
  position: absolute;
  top: 34%;
  left: 50%;
  width: max-content;
  max-width: 78%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.board-promotions-piece .marks {
  position: absolute;
  top: 52%;
  left: 50%;
  width: max-content;
  max-width: 76%;
  margin-top: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.board-promotions-piece .promo-reminder {
  position: absolute;
  top: 82%;
  left: 82%;
  width: clamp(2.35rem, 3vw, 3.1rem);
  transform: translate(-50%, -50%) rotate(-45deg);
}
