:root {
  --bg-deep: #0a0612;
  --bg-mid: #120a1c;
  --hex-stroke: #ff2d95;
  --hex-fill: rgba(255, 45, 149, 0.06);
  --hex-stroke-muted: rgba(255, 45, 149, 0.35);
  --text: #f4e8ff;
  --text-dim: rgba(244, 232, 255, 0.55);
  --panel-border: rgba(255, 45, 149, 0.22);
  --header-pad: 1rem 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, var(--bg-mid), var(--bg-deep));
  color: var(--text);
  font-family: system-ui, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

.landing {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.landing[hidden] {
  display: none;
}

.landing__inner {
  width: min(1280px, 100%);
  border: none;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(20, 12, 34, 0.85), rgba(10, 6, 18, 0.78));
  padding: 1.1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.landing__title {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  align-self: center;
  text-align: center;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffe9a8;
  text-shadow:
    0 0 8px rgba(255, 213, 74, 0.38),
    0 0 20px rgba(255, 213, 74, 0.2);
  position: relative;
}

.landing__title::before,
.landing__title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(48px, 10vw, 120px);
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 213, 74, 0), rgba(255, 213, 74, 0.7), rgba(255, 213, 74, 0));
  opacity: 0.75;
  transform: translateY(-50%);
}

.landing__title::before {
  left: calc(-1 * clamp(48px, 10vw, 120px) - 0.65rem);
}

.landing__title::after {
  right: calc(-1 * clamp(48px, 10vw, 120px) - 0.65rem);
}

.landing__subtitle {
  margin: 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.beast-choice-grid {
  --beast-choice-width: 118px;
  --beast-choice-gap: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--beast-choice-gap);
  padding: 0.3rem;
}

.beast-choice-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--beast-choice-gap);
  align-items: stretch;
}

.beast-choice-unlocked {
  display: flex;
  flex-direction: column;
  gap: var(--beast-choice-gap);
  align-items: center;
}

.beast-choice-unlocked__title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 229, 191, 0.95);
}

.beast-choice-unlocked__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--beast-choice-width, 118px));
  gap: var(--beast-choice-gap);
  width: max-content;
  max-width: min(760px, 100%);
  margin-inline: auto;
  justify-content: center;
}

.beast-choice-tab {
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--beast-choice-gap);
  padding: 0.38rem 0.56rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 164, 116, 0.22);
  background: linear-gradient(90deg, rgba(255, 83, 174, 0.09), rgba(255, 187, 70, 0.05));
  color: #ffe4bc;
  cursor: pointer;
  white-space: nowrap;
}

.beast-choice-tab:hover {
  border-color: rgba(255, 224, 174, 0.42);
}

.beast-choice-tab.is-active {
  border-color: rgba(255, 213, 74, 0.62);
  box-shadow: 0 0 0 1px rgba(255, 213, 74, 0.32), 0 0 10px rgba(255, 213, 74, 0.1);
  background: linear-gradient(90deg, rgba(255, 83, 174, 0.14), rgba(255, 187, 70, 0.09));
}

.beast-choice-tab__title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.beast-choice-panels {
  padding: 0;
  min-height: 340px;
  margin-top: 0.75rem;
}

.beast-choice-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  column-gap: 1rem;
  row-gap: var(--beast-choice-gap);
  overflow-x: auto;
}

.beast-choice-panel[hidden] {
  display: none !important;
}

.beast-choice-panel.is-active {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1rem;
  row-gap: var(--beast-choice-gap);
}

.beast-choice-subsection {
  display: flex;
  flex-direction: column;
  gap: var(--beast-choice-gap);
  padding: 0;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

.beast-choice-subsection__title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe6bf;
  width: 100%;
  white-space: nowrap;
  padding: 0.26rem 0.55rem;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 83, 174, 0.34), rgba(255, 187, 70, 0.24));
  border: 1px solid rgba(255, 186, 128, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.beast-choice-subsection__grid {
  display: grid;
  grid-template-columns: repeat(
    var(--section-columns, 3),
    minmax(0, var(--beast-choice-width, 118px))
  );
  gap: var(--beast-choice-gap);
}

.beast-choice {
  font: inherit;
  color: var(--text);
  background: rgba(15, 10, 24, 0.86);
  border: 1px solid rgba(255, 45, 149, 0.25);
  border-radius: 12px;
  padding: 0.42rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--beast-choice-gap);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--beast-choice-width, 118px);
}

