/*
  Purpose: shared visual system for Broken Domains public pages, lobbies, and the live board table.
  Depends: local assets under public/assets for backgrounds, board cards, miniatures, tokens, UI button slices, and sounds referenced by PHP.
*/

:root {
  color-scheme: dark;
  --bg: #0d0f0d;
  --panel: #171a16;
  --panel-2: #20251e;
  --text: #f4ecd8;
  --muted: #b8ac93;
  --line: rgba(244, 236, 216, 0.18);
  --gold: #d9ad45;
  --green: #7aa36f;
  --red: #b95c4f;
  --blue: #6d9fcf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

body::before {
  background:
    radial-gradient(circle at 18% 8%, rgba(217, 173, 69, 0.11), transparent 24%),
    radial-gradient(circle at 78% 20%, rgba(109, 159, 207, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(8, 9, 8, 0.52), rgba(8, 9, 8, 0.92)),
    url("web/ambient-board-center.jpg");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  content: "";
  inset: 0;
  opacity: 0.24;
  pointer-events: none;
  position: fixed;
  z-index: -2;
}

body::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.46), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.46)),
    repeating-linear-gradient(0deg, rgba(255, 248, 220, 0.025), rgba(255, 248, 220, 0.025) 1px, transparent 1px, transparent 5px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

body:not(.game-screen).realm-page::before,
body.landing::before {
  background:
    radial-gradient(circle at 16% 12%, rgba(217, 173, 69, 0.14), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(109, 159, 207, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(7, 8, 7, 0.5), rgba(7, 8, 7, 0.92)),
    url("web/web-bg-realm.png");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  opacity: 0.34;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(11, 12, 10, 0.98), rgba(31, 26, 17, 0.94), rgba(11, 12, 10, 0.98)),
    url("web/topbar-citadel.jpg");
  background-position: center 42%;
  background-size: cover;
  border-bottom: 1px solid rgba(217, 173, 69, 0.38);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: space-between;
  left: 0;
  min-height: 64px;
  padding: 9px 28px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

body:not(.game-screen).realm-page .topbar,
body.landing .topbar {
  background:
    linear-gradient(90deg, rgba(10, 11, 9, 0.98), rgba(26, 23, 17, 0.9), rgba(10, 11, 9, 0.98)),
    url("web/web-banner-realm.png");
  background-position: center 46%;
  background-size: cover;
}

.brand {
  align-items: center;
  color: var(--gold);
  display: inline-flex;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.brand img {
  display: block;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.62));
  height: 42px;
  object-fit: cover;
  object-position: center;
  width: 118px;
}

.brand span {
  display: inline;
}

.nav {
  align-items: center;
  display: flex;
  gap: 16px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.topbar-center {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.focused-tab-actions {
  margin-left: auto;
}

.nav a {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  padding: 7px 9px;
  text-decoration: none;
}

.nav a:hover {
  background: rgba(255, 248, 220, 0.08);
  border-color: rgba(217, 173, 69, 0.28);
}

.nav span {
  color: var(--muted);
  font-size: 14px;
}

.hero {
  background-image:
    linear-gradient(90deg, rgba(5, 6, 5, 0.9), rgba(5, 6, 5, 0.48), rgba(5, 6, 5, 0.05)),
    url("web/homepage-hero-background.png");
  background-position: center;
  background-size: cover;
  display: grid;
  min-height: calc(100vh - 170px);
  padding: 62px 28px 42px;
}

.hero-content {
  align-self: center;
  justify-self: start;
  max-width: 680px;
  text-align: left;
}

.eyebrow {
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(46px, 8vw, 96px);
  line-height: 0.95;
  margin: 14px 0 18px;
}

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

h2 {
  font-size: 34px;
  margin: 0 0 18px;
}

h3 {
  font-size: 22px;
  margin: 0 0 10px;
}

p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero p {
  color: #efe3c6;
  font-size: 21px;
  max-width: 680px;
}

.hero-logo {
  display: block;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.74));
  height: auto;
  margin: 0 0 18px;
  max-width: min(560px, 90vw);
  width: 56vw;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.actions form {
  display: inline-flex;
  margin: 0;
}

.text-link {
  color: var(--gold);
  display: inline-flex;
  font-weight: 700;
  margin-top: 24px;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.text-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-link-gold {
  color: var(--gold);
}

.tight-actions {
  gap: 8px;
  margin-top: 0;
}

.button,
button {
  background-color: transparent;
  background-image: url("ui/button-normal.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border: 0;
  border-radius: 0;
  color: #fff8dc;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 136px;
  padding: 12px 24px;
  text-decoration: none;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.46));
  text-shadow: 0 1px 2px #120804, 0 0 5px rgba(0, 0, 0, 0.9);
}

.button:hover,
button:not(:disabled):hover {
  background-image: url("ui/button-hover.png");
}

.button:active,
button:not(:disabled):active {
  background-image: url("ui/button-pressed.png");
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-secondary {
  background-color: transparent;
  border: 0;
  color: var(--text);
}

.button-small {
  font-size: 14px;
  min-height: 34px;
  min-width: auto;
  padding: 8px 12px;
}

.nav a.button.button-small {
  min-width: 138px;
  padding-left: 20px;
  padding-right: 20px;
}

.hero .actions .button {
  min-width: 172px;
  padding-left: 30px;
  padding-right: 30px;
}

.account-cta {
  white-space: nowrap;
}

.hero .actions .account-cta-hero {
  min-width: 218px;
  padding-left: 42px;
  padding-right: 42px;
}

.nav a.button.account-cta-nav {
  min-width: 176px;
  padding-left: 30px;
  padding-right: 30px;
}

.button-large {
  font-size: 24px;
  min-height: 62px;
  min-width: 190px;
  padding: 16px 32px 18px;
}

.site-footer {
  align-items: center;
  background: rgba(8, 9, 8, 0.84);
  border-top: 1px solid rgba(217, 173, 69, 0.2);
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 18px 28px 24px;
}

.focused-tab-footer {
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold);
}

.content {
  margin: 0 auto;
  max-width: 1120px;
  padding: 42px 28px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.ornate-panel,
.panel {
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.055), rgba(255, 248, 220, 0.018)),
    rgba(16, 18, 15, 0.9);
  border-color: rgba(217, 173, 69, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.08),
    0 18px 48px rgba(0, 0, 0, 0.28);
}

.realm-hero-panel {
  background:
    linear-gradient(90deg, rgba(15, 17, 14, 0.95), rgba(15, 17, 14, 0.72)),
    url("web/web-banner-realm.png");
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid rgba(217, 173, 69, 0.26);
  max-width: none;
  padding-left: max(28px, calc((100vw - 1120px) / 2));
  padding-right: max(28px, calc((100vw - 1120px) / 2));
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.form {
  display: grid;
  gap: 16px;
  max-width: 520px;
}

.setup-form {
  display: grid;
  gap: 18px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 7px;
  font-size: 15px;
}

input,
select,
textarea {
  background: #0f120f;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr 44px;
  position: relative;
}

.password-field input {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  min-width: 0;
}

.password-toggle {
  align-items: center;
  background: #151914;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  filter: none;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  width: 44px;
}

.password-toggle:hover,
.password-toggle:active {
  background: rgba(217, 173, 69, 0.14);
  background-image: none;
  filter: none;
  transform: none;
}

.password-eye {
  border: 2px solid #f4ecd8;
  border-radius: 70% 12%;
  display: block;
  height: 16px;
  position: relative;
  transform: rotate(45deg);
  width: 16px;
}

.password-eye::after {
  background: #d9ad45;
  border-radius: 50%;
  content: "";
  height: 6px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

input[type="checkbox"] {
  min-height: auto;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
}

legend {
  color: var(--gold);
  font-weight: 700;
  padding: 0 6px;
}

.flash {
  border-radius: 6px;
  margin: 18px auto 0;
  max-width: 1120px;
  padding: 12px 16px;
}

.flash-success {
  background: rgba(122, 163, 111, 0.16);
  border: 1px solid rgba(122, 163, 111, 0.45);
}

.flash-error,
.flash-warning {
  background: rgba(185, 92, 79, 0.16);
  border: 1px solid rgba(185, 92, 79, 0.45);
}

.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stat strong {
  color: var(--gold);
  display: block;
  font-size: 28px;
}

.home-showcase {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
}

.showcase-copy p {
  margin-bottom: 0;
}

.realm-carousel {
  display: grid;
  gap: 14px;
  grid-auto-columns: minmax(210px, 28%);
  grid-auto-flow: column;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
}

.carousel-card {
  background:
    linear-gradient(180deg, rgba(13, 15, 13, 0.08), rgba(13, 15, 13, 0.88)),
    rgba(12, 13, 11, 0.92);
  border: 1px solid rgba(217, 173, 69, 0.26);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  display: grid;
  min-height: 330px;
  overflow: hidden;
  scroll-snap-align: start;
}

.carousel-card img {
  aspect-ratio: 1;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.carousel-card div {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.carousel-card strong {
  color: #fff8dc;
  font-size: 18px;
}

.carousel-card p {
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.realm-stats .stat {
  min-height: 124px;
}

.home-rules-preview {
  padding-top: 0;
}

.home-rules-preview .ornate-panel {
  background:
    linear-gradient(90deg, rgba(12, 14, 11, 0.92), rgba(12, 14, 11, 0.76)),
    url("web/web-banner-war.png");
  background-position: center 50%;
  background-size: cover;
}

.home-pathways {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0;
}

.pathway-link {
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.07), rgba(255, 248, 220, 0.02)),
    rgba(16, 18, 15, 0.9);
  border: 1px solid rgba(217, 173, 69, 0.22);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  display: grid;
  gap: 7px;
  min-height: 106px;
  padding: 18px;
  text-decoration: none;
}

.pathway-link:nth-child(1) {
  background:
    linear-gradient(180deg, rgba(10, 11, 9, 0.54), rgba(10, 11, 9, 0.9)),
    url("web/web-banner-war.png");
  background-position: center;
  background-size: cover;
}

.pathway-link:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(10, 11, 9, 0.54), rgba(10, 11, 9, 0.9)),
    url("web/web-banner-magic.png");
  background-position: center;
  background-size: cover;
}

.pathway-link:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(10, 11, 9, 0.54), rgba(10, 11, 9, 0.9)),
    url("web/web-banner-realm.png");
  background-position: center;
  background-size: cover;
}

.pathway-link span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.pathway-link strong {
  color: #fff8dc;
  font-size: 20px;
  line-height: 1.2;
}

.pathway-link:hover {
  border-color: rgba(217, 173, 69, 0.55);
  transform: translateY(-1px);
}

.rules-preview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.rules-preview-grid article {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 248, 220, 0.1);
  border-radius: 8px;
  padding: 14px;
}

.rules-preview-grid strong {
  color: #fff8dc;
}

.rules-preview-grid p {
  font-size: 14px;
  margin: 8px 0 0;
}

.table {
  border-collapse: collapse;
  width: 100%;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

.table th {
  color: var(--gold);
}

.active-games-table td:last-child {
  text-align: right;
}

.active-games-table .button {
  min-width: 96px;
}

.code {
  background: #0f120f;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold);
  display: inline-block;
  font-family: "Courier New", monospace;
  font-size: 34px;
  letter-spacing: 0.08em;
  padding: 12px 18px;
}

.muted {
  color: var(--muted);
}

.split {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
}

.auth-page .split > div:first-child {
  background:
    linear-gradient(180deg, rgba(8, 9, 8, 0.14), rgba(8, 9, 8, 0.82)),
    url("web/web-vertical-magic.png");
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(217, 173, 69, 0.24);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.08),
    0 18px 48px rgba(0, 0, 0, 0.28);
  display: grid;
  min-height: 460px;
  padding: 28px;
}

.auth-page .split > div:first-child h2,
.auth-page .split > div:first-child p {
  align-self: end;
  margin: 0;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.88);
}

.auth-page .split > div:first-child h2 {
  color: #fff8dc;
  margin-top: auto;
}

.auth-page .form {
  align-self: stretch;
  justify-content: center;
}

.messages-page .messages-layout > .panel:first-child,
.report-page .report-layout > .panel:first-child {
  background:
    linear-gradient(180deg, rgba(12, 14, 11, 0.82), rgba(12, 14, 11, 0.94)),
    url("web/web-banner-magic.png");
  background-position: center;
  background-size: cover;
}

.lobby-hero {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.lobby-hero > div:first-child {
  max-width: 660px;
}

.lobby-hero-card {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 248, 220, 0.08), rgba(255, 248, 220, 0.02)),
    rgba(9, 10, 8, 0.34);
  border: 1px solid rgba(217, 173, 69, 0.22);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.26);
  display: grid;
  gap: 18px;
  grid-template-columns: 132px minmax(180px, auto);
  padding: 14px 18px 14px 14px;
}

.lobby-crest-art {
  border: 1px solid rgba(217, 173, 69, 0.3);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  height: 132px;
  object-fit: cover;
  width: 132px;
}

.lobby-hero-actions {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  margin-top: 0;
  min-width: 210px;
}

.lobby-hero-actions .button {
  min-width: 100%;
}

.lobby-grid {
  align-items: start;
  padding-top: 28px;
}

.panel-heading {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-heading p {
  font-size: 15px;
  margin: 0;
}

.segmented {
  background: #0f120f;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  overflow: hidden;
}

.segmented a {
  color: var(--muted);
  font-size: 14px;
  padding: 9px 12px;
  text-decoration: none;
}

.segmented a.active {
  background: var(--gold);
  color: #171107;
  font-weight: 700;
}

.group-title {
  color: var(--gold);
  font-size: 15px;
  margin: 18px 0 8px;
  text-transform: uppercase;
}

.player-list,
.friend-stack {
  display: grid;
  gap: 8px;
}

.player-row,
.friend-row,
.request-row,
.check-row {
  align-items: center;
  background: rgba(244, 236, 216, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 44px;
  padding: 9px 11px;
  text-decoration: none;
}

.friend-row.selected {
  border-color: rgba(217, 173, 69, 0.62);
}

.request-row {
  flex-wrap: wrap;
}

.compact-actions {
  display: flex;
  gap: 8px;
}

.check-row {
  justify-content: flex-start;
}

.check-row input {
  width: auto;
}

.pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-height: 26px;
  padding: 5px 8px;
  text-align: center;
}

.status-available {
  background: rgba(122, 163, 111, 0.18);
  color: #cbe8c2;
}

.status-starting {
  background: rgba(217, 173, 69, 0.16);
  color: #f1cf7b;
}

.status-ingame {
  background: rgba(109, 159, 207, 0.16);
  color: #b8d7f5;
}

.status-offline {
  background: rgba(244, 236, 216, 0.08);
  color: var(--muted);
}

.inline-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
}