.beast-choice img {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255, 45, 149, 0.4);
}

.beast-choice__placeholder {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  border: 2px solid rgba(255, 45, 149, 0.4);
  background: radial-gradient(circle at 30% 20%, #41205f, #1a1028);
}

.beast-choice span {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.beast-choice:hover {
  border-color: rgba(255, 45, 149, 0.7);
}

.beast-choice.is-selected {
  border-color: #ffd54a;
  box-shadow: 0 0 0 1px rgba(255, 213, 74, 0.9), 0 0 18px rgba(255, 213, 74, 0.3);
}

.beast-choice.is-selected img {
  border-color: #ffd54a;
}

.beast-choice.is-selected .beast-choice__placeholder {
  border-color: #ffd54a;
}

.beast-choice.is-locked {
  cursor: not-allowed;
  border-color: rgba(168, 150, 190, 0.38);
  background: rgba(10, 7, 18, 0.92);
}

.beast-choice.is-locked img,
.beast-choice.is-locked .beast-choice__placeholder {
  filter: grayscale(0.5) blur(1.2px) brightness(0.55);
}

.beast-choice.is-locked span {
  color: rgba(244, 232, 255, 0.72);
}

.beast-choice.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 6, 14, 0.35), rgba(8, 6, 14, 0.62));
  pointer-events: none;
}

.beast-choice__lock-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 235, 170, 0.62);
  background: rgba(16, 10, 26, 0.88);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.landing__start {
  align-self: center;
  margin-top: 0.75rem;
  margin-bottom: 3rem;
  min-width: min(420px, 100%);
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #120a1c;
  background: linear-gradient(180deg, #ffd54a, #ffb800);
  cursor: pointer;
  box-shadow: 0 0 22px rgba(255, 190, 20, 0.34);
}

.landing__start:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.main-row[hidden] {
  display: none;
}

.site-header {
  flex-shrink: 0;
  padding: var(--header-pad);
  text-align: center;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(18, 10, 28, 0.95), rgba(10, 6, 18, 0.6));
}

.site-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-indent: 0.28em;
}

.panel-active-footer {
  margin-top: auto;
  width: 100%;
  max-width: 14rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.panel-active-footer[hidden] {
  display: none;
}

.column-yield-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
  color: var(--text-dim);
}

@keyframes turn-avatar-glow-you {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 0 18px rgba(126, 203, 255, 0.5),
      0 0 36px rgba(126, 203, 255, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 0 30px rgba(126, 203, 255, 0.75),
      0 0 52px rgba(126, 203, 255, 0.32);
  }
}

@keyframes turn-avatar-glow-rival {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 0 18px rgba(201, 160, 255, 0.5),
      0 0 36px rgba(201, 160, 255, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 0 30px rgba(232, 184, 255, 0.72),
      0 0 52px rgba(201, 160, 255, 0.32);
  }
}

.panel--active-turn {
  position: relative;
  background: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(255, 45, 149, 0.14), transparent 62%);
}

.panel--active-turn::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 45, 149, 0.2);
  border-radius: 2px;
  box-shadow: inset 0 0 40px rgba(255, 45, 149, 0.08);
}

.panel--you.panel--active-turn {
  background: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(126, 203, 255, 0.16), transparent 62%);
}

.panel--you.panel--active-turn::before {
  border-color: rgba(126, 203, 255, 0.35);
  box-shadow: inset 0 0 48px rgba(126, 203, 255, 0.1);
}

.panel--rival.panel--active-turn {
  background: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(201, 160, 255, 0.18), transparent 62%);
}

.panel--rival.panel--active-turn::before {
  border-color: rgba(232, 184, 255, 0.4);
  box-shadow: inset 0 0 48px rgba(201, 160, 255, 0.12);
}

.panel--idle-turn {
  filter: saturate(0.9);
}