.host-race-picker {
  border: 1px solid rgba(217, 173, 69, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
}

.host-race-picker legend {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0 6px;
  text-transform: uppercase;
}

.host-race-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.host-race-card {
  align-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(217, 173, 69, 0.15), transparent 48%),
    rgba(244, 236, 216, 0.04);
  border: 1px solid rgba(217, 173, 69, 0.2);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 10px 8px;
  text-align: center;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.host-race-choice {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 5px;
  justify-items: center;
  width: 100%;
}

.host-race-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.host-race-choice img {
  aspect-ratio: 1;
  height: 58px;
  object-fit: contain;
  width: 58px;
}

.host-race-card span {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.host-race-card:has(input:checked) {
  border-color: rgba(217, 173, 69, 0.72);
  box-shadow:
    inset 0 0 18px rgba(217, 173, 69, 0.12),
    0 0 18px rgba(217, 173, 69, 0.16);
  transform: translateY(-1px);
}

.cosmetic-chooser {
  background: rgba(8, 9, 8, 0.42);
  border: 1px solid rgba(217, 173, 69, 0.16);
  border-radius: 6px;
  display: grid;
  gap: 7px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.host-cosmetic-panel {
  display: none;
}

.host-cosmetic-strip {
  margin-top: 4px;
  overflow: hidden;
}

.host-cosmetic-set {
  display: none;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.host-cosmetic-set.active {
  display: grid;
}

.host-board-skin-picker {
  align-items: center;
  background: rgba(8, 9, 8, 0.42);
  border: 1px solid rgba(217, 173, 69, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 92px;
  padding: 10px;
}

.host-board-skin-preview {
  aspect-ratio: 1;
  border: 1px solid rgba(217, 173, 69, 0.32);
  border-radius: 7px;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.42);
  height: 82px;
  justify-self: end;
  object-fit: cover;
  width: 82px;
}

.cosmetic-chooser label {
  color: var(--gold);
  display: grid;
  font-size: 10px;
  font-weight: 900;
  gap: 4px;
  letter-spacing: 0.03em;
  min-width: 0;
  text-transform: uppercase;
}

.cosmetic-chooser select {
  color: var(--text);
  font-size: 11px;
  max-width: 100%;
  min-height: 30px;
  min-width: 0;
  padding: 5px 7px;
  text-transform: none;
  width: 100%;
}

.setup-form > button[type="submit"] {
  justify-self: center;
  min-width: min(100%, 360px);
}

.miniature-skin-preview {
  align-self: center;
  filter:
    drop-shadow(0 0 10px rgba(217, 173, 69, 0.28))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.58));
  height: 118px;
  justify-self: center;
  object-fit: contain;
  pointer-events: none;
  width: min(100%, 118px);
}

.host-cosmetic-panel .miniature-skin-preview {
  height: 132px;
  margin-top: -2px;
  width: min(100%, 132px);
}

.lobby-cosmetic-menu summary {
  color: var(--gold);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style-position: inside;
  text-align: center;
}

.miniature-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.miniature-slot {
  background:
    radial-gradient(circle at 50% 24%, rgba(217, 173, 69, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(244, 236, 216, 0.08), rgba(244, 236, 216, 0.03)),
    #10130f;
  border: 1px solid rgba(217, 173, 69, 0.22);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 248, 220, 0.06);
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 156px;
  padding: 14px;
  text-align: center;
}

.display-slot {
  min-height: 148px;
}

.miniature-token {
  aspect-ratio: 1;
  display: block;
  filter:
    drop-shadow(0 0 8px rgba(217, 173, 69, 0.22))
    drop-shadow(0 10px 24px rgba(0, 0, 0, 0.42));
  height: 76px;
  object-fit: contain;
  width: 76px;
}

.miniature-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.miniature-ai-style {
  align-items: center;
  display: none;
  gap: 5px;
  width: 100%;
}

.miniature-slot.is-ai .miniature-ai-style {
  display: grid;
}

.miniature-ai-style span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slot-owner {
  color: var(--muted);
  font-size: 14px;
  min-height: 18px;
  overflow-wrap: anywhere;
}

.miniature-slot-action,
.miniature-slot-controls {
  display: grid;
  gap: 6px;
  width: 100%;
}

.miniature-slot-controls select {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 8px;
}

.miniature-slot-controls .button-small,
.miniature-slot-action .button-small {
  justify-self: center;
  min-width: 82px;
}

.setup-shell {
  align-items: start;
}

.setup-left-column {
  align-content: start;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.setup-intro {
  display: grid;
  gap: 14px;
}

.setup-intro.ornate-panel {
  padding: 18px;
}

.setup-visual-row {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 150px;
}

.setup-intro > img,
.setup-hero-art {
  aspect-ratio: 1;
  border: 1px solid rgba(217, 173, 69, 0.24);
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
  object-fit: cover;
  width: 100%;
}

.join-page .setup-intro > img,
.join-page .setup-hero-art {
  aspect-ratio: 3 / 4;
  max-height: 480px;
  object-position: center;
}

.host-selected-preview {
  align-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(217, 173, 69, 0.13), transparent 58%),
    rgba(7, 8, 7, 0.48);
  border: 1px solid rgba(217, 173, 69, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
  padding: 10px;
  text-align: center;
}

.host-selected-preview h3 {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.05em;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.host-preview-token {
  aspect-ratio: 1;
  filter: drop-shadow(0 0 9px rgba(217, 173, 69, 0.32));
  height: 58px;
  object-fit: contain;
  width: 58px;
}

.host-preview-miniature {
  filter:
    drop-shadow(0 0 12px rgba(217, 173, 69, 0.28))
    drop-shadow(0 14px 22px rgba(0, 0, 0, 0.62));
  height: 178px;
  max-width: 100%;
  object-fit: contain;
}

.host-selected-preview strong {
  color: #fff8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1;
}

.host-selected-preview span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
}

.setup-intro h2 {
  margin-bottom: 0;
}

.setup-intro p {
  margin: 0;
}

.host-comms-setup.ornate-panel {
  align-content: start;
  background:
    radial-gradient(circle at 18% 18%, rgba(88, 119, 179, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(22, 24, 22, 0.96), rgba(10, 12, 11, 0.96));
  gap: 12px;
  padding: 18px;
}

.host-comms-setup legend {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.host-discord-settings {
  display: grid;
  gap: 7px;
}

.host-discord-settings[hidden] {
  display: none;
}

.host-comms-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.instance-lobby-actions {
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.instance-lobby-actions form {
  display: inline-flex;
  margin: 0;
}

.instance-lobby-actions .button,
.instance-lobby-actions button {
  min-width: 160px;
}

.game-started-overlay {
  align-items: center;
  background: rgba(4, 5, 4, 0.44);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 80;
}

.game-started-overlay[hidden] {
  display: none;
}

.game-started-overlay > div {
  background: linear-gradient(90deg, rgba(8, 9, 8, 0.94), rgba(30, 27, 21, 0.96), rgba(8, 9, 8, 0.94));
  border: 1px solid rgba(217, 173, 69, 0.62);
  box-shadow:
    inset 0 0 28px rgba(217, 173, 69, 0.12),
    0 20px 70px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(217, 173, 69, 0.18);
  color: var(--gold);
  display: grid;
  gap: 8px;
  min-width: min(560px, calc(100vw - 48px));
  padding: 28px 34px;
  text-align: center;
}

.game-started-overlay strong {
  color: #ffe39a;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: 0 3px 0 #17110a, 0 0 18px rgba(217, 173, 69, 0.26);
}

.game-started-overlay span {
  color: var(--text);
  font-size: 18px;
}

.game-started-overlay.is-fading {
  opacity: 0;
  transition: opacity 650ms ease;
}

.join-preview {
  margin-top: 14px;
}

.social-dock {
  max-width: none;
  position: relative;
  width: auto;
  z-index: 20;
}

.invite-toast,
.friend-dock {
  background: rgba(23, 26, 22, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  padding: 14px;
}

.friend-dock {
  padding: 0;
}

.friend-dock[open] {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.friend-dock-menu {
  background: rgba(23, 26, 22, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  margin-top: 10px;
  max-height: min(70vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px 12px;
  position: absolute;
  right: 0;
  top: 100%;
  width: 300px;
  z-index: 20;
}

.invite-toast {
  background: rgba(244, 236, 216, 0.045);
  border: 1px solid var(--line);
  box-shadow: none;
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px;
}

.invite-toast span {
  color: var(--muted);
  font-size: 14px;
}

.friend-dock summary {
  align-items: center;
  background: rgba(244, 236, 216, 0.08);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  gap: 8px;
  font-weight: 700;
  list-style: none;
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.friend-dock summary::-webkit-details-marker {
  display: none;
}

.friend-dock summary::before {
  content: "▾";
  transform: rotate(-90deg);
  transition: transform 160ms ease;
}

.friend-dock[open] summary::before {
  transform: rotate(0deg);
}

.friend-dock-menu > .friend-stack {
  margin: 0;
  width: 100%;
}

.friend-dock-menu > .dock-empty {
  margin: 0;
  width: auto;
}

.dock-link {
  color: var(--gold);
  display: inline-block;
  font-size: 14px;
  margin-top: 10px;
}

.dock-empty {
  font-size: 14px;
  margin: 10px 0 0;
}

.messages-layout {
  grid-template-columns: minmax(240px, 0.36fr) minmax(0, 1fr);
}

.contact-hero,
.policy-hero {
  background:
    linear-gradient(90deg, rgba(15, 17, 14, 0.96), rgba(15, 17, 14, 0.68)),
    url("web/web-banner-magic.png");
  background-position: center 38%;
  background-size: cover;
}

.policy-hero {
  background:
    linear-gradient(90deg, rgba(15, 17, 14, 0.96), rgba(15, 17, 14, 0.68)),
    url("web/web-banner-realm.png");
  background-position: center 42%;
  background-size: cover;
}

.contact-shell {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.contact-form {
  max-width: none;
}

.form-note {
  font-size: 14px;
  margin: -4px 0 0;
}

.report-layout {
  align-items: start;
}

.report-target-card {
  background:
    linear-gradient(180deg, rgba(217, 173, 69, 0.14), rgba(217, 173, 69, 0.05)),
    rgba(6, 7, 6, 0.54);
  border: 1px solid rgba(217, 173, 69, 0.28);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  margin-top: 22px;
  padding: 16px;
}

.report-target-card span,
.report-target-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.report-target-card strong {
  color: #fff8dc;
  font-size: 21px;
}

.contact-guidance {
  display: grid;
  gap: 12px;
}

.contact-guidance img {
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(217, 173, 69, 0.26);
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.contact-guidance p {
  font-size: 15px;
  margin: 0;
}

.policy-shell {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 240px minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px 28px 56px;
}

.policy-index {
  top: 82px;
}

.store-hero {
  background:
    linear-gradient(90deg, rgba(9, 10, 8, 0.82), rgba(9, 10, 8, 0.48), rgba(9, 10, 8, 0.12)),
    url("web/web-bg-war.png");
  background-position: center;
  background-size: cover;
  display: grid;
  min-height: calc(100vh - 230px);
  padding: 68px 28px 54px;
}

.store-hero-copy {
  align-self: center;
  max-width: 760px;
}

.store-hero p {
  color: #efe3c6;
  font-size: 21px;
  max-width: 680px;
}

.purchase-coming-hero {
  background:
    linear-gradient(90deg, rgba(5, 6, 5, 0.9), rgba(5, 6, 5, 0.48), rgba(5, 6, 5, 0.12)),
    url("web/web-bg-realm.png");
  background-position: center;
  background-size: cover;
  display: grid;
  min-height: calc(100vh - 168px);
  padding: 74px max(28px, calc((100vw - 1180px) / 2)) 68px;
}

.purchase-coming-card {
  align-self: center;
  max-width: 590px;
  padding: 34px 36px 36px;
}

.purchase-coming-card h1 {
  font-size: clamp(44px, 4.8vw, 72px);
  line-height: 1;
  margin: 14px 0 20px;
}

.purchase-coming-card p:not(.eyebrow) {
  font-size: 18px;
  max-width: 520px;
}

.store-feature-grid {
  align-items: start;
  display: grid;
  gap: 20px;
  max-width: 1320px;
}

.store-catalog-shell {
  display: grid;
  gap: 24px;
  max-width: 1320px;
  padding-top: 0;
}

.store-section {
  --store-art-height: 270px;
  overflow: visible;
}

.store-section[data-store-section="tokens"] {
  --store-art-height: 230px;
}

.store-section[data-store-section="packages"] {
  --store-art-height: 250px;
}

.store-section-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.store-section-heading h2,
.store-section-heading p {
  margin-bottom: 0;
}

.store-race-filter {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.store-race-filter button {
  background: rgba(255, 248, 220, 0.06);
  border: 1px solid rgba(217, 173, 69, 0.28);
  border-radius: 999px;
  color: #efe3c6;
  font-size: 13px;
  min-height: 34px;
  min-width: 0;
  padding: 7px 12px;
}

.store-race-filter button.active,
.store-race-filter button:hover {
  background: rgba(217, 173, 69, 0.88);
  color: #15100b;
}

.subscription-card {
  background:
    linear-gradient(90deg, rgba(7, 8, 7, 0.9), rgba(7, 8, 7, 0.62)),
    url("web/web-banner-realm.png");
  background-position: center;
  background-size: cover;
  min-height: 260px;
}

.store-price {
  color: #fff8dc;
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  margin: 8px 0 14px;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.72);
}

.store-price span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
}

.store-grid {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.store-card {
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.07), rgba(255, 248, 220, 0.02)),
    rgba(13, 15, 13, 0.92);
  border: 1px solid rgba(217, 173, 69, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  display: grid;
  gap: 14px;
  grid-template-rows: var(--store-art-height) minmax(0, 1fr);
  overflow: visible;
  position: relative;
}

.store-card:hover {
  z-index: 12;
}

.store-card-christmas-board {
  --store-art-height: clamp(104px, 20vw, 270px);
  background:
    linear-gradient(180deg, rgba(8, 11, 10, 0.7), rgba(7, 9, 8, 0.91)),
    linear-gradient(90deg, rgba(10, 36, 29, 0.34), rgba(83, 14, 18, 0.25)),
    url("spaces/ws-board/christmas-great-tree-tile.png");
  background-position: center 42%;
  background-size: cover;
}

.store-card[hidden],
.store-card.store-item-hidden {
  display: none !important;
}

.store-unlock-form {
  margin: 0;
}

.store-card .button,
.store-unlock-form button {
  min-width: 170px;
}

.account-shell {
  align-items: start;
}

.account-card {
  align-content: start;
}

.account-unlock-grid {
  grid-template-columns: 1fr;
}

.account-unlock-card {
  grid-template-columns: 120px minmax(0, 1fr);
}

.store-card-art {
  align-items: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(217, 173, 69, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.64));
  display: flex;
  height: var(--store-art-height);
  justify-content: center;
  overflow: visible;
  position: relative;
}

.store-card-art img {
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.62));
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: cover;
  position: relative;
  transition: transform 180ms ease, filter 180ms ease;
  width: 100%;
  z-index: 1;
}

.store-card-art:not(.store-board-skin-showcase):hover img,
.store-card:hover .store-card-art:not(.store-board-skin-showcase) img {
  filter:
    drop-shadow(0 24px 24px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 20px rgba(217, 173, 69, 0.26));
  transform: scale(1.22);
  z-index: 20;
}

.store-art-cosmetic {
  background:
    radial-gradient(circle at 50% 42%, rgba(217, 173, 69, 0.3), transparent 42%),
    linear-gradient(180deg, rgba(255, 248, 220, 0.03), rgba(0, 0, 0, 0.64));
}

.store-art-cosmetic img {
  height: calc(var(--store-art-height) - 20px);
  object-fit: contain;
  padding: 10px;
  transform-origin: center bottom;
}

.store-card:hover .store-art-cosmetic:not(.store-board-skin-showcase) img,
.store-art-cosmetic:not(.store-board-skin-showcase):hover img {
  transform: scale(1.38);
}

.store-board-skin-showcase {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(3, 8, 7, 0.2), rgba(3, 5, 4, 0.72)),
    radial-gradient(circle at 50% 38%, rgba(255, 226, 146, 0.2), transparent 44%);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 2fr)) minmax(0, 3fr) repeat(3, minmax(0, 2fr));
  overflow: visible;
  padding: 12px 16px 14px;
  z-index: 2;
}

.store-board-showcase-item {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  margin: 0;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.store-board-showcase-item:focus-visible {
  outline: 2px solid rgba(255, 227, 147, 0.92);
  outline-offset: 3px;
}

.store-art-cosmetic.store-board-skin-showcase .store-board-showcase-thumb {
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(255, 239, 190, 0.28);
  border-radius: 4px;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.58),
    0 0 12px rgba(255, 219, 118, 0.1);
  filter: none;
  height: auto;
  image-rendering: auto;
  max-height: 100%;
  min-width: 0;
  object-fit: contain;
  padding: 0;
  transform: none;
  width: 100%;
}

.store-art-cosmetic.store-board-skin-showcase .store-board-showcase-start .store-board-showcase-thumb {
  aspect-ratio: 1;
  border-color: rgba(255, 227, 147, 0.52);
}

.store-art-cosmetic.store-board-skin-showcase .store-board-showcase-preview {
  aspect-ratio: 2 / 3;
  background: #090b09;
  border: 2px solid rgba(255, 227, 147, 0.82);
  border-radius: 7px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.88),
    0 0 28px rgba(217, 173, 69, 0.34);
  display: none;
  filter: none;
  height: auto;
  image-rendering: auto;
  left: 50%;
  max-height: min(600px, 80vh);
  max-width: none;
  object-fit: contain;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: none;
  transition: opacity 140ms ease;
  translate: -50% -50%;
  visibility: hidden;
  width: min(400px, 82vw);
  z-index: 100;
}

.store-art-cosmetic.store-board-skin-showcase .store-board-showcase-start .store-board-showcase-preview {
  aspect-ratio: 1;
  max-height: min(460px, 80vh);
  width: min(460px, 86vw);
}

.store-art-cosmetic.store-board-skin-showcase .store-board-showcase-left .store-board-showcase-preview {
  left: 0;
  translate: 0 -50%;
}

.store-art-cosmetic.store-board-skin-showcase .store-board-showcase-right .store-board-showcase-preview {
  left: auto;
  right: 0;
  translate: 0 -50%;
}

.store-board-showcase-item:is(:hover, :focus-visible) {
  z-index: 100;
}

.store-art-cosmetic.store-board-skin-showcase .store-board-showcase-item:is(:hover, :focus-visible) .store-board-showcase-preview {
  display: block;
  opacity: 1;
  visibility: visible;
}

.store-card > div:last-child {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.store-board-product-info {
  min-height: 84px;
  position: relative;
}

.store-board-product-details > .button {
  justify-self: center;
  width: min(100%, 480px);
}

.store-board-price-badge {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 241, 183, 0.16), transparent 42%),
    linear-gradient(145deg, #183126 0%, #35161a 62%, #0b0d0b 100%);
  border: 1px solid rgba(255, 224, 126, 0.92);
  border-radius: 11px;
  box-shadow:
    inset 0 0 24px rgba(217, 173, 69, 0.16),
    0 0 0 2px rgba(0, 0, 0, 0.62),
    0 9px 22px rgba(0, 0, 0, 0.58);
  color: #fff3c4;
  display: grid;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 57px;
  font-weight: 900;
  left: 0;
  letter-spacing: -0.08em;
  line-height: 1;
  overflow: hidden;
  padding: 0 4px 5px 0;
  place-items: center;
  position: absolute;
  text-shadow: 0 2px 2px #000, 0 4px 12px rgba(0, 0, 0, 0.9);
  top: 0;
  translate: none;
  width: 84px;
  z-index: 2;
}

.store-board-price-badge::before {
  border: 1px solid rgba(255, 244, 205, 0.2);
  border-radius: 7px;
  content: "";
  inset: 5px;
  pointer-events: none;
  position: absolute;
}

.store-board-title-panel {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 0;
  padding: 0 92px;
}

.store-board-title-panel img {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.72));
  height: auto;
  max-width: 100%;
  width: min(100%, 980px);
}

.store-card .store-board-title-panel p {
  color: #fff;
  font-size: 13px;
  margin: 0;
  text-align: center;
}

@media (max-width: 560px) {
  .store-board-product-info {
    min-height: 57px;
  }

  .store-board-price-badge {
    font-size: 42px;
    width: 57px;
  }

  .store-board-title-panel {
    padding: 0 62px;
  }
}

.store-card-price {
  color: #fff8dc;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.store-card h3 {
  font-size: 25px;
  line-height: 1.08;
  margin-bottom: 0;
  overflow-wrap: normal;
}

.store-card-meta {
  align-items: center;
  color: #fff8dc;
  display: flex;
  flex-wrap: wrap;
  font-size: 26px;
  font-weight: 900;
  gap: 8px;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.store-card-meta span + span {
  border-left: 1px solid rgba(217, 173, 69, 0.34);
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding-left: 8px;
  text-transform: uppercase;
}

.store-empty-board {
  align-items: center;
  background: rgba(8, 9, 8, 0.54);
  border: 1px solid rgba(217, 173, 69, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
}

.store-empty-board img {
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  width: 100%;
}

.store-empty-board div {
  padding: 18px 20px 18px 0;
}

.store-card p,
.store-note p {
  font-size: 15px;
  margin: 0;
}

.store-status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-status-row .muted {
  font-size: 13px;
}

.store-card button,
.subscription-card button {
  justify-self: start;
}

.apply-code-art {
  background:
    linear-gradient(180deg, rgba(8, 9, 8, 0.26), rgba(8, 9, 8, 0.86)),
    url("web/web-vertical-magic.png");
  background-position: center;
  background-size: cover;
  min-height: 420px;
}

.apply-code-art h2,
.apply-code-art p {
  max-width: 520px;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.84);
}

.apply-code-form {
  align-self: center;
}

.admin-shell {
  display: grid;
  gap: 18px;
  max-width: 1380px;
}

.admin-title-panel {
  background:
    linear-gradient(90deg, rgba(10, 11, 9, 0.92), rgba(10, 11, 9, 0.62)),
    url("web/web-banner-war.png");
  background-position: center;
  background-size: cover;
}

.admin-tabs {
  background: rgba(8, 9, 8, 0.74);
  border: 1px solid rgba(217, 173, 69, 0.2);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.admin-tabs a {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  padding: 9px 12px;
  text-decoration: none;
}

.admin-tabs a.active,
.admin-tabs a:hover {
  background: rgba(217, 173, 69, 0.14);
  border-color: rgba(217, 173, 69, 0.42);
  color: #fff8dc;
}

.admin-metric-grid,
.admin-store-grid,
.admin-log-grid,
.contentless-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.admin-report-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-danger-panel {
  border-color: rgba(185, 92, 79, 0.34);
}

.admin-stat-list {
  display: grid;
  gap: 9px;
}

.admin-stat-list div {
  align-items: center;
  background: rgba(244, 236, 216, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.admin-stat-list span {
  color: var(--muted);
  font-size: 13px;
}

.admin-stat-list strong {
  color: var(--gold);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.05;
  text-align: right;
}

.admin-table {
  font-size: 14px;
}

.admin-table td {
  vertical-align: top;
}

.admin-inline-form {
  display: grid;
  gap: 6px;
}

.admin-inline-form select {
  min-height: 34px;
  min-width: 130px;
  padding: 6px 8px;
}

.admin-search {
  align-items: center;
  display: flex;
  gap: 8px;
}

.admin-search input {
  min-height: 38px;
}

.admin-log-line {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  margin: 0;
  padding: 10px 0;
}

.admin-log-line strong {
  color: var(--gold);
}

.admin-code-result,
.admin-code-inline {
  color: var(--gold);
  font-family: "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.admin-code-result {
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(217, 173, 69, 0.42);
  border-radius: 8px;
  font-size: 24px;
  margin: 0;
  padding: 12px;
  text-align: center;
}

.check-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  margin-left: 6px;
}

.rules-shell {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 240px minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px 28px 56px;
}

.rules-index {
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.07), rgba(255, 248, 220, 0.02)),
    rgba(14, 16, 13, 0.92);
  border: 1px solid rgba(217, 173, 69, 0.22);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 8px;
  padding: 14px;
  position: sticky;
  top: 82px;
}

.rules-title-panel {
  background:
    linear-gradient(90deg, rgba(10, 11, 9, 0.92), rgba(10, 11, 9, 0.72)),
    url("web/web-banner-realm.png");
  background-position: center 44%;
  background-size: cover;
}

.rules-index img {
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
  justify-self: center;
  max-width: 174px;
}

.rules-index strong {
  color: #fff8dc;
  font-size: 18px;
}

.rules-index a {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 9px;
  text-decoration: none;
}

.rules-index a:hover {
  background: rgba(255, 248, 220, 0.08);
  border-color: rgba(217, 173, 69, 0.22);
  color: var(--text);
}

.rules-content {
  display: grid;
  gap: 16px;
}

.rules-title-panel h1 {
  font-size: clamp(36px, 5vw, 58px);
  margin-bottom: 12px;
}

.rules-title-panel p {
  margin: 0;
}

.rule-section {
  scroll-margin-top: 90px;
}

.rule-section h2 {
  color: #fff8dc;
}

.rule-section ul {
  color: var(--muted);
  display: grid;
  gap: 10px;
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
  padding-left: 22px;
}

.glossary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.glossary-grid article {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 248, 220, 0.1);
  border-radius: 8px;
  padding: 13px;
}

.glossary-grid strong {
  color: var(--gold);
}

.glossary-grid p {
  font-size: 14px;
  margin: 6px 0 0;
}

.chat-panel {
  display: grid;
  gap: 14px;
}

.chat-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding: 12px;
}

.chat-log.compact {
  max-height: 300px;
}

.chat-message {
  background: rgba(244, 236, 216, 0.05);
  border-radius: 8px;
  justify-self: start;
  max-width: min(680px, 92%);
  padding: 10px 12px;
}

.chat-message.mine {
  background: rgba(217, 173, 69, 0.14);
  justify-self: end;
}

.chat-message.relevant-to-viewer {
  animation: relevantChatGlow 2.8s ease-in-out infinite;
  border: 1px solid rgba(239, 204, 109, 0.5);
  box-shadow:
    0 0 12px rgba(239, 204, 109, 0.18),
    inset 0 0 18px rgba(239, 204, 109, 0.08);
}

.chat-message strong {
  color: var(--gold);
  font-size: 14px;
}

.chat-message p {
  color: var(--text);
  font-size: 16px;
  margin: 5px 0;
}

.chat-message span {
  color: var(--muted);
  font-size: 12px;
}

@keyframes relevantChatGlow {
  0%,
  100% {
    border-color: rgba(239, 204, 109, 0.36);
    box-shadow:
      0 0 10px rgba(239, 204, 109, 0.12),
      inset 0 0 14px rgba(239, 204, 109, 0.06);
  }

  50% {
    border-color: rgba(239, 204, 109, 0.74);
    box-shadow:
      0 0 18px rgba(239, 204, 109, 0.28),
      inset 0 0 22px rgba(239, 204, 109, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-message.relevant-to-viewer {
    animation: none;
  }
}

.chat-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.mini-board {
  aspect-ratio: 1;
  background-image: url("board.jpg");
  background-position: center;
  background-size: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 320px;
}

.game-screen main {
  max-width: none;
}

.game-screen {
  background:
    radial-gradient(circle at 8% 18%, rgba(122, 163, 111, 0.13), transparent 26%),
    radial-gradient(circle at 92% 22%, rgba(217, 173, 69, 0.12), transparent 24%),
    linear-gradient(180deg, #0c0e0c, #080908 60%, #0c0d0b);
}

.game-screen::before {
  background:
    linear-gradient(90deg, rgba(7, 8, 7, 0.78), rgba(7, 8, 7, 0.28), rgba(7, 8, 7, 0.78)),
    url("board.jpg");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  opacity: 0.18;
}

.game-shell {
  display: block;
  padding: 20px;
}

.game-stage {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: 220px minmax(700px, min(calc(100vh - 92px), calc(100vw - 966px))) 650px;
  justify-content: start;
  margin: 0;
  min-width: 0;
  position: relative;
  width: 100%;
}

/* The portrait table is enabled only at mobile/tablet widths. */
.mobile-game-view {
  display: none;
}

.table-comms-dock {
  position: relative;
  z-index: 35;
}

.table-comms-tab {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(32, 38, 39, 0.98), rgba(8, 11, 12, 0.98));
  border: 1px solid rgba(217, 173, 69, 0.58);
  border-radius: 7px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  color: #f6d982;
  display: flex;
  height: 44px;
  justify-content: center;
  max-width: 190px;
  min-height: 44px;
  min-width: 190px;
  padding: 8px 18px;
  width: 190px;
}

.table-comms-tab span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table-comms-tab:not(:disabled):hover {
  background:
    linear-gradient(180deg, rgba(43, 51, 52, 0.99), rgba(12, 16, 17, 0.99));
}

.table-comms-dock.is-open .table-comms-tab {
  border-color: rgba(242, 207, 113, 0.9);
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.62), 0 0 18px rgba(217, 173, 69, 0.2);
}

.table-comms-panel {
  background: rgba(8, 11, 12, 0.985);
  border: 1px solid rgba(217, 173, 69, 0.52);
  border-radius: 8px;
  box-shadow: 18px 24px 70px rgba(0, 0, 0, 0.82);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(620px, calc(100vh - 88px));
  left: 50%;
  overflow: hidden;
  position: absolute;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(410px, calc(100vw - 68px));
}

.table-comms-panel[hidden] {
  display: none;
}

.table-comms-panel > header {
  align-items: center;
  background: linear-gradient(90deg, rgba(60, 48, 21, 0.64), rgba(16, 21, 23, 0.96));
  border-bottom: 1px solid rgba(217, 173, 69, 0.26);
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.table-comms-panel > header div {
  display: grid;
  gap: 2px;
}

.table-comms-panel > header span,
.table-comms-panel > footer span {
  color: var(--muted);
  font-size: 11px;
}

.table-comms-panel > header strong {
  color: #fff5d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.table-comms-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #f7eed7;
  font-family: Arial, sans-serif;
  font-size: 21px;
  height: 32px;
  line-height: 1;
  min-width: 32px;
  padding: 0 0 2px;
  width: 32px;
}

.table-comms-embed {
  background: #11151a;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.table-comms-embed iframe,
.table-comms-embed widgetbot {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.table-comms-placeholder {
  align-content: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
  height: 100%;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.table-comms-placeholder strong {
  color: #fff5d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.table-comms-panel > footer {
  align-items: center;
  background: rgba(8, 10, 10, 0.98);
  border-top: 1px solid rgba(217, 173, 69, 0.2);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 12px;
}

.table-comms-panel > footer a {
  color: #f0cf70;
  font-size: 12px;
  white-space: nowrap;
}

.board-viewport {
  aspect-ratio: 1;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.player-side-panel,
.kept-cards-panel,
.table-alert-box,
.table-management-panel {
  background: rgba(13, 16, 13, 0.82);
  border: 1px solid rgba(244, 236, 216, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  color: var(--text);
  display: grid;
  gap: 8px;
  padding: 10px;
  width: 220px;
  z-index: 12;
}

.player-side-panel h3,
.kept-cards-panel h3,
.table-alert-box h4,
.table-management-panel h3 {
  font-size: 13px;
  margin: 0;
  text-transform: uppercase;
}

.player-side-panel {
  justify-items: center;
  position: absolute;
  text-align: center;
  top: 0;
}

.active-player-panel {
  right: calc(100% + 14px);
}

.left-side-stack {
  display: grid;
  gap: 12px;
  justify-items: center;
  position: static;
  width: 220px;
  z-index: 12;
}

.left-side-stack .player-side-panel {
  position: static;
  width: 100%;
}

.right-side-stack {
  display: grid;
  gap: 12px;
  grid-template-columns: 220px minmax(390px, 1fr);
  justify-items: stretch;
  min-width: 0;
  position: static;
  width: 650px;
  z-index: 12;
}

.right-player-stack,
.right-table-stack {
  display: grid;
  gap: 12px;
  grid-auto-rows: max-content;
  min-width: 0;
}

.right-player-stack {
  grid-column: 1;
}

.right-table-stack {
  grid-column: 2;
}

.right-side-stack .player-side-panel {
  position: static;
  width: 220px;
}

.right-side-stack .current-space-preview,
.right-side-stack .kept-cards-panel {
  width: 220px;
}

.right-side-stack .table-status-panel {
  width: 100%;
}

.right-side-stack .board-chat {
  align-self: start;
  width: 100%;
}

.left-side-stack .table-alert-box {
  width: 100%;
}

.current-space-preview {
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.07), rgba(255, 248, 220, 0.02)),
    rgba(13, 16, 13, 0.86);
  border: 1px solid rgba(244, 236, 216, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  color: var(--text);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 9px;
  width: 100%;
}

.current-space-art {
  aspect-ratio: 2 / 3;
  background: #090b09;
  border: 1px solid rgba(217, 173, 69, 0.26);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.44), 0 12px 24px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  position: relative;
  width: min(100%, 178px);
}

.current-space-preview.preview-corner .current-space-art {
  aspect-ratio: 1;
}

.current-space-art-orientation {
  height: 100%;
  inset: 0;
  overflow: hidden;
  position: absolute;
  transform-origin: center;
  width: 100%;
}

.current-space-art-orientation > img:first-child {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.current-space-preview.preview-art-rotated .current-space-art-orientation {
  height: 100%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--preview-image-rotation, 0deg));
  width: 66.6667%;
}

.current-space-preview.preview-corner.preview-art-rotated .current-space-art-orientation {
  width: 100%;
}

.current-space-banner {
  align-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--preview-color) 92%, #ffffff 8%), var(--preview-color));
  border-bottom: 1px solid rgba(0, 0, 0, 0.48);
  color: #fff8dc;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  left: 0;
  line-height: 1;
  min-height: 24px;
  padding: 4px 7px;
  position: absolute;
  right: 0;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
  top: 0;
  z-index: 2;
}

.current-space-claim {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.84));
  height: 40px;
  left: 50%;
  object-fit: contain;
  position: absolute;
  top: 24px;
  transform: translate(-50%, -50%);
  width: 40px;
  z-index: 4;
}

.current-space-claim.viewer-owned-claim {
  animation: viewer-owned-claim-pulse 1.65s ease-in-out infinite;
  background: radial-gradient(circle, rgba(77, 255, 139, 0.7) 0%, rgba(77, 255, 139, 0.28) 48%, transparent 74%);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(77, 255, 139, 0.65), 0 0 28px rgba(77, 255, 139, 0.38);
  filter: drop-shadow(0 0 8px rgba(97, 255, 153, 0.86)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.84));
}

.current-space-buildings {
  align-items: flex-end;
  display: flex;
  gap: 2px;
  justify-content: center;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 44px;
  transform: translateX(-50%);
  width: 78%;
  z-index: 5;
}

.current-space-buildings .space-building.tower {
  height: 34px;
}

.current-space-buildings .space-building.fortress {
  height: 48px;
}

.current-space-value {
  align-items: center;
  background: linear-gradient(180deg, #f3df9a, #a7792d);
  border: 1px solid rgba(57, 35, 8, 0.82);
  border-radius: 4px 4px 0 0;
  bottom: 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.4);
  color: #241505;
  display: flex;
  font-size: 18px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  left: 50%;
  min-width: 42px;
  padding: 0 12px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 3;
}

.current-space-preview.preview-non-domain .current-space-value {
  border-radius: 4px 0 0 4px;
  bottom: auto;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.42);
  height: 34px;
  left: auto;
  min-width: 36px;
  padding: 0 9px;
  right: 0;
  top: 58%;
  transform: translateY(-50%);
}

.space-hover-bubble .current-space-preview.preview-domain .current-space-value {
  display: none;
}

.space-hover-bubble .current-space-claim {
  height: 80px;
  left: 12px;
  top: 48px;
  transform: none;
  width: 80px;
}

.current-space-copy {
  display: grid;
  gap: 4px;
  text-align: center;
}

.current-space-copy span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.current-space-name {
  color: #fff8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.05;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.86);
}

.current-space-copy p {
  color: #efe3c6;
  font-size: 13px;
  line-height: 1.25;
  margin: 0;
}

.current-space-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.current-space-details {
  display: none;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.hover-space-preview .current-space-details {
  display: grid;
  gap: 5px;
}

.current-space-details li {
  border-top: 1px solid rgba(244, 236, 216, 0.1);
  color: #d7caa9;
  font-size: 12px;
  line-height: 1.28;
  padding-top: 5px;
}

.space-hover-template {
  display: none;
}

.space-hover-bubble {
  opacity: 0;
  pointer-events: auto;
  position: fixed;
  transform: translateY(4px) scale(0.98);
  transition: opacity 140ms ease, transform 140ms ease;
  width: min(510px, calc(100vw - 24px));
  z-index: 1000;
}

.space-hover-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.space-hover-bubble .current-space-preview {
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.09), rgba(255, 248, 220, 0.025)),
    rgba(11, 13, 11, 0.96);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(217, 173, 69, 0.08);
  gap: 11px;
  padding: 15px;
  width: 100%;
}