.panel--idle-turn .panel__beast,
.panel--idle-turn .panel__epithet,
.panel--idle-turn .avatar,
.panel--idle-turn .panel__track,
.panel--idle-turn .action-deck {
  opacity: 0.76;
}

.panel--active-turn .avatar--you {
  animation: turn-avatar-glow-you 1.45s ease-in-out infinite;
}

.panel--active-turn .avatar--rival {
  animation: turn-avatar-glow-rival 1.45s ease-in-out infinite;
}

.main-row {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(18rem, 3.1fr) minmax(11rem, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 0;
}

.cool-hud {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  min-width: 6.2rem;
  padding: 0.5rem 0.95rem 0.58rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 14, 36, 0.94), rgba(8, 4, 14, 0.9));
  border: 1px solid rgba(255, 45, 149, 0.52);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 18px rgba(0, 0, 0, 0.42);
}

.cool-hud--player {
  justify-self: start;
  align-items: flex-start;
}

.cool-hud--rival {
  justify-self: end;
  align-items: flex-end;
}

.cool-hud__label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 232, 255, 0.82);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.12);
}

.cool-hud__value {
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
}

.cool-hud__rounds-label {
  margin-top: 0.15rem;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 232, 255, 0.68);
}

.cool-hud__rounds-value {
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
}

.cool-hud--player .cool-hud__value {
  color: #b8e8ff;
  text-shadow: 0 0 18px rgba(126, 203, 255, 0.72);
}
.cool-hud--player .cool-hud__rounds-value {
  color: #b8e8ff;
  text-shadow: 0 0 10px rgba(126, 203, 255, 0.55);
}

.cool-hud--player {
  border-color: rgba(126, 203, 255, 0.78);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 22px rgba(126, 203, 255, 0.28);
}

.cool-hud--rival .cool-hud__value {
  color: #e8c8ff;
  text-shadow: 0 0 18px rgba(201, 160, 255, 0.72);
}
.cool-hud--rival .cool-hud__rounds-value {
  color: #e8c8ff;
  text-shadow: 0 0 10px rgba(201, 160, 255, 0.55);
}

.cool-hud--rival {
  border-color: rgba(201, 160, 255, 0.82);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 22px rgba(201, 160, 255, 0.28);
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  min-height: 0;
  border-right: 1px solid var(--panel-border);
}

.panel:last-child {
  border-right: none;
}

.panel__identity {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  align-self: stretch;
  position: relative;
  padding-top: 1.55rem;
}

.panel--rival .panel__identity {
  flex-direction: row-reverse;
}

.panel__round-chip {
  position: absolute;
  top: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0;
}

.panel__round-chip--you {
  right: 0.05rem;
}

.panel__round-chip--rival {
  left: 0.05rem;
}

.panel__round-chip-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.panel__round-chip-value {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1;
}

.panel__round-chip--you .panel__round-chip-value {
  color: #b8e8ff;
  text-shadow: 0 0 8px rgba(126, 203, 255, 0.5);
}

.panel__round-chip--rival .panel__round-chip-value {
  color: #e8c8ff;
  text-shadow: 0 0 8px rgba(201, 160, 255, 0.5);
}

.panel__identity-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.panel__epithet {
  margin: 0;
  max-width: none;
  font-size: 0.78rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.35;
  color: var(--text-dim);
}

.panel__score {
  margin: 0.55rem 0 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.42rem;
}

.panel__score-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.panel__score-value {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

.panel--you .panel__score-value {
  color: #b8e8ff;
  text-shadow: 0 0 10px rgba(126, 203, 255, 0.35);
}

.panel--rival .panel__score-value {
  color: #e8c8ff;
  text-shadow: 0 0 10px rgba(201, 160, 255, 0.35);
}

.panel--you .panel__beast,
.panel--you .panel__epithet {
  text-align: left;
}

.panel--rival .panel__beast,
.panel--rival .panel__epithet {
  text-align: right;
}

.panel__beast {
  margin: 0;
  font-size: clamp(1.22rem, 2.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.avatar {
  width: min(10.875rem, 39vw);
  aspect-ratio: 1;
  margin-top: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--hex-stroke);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(255, 45, 149, 0.2);
  flex-shrink: 0;
}

.avatar--you {
  border-color: #7ecbff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(126, 203, 255, 0.25);
}

.avatar--rival {
  border-color: #c9a0ff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(201, 160, 255, 0.25);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.avatar--rival img {
  transform: scaleX(-1);
}

.panel__track {
  margin: 1.2rem 0 0.4rem;
  width: 100%;
  max-width: 14rem;
  font-size: 0.8rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text);
}

.panel__track:empty {
  margin-top: 0;
  margin-bottom: 0;
  min-height: 0;
}

.ap-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.62rem;
  padding: 0.25rem 0 0.3rem;
}

.ap-label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-indent: 0.22em;
  color: var(--text-dim);
}

.ap-meter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.ap-pip {
  display: block;
  width: 11px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(12, 10, 22, 0.72);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55);
}

.panel--you .ap-pip--on {
  background: linear-gradient(165deg, #e8fbff 0%, #7ecbff 45%, #4a9fd4 100%);
  box-shadow:
    0 0 12px rgba(126, 203, 255, 0.7),
    0 0 24px rgba(126, 203, 255, 0.28);
}

.panel--rival .ap-pip--on {
  background: linear-gradient(165deg, #fff0ff 0%, #d4a8ff 40%, #9b6ec9 100%);
  box-shadow:
    0 0 12px rgba(201, 160, 255, 0.65),
    0 0 24px rgba(201, 160, 255, 0.24);
}

.ap-count {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.ap-count__sep {
  margin: 0 0.15em;
  font-weight: 500;
  color: var(--text-dim);
  opacity: 0.75;
}

.ap-count__max {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-dim);
}

.panel--board {
  position: relative;
  border-right: 1px solid var(--panel-border);
  padding: 0.75rem 0.75rem 1.25rem;
}

.board-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0;
  margin-bottom: 0.4rem;
  width: 100%;
}

.board-header__spacer {
  min-width: 1.25rem;
}

.board-hint {
  margin: 0;
  padding: 0;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.16rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffe9a8;
  text-align: center;
  line-height: 1.1;
  position: relative;
  z-index: 2;
}

.board-hint::before,
.board-hint::after {
  content: "";
  position: absolute;
  top: 0.78rem;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 213, 74, 0), rgba(255, 213, 74, 0.7), rgba(255, 213, 74, 0));
  opacity: 0.75;
}

.board-hint::before {
  right: calc(100% + 0.95rem);
}

.board-hint::after {
  left: calc(100% + 0.95rem);
}

.board-hint__round {
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1;
  color: #ffe9a8;
  text-shadow:
    0 0 8px rgba(255, 213, 74, 0.38),
    0 0 20px rgba(255, 213, 74, 0.2);
}

.board-hint__turn {
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.1;
  color: rgba(255, 238, 190, 0.98);
  text-shadow: 0 0 10px rgba(255, 213, 74, 0.2);
}

.hex-editor {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(10, 6, 18, 0.86);
  border: 1px solid rgba(255, 170, 120, 0.3);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.4);
}

.hex-editor__toggle,
.hex-editor__picker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(244, 232, 255, 0.86);
}

.hex-editor__toggle input {
  accent-color: #ffd54a;
}

.hex-editor__select {
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 239, 201, 0.96);
  background: rgba(18, 10, 30, 0.9);
  border: 1px solid rgba(255, 170, 120, 0.4);
  border-radius: 999px;
  padding: 0.26rem 0.65rem;
}

.hex-editor__btn {
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 239, 201, 0.95);
  background: rgba(18, 10, 30, 0.9);
  border: 1px solid rgba(255, 170, 120, 0.4);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}

.hex-editor__btn:hover {
  border-color: rgba(255, 223, 168, 0.8);
}

@media (max-width: 840px) {
  .board-header {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 0.4rem;
  }

  .board-header__spacer {
    display: none;
  }

  .cool-hud--player,
  .cool-hud--rival {
    justify-self: center;
    align-items: center;
  }

  .board-hint::before,
  .board-hint::after {
    display: none;
  }
}

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 3, 10, 0.72);
  backdrop-filter: blur(4px);
}

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