.space-hover-bubble .current-space-art {
  width: min(100%, 375px);
}

.space-hover-bubble .current-space-preview.preview-corner .current-space-art,
.space-hover-bubble .current-space-preview.preview-art-rotated .current-space-art {
  aspect-ratio: 1;
}

.space-hover-bubble .hover-space-preview .current-space-art-orientation {
  transform: rotate(var(--preview-image-rotation, 0deg));
}

.space-hover-bubble .hover-space-preview.preview-art-rotated .current-space-art-orientation {
  height: 100%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--preview-image-rotation, 0deg));
  width: 66.6667%;
}

.space-hover-bubble .hover-space-preview.preview-corner.preview-art-rotated .current-space-art-orientation {
  width: 100%;
}

.space-hover-bubble .current-space-banner {
  font-size: 15px;
  min-height: 36px;
  padding: 5px 9px;
}

.space-hover-bubble .current-space-buildings {
  top: 58px;
}

.space-hover-bubble .current-space-buildings .space-building.tower {
  height: 46px;
}

.space-hover-bubble .current-space-buildings .space-building.fortress {
  height: 66px;
}

.space-hover-bubble .current-space-copy p {
  font-size: 16px;
}

.space-hover-bubble .current-space-copy span {
  font-size: 13px;
}

.space-hover-bubble .current-space-name {
  font-size: 20px;
}