.result-overlay__card {
  width: min(34rem, 100%);
  padding: 1.1rem 1rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 213, 74, 0.68);
  background: linear-gradient(180deg, rgba(40, 22, 58, 0.98), rgba(17, 10, 28, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 34px rgba(255, 213, 74, 0.26);
  text-align: center;
}

.result-overlay__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 233, 168, 0.9);
}

.result-overlay__title {
  margin: 0.25rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ffe9a8;
  text-shadow: 0 0 16px rgba(255, 213, 74, 0.34);
}

.result-overlay__body {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(244, 232, 255, 0.88);
}

.result-overlay__button {
  margin-top: 0.95rem;
  min-width: 10.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #120a1c;
  background: linear-gradient(180deg, #ffd54a, #ffb800);
  box-shadow: 0 0 22px rgba(255, 190, 20, 0.34);
  cursor: pointer;
}

.ui-tooltip {
  position: fixed;
  z-index: 70;
  max-width: 280px;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 213, 74, 0.58);
  background: rgba(12, 8, 22, 0.95);
  color: #ffe9a8;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.35;
  box-shadow: 0 0 14px rgba(255, 213, 74, 0.2);
  pointer-events: none;
}

.ui-tooltip__title {
  font-size: 0.74rem;
  font-weight: 900;
  color: #fff2c3;
  line-height: 1.25;
}

.ui-tooltip__body {
  margin-top: 0.2rem;
  color: rgba(244, 232, 255, 0.78);
  white-space: pre-line;
  font-weight: 600;
}

.action-deck {
  flex-shrink: 0;
  align-self: stretch;
  width: 100%;
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.action-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.32rem;
  margin-bottom: 0.15rem;
}

.action-tab {
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(18, 12, 28, 0.6);
  border: 1px solid rgba(126, 203, 255, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.2rem;
  cursor: pointer;
}

.action-tab.is-active {
  color: var(--text);
  border-color: rgba(255, 213, 74, 0.72);
  background: rgba(255, 213, 74, 0.12);
}

.action-slot[hidden] {
  display: none;
}

.panel__track:empty + .action-deck {
  margin-top: 0.85rem;
}

.action-slot {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.5rem 0.35rem;
  border-radius: 12px;
  background: rgba(18, 10, 32, 0.4);
  transition: opacity 120ms ease, filter 120ms ease;
  position: relative;
}

.action-slot[data-category][data-action-index] {
  cursor: pointer;
}

.action-slot.is-selected-action {
  box-shadow:
    0 0 0 1px rgba(255, 213, 74, 0.72),
    inset 0 0 18px rgba(255, 213, 74, 0.08);
}

.action-slot.is-unavailable {
  opacity: 0.48;
  filter: saturate(0.72);
}

.action-slot__icon {
  flex-shrink: 0;
  width: 42px;
  min-height: 42px;
  align-self: center;
  position: relative;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: rgba(255, 245, 212, 0.88);
  text-shadow: 0 0 8px rgba(255, 213, 74, 0.35);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(40, 22, 52, 0.9), rgba(14, 10, 24, 0.95));
  border: 1px dashed rgba(255, 45, 149, 0.35);
  box-shadow: inset 0 0 12px rgba(255, 45, 149, 0.08);
}

.action-slot__icon-glyph {
  transition: opacity 120ms ease;
}

.action-slot__lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  font-size: 0.92rem;
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
}

.action-slot.is-unavailable .action-slot__icon-glyph {
  opacity: 0.15;
}

.action-slot.is-unavailable .action-slot__lock {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.panel--you .action-slot__icon {
  border-color: rgba(126, 203, 255, 0.4);
  box-shadow: inset 0 0 12px rgba(126, 203, 255, 0.1);
}

.panel--rival .action-slot__icon {
  border-color: rgba(201, 160, 255, 0.42);
  box-shadow: inset 0 0 12px rgba(201, 160, 255, 0.1);
}

.action-slot__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  text-align: left;
}