.space-hover-bubble .current-space-copy small {
  font-size: 12px;
}

.space-hover-bubble .current-space-details li {
  font-size: 13px;
}

.right-side-stack .table-management-panel {
  display: grid;
  gap: 9px;
  width: 100%;
}

.game-screen .site-footer {
  display: none;
}

.game-table-footer.table-management-panel {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 14px auto 0;
  padding: 10px 14px;
  width: min(880px, calc(100vw - 40px));
}

.game-screen-classic .game-table-footer.table-management-panel {
  margin-left: 234px;
  margin-right: 0;
  margin-top: -42px;
  width: max(700px, min(calc(100vh - 92px), calc(100vw - 966px)));
}

.game-table-footer.table-management-panel form,
.game-table-footer.table-management-panel .table-footer-button {
  flex: 0 1 190px;
}

.game-table-footer.table-management-panel button,
.game-table-footer.table-management-panel .table-footer-button {
  min-height: 44px;
  min-width: 170px;
  padding: 11px 18px 13px;
}

.table-management-panel form {
  margin: 0;
}

.table-management-panel button,
.table-management-panel .table-footer-button {
  align-items: center;
  background-color: transparent;
  background-image: url("ui/button-normal.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border: 0;
  color: #fff8dc;
  display: inline-flex;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.46));
  font-size: 13px;
  justify-content: center;
  line-height: 1;
  min-height: 38px;
  padding: 9px 14px 11px;
  text-decoration: none;
  text-shadow: 0 1px 2px #120804, 0 0 5px rgba(0, 0, 0, 0.9);
  width: 100%;
}

.table-management-panel button:not(:disabled):hover,
.table-management-panel .table-footer-button:hover {
  background-image: url("ui/button-hover.png");
}

.table-management-panel button:not(:disabled):active,
.table-management-panel .table-footer-button:active {
  background-image: url("ui/button-pressed.png");
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.46));
  transform: translateY(1px);
}

.table-management-panel .table-button-restart {
  color: #fff2ba;
}

.table-management-panel .table-button-pause {
  color: #dcecff;
}

.table-management-panel .table-button-danger {
  color: #ffd9d4;
}

.table-confirm-layer,
.travel-gate-choice-layer {
  align-items: center;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: absolute;
  z-index: 40;
}

.table-confirm-layer[hidden],
.travel-gate-choice-layer[hidden] {
  display: none;
}

.table-confirm-dialog,
.travel-gate-choice-dialog {
  background: rgba(18, 21, 17, 0.96);
  border: 1px solid rgba(255, 248, 220, 0.24);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  color: var(--text);
  display: grid;
  gap: 12px;
  max-width: 390px;
  padding: 18px;
  text-align: center;
}

.table-confirm-dialog h3,
.travel-gate-choice-dialog h3 {
  color: #fff8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

.table-confirm-dialog p,
.travel-gate-choice-dialog p {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.table-confirm-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.travel-gate-choice-dialog {
  width: min(100%, 430px);
}

.travel-gate-choice-dialog .eyebrow {
  color: #d6b85a;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.travel-gate-choice-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.travel-gate-choice-actions form {
  margin: 0;
}

.travel-gate-choice-actions button,
.travel-gate-choice-cancel {
  width: 100%;
}

.travel-gate-choice-cancel {
  justify-self: center;
  max-width: 150px;
}

@media (max-width: 560px) {
  .travel-gate-choice-actions {
    grid-template-columns: 1fr;
  }
}

.table-confirm-actions button,
.travel-gate-choice-dialog button {
  align-items: center;
  background-color: transparent;
  background-image: url("ui/button-normal.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border: 0;
  color: #fff8dc;
  display: inline-flex;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.46));
  font-size: 13px;
  justify-content: center;
  line-height: 1;
  min-height: 38px;
  padding: 9px 14px 11px;
  text-shadow: 0 1px 2px #120804, 0 0 5px rgba(0, 0, 0, 0.9);
}

.table-confirm-actions button:not(:disabled):hover,
.travel-gate-choice-dialog button:not(:disabled):hover {
  background-image: url("ui/button-hover.png");
}

.table-confirm-actions button:not(:disabled):active,
.travel-gate-choice-dialog button:not(:disabled):active {
  background-image: url("ui/button-pressed.png");
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.46));
  transform: translateY(1px);
}

.player-side-panel strong {
  color: #fff8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.side-token {
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.72));
  height: 72px;
  object-fit: contain;
  width: 78px;
}

.side-miniature {
  filter:
    drop-shadow(0 0 2px rgba(255, 248, 220, 0.8))
    drop-shadow(0 12px 10px rgba(0, 0, 0, 0.76));
  height: min(32vh, 250px);
  max-width: 170px;
  object-fit: contain;
  width: auto;
}

.troop-recovery-counter {
  align-items: center;
  background: rgba(244, 236, 216, 0.08);
  border: 1px solid rgba(217, 173, 69, 0.36);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 7px 9px;
  width: 100%;
}

.troop-recovery-counter span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.troop-recovery-counter strong {
  color: #fff8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1;
}

.table-alert-box {
  display: grid;
  gap: 6px;
  text-align: left;
}

.table-alert-box h4 {
  color: #fff8dc;
  letter-spacing: 0;
  line-height: 1;
}

.table-alert-log {
  display: grid;
  gap: 6px;
  max-height: 176px;
  overflow-y: auto;
  padding-right: 2px;
}

.table-alert {
  background: rgba(255, 248, 220, 0.07);
  border-left: 3px solid rgba(255, 248, 220, 0.34);
  border-radius: 5px;
  display: grid;
  gap: 2px;
  padding: 6px 7px;
}

.table-alert-player_left,
.table-alert-player_kicked,
.table-alert-human_grace,
.table-alert-player_broken,
.table-alert-player_surrendered,
.table-alert-player_removed,
.table-alert-player_eliminated {
  border-left-color: #d76b58;
}

.table-alert-player_rejoined,
.table-alert-player_restored {
  border-left-color: #79c98d;
}

.table-alert-host_changed,
.table-alert-game_restarted,
.table-alert-game_won {
  border-left-color: #e0b44f;
}

.table-alert strong {
  font-family: inherit;
  font-size: 10px;
  line-height: 1.15;
  text-transform: uppercase;
}

.table-alert p,
.table-alert-empty {
  font-size: 11px;
  line-height: 1.25;
  margin: 0;
}

.table-alert span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
}

.kept-cards-panel > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.kept-card-list {
  display: grid;
  gap: 8px;
}

.kept-card {
  background: rgba(244, 236, 216, 0.07);
  border: 1px solid rgba(244, 236, 216, 0.14);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.kept-card.kept-magic {
  border-left-color: #8c7bd1;
}

.kept-card.kept-luck {
  border-left-color: #d9ad45;
}

.kept-card strong {
  font-size: 12px;
}

.kept-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  margin: 0;
}

.kept-card form {
  margin: 0;
}

.kept-card button {
  font-size: 12px;
  min-height: 28px;
  padding: 5px 10px;
  width: 100%;
}

.card-choice-layer {
  align-items: center;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  position: absolute;
  z-index: 30;
}

.drawn-card {
  animation: card-reveal 260ms ease-out;
  aspect-ratio: 2 / 3;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.6));
  max-height: min(74vh, 560px);
  max-width: min(82vw, 374px);
  position: relative;
  width: 42%;
}

.drawn-card > img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.drawn-card-copy {
  color: #2a1607;
  display: grid;
  gap: 10px;
  left: 14%;
  position: absolute;
  right: 14%;
  text-align: center;
  top: 17%;
}