.action-slot__head {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.action-slot__meta {
  display: inline-block;
  margin-top: 0.08rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.action-slot__title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text);
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-slot__cost {
  flex-shrink: 0;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: right;
  color: #ffb8e8;
  text-shadow: 0 0 12px rgba(255, 45, 149, 0.35);
}

.action-slot.is-activated-action .action-slot__cost {
  color: #ffe36e;
  text-shadow: 0 0 10px rgba(255, 213, 74, 0.42);
}

.panel--you .action-slot__cost {
  color: #b8e8ff;
  text-shadow: 0 0 12px rgba(126, 203, 255, 0.4);
}

.panel--rival .action-slot__cost {
  color: #e8c8ff;
  text-shadow: 0 0 12px rgba(201, 160, 255, 0.4);
}

.action-slot__desc {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.42;
  color: var(--text);
  opacity: 0.82;
}

.end-turn {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.75rem;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-indent: 0.14em;
  color: #0a0612;
  background: linear-gradient(180deg, #ff6eb6, #ff2d95);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 0 20px rgba(255, 45, 149, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.end-turn:hover {
  filter: brightness(1.08);
}

.end-turn:active {
  transform: scale(0.98);
}

.board-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

#grid {
  width: 100%;
  max-width: min(100%, 936px);
  height: auto;
  max-height: min(94vh, calc(100vh - 9rem));
  filter: drop-shadow(0 0 12px rgba(255, 45, 149, 0.25));
}

#grid .hex-cell {
  stroke: var(--hex-stroke);
  stroke-width: 1.75;
  fill: url(#hex-light-normal);
  vector-effect: non-scaling-stroke;
  transition:
    fill 120ms ease,
    stroke 120ms ease,
    filter 120ms ease,
    opacity 120ms ease;
}

#grid .hex-cell.hex-light--deep-shadow {
  fill: url(#hex-light-deep-shadow);
  stroke: var(--hex-stroke);
}

#grid .hex-cell.hex-light--deep-shadow.is-edge,
#grid .hex-cell.hex-light--deep-shadow.has-player,
#grid .hex-cell.hex-light--deep-shadow.has-rival,
#grid .hex-cell.hex-light--deep-shadow.confirm-player,
#grid .hex-cell.hex-light--deep-shadow.confirm-rival {
  stroke: var(--hex-stroke);
}

#grid .hex-cell.hex-light--mild-shadow {
  fill: url(#hex-light-mild-shadow);
}

#grid .hex-cell.hex-light--normal {
  fill: url(#hex-light-normal);
}

#grid .hex-cell.hex-light--light {
  fill: url(#hex-light-light);
  filter: drop-shadow(0 0 6px rgba(255, 170, 230, 0.26));
}

#grid .hex-cell.hex-light--spotlight {
  fill: url(#hex-light-spotlight);
  filter: drop-shadow(0 0 9px rgba(255, 232, 168, 0.42));
}

/* Light-state outlines should take precedence over occupancy/edge overlays. */
#grid .hex-cell.hex-light--light.is-edge,
#grid .hex-cell.hex-light--light.has-player,
#grid .hex-cell.hex-light--light.has-rival,
#grid .hex-cell.hex-light--light.confirm-player,
#grid .hex-cell.hex-light--light.confirm-rival {
  stroke: var(--hex-stroke);
}

#grid .hex-cell.hex-light--spotlight.is-edge,
#grid .hex-cell.hex-light--spotlight.has-player,
#grid .hex-cell.hex-light--spotlight.has-rival,
#grid .hex-cell.hex-light--spotlight.confirm-player,
#grid .hex-cell.hex-light--spotlight.confirm-rival {
  stroke: var(--hex-stroke);
}

#grid .hex-cell.is-edge {
  stroke-width: 2.25;
}

#grid .hex-cell.has-player {
  stroke: #7ecbff;
  stroke-width: 2.2;
  filter: drop-shadow(0 0 6px rgba(126, 203, 255, 0.45));
}

#grid .hex-cell.confirm-player {
  stroke: #b8e8ff;
  stroke-width: 3;
  stroke-dasharray: 4 3;
  filter: drop-shadow(0 0 8px rgba(126, 203, 255, 0.7));
}

#grid .hex-cell.has-rival {
  stroke: #c9a0ff;
  stroke-width: 2.2;
  filter: drop-shadow(0 0 6px rgba(201, 160, 255, 0.45));
}

#grid .hex-cell.confirm-rival {
  stroke: #e8c8ff;
  stroke-width: 3;
  stroke-dasharray: 4 3;
  filter: drop-shadow(0 0 8px rgba(201, 160, 255, 0.7));
}

#grid .reachable-track-marker {
  pointer-events: none;
  --track-color: #ffd54a;
}

#grid .reachable-track-marker[data-owner="player"] {
  --track-color: #7ecbff;
}

#grid .reachable-track-marker[data-owner="rival"] {
  --track-color: #c9a0ff;
}

#grid .reachable-track-marker__bg {
  fill: rgba(12, 8, 22, 0.32);
  stroke: var(--track-color);
  stroke-width: 1.2;
}

#grid .reachable-track-marker__icon {
  fill: var(--track-color);
  opacity: 0.95;
}

#grid #tile-mood-overlays {
  pointer-events: none;
}

#grid .tile-sparkle {
  filter: drop-shadow(0 0 2.5px rgba(255, 228, 132, 0.52));
}

#grid .tile-sparkle__star {
  fill: none;
  stroke: rgba(255, 246, 212, 0.52);
  stroke-width: 0.9;
  stroke-linecap: round;
}

#grid .tile-sparkle__star--a {
  opacity: 0.92;
}

#grid .tile-sparkle__star--b {
  opacity: 0.5;
}

#grid .tile-light-mood {
  filter: blur(0.35px) drop-shadow(0 0 2.5px rgba(255, 210, 246, 0.28));
}

#grid .tile-light-mood circle:first-child {
  fill: rgba(255, 214, 244, 0.28);
}

#grid .tile-light-mood circle:last-child {
  fill: rgba(255, 235, 250, 0.34);
}

#grid .tile-shadow-mood {
  filter: blur(1.8px);
}

#grid .tile-shadow-mood--deep {
  filter: blur(2.4px);
  opacity: 1;
}

#grid .tile-shadow-mood--mild {
  filter: blur(1.45px);
  opacity: 0.9;
}

#grid .tile-shadow-mood--mild ellipse:first-child {
  fill: rgba(14, 6, 26, 0.68);
}

#grid .tile-shadow-mood--mild ellipse:last-child {
  fill: rgba(4, 1, 10, 0.56);
}

#grid .tile-shadow-mood ellipse:first-child {
  fill: rgba(20, 10, 36, 0.34);
}

#grid .tile-shadow-mood ellipse:last-child {
  fill: rgba(8, 4, 16, 0.24);
}

#grid .tile-shadow-mood--deep ellipse:first-child {
  fill: rgba(2, 1, 8, 0.78);
}

#grid .tile-shadow-mood--deep ellipse:last-child {
  fill: rgba(0, 0, 4, 0.62);
}

#grid .actor,
#grid .actor-image {
  pointer-events: none;
}

#grid #actors-root > g.actor-layer--motion-ready {
  transition: transform 260ms cubic-bezier(0.22, 0.85, 0.32, 1);
  will-change: transform;
}

#grid #confirm-prompt-layer {
  pointer-events: none;
}

#grid .confirm-action-label {
  fill: #ffe36e;
  font-size: 6.2px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#grid .actor-image {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

#grid .actor-image.actor-image--confirm-blur {
  filter: blur(1.4px) brightness(0.9) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

@keyframes actor-pose-ring-pulse {
  0%,
  100% {
    stroke: rgba(255, 227, 110, 0.8);
    opacity: 0.72;
    stroke-width: 1.6;
    filter: drop-shadow(0 0 6px rgba(255, 227, 110, 0.68));
  }
  50% {
    stroke: rgba(255, 246, 196, 0.98);
    opacity: 1;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 10px rgba(255, 227, 110, 0.94));
  }
}

#grid .actor-pose-ring {
  fill: none;
  stroke: rgba(255, 227, 110, 0);
  stroke-width: 0;
  opacity: 0;
  pointer-events: none;
}

#grid .actor--pose-active .actor-pose-ring {
  animation: actor-pose-ring-pulse 1.1s ease-in-out infinite;
}

@media (max-width: 840px) {
  .main-row {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }

  .panel--board {
    order: -1;
    border-bottom: 1px solid var(--panel-border);
  }

  .avatar {
    width: min(12rem, 60vw);
  }
}