.drawn-card-copy span {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.drawn-card-copy h2 {
  color: #231204;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1.05;
  margin: 0;
}

.drawn-card-copy p {
  color: #321b08;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.drawn-card-actions {
  bottom: 8%;
  display: flex;
  gap: 8px;
  justify-content: center;
  left: 12%;
  position: absolute;
  right: 12%;
}

.drawn-card-actions form {
  flex: 1 1 0;
  margin: 0;
}

.drawn-card-actions button {
  font-size: 14px;
  min-height: 36px;
  padding: 8px 12px;
  width: 100%;
}

@keyframes card-reveal {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.board-grid {
  aspect-ratio: 1;
  background: #090b09;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  grid-template-columns: 3fr repeat(9, 2fr) 3fr;
  grid-template-rows: 3fr repeat(9, 2fr) 3fr;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 2px;
  transform: rotate(var(--board-rotation, 0deg));
  transform-origin: center;
  transition: transform 420ms ease;
}

.game-screen-widescreen .game-stage {
  display: block;
  min-width: 0;
  width: 100%;
}

.game-screen-widescreen .game-shell {
  --ws-ring-x: 6.25%;
  --ws-ring-y: 16.6667%;
  --ws-side-width: clamp(178px, 10.9%, 192px);
  --ws-player-panel-height: clamp(345px, 35vh, 365px);
  --ws-inner-inset: calc(var(--ws-ring-x) + var(--ws-side-width) + 18px);
  margin-inline: auto;
  min-width: 1180px;
  overflow: visible;
  padding: 6px 8px 0;
  position: relative;
  width: min(calc(100vw - 16px), calc((100vh - 64px) * 1.7778), 1760px);
}

.game-screen-widescreen .board-viewport {
  overflow: visible;
  width: 100%;
}

.game-screen-widescreen .left-side-stack {
  align-content: start;
  bottom: calc(var(--ws-ring-y) + 8px);
  gap: 8px;
  grid-template-rows: var(--ws-player-panel-height) minmax(0, 1fr);
  left: calc(var(--ws-ring-x) + 8px);
  overflow: visible;
  position: absolute;
  top: calc(var(--ws-ring-y) + 8px);
  width: var(--ws-side-width);
}

.game-screen-widescreen .left-side-stack .player-side-panel,
.game-screen-widescreen .left-side-stack .current-space-preview {
  width: var(--ws-side-width);
}

.game-screen-widescreen .right-side-stack {
  bottom: 0;
  display: block;
  left: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
  z-index: 14;
}

.game-screen-widescreen .right-player-stack {
  align-content: start;
  bottom: calc(var(--ws-ring-y) + 8px);
  gap: 8px;
  grid-template-rows: var(--ws-player-panel-height) minmax(0, 1fr);
  pointer-events: auto;
  position: absolute;
  right: calc(var(--ws-ring-x) + 8px);
  top: calc(var(--ws-ring-y) + 8px);
  width: var(--ws-side-width);
}

.game-screen-widescreen .right-table-stack {
  bottom: calc(var(--ws-ring-y) + 78px);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(390px, 1.08fr) minmax(330px, 0.92fr);
  grid-template-rows: 94px auto auto minmax(0, 1fr);
  left: var(--ws-inner-inset);
  min-width: 0;
  pointer-events: auto;
  position: absolute;
  right: var(--ws-inner-inset);
  top: calc(var(--ws-ring-y) + 8px);
  z-index: 15;
}

.game-screen-widescreen .right-side-stack .player-side-panel,
.game-screen-widescreen .right-side-stack .current-space-preview {
  width: var(--ws-side-width);
}

.game-screen-widescreen .player-side-panel {
  box-sizing: border-box;
  gap: 4px;
  grid-template-rows: minmax(0, 1fr) auto;
  height: var(--ws-player-panel-height);
  max-height: var(--ws-player-panel-height);
  min-height: var(--ws-player-panel-height);
  overflow: hidden;
  padding: 6px 8px;
}

.game-screen-widescreen .side-miniature-stage {
  align-self: stretch;
  cursor: zoom-in;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.game-screen-widescreen .side-miniature-stage:focus-visible {
  outline: 2px solid rgba(222, 177, 64, 0.9);
  outline-offset: -3px;
}

.game-screen-widescreen .side-token {
  display: none;
}

.game-screen-widescreen .side-miniature {
  bottom: 0;
  height: 108%;
  left: 50%;
  max-height: none;
  max-width: none;
  object-fit: contain;
  position: absolute;
  transform: translateX(-50%);
  width: 108%;
}

.game-screen-widescreen .side-player-caption {
  align-items: center;
  background: linear-gradient(90deg, rgba(4, 7, 5, 0.18), rgba(4, 7, 5, 0.84) 18%, rgba(4, 7, 5, 0.84) 82%, rgba(4, 7, 5, 0.18));
  bottom: 0;
  display: grid;
  gap: 1px;
  left: 0;
  padding: 5px 4px 6px;
  position: absolute;
  right: 0;
  text-align: center;
  z-index: 2;
}

.game-screen-widescreen .side-player-caption h3 {
  font-size: 12px;
  line-height: 1;
  margin: 0;
}

.game-screen-widescreen .side-player-caption strong {
  font-size: 17px;
  line-height: 1.05;
}

.miniature-hover-preview {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 0;
  padding: 76px 24px 24px;
  pointer-events: none;
  position: fixed;
  transition: opacity 140ms ease;
  z-index: 29;
}

.miniature-hover-preview[hidden] {
  display: none;
}

.miniature-hover-preview.is-visible {
  opacity: 1;
}

.miniature-hover-preview-card {
  background:
    radial-gradient(circle at 50% 42%, rgba(225, 185, 74, 0.19), transparent 43%),
    linear-gradient(180deg, rgba(25, 28, 22, 0.98), rgba(7, 9, 7, 0.98));
  border: 1px solid rgba(222, 177, 64, 0.5);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78), 0 0 34px rgba(213, 171, 66, 0.13);
  height: min(74vh, 720px);
  max-width: calc(100vw - 32px);
  overflow: hidden;
  position: relative;
  transform: translateY(8px) scale(0.985);
  transition: transform 140ms ease;
  width: min(440px, 40vw);
}

.miniature-hover-preview.is-visible .miniature-hover-preview-card {
  transform: translateY(0) scale(1);
}

.miniature-hover-preview-card img {
  box-sizing: border-box;
  filter: drop-shadow(0 15px 16px rgba(0, 0, 0, 0.72));
  height: 100%;
  object-fit: contain;
  padding: 14px 14px 58px;
  width: 100%;
}

.miniature-hover-preview-caption {
  background: linear-gradient(90deg, rgba(5, 8, 6, 0.35), rgba(5, 8, 6, 0.94) 20%, rgba(5, 8, 6, 0.94) 80%, rgba(5, 8, 6, 0.35));
  bottom: 0;
  display: grid;
  gap: 2px;
  left: 0;
  padding: 9px 12px 11px;
  position: absolute;
  right: 0;
  text-align: center;
}

.miniature-hover-preview-caption span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.miniature-hover-preview-caption strong {
  color: #fff8e6;
  font-size: 22px;
  line-height: 1.05;
}

@media (max-height: 760px) {
  .miniature-hover-preview {
    padding-top: 64px;
  }

  .miniature-hover-preview-card {
    height: calc(100vh - 88px);
  }
}

.game-screen-widescreen .troop-recovery-counter {
  align-self: end;
  box-sizing: border-box;
  gap: 1px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 4px;
  width: 100%;
}

.game-screen-widescreen .troop-recovery-counter span {
  font-size: 8px;
  line-height: 1.05;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.game-screen-widescreen .troop-recovery-counter strong {
  font-size: 20px;
}

.game-screen-widescreen .current-space-preview {
  gap: 6px;
  padding: 8px;
}

.game-screen-widescreen .left-side-stack > .current-space-preview,
.game-screen-widescreen .right-player-stack > .current-space-preview {
  align-self: end;
}

.game-screen-widescreen .current-space-art {
  width: min(100%, 152px);
}

.game-screen-widescreen .current-space-copy {
  gap: 2px;
}

.game-screen-widescreen .current-space-copy strong {
  font-size: 14px;
}

.game-screen-widescreen .current-space-copy p,
.game-screen-widescreen .current-space-copy small {
  font-size: 11px;
  line-height: 1.18;
}

.game-screen-widescreen .current-space-details {
  display: none;
}

.game-screen-widescreen .compact-space-preview .current-space-copy {
  display: none;
}

.game-screen-widescreen .compact-space-preview .current-space-banner {
  border-bottom: 1px solid rgba(0, 0, 0, 0.68);
  border-top: 1px solid rgba(0, 0, 0, 0.68);
  min-height: 26px;
  top: 50%;
  transform: translateY(-50%);
}

.game-screen-widescreen .right-table-stack {
  grid-auto-rows: unset;
  height: auto;
}

.game-screen-widescreen .right-side-stack .table-status-panel,
.game-screen-widescreen .right-side-stack .board-chat {
  background: rgba(9, 11, 9, 0.66);
  backdrop-filter: blur(1px);
}

.game-screen-widescreen .right-side-stack .table-status-panel {
  background: none;
  border: 0;
  box-shadow: none;
  display: contents;
  padding: 0;
}

.game-screen-widescreen .board-turn-summary {
  align-items: start;
  background: rgba(9, 11, 9, 0.66);
  border: 1px solid rgba(244, 236, 216, 0.16);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-column: 1 / 3;
  grid-row: 1;
  min-height: 94px;
  padding: 8px 12px;
}

.game-screen-widescreen .board-turn-summary .eyebrow {
  grid-column: 1;
  grid-row: 1;
}

.game-screen-widescreen .board-turn-summary > strong {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.game-screen-widescreen .board-turn-summary > span:not(.turn-timer) {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.game-screen-widescreen .board-turn-summary .turn-timer {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.game-screen-widescreen .board-player-grid {
  align-content: start;
  align-self: start;
  background: rgba(9, 11, 9, 0.66);
  border: 1px solid rgba(244, 236, 216, 0.16);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
  grid-column: 2;
  grid-row: 2;
  grid-auto-rows: 142px;
  height: auto;
  padding: 6px;
  position: relative;
}

.game-screen-widescreen .board-player-token {
  height: 142px;
  min-height: 0;
}

.game-screen-widescreen .board-player-token-art {
  inset: 13px 7px 20px;
}

.game-screen-widescreen .board-player-token-art img {
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  width: 100%;
}

.game-screen-widescreen .board-player-token-art strong {
  font-size: 18px;
  height: 32px;
  min-width: 42px;
}

.game-screen-widescreen .board-player-name {
  bottom: 27px;
  font-size: 11px;
  line-height: 1.05;
}

.game-screen-widescreen .board-player-token .pill {
  bottom: 5px;
  font-size: 10px;
  line-height: 1;
  padding: 3px 7px;
}

.game-screen-widescreen .right-side-stack .board-chat {
  align-self: stretch;
  grid-column: 1;
  grid-row: 2 / 5;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.game-screen-widescreen .right-side-stack .board-chat h3 {
  font-size: 18px;
}

.game-screen-widescreen .right-side-stack .board-chat .board-chat-log {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding: 4px 2px;
}

.game-screen-widescreen .board-controls {
  top: 42px;
  width: min(68%, 790px);
  z-index: 18;
}

.game-screen-widescreen .turn-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
}

.game-screen-widescreen .turn-action-row {
  display: contents;
}

.game-screen-widescreen .turn-actions-primary,
.game-screen-widescreen .turn-actions-secondary {
  min-width: 0;
}

.game-screen-widescreen .turn-actions-secondary {
  margin-top: 0;
}

.game-screen-widescreen .turn-actions button {
  font-size: 13px;
  min-height: 40px;
  min-width: 104px;
  padding: 8px 13px 10px;
}

.game-screen-widescreen .turn-actions #declareWarButton {
  min-width: 126px;
}

.game-screen-widescreen .board-chat-composer .chat-form input {
  font-size: 11px;
  height: 28px;
  line-height: 1;
  min-height: 28px;
  padding: 2px 7px;
}

.game-screen-widescreen .board-chat-composer .chat-form button {
  font-size: 12px;
  height: 30px;
  line-height: 1;
  min-height: 30px;
  min-width: 82px;
  padding: 2px 8px 4px;
}

.game-screen-widescreen .board-logo {
  left: 71%;
  max-width: 270px;
  top: 69%;
  width: 21%;
}

.game-screen-widescreen .board-kept-cards {
  align-self: start;
  grid-column: 2;
  grid-row: 3;
  max-height: 64px;
  overflow: auto;
  padding: 5px 7px;
  position: static;
  transform: none;
  width: 100%;
  z-index: 18;
}

.game-screen-widescreen .board-chat-composer {
  align-self: end;
  grid-column: 2;
  grid-row: 4;
  min-width: 0;
  max-height: 36px;
  min-height: 0;
  padding: 2px 4px;
  width: 100%;
}

.game-screen-widescreen .board-chat-composer .chat-form {
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  height: 30px;
  margin: 0;
  width: 100%;
}

.game-screen-widescreen .board-kept-cards h3 {
  font-size: 10px;
  line-height: 1;
}

.game-screen-widescreen .board-kept-cards > p {
  font-size: 10px;
}

.game-screen-widescreen .board-kept-cards .kept-card-list {
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-screen-widescreen .board-kept-cards .kept-card {
  gap: 3px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 5px 6px;
}

.game-screen-widescreen .board-kept-cards .kept-card strong,
.game-screen-widescreen .board-kept-cards .kept-card p {
  font-size: 9px;
  line-height: 1.1;
}

.game-screen-widescreen .board-kept-cards .kept-card strong,
.game-screen-widescreen .board-kept-cards .kept-card p {
  grid-column: 1;
}

.game-screen-widescreen .board-kept-cards .kept-card form {
  align-self: center;
  grid-column: 2;
  grid-row: 1 / 3;
}

.game-screen-widescreen .board-kept-cards .kept-card button {
  font-size: 9px;
  min-height: 24px;
  padding: 3px 7px;
}

.game-screen-widescreen .your-turn-banner-slot {
  top: 15%;
  width: min(36%, 380px);
  z-index: 19;
}

.game-screen-widescreen .your-turn-banner {
  font-size: 30px;
  padding: 8px 18px 10px;
}

.game-screen-widescreen .table-victory-banner-slot {
  top: 17%;
  width: min(36%, 380px);
}

.game-screen-widescreen .game-table-footer {
  bottom: calc(var(--ws-ring-y) + 8px);
  left: calc(var(--ws-inner-inset) + 10px);
  margin: 0;
  max-width: none;
  min-height: 60px;
  padding: 8px 12px;
  position: absolute;
  right: calc(var(--ws-inner-inset) + 10px);
  width: auto;
  z-index: 18;
}

.game-screen-widescreen .space-hover-bubble {
  max-height: calc(100vh - 32px);
  overflow: auto;
  width: min(580px, calc(100vw - 24px));
}

.game-screen-widescreen .space-hover-bubble .hover-space-preview {
  padding: 15px;
}

.game-screen-widescreen .space-hover-bubble .hover-space-preview .current-space-art {
  width: min(100%, 480px, 46vh);
}

.game-screen-widescreen .space-hover-bubble .hover-space-preview .current-space-details {
  display: grid;
}

.game-screen-widescreen .game-table-footer.table-management-panel form,
.game-screen-widescreen .game-table-footer.table-management-panel .table-footer-button {
  flex: 0 1 170px;
}

.game-screen-widescreen .game-table-footer.table-management-panel button,
.game-screen-widescreen .game-table-footer.table-management-panel .table-footer-button {
  min-height: 38px;
  min-width: 150px;
  padding: 8px 14px 10px;
}

.game-screen-widescreen .board-viewport,
.game-screen-widescreen .board-grid {
  aspect-ratio: 16 / 9;
}

.game-screen-widescreen .board-grid {
  grid-template-columns: repeat(16, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  overflow: visible;
  transform: none;
}

.game-screen-widescreen .board-center {
  grid-column: 2 / 16;
  grid-row: 2 / 6;
}

.game-screen-widescreen .board-center > img:first-child {
  filter: brightness(0.58) saturate(0.86);
  object-fit: cover;
}

.game-screen-widescreen .board-hud {
  transform: none;
  z-index: auto;
}

.board-center {
  display: grid;
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  overflow: hidden;
  position: relative;
}

.board-center > img:first-child {
  height: 100%;
  object-fit: fill;
  width: 100%;
}

.board-hud {
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform: rotate(var(--counter-rotation, 0deg));
  z-index: 2;
}

.your-turn-banner-slot {
  left: 50%;
  position: absolute;
  top: 10.5%;
  transform: translateX(-50%);
  width: min(48%, 390px);
  z-index: 4;
}

.table-victory-banner-slot {
  top: 7.25%;
  width: min(42%, 330px);
}

.your-turn-banner {
  animation: yourTurnBannerGlow 2.2s ease-in-out infinite;
  background: rgba(48, 129, 76, 0.48);
  border: 1px solid rgba(126, 232, 152, 0.52);
  border-radius: 16px;
  box-shadow:
    0 0 24px rgba(79, 222, 117, 0.24),
    inset 0 0 22px rgba(174, 255, 189, 0.12);
  color: #ecffe8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  padding: 12px 22px 14px;
  text-align: center;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 13px rgba(133, 255, 151, 0.78);
  text-transform: uppercase;
}

.table-victory-banner {
  display: grid;
  gap: 3px;
  line-height: 1.05;
  padding: 10px 18px 11px;
}

.your-turn-banner.table-victory-banner span {
  font-size: 27px;
}

.your-turn-banner.table-victory-banner strong {
  color: #fff7ce;
  font-size: 20px;
  line-height: 1;
  text-transform: none;
}

.your-turn-banner.table-victory-banner small {
  color: #d6f4cf;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

@keyframes yourTurnBannerGlow {
  0%,
  100% {
    background-color: rgba(48, 129, 76, 0.42);
    border-color: rgba(126, 232, 152, 0.42);
    box-shadow:
      0 0 18px rgba(79, 222, 117, 0.18),
      inset 0 0 18px rgba(174, 255, 189, 0.1);
  }

  50% {
    background-color: rgba(58, 162, 92, 0.56);
    border-color: rgba(156, 255, 178, 0.78);
    box-shadow:
      0 0 32px rgba(79, 222, 117, 0.34),
      inset 0 0 26px rgba(174, 255, 189, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .your-turn-banner {
    animation: none;
  }
}

@media (max-width: 900px) {
  .your-turn-banner {
    font-size: 30px;
    padding: 10px 18px 12px;
  }

  .table-victory-banner-slot {
    top: 6%;
    width: min(46%, 290px);
  }

  .your-turn-banner.table-victory-banner span {
    font-size: 22px;
  }

  .your-turn-banner.table-victory-banner strong {
    font-size: 16px;
  }

  .your-turn-banner.table-victory-banner small {
    font-size: 11px;
  }
}

.hud-panel {
  background: rgba(13, 16, 13, 0.76);
  border: 1px solid rgba(244, 236, 216, 0.18);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.board-skirmish {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  width: 100%;
}

.board-turn-summary {
  align-items: center;
  display: grid;
  gap: 4px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.board-turn-summary .eyebrow {
  margin: 0;
}

.board-turn-summary strong {
  color: #fff8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-turn-summary span {
  color: var(--muted);
  font-size: 11px;
  justify-self: end;
}

.board-turn-summary .turn-timer {
  background: rgba(217, 173, 69, 0.14);
  border: 1px solid rgba(217, 173, 69, 0.28);
  border-radius: 999px;
  color: #fff4c8;
  font-size: 11px;
  font-weight: 800;
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  line-height: 1;
  padding: 6px 9px;
  white-space: nowrap;
}

.board-turn-summary span:not(.turn-timer) {
  grid-column: 1;
  justify-self: start;
}

.board-turn-summary .turn-timer.timer-warning {
  background: rgba(185, 92, 79, 0.22);
  border-color: rgba(185, 92, 79, 0.52);
  color: #ffd9d4;
}

.board-turn-summary .turn-timer.timer-email,
.board-turn-summary .turn-timer.timer-paused {
  background: rgba(109, 159, 207, 0.16);
  border-color: rgba(109, 159, 207, 0.38);
}

.board-player-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-player-token {
  background:
    radial-gradient(circle at 50% 50%, rgba(217, 173, 69, 0.16), transparent 54%),
    rgba(244, 236, 216, 0.045);
  border: 1px solid rgba(244, 236, 216, 0.12);
  border-radius: 7px;
  display: block;
  justify-items: center;
  min-height: 108px;
  min-width: 0;
  overflow: visible;
  padding: 0;
  position: relative;
  text-align: center;
}

.board-player-token:hover,
.board-player-token:focus-within {
  border-color: rgba(217, 173, 69, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(217, 173, 69, 0.14),
    0 0 14px rgba(217, 173, 69, 0.18);
  z-index: 8;
}

.board-player-token.has-player-actions {
  cursor: pointer;
}

.board-player-token.current-turn {
  border-color: rgba(217, 173, 69, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(217, 173, 69, 0.24),
    0 0 16px rgba(217, 173, 69, 0.22);
}

.board-player-race,
.board-player-name {
  left: 5px;
  max-width: calc(100% - 10px);
  min-width: 0;
  overflow: hidden;
  position: relative;
  right: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 2;
}

.board-player-race {
  background: linear-gradient(90deg, transparent, rgba(7, 8, 7, 0.72), transparent);
  color: var(--gold);
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 3px 7px 2px;
  position: absolute;
  top: 4px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000, 0 0 5px #000;
}

.board-player-token-art {
  display: grid;
  inset: 14px 5px 18px;
  height: auto;
  opacity: 0.9;
  overflow: hidden;
  place-items: center;
  pointer-events: none;
  position: absolute;
  width: auto;
  z-index: 1;
}

.board-player-token-art img {
  filter:
    drop-shadow(0 0 8px rgba(217, 173, 69, 0.38))
    drop-shadow(0 5px 8px rgba(0, 0, 0, 0.55));
  height: 96%;
  object-fit: contain;
  width: 96%;
}

.board-player-token-art strong {
  align-items: center;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 248, 220, 0.48);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  color: #fff8dc;
  display: flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  line-height: 1;
  min-width: 36px;
  padding: 0 5px;
  position: absolute;
  text-shadow: 0 1px 2px #000;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.board-player-name {
  background: linear-gradient(90deg, transparent, rgba(7, 8, 7, 0.76), transparent);
  color: #fff8dc;
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.05;
  padding: 3px 7px;
  position: absolute;
  bottom: 21px;
  text-shadow: 0 1px 2px #000, 0 0 5px #000;
}

.board-player-token .pill {
  font-size: 9px;
  left: 50%;
  line-height: 1;
  padding: 3px 6px;
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  z-index: 2;
}

.board-player-actions {
  background:
    radial-gradient(circle at 50% 18%, rgba(217, 173, 69, 0.14), transparent 54%),
    linear-gradient(180deg, rgba(20, 22, 19, 0.97), rgba(10, 11, 10, 0.97));
  border: 1px solid rgba(217, 173, 69, 0.32);
  border-radius: 6px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.48);
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  opacity: 0;
  padding: 4px;
  pointer-events: none;
  position: absolute;
  inset: 17px 5px 15px;
  transform: scale(0.96);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  visibility: hidden;
  z-index: 20;
}

.board-player-token:hover .board-player-actions,
.board-player-token:focus-within .board-player-actions {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  visibility: visible;
}

.board-player-actions form {
  display: flex;
  margin: 0;
  min-width: 0;
}

.board-player-actions .button-small,
.board-player-actions .button.button-small {
  font-size: 9px;
  min-height: 25px;
  min-width: 0;
  padding: 3px 5px;
  width: 100%;
}

.board-logo {
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.62));
  height: auto;
  left: 50%;
  max-width: 34%;
  object-fit: contain;
  position: absolute;
  pointer-events: none;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 34%;
  z-index: 1;
}

.board-controls {
  left: 50%;
  pointer-events: auto;
  position: absolute;
  text-align: center;
  top: 55%;
  transform: translateX(-50%);
  width: min(96%, 720px);
  z-index: 2;
}

.board-chat {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  width: 100%;
}

.board-chat h3 {
  font-size: 15px;
  margin: 0;
}

.board-chat .board-chat-log {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  gap: 6px;
  max-height: 360px;
  min-height: 260px;
  padding: 8px;
}

.right-side-stack .board-chat .board-chat-log {
  max-height: 580px;
  min-height: 500px;
}

.board-chat .chat-message {
  border-radius: 6px;
  max-width: 94%;
  padding: 6px 8px;
}

.board-chat .chat-message.system {
  background: rgba(109, 159, 207, 0.16);
  justify-self: stretch;
}

.board-chat .chat-message strong {
  font-size: 11px;
}

.board-chat .chat-message p {
  font-size: 12px;
  line-height: 1.25;
  margin: 2px 0;
}

.board-chat .chat-message span {
  font-size: 9px;
}

.board-chat .chat-form input,
.board-chat .chat-form button {
  font-size: 13px;
}

.board-chat .chat-form {
  grid-template-columns: 1fr auto;
}

.board-chat .chat-form input {
  min-height: 34px;
}

.board-chat .chat-form button {
  min-height: 34px;
  padding: 7px 12px;
}

.table-status p {
  font-size: 16px;
  margin: 0;
}

.turn-actions {
  align-items: center;
  display: grid;
  gap: 2px;
  justify-content: center;
  margin-top: 0;
}

.turn-action-row {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: center;
}

.turn-actions-primary {
  min-width: min(100%, 500px);
}

.turn-actions-secondary {
  margin-top: -4px;
}

.turn-actions form {
  flex: 0 1 auto;
  margin: 0;
  min-width: 0;
}

.turn-actions button {
  align-items: center;
  background-color: transparent;
  background-image: url("ui/button-normal.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border: 0;
  color: #fff8dc;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.42));
  font-size: 15px;
  line-height: 1;
  min-height: 64px;
  min-width: 128px;
  padding: 15px 19px 18px;
  text-shadow: 0 1px 2px #120804, 0 0 5px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.turn-actions form button {
  width: 100%;
}

.turn-actions button:not(:disabled):hover {
  background-image: url("ui/button-hover.png");
}

.turn-actions button:not(:disabled):active {
  background-image: url("ui/button-pressed.png");
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.46));
  transform: translateY(1px);
}

.turn-actions .button-secondary {
  background-color: transparent;
  border: 0;
  color: #fff8dc;
}

.turn-actions #declareWarButton {
  min-width: 152px;
}

.turn-actions button:disabled {
  filter: grayscale(0.35) brightness(0.72);
  opacity: 0.58;
}

.board-space {
  background: #090b09;
  border: 1px solid rgba(244, 236, 216, 0.18);
  border-radius: 3px;
  min-width: 0;
  overflow: visible;
  position: relative;
}

.space-art-frame {
  background: #090b09;
  border-radius: 3px;
  inset: 0;
  overflow: hidden;
  position: absolute;
  z-index: 0;
}

.space-art-frame::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.space-art {
  display: block;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  width: 100%;
}

.space-left-edge .space-art,
.space-right-edge .space-art {
  height: 150%;
  left: 50%;
  object-fit: cover;
  position: absolute;
  top: 50%;
  width: 66.6667%;
}

.space-left-edge .space-art {
  transform: translate(-50%, -50%) rotate(90deg);
}

.space-top-edge .space-art {
  transform: rotate(180deg);
}

.space-right-edge .space-art {
  transform: translate(-50%, -50%) rotate(-90deg);
}

.space-face {
  display: block;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.space-left-edge .space-face,
.space-right-edge .space-face {
  height: 150%;
  left: 50%;
  position: absolute;
  top: 50%;
  width: 66.6667%;
}

.space-left-edge .space-face {
  transform: translate(-50%, -50%) rotate(90deg);
}

.space-top-edge .space-face {
  transform: rotate(180deg);
}

.space-right-edge .space-face {
  transform: translate(-50%, -50%) rotate(-90deg);
}

.game-screen-widescreen .space-widescreen-edge .space-art,
.game-screen-widescreen .space-widescreen-edge .space-face {
  height: 100%;
  left: 0;
  top: 0;
  transform: none;
  width: 100%;
}

.game-screen-widescreen .space-widescreen-edge .space-art {
  -ms-interpolation-mode: bicubic;
  image-rendering: auto;
  image-rendering: smooth;
  object-fit: cover;
}

.domain-banner {
  background: linear-gradient(180deg, color-mix(in srgb, var(--domain-color) 92%, #ffffff 8%), var(--domain-color));
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  color: #fff8dc;
  align-items: center;
  display: flex;
  font-size: clamp(6px, 0.42vw, 8px);
  font-weight: 800;
  justify-content: center;
  left: 0;
  line-height: 0.95;
  min-height: 22px;
  overflow: hidden;
  padding: 3px 4px 4px;
  position: absolute;
  right: 0;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  text-transform: uppercase;
  top: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.game-screen-widescreen .domain-banner {
  font-size: clamp(7px, 0.48vw, 10px);
  min-height: 24px;
}

.value-placard {
  align-items: center;
  background: linear-gradient(180deg, #f3df9a, #a7792d);
  border: 1px solid rgba(57, 35, 8, 0.82);
  border-radius: 3px 3px 0 0;
  bottom: 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.35);
  color: #241505;
  display: flex;
  font-size: clamp(11px, 0.82vw, 15px);
  font-weight: 900;
  height: 22px;
  justify-content: center;
  left: 50%;
  min-width: 34px;
  padding: 0 10px;
  position: absolute;
  transform: translateX(-50%);
}

.game-screen-widescreen .value-placard {
  font-size: clamp(12px, 0.75vw, 16px);
  height: 24px;
  min-width: 34px;
}

.space-overlay {
  background: none;
  display: grid;
  gap: 3px;
  inset: 0;
  padding: 5px;
  position: absolute;
  z-index: 1;
}

.domain-territory .space-overlay {
  background: none;
  z-index: 3;
}

.space-buildings {
  align-items: flex-end;
  display: flex;
  gap: 1px;
  justify-content: center;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 28px;
  transform: translateX(-50%);
  width: 82%;
  z-index: 4;
}

.current-space-buildings::before,
.space-buildings::before {
  background:
    radial-gradient(ellipse at center, rgba(255, 230, 143, 0.72), rgba(217, 173, 69, 0.34) 38%, rgba(112, 159, 207, 0.14) 62%, transparent 78%);
  content: "";
  filter: blur(2px);
  height: 150%;
  left: 50%;
  opacity: 0.92;
  pointer-events: none;
  position: absolute;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 118%;
  z-index: 0;
}

.space-building {
  filter:
    drop-shadow(0 0 2px rgba(255, 248, 220, 0.92))
    drop-shadow(0 0 6px rgba(217, 173, 69, 0.62))
    drop-shadow(0 5px 5px rgba(0, 0, 0, 0.76));
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.space-building.tower {
  flex: 0 1 22%;
  height: 25px;
  max-width: 22%;
  min-width: 0;
}

.space-building.fortress {
  height: 34px;
  max-width: 58%;
  width: auto;
}

.claim-coin {
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.82));
  height: 34px;
  left: 50%;
  object-fit: contain;
  position: absolute;
  top: 9px;
  transform: translate(-50%, -50%);
  width: 34px;
  z-index: 5;
}

.claim-coin.viewer-owned-claim {
  animation: viewer-owned-claim-pulse 1.65s ease-in-out infinite;
  background: radial-gradient(circle, rgba(77, 255, 139, 0.72) 0%, rgba(77, 255, 139, 0.3) 48%, transparent 74%);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(77, 255, 139, 0.72), 0 0 24px rgba(77, 255, 139, 0.42);
  filter: drop-shadow(0 0 7px rgba(97, 255, 153, 0.92)) drop-shadow(0 3px 7px rgba(0, 0, 0, 0.82));
}

@keyframes viewer-owned-claim-pulse {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(77, 255, 139, 0.56), 0 0 20px rgba(77, 255, 139, 0.32);
    opacity: 0.92;
  }

  50% {
    box-shadow: 0 0 15px rgba(111, 255, 170, 0.9), 0 0 34px rgba(77, 255, 139, 0.58);
    opacity: 1;
  }
}

.space-territory {
  border-color: rgba(217, 173, 69, 0.32);
}

.space-gate {
  border-color: rgba(109, 159, 207, 0.42);
}

.space-magic,
.space-luck {
  border-color: rgba(140, 123, 209, 0.42);
}

.space-bandit,
.space-citadel {
  border-color: rgba(185, 92, 79, 0.5);
}

.board-space.owned {
  box-shadow: inset 0 0 0 1px rgba(217, 173, 69, 0.22);
}

.game-screen-widescreen .board-space.owned {
  z-index: 5;
}

.board-space.has-piece {
  z-index: 6;
}

.board-space.has-piece .space-art-frame::after {
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 226, 139, 0.12), transparent 44%),
    rgba(0, 0, 0, 0.42);
}

.board-space.attack-target {
  z-index: 7;
}

.board-space.build-target {
  z-index: 7;
}

/* Widescreen callouts must cross the inset player panels at the board edges. */
.game-screen-widescreen .show-war-targets .board-space.attack-target,
.game-screen-widescreen .show-build-targets .board-space.build-target {
  z-index: 40 !important;
}

.board-space.viewer-piece-space {
  z-index: 11;
}

.board-space.viewer-piece-space::before {
  animation: pulse-viewer-piece-space 1.25s ease-in-out infinite;
  border: 3px solid rgba(75, 196, 112, 0.82);
  border-radius: 7px;
  box-shadow:
    0 0 0 1px rgba(211, 242, 220, 0.58),
    0 0 14px rgba(65, 203, 106, 0.58),
    0 0 30px rgba(32, 171, 77, 0.38),
    inset 0 0 18px rgba(45, 182, 87, 0.2);
  content: "";
  inset: -5px;
  pointer-events: none;
  position: absolute;
  z-index: 21;
}

/* A pending attack is the more urgent state if the two ever overlap. */
.board-space.viewer-piece-space.under-attack-target::before {
  display: none;
}

.board-space.under-attack-target {
  z-index: 12;
}

.board-space.under-attack-target::after {
  animation: pulse-under-attack-target 1.05s ease-in-out infinite;
  border: 4px solid #ff2929;
  border-radius: 7px;
  box-shadow:
    0 0 0 1px rgba(255, 242, 230, 0.96),
    0 0 18px rgba(255, 35, 35, 0.98),
    0 0 42px rgba(255, 0, 0, 0.88),
    inset 0 0 24px rgba(255, 20, 20, 0.42);
  content: "";
  inset: -5px;
  pointer-events: none;
  position: absolute;
  z-index: 22;
}

/* Keep position and attack indicators on the tile surface, behind standing pieces. */
.board-space.has-piece .space-overlay {
  z-index: 30;
}

.piece-row {
  align-items: flex-end;
  display: block;
  gap: 2px;
  height: 88px;
  isolation: isolate;
  justify-content: center;
  justify-items: center;
  left: 50%;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -100%) rotate(var(--counter-rotation, 0deg));
  transform-origin: center bottom;
  width: var(--piece-row-width, max-content);
  z-index: 8;
}

.piece-row::before {
  bottom: 0;
  content: "";
  display: none;
  filter: blur(2.5px);
  height: 84px;
  left: 50%;
  opacity: 0.96;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  width: 124px;
  z-index: 0;
}

.piece-row-stacked::before {
  bottom: calc(-1 * var(--piece-stack-depth, 0px));
  width: 210px;
}

.board-space.has-piece .piece-row::before {
  animation: piece-aura-pulse 2.1s ease-in-out infinite;
  background:
    radial-gradient(ellipse at center bottom, rgba(255, 241, 177, 0.92), rgba(217, 173, 69, 0.46) 38%, rgba(109, 159, 207, 0.23) 60%, transparent 78%);
  display: block;
}

.piece-line {
  align-items: flex-end;
  bottom: calc(-1 * var(--piece-line-offset, 0px));
  display: flex;
  gap: 2px;
  justify-content: center;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: max-content;
  z-index: var(--piece-line-layer, 1);
}

.piece-line img {
  filter:
    drop-shadow(0 0 2px rgba(255, 248, 220, 0.98))
    drop-shadow(0 0 9px rgba(255, 218, 114, 0.9))
    drop-shadow(0 0 16px rgba(106, 168, 255, 0.38))
    drop-shadow(0 8px 7px rgba(0, 0, 0, 0.88));
  flex: 0 0 auto;
  height: 78px;
  image-rendering: auto;
  max-width: 58px;
  object-fit: contain;
  pointer-events: none;
  position: relative;
  transform: none;
  transform-origin: center bottom;
  width: auto;
  z-index: 1;
}

.game-screen-widescreen .piece-row {
  height: 98px;
}

.game-screen-widescreen .piece-row::before {
  height: 94px;
  width: 136px;
}

.game-screen-widescreen .piece-line img {
  height: 88px;
  max-width: 66px;
}

.piece-line img + img {
  margin-left: 0;
}

.piece-line img:nth-child(2) {
  transform: none;
}

.piece-line img:nth-child(3) {
  transform: none;
}

.piece-line img:nth-child(4) {
  transform: none;
}

.piece-line img:nth-child(5) {
  transform: none;
}

.piece-line img:nth-child(6) {
  transform: none;
}

.attack-target,
.build-target {
  outline: 2px solid transparent;
}

.show-war-targets .attack-target {
  animation: pulse-target 1.2s ease-in-out infinite;
  outline: 3px solid #ff3030;
  outline-offset: -3px;
}

.show-build-targets .build-target {
  animation: pulse-build-target 1.2s ease-in-out infinite;
  outline-color: var(--gold);
}

.show-war-targets .attack-target .space-overlay,
.show-build-targets .build-target .space-overlay {
  background: none;
}

.war-target-form,
.build-target-form {
  display: none;
  position: absolute;
}

.war-target-form,
.build-target-form {
  bottom: calc(100% + 5px);
  inset-inline: auto;
  left: 50%;
  right: auto;
  top: auto;
  transform: translateX(-50%);
  width: 96px;
  z-index: 50;
}

.build-target-form {
  width: 110px;
}

.space-top-edge .war-target-form,
.space-top-edge .build-target-form,
.callout-top-edge .war-target-form,
.callout-top-edge .build-target-form {
  bottom: auto;
  top: calc(100% + 5px);
}

.space-left-edge .war-target-form,
.space-left-edge .build-target-form,
.callout-left-edge .war-target-form,
.callout-left-edge .build-target-form {
  bottom: auto;
  left: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
}

.space-right-edge .war-target-form,
.space-right-edge .build-target-form,
.callout-right-edge .war-target-form,
.callout-right-edge .build-target-form {
  bottom: auto;
  left: auto;
  right: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
}

.show-war-targets .war-target-form {
  display: block;
}

.show-build-targets .build-target-form {
  display: block;
}

.war-target-form button,
.build-target-form button {
  font-size: 12px;
  min-height: 30px;
  padding: 6px 8px;
  transform: rotate(var(--counter-rotation, 0deg));
  width: 100%;
}

.war-target-form button {
  background-color: rgba(42, 12, 10, 0.92);
  border-color: rgba(255, 202, 151, 0.74);
  box-shadow:
    0 0 0 1px rgba(82, 23, 19, 0.9),
    0 8px 18px rgba(0, 0, 0, 0.48),
    0 0 18px rgba(185, 92, 79, 0.48);
  color: #fff0d6;
  min-height: 28px;
  padding: 5px 9px;
  text-shadow: 0 1px 2px #170605, 0 0 7px rgba(0, 0, 0, 0.95);
}

.build-target-form button {
  background-color: rgba(44, 32, 10, 0.94);
  border-color: rgba(255, 225, 141, 0.78);
  box-shadow:
    0 0 0 1px rgba(91, 67, 17, 0.9),
    0 8px 18px rgba(0, 0, 0, 0.48),
    0 0 18px rgba(217, 173, 69, 0.46);
  color: #fff5cf;
  min-height: 28px;
  padding: 5px 9px;
  text-shadow: 0 1px 2px #171005, 0 0 7px rgba(0, 0, 0, 0.95);
}

@keyframes pulse-target {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 49, 49, 0.82),
      0 0 10px rgba(255, 24, 24, 0.72),
      0 0 22px rgba(255, 0, 0, 0.42);
  }
  50% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 232, 225, 0.98),
      0 0 22px rgba(255, 42, 42, 1),
      0 0 46px rgba(255, 0, 0, 0.86);
  }
}

@keyframes pulse-build-target {
  0%, 100% {
    box-shadow: 0 0 0 rgba(217, 173, 69, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(217, 173, 69, 0.66);
  }
}

@keyframes pulse-under-attack-target {
  0%, 100% {
    border-color: #ff2929;
    box-shadow:
      0 0 0 1px rgba(255, 242, 230, 0.88),
      0 0 14px rgba(255, 35, 35, 0.9),
      0 0 34px rgba(255, 0, 0, 0.7),
      inset 0 0 20px rgba(255, 20, 20, 0.34);
    opacity: 0.86;
  }
  50% {
    border-color: #fff1e8;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 1),
      0 0 26px rgba(255, 42, 42, 1),
      0 0 58px rgba(255, 0, 0, 0.96),
      inset 0 0 30px rgba(255, 24, 24, 0.56);
    opacity: 1;
  }
}

@keyframes pulse-viewer-piece-space {
  0%, 100% {
    border-color: rgba(69, 181, 102, 0.78);
    box-shadow:
      0 0 0 1px rgba(206, 238, 215, 0.46),
      0 0 11px rgba(68, 196, 105, 0.5),
      0 0 25px rgba(35, 161, 76, 0.3),
      inset 0 0 16px rgba(45, 168, 82, 0.16);
    opacity: 0.78;
  }
  50% {
    border-color: rgba(127, 221, 153, 0.92);
    box-shadow:
      0 0 0 1px rgba(226, 247, 232, 0.7),
      0 0 18px rgba(88, 213, 124, 0.7),
      0 0 38px rgba(38, 181, 83, 0.46),
      inset 0 0 22px rgba(54, 191, 94, 0.25);
    opacity: 0.92;
  }
}

@keyframes piece-aura-pulse {
  0%, 100% {
    opacity: 0.76;
    transform: translateX(-50%) scale(0.94);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
}

.game-sidebar {
  display: grid;
  gap: 14px;
}

.current-turn {
  border-color: rgba(217, 173, 69, 0.62);
}

.tiny-token {
  height: 24px;
  margin-right: 8px;
  object-fit: contain;
  vertical-align: middle;
  width: 24px;
}

.event-log {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.event-log p {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  margin: 0;
  padding-bottom: 8px;
}

.event-log strong {
  color: var(--gold);
  margin-right: 6px;
  text-transform: capitalize;
}

@media (max-width: 800px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .topbar-actions,
  .nav {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .grid-2,
  .grid-3,
  .split,
  .lobby-hero,
  .home-showcase,
  .home-pathways,
  .contact-shell,
  .policy-shell,
  .store-feature-grid,
  .store-grid,
  .admin-metric-grid,
  .admin-dashboard-grid,
  .admin-report-grid,
  .admin-store-grid,
  .admin-log-grid,
  .contentless-grid,
  .rules-preview-grid,
  .rules-shell,
  .glossary-grid {
    grid-template-columns: 1fr;
  }

  .rules-shell {
    padding: 22px 18px 40px;
  }

  .rules-index {
    position: static;
  }

  .site-footer {
    flex-wrap: wrap;
  }

  .store-section-heading {
    align-items: start;
    flex-direction: column;
  }

  .store-race-filter {
    justify-content: flex-start;
  }

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

  .store-empty-board div {
    padding: 0 18px 18px;
  }

  .realm-carousel {
    grid-auto-columns: minmax(220px, 72%);
  }

  .miniature-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .lobby-hero {
    align-items: stretch;
    display: grid;
  }

  .lobby-hero-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .panel-heading,
  .player-row,
  .friend-row {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .social-dock {
    width: 100%;
  }

  .friend-dock-menu {
    left: 0;
    right: auto;
    width: min(100vw - 56px, 300px);
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    justify-self: start;
    text-align: left;
  }

  .hero p {
    margin-left: 0;
  }

  .hero-logo {
    margin-left: -10px;
    max-width: min(420px, 92vw);
    width: 92vw;
  }

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

  .brand img {
    height: 36px;
    width: 102px;
  }

  .lobby-crest-art {
    height: 100px;
    width: 100px;
  }
}

@media (max-width: 1180px) {
  .game-shell {
    overflow-x: auto;
  }

  .game-stage {
    grid-template-columns: minmax(220px, 1fr);
    width: 100%;
  }

  .left-side-stack {
    width: 100%;
  }

  .active-player-panel {
    width: 100%;
  }

  .right-side-stack,
  .right-player-stack,
  .right-table-stack {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .right-side-stack .player-side-panel,
  .right-side-stack .current-space-preview,
  .right-side-stack .kept-cards-panel,
  .right-side-stack .table-status-panel,
  .right-side-stack .board-chat {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .right-side-stack .board-chat .board-chat-log {
    max-height: 360px;
    min-height: 260px;
  }

  .side-token {
    height: 50px;
    width: 54px;
  }

  .side-miniature {
    height: min(22vh, 160px);
    max-width: 130px;
  }

  .current-space-art {
    width: min(100%, 150px);
  }

  .current-space-copy p {
    font-size: 12px;
  }

  .board-grid {
    min-height: auto;
  }

  .board-viewport {
    min-height: auto;
    width: min(100%, calc(100vh - 92px));
  }
}

@media (max-width: 1100px) {
  .game-screen {
    overflow-x: hidden;
  }

  .game-screen .topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    min-height: 58px;
    padding: 7px 10px;
  }

  .game-screen .brand {
    flex: 0 0 auto;
  }

  .game-screen .brand img {
    height: 38px;
    width: 106px;
  }

  .game-screen .brand span,
  .game-screen .topbar-actions > .nav,
  .game-screen .topbar-actions > .social-dock {
    display: none;
  }

  .game-screen .topbar-actions {
    margin-left: auto;
  }

  .game-screen .topbar-center {
    left: auto;
    margin-left: auto;
    position: static;
    right: auto;
    top: auto;
    transform: none;
  }

  .game-screen .table-comms-tab {
    height: 40px;
    min-height: 40px;
    min-width: 142px;
    padding: 6px 12px;
    width: 142px;
  }

  .game-screen .table-comms-panel {
    height: calc(100svh - 70px);
    left: 8px;
    position: fixed;
    right: 8px;
    top: 62px;
    transform: none;
    width: auto;
    z-index: 150;
  }

  .game-screen .game-shell,
  .game-screen-widescreen .game-shell {
    margin: 0;
    min-width: 0;
    overflow: visible;
    padding: 0;
    width: 100%;
  }

  .mobile-game-view {
    display: block;
    min-height: calc(100svh - 58px);
    position: relative;
    width: 100%;
  }

  .mobile-tile-focus {
    --mobile-focus-color: #d9ad45;
    background: #080a09;
    color: #fff7df;
    height: calc(100svh - 58px);
    min-height: 590px;
    overflow: hidden;
    position: relative;
    width: 100%;
  }

  .mobile-turn-strip {
    align-items: center;
    background: linear-gradient(180deg, rgba(4, 7, 7, 0.96), rgba(9, 12, 11, 0.84));
    border-bottom: 1px solid color-mix(in srgb, var(--mobile-focus-color) 64%, transparent);
    display: flex;
    height: 54px;
    justify-content: space-between;
    left: 0;
    padding: 7px 13px;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 8;
  }

  .mobile-turn-strip strong {
    color: #f0ca65;
    font-size: clamp(13px, 3.5vw, 17px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mobile-turn-strip span {
    color: #fff7df;
    font-size: clamp(11px, 3vw, 15px);
    max-width: 48%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-active-tile {
    background-image: var(--mobile-tile-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    bottom: 0;
    left: 0;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 54px;
  }

  .mobile-tile-shade {
    background:
      linear-gradient(180deg, rgba(5, 7, 7, 0.7) 0%, rgba(5, 7, 7, 0.12) 24%, rgba(5, 7, 7, 0.14) 56%, rgba(5, 7, 7, 0.88) 82%, rgba(5, 7, 7, 0.97) 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.48), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.48));
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
  }

  .mobile-tile-heading {
    filter: drop-shadow(0 3px 4px #000);
    left: 88px;
    position: absolute;
    right: 14px;
    text-align: center;
    top: 17px;
    z-index: 5;
  }

  .mobile-tile-heading span {
    color: #f2cf73;
    font-size: clamp(11px, 3vw, 15px);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .mobile-tile-heading h2 {
    color: #fff8e6;
    font-size: clamp(28px, 8.4vw, 50px);
    line-height: 0.95;
    margin: 3px 0 5px;
    text-shadow: 0 2px 2px #000, 0 0 14px #000;
  }

  .mobile-tile-heading p,
  .mobile-tile-heading small {
    display: block;
    font-size: clamp(10px, 2.8vw, 14px);
    margin: 2px 0;
  }

  .mobile-tile-claim {
    filter: drop-shadow(0 3px 5px #000) drop-shadow(0 0 8px var(--mobile-focus-color));
    height: 68px;
    left: 12px;
    object-fit: contain;
    position: absolute;
    top: 14px;
    width: 68px;
    z-index: 6;
  }

  .mobile-tile-fortifications {
    align-items: end;
    display: flex;
    gap: 2px;
    justify-content: center;
    left: 50%;
    max-width: calc(100% - 24px);
    position: absolute;
    top: clamp(126px, 20vh, 170px);
    transform: translateX(-50%);
    width: max-content;
    z-index: 4;
  }

  .mobile-tile-fortifications img {
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.9));
    object-fit: contain;
  }

  .mobile-tile-fortifications .tower {
    height: clamp(54px, 9.5vh, 88px);
    max-width: 23vw;
  }

  .mobile-tile-fortifications .fortress {
    height: clamp(78px, 14vh, 120px);
    max-width: 54vw;
  }

  .mobile-focus-pieces {
    align-items: end;
    bottom: clamp(194px, 25vh, 238px);
    display: flex;
    justify-content: center;
    left: 5%;
    position: absolute;
    right: 5%;
    z-index: 3;
  }

  .mobile-focus-pieces img {
    filter: drop-shadow(0 9px 7px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 8px rgba(255, 245, 207, 0.36));
    height: min(39vh, 390px);
    margin-inline: clamp(-12px, -2vw, -4px);
    max-width: min(38vw, var(--mobile-piece-width));
    object-fit: contain;
    object-position: center bottom;
  }

  .mobile-tile-summary {
    bottom: 126px;
    left: 18px;
    position: absolute;
    right: 18px;
    text-align: center;
    text-shadow: 0 2px 3px #000;
    z-index: 5;
  }

  .mobile-tile-summary span {
    color: #f0ca65;
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .mobile-tile-summary p {
    color: #f9f2de;
    font-size: clamp(11px, 2.8vw, 14px);
    line-height: 1.28;
    margin: 4px auto 0;
    max-width: 650px;
  }

  .mobile-take-action,
  .mobile-target-confirm {
    background:
      linear-gradient(180deg, rgba(140, 102, 37, 0.98), rgba(72, 45, 13, 0.98));
    border: 1px solid #f0cc70;
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255, 246, 196, 0.35);
    color: #fff7da;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 700;
    min-height: 50px;
    text-shadow: 0 2px 2px #261305;
  }

  .mobile-take-action {
    bottom: 62px;
    left: 18px;
    position: absolute;
    right: 18px;
    width: calc(100% - 36px);
    z-index: 7;
  }

  .mobile-take-action:disabled {
    filter: grayscale(0.5);
    opacity: 0.65;
  }

  .mobile-scroll-cue {
    align-items: center;
    bottom: 7px;
    color: #ead8a6;
    display: flex;
    flex-direction: column;
    font-size: 10px;
    left: 50%;
    line-height: 1;
    position: absolute;
    text-decoration: none;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 6;
  }

  .mobile-scroll-cue b {
    font-family: Arial, sans-serif;
    font-size: 23px;
    font-weight: 400;
  }

  .mobile-feed-toast {
    background: rgba(5, 9, 10, 0.78);
    border: 1px solid rgba(217, 173, 69, 0.58);
    border-radius: 9px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.66);
    display: grid;
    gap: 4px;
    left: 50%;
    max-width: calc(100% - 34px);
    opacity: 0;
    padding: 12px 15px;
    position: absolute;
    top: 48%;
    transform: translate(-50%, -44%);
    transition: opacity 220ms ease, transform 220ms ease;
    width: min(620px, calc(100% - 34px));
    z-index: 10;
  }

  .mobile-feed-toast[hidden] {
    display: none;
  }

  .mobile-feed-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  .mobile-feed-toast.is-chat-bubble {
    background: rgba(12, 20, 23, 0.9);
    border-color: rgba(164, 205, 225, 0.7);
    border-radius: 17px 17px 4px 17px;
    left: auto;
    max-width: calc(100% - 104px);
    right: 12px;
    top: 16px;
    transform: translateY(-9px);
    width: min(330px, calc(100% - 104px));
  }

  .mobile-feed-toast.is-chat-bubble::after {
    border-left: 10px solid transparent;
    border-top: 10px solid rgba(164, 205, 225, 0.7);
    bottom: -10px;
    content: "";
    position: absolute;
    right: 0;
  }

  .mobile-feed-toast.is-chat-bubble.is-visible {
    transform: translateY(0);
  }

  .mobile-feed-toast.relevant-to-viewer {
    background: rgba(64, 53, 18, 0.91);
    border-color: #f7d875;
    box-shadow: 0 0 0 2px rgba(255, 224, 112, 0.22), 0 0 32px rgba(247, 201, 70, 0.38);
  }

  .mobile-feed-toast.is-chat-bubble.relevant-to-viewer::after {
    border-top-color: #f7d875;
  }

  .mobile-feed-toast strong {
    color: #f2ca5d;
    font-size: 15px;
  }

  .mobile-feed-toast span {
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
  }

  .mobile-action-layer,
  .mobile-target-layer {
    align-items: stretch;
    background: rgba(2, 4, 4, 0.86);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 140;
  }

  .mobile-action-layer[hidden],
  .mobile-target-layer[hidden] {
    display: none;
  }

  .mobile-action-dialog,
  .mobile-target-dialog {
    align-content: center;
    background:
      linear-gradient(180deg, rgba(25, 30, 27, 0.98), rgba(8, 11, 10, 0.99)),
      url("web/ambient-board-center.jpg") center / cover;
    border: 1px solid rgba(217, 173, 69, 0.58);
    display: grid;
    gap: 12px;
    min-height: 100%;
    overflow-y: auto;
    padding: 58px 20px 28px;
    position: relative;
    text-align: center;
    width: min(720px, 100%);
  }

  .mobile-action-dialog h2,
  .mobile-target-dialog h2 {
    color: #fff4d2;
    font-size: clamp(27px, 8vw, 44px);
    margin: 0;
  }

  .mobile-layer-close {
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #fff7df;
    font-family: Arial, sans-serif;
    font-size: 27px;
    height: 42px;
    line-height: 1;
    min-width: 42px;
    padding: 0 0 3px;
    position: absolute;
    right: 14px;
    top: 13px;
    width: 42px;
  }

  .mobile-action-options .turn-actions,
  .game-screen-widescreen .mobile-action-options .turn-actions {
    display: grid;
    gap: 9px;
    width: 100%;
  }

  .mobile-action-options .turn-action-row,
  .game-screen-widescreen .mobile-action-options .turn-action-row {
    display: grid;
    gap: 9px;
    min-width: 0;
    width: 100%;
  }

  .mobile-action-options form,
  .mobile-action-options button,
  .game-screen-widescreen .mobile-action-options form,
  .game-screen-widescreen .mobile-action-options button {
    margin: 0;
    min-width: 0;
    width: 100%;
  }

  .mobile-action-options .turn-actions button,
  .game-screen-widescreen .mobile-action-options .turn-actions button {
    font-size: 17px;
    min-height: 54px;
    padding: 11px 18px 14px;
  }

  .mobile-target-dialog {
    align-content: start;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .mobile-target-carousel {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    min-height: 0;
  }

  .mobile-target-arrow {
    background: rgba(21, 26, 24, 0.88);
    border: 1px solid rgba(217, 173, 69, 0.64);
    border-radius: 999px;
    color: #f3d477;
    font-size: 25px;
    height: 44px;
    padding: 0;
    width: 44px;
  }

  .mobile-target-preview {
    align-self: stretch;
    display: grid;
    min-height: 0;
    place-items: center;
  }

  .mobile-target-preview .current-space-preview {
    max-width: 430px;
    width: 100%;
  }

  .mobile-target-preview .current-space-art {
    max-height: 58svh;
    object-fit: contain;
    width: min(100%, 360px);
  }

  .mobile-target-confirm {
    margin: 0 auto;
    width: min(420px, 100%);
  }

  .game-screen .game-stage,
  .game-screen.game-screen-widescreen .game-stage {
    display: block;
    min-width: 0;
    padding: 12px;
    width: 100%;
  }

  .game-screen .board-viewport,
  .game-screen .left-side-stack,
  .game-screen .space-hover-bubble,
  .game-screen .miniature-hover-preview {
    display: none !important;
  }

  .game-screen .right-side-stack,
  .game-screen.game-screen-widescreen .right-side-stack {
    bottom: auto;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    left: auto;
    min-width: 0;
    overflow: visible;
    pointer-events: auto;
    position: static;
    right: auto;
    top: auto;
    width: 100%;
  }

  .game-screen .right-player-stack,
  .game-screen.game-screen-widescreen .right-player-stack,
  .game-screen .right-table-stack,
  .game-screen.game-screen-widescreen .right-table-stack {
    bottom: auto;
    display: grid;
    gap: 12px;
    grid-column: 1;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    left: auto;
    position: static;
    right: auto;
    top: auto;
    width: 100%;
  }

  .game-screen .right-side-stack .player-side-panel,
  .game-screen.game-screen-widescreen .right-side-stack .player-side-panel,
  .game-screen .right-side-stack .current-space-preview,
  .game-screen.game-screen-widescreen .right-side-stack .current-space-preview,
  .game-screen .right-side-stack .kept-cards-panel,
  .game-screen.game-screen-widescreen .right-side-stack .kept-cards-panel,
  .game-screen .right-side-stack .table-status-panel,
  .game-screen.game-screen-widescreen .right-side-stack .table-status-panel,
  .game-screen .right-side-stack .board-chat,
  .game-screen.game-screen-widescreen .right-side-stack .board-chat,
  .game-screen .board-chat-composer,
  .game-screen.game-screen-widescreen .board-chat-composer {
    bottom: auto;
    display: grid;
    grid-column: 1;
    grid-row: auto;
    height: auto;
    left: auto;
    max-height: none;
    min-height: 0;
    position: static;
    right: auto;
    top: auto;
    width: 100%;
  }

  .game-screen .right-side-stack .player-side-panel,
  .game-screen.game-screen-widescreen .right-side-stack .player-side-panel {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .game-screen .right-side-stack .side-miniature-stage,
  .game-screen.game-screen-widescreen .right-side-stack .side-miniature-stage {
    cursor: default;
    min-height: 150px;
  }

  .game-screen .right-side-stack .side-miniature,
  .game-screen.game-screen-widescreen .right-side-stack .side-miniature {
    height: 145px;
  }

  .game-screen .right-side-stack .table-status-panel,
  .game-screen.game-screen-widescreen .right-side-stack .table-status-panel {
    background: rgba(9, 11, 9, 0.82);
    border: 1px solid rgba(244, 236, 216, 0.16);
    border-radius: 8px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
    padding: 10px;
  }

  .game-screen .board-turn-summary,
  .game-screen-widescreen .board-turn-summary {
    display: grid;
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    min-height: 0;
    padding: 8px;
  }

  .game-screen-widescreen .board-turn-summary .eyebrow {
    grid-column: 1;
    grid-row: 1;
  }

  .game-screen-widescreen .board-turn-summary > strong {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .game-screen-widescreen .board-turn-summary > span:not(.turn-timer) {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .game-screen-widescreen .board-turn-summary .turn-timer {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .game-screen .board-player-grid,
  .game-screen-widescreen .board-player-grid {
    display: grid;
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(110px, auto);
    height: auto;
    padding: 6px;
    position: static;
  }

  .game-screen .board-player-token,
  .game-screen-widescreen .board-player-token {
    height: 122px;
    min-height: 122px;
  }

  .game-screen .board-kept-cards,
  .game-screen.game-screen-widescreen .board-kept-cards {
    grid-column: 1;
    grid-row: auto;
    max-height: none;
    position: static;
    width: 100%;
  }

  .game-screen .right-side-stack .board-chat .board-chat-log,
  .game-screen.game-screen-widescreen .right-side-stack .board-chat .board-chat-log {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    max-height: 62svh;
    min-height: 330px;
    padding: 8px;
  }

  .game-screen-widescreen .board-chat.chat-panel::before {
    color: #fff4d4;
    content: "Game Chat";
    font-size: 15px;
    font-weight: 700;
  }

  .game-screen .board-chat-composer .chat-form,
  .game-screen.game-screen-widescreen .board-chat-composer .chat-form,
  .game-screen .board-chat .chat-form {
    display: grid;
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    width: 100%;
  }

  .game-screen .board-chat-composer .chat-form input,
  .game-screen.game-screen-widescreen .board-chat-composer .chat-form input,
  .game-screen .board-chat .chat-form input,
  .game-screen .board-chat-composer .chat-form button,
  .game-screen.game-screen-widescreen .board-chat-composer .chat-form button,
  .game-screen .board-chat .chat-form button {
    font-size: 15px;
    height: 42px;
    min-height: 42px;
  }

  .game-screen .game-table-footer,
  .game-screen.game-screen-classic .game-table-footer.table-management-panel,
  .game-screen.game-screen-widescreen .game-table-footer {
    bottom: auto;
    left: auto;
    margin: 0 12px 18px;
    max-width: none;
    position: static;
    right: auto;
    width: calc(100% - 24px);
  }

  .game-screen .game-table-footer.table-management-panel form,
  .game-screen .game-table-footer.table-management-panel .table-footer-button,
  .game-screen.game-screen-widescreen .game-table-footer.table-management-panel form,
  .game-screen.game-screen-widescreen .game-table-footer.table-management-panel .table-footer-button {
    flex: 1 1 145px;
  }

  .game-screen .card-choice-layer,
  .game-screen .travel-gate-choice-layer,
  .game-screen .table-confirm-layer {
    position: fixed;
    z-index: 145;
  }
}

@media (max-width: 430px) {
  .mobile-tile-heading {
    left: 78px;
    right: 8px;
  }

  .mobile-tile-claim {
    height: 60px;
    left: 9px;
    width: 60px;
  }

  .mobile-focus-pieces img {
    height: min(35vh, 310px);
  }

  .mobile-tile-summary {
    bottom: 124px;
  }

  .game-screen .board-player-grid,
  .game-screen-widescreen .board-player-grid {
    grid-template-columns: 1fr;
  }
}
