@font-face {
  font-family: "Jura";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/jura/jura-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: "Jura";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/jura/jura-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Jura";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/jura/jura-latin-700.woff2") format("woff2");
}

@font-face {
  font-family: "Russo One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/russo-one/russo-one-latin-400.woff2") format("woff2");
}

:root {
  --game-scale: 1;
  --game-bleed-x: 0px;
  --game-width: 1200px;
  --game-height: 675px;
  --font-display: "Russo One", "Arial Narrow", sans-serif;
  --font-ui: "Jura", "Arial Narrow", sans-serif;
  --battle-bg: url("assets/generated-art/environment/mars-research-station.webp");
  --menu-bg: url("assets/generated-art/environment/martian-city-menu.webp");
  --ink: #17202a;
  --ink-soft: #5f6870;
  --glass: rgba(21, 28, 34, 0.78);
  --paper: #f5f0e4;
  --paper-edge: #d7c9a8;
  --gold: #b98a2d;
  --gold-bright: #e2bc66;
  --cyan: #35b8d9;
  --friendly: #3b927f;
  --friendly-dark: #174f58;
  --enemy: #d7d8d3;
  --enemy-dark: #242a2b;
  --good: #64ba83;
  --rail-w: 126px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-synthesis: none;
  text-transform: uppercase;
  background: #cdd9dc;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  background:
    linear-gradient(rgba(210, 104, 51, 0.12), rgba(78, 42, 24, 0.24)),
    var(--battle-bg) center / cover no-repeat,
    #9b5f39;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(1px);
}

body::before {
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0.32;
  background:
    radial-gradient(ellipse at 50% 74%, transparent 0 33%, rgba(48, 29, 14, 0.24) 78%),
    linear-gradient(180deg, rgba(255, 230, 180, 0.08), rgba(63, 39, 20, 0.12));
  filter: none;
}

body::after {
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0.08;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.35) 0,
    rgba(255, 255, 255, 0.35) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: soft-light;
  filter: none;
}

button {
  font: inherit;
  text-transform: uppercase;
}

.hud__menu,
.hud__label,
.hud__val,
.rail__label,
.command-panel__action,
.end-turn,
.phase-label,
.banner h2,
.banner button,
.rotate-device strong,
.discard-selected__label {
  font-family: var(--font-display);
  font-weight: 400;
}

#app,
.title-screen,
.submenu-screen {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  width: var(--game-width);
  height: var(--game-height);
  overflow: visible;
  transform: translate(-50%, -50%) scale(var(--game-scale));
  transform-origin: center;
}

#app[hidden],
.title-screen[hidden],
.submenu-screen[hidden] {
  display: none;
}

.title-screen {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f5e5b7;
  background:
    linear-gradient(180deg, rgba(6, 9, 8, 0.1), rgba(18, 11, 8, 0.6)),
    var(--menu-bg) center 50% / cover no-repeat,
    #6b3828;
  isolation: isolate;
}

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

.title-screen::before {
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(168, 74, 36, 0.02) 0 22%, rgba(7, 10, 9, 0.24) 54%, rgba(3, 5, 5, 0.76) 100%),
    linear-gradient(90deg, rgba(4, 7, 6, 0.68), transparent 30% 70%, rgba(4, 7, 6, 0.68)),
    repeating-linear-gradient(90deg, rgba(224, 166, 76, 0.07) 0 1px, transparent 1px 64px);
}

.title-screen::after {
  z-index: 5;
  inset: 0;
  opacity: 0.13;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.25) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: soft-light;
}

.title-screen__wash {
  position: absolute;
  z-index: -1;
  top: -130px;
  left: 50%;
  width: 780px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 74, 44, 0.28), rgba(116, 32, 25, 0.1) 48%, transparent 70%);
  transform: translateX(-50%);
  filter: blur(5px);
}

.title-screen__planet {
  position: absolute;
  z-index: -1;
  top: -174px;
  left: 37%;
  width: 470px;
  height: 470px;
  border: 2px solid rgba(241, 158, 72, 0.4);
  border-radius: 50%;
  background:
    repeating-linear-gradient(8deg, transparent 0 22px, rgba(255, 198, 116, 0.08) 23px 25px),
    radial-gradient(circle at 36% 30%, #e6a267, #9e3e2d 48%, #401918 72%, #140d0e);
  box-shadow:
    0 0 60px rgba(190, 66, 40, 0.48),
    inset -50px -35px 70px rgba(5, 7, 8, 0.72);
  transform: translateX(-50%);
  opacity: 0.82;
}

.title-screen__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 700px 280px;
  align-items: center;
  gap: 54px;
  width: 1034px;
  margin-top: 42px;
  text-align: center;
}

.title-screen__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.game-logo {
  position: relative;
  display: grid;
  justify-items: center;
  width: 690px;
  padding: 24px 34px 30px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.55));
}

.game-logo::before,
.game-logo::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 3px;
  background:
    linear-gradient(90deg, transparent, #d29b3f 12% 88%, transparent),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(75, 40, 18, 0.7) 18px 20px);
  box-shadow: 0 1px rgba(255, 230, 164, 0.32), 0 0 16px rgba(203, 116, 45, 0.25);
}

.game-logo::before {
  top: 12px;
}

.game-logo::after {
  bottom: 14px;
}

.game-logo__killer,
.game-logo__from,
.game-logo__kosmonauts,
.game-logo__mars {
  display: block;
  width: 100%;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
}

.game-logo__killer,
.game-logo__from {
  font-family: var(--font-display);
  color: #e1bc67;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}

.game-logo__killer {
  font-size: 24px;
  line-height: 1.25;
}

.game-logo__kosmonauts {
  margin-top: 6px;
  color: #f1e2bd;
  font-family: var(--font-display);
  font-size: 66px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-indent: 0.02em;
  text-shadow:
    0 3px 0 #76371f,
    0 7px 0 rgba(27, 13, 10, 0.78),
    0 0 18px rgba(230, 164, 73, 0.18);
}

.game-logo__from {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1;
}

.game-logo__mars {
  margin-top: 4px;
  color: #df5c3d;
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  text-shadow:
    0 2px 0 #74261d,
    0 5px 12px rgba(32, 9, 8, 0.72);
}

.title-screen__strapline {
  max-width: 620px;
  margin: 14px 0 0;
  padding: 8px 14px;
  border: 1px solid rgba(215, 170, 76, 0.36);
  color: rgba(252, 228, 181, 0.86);
  background: rgba(20, 13, 9, 0.44);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.title-menu {
  display: grid;
  gap: 8px;
  width: 280px;
  padding: 18px 18px 20px;
  border: 2px solid rgba(224, 183, 88, 0.55);
  border-radius: 8px 8px 18px 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(174, 81, 42, 0.24), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255, 220, 148, 0.05) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, rgba(35, 31, 24, 0.94), rgba(8, 13, 12, 0.96));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.42),
    inset 0 1px rgba(255, 255, 255, 0.09),
    inset 0 -8px rgba(98, 45, 23, 0.22);
}

.title-menu::before {
  content: "PANIC BOARD";
  justify-self: center;
  margin-bottom: 4px;
  color: rgba(224, 183, 88, 0.78);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.09em;
}

.title-menu__button {
  min-height: 42px;
  padding: 9px 14px 8px;
  border: 1px solid rgba(224, 183, 88, 0.36);
  border-radius: 6px 2px 6px 2px;
  color: rgba(247, 232, 196, 0.84);
  background:
    linear-gradient(90deg, rgba(180, 78, 38, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(54, 56, 47, 0.84), rgba(15, 21, 19, 0.9));
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.title-menu__button--primary {
  min-height: 48px;
  border-color: #e0b54d;
  color: #fff0c9;
  background:
    radial-gradient(circle at 12% 50%, rgba(255, 222, 137, 0.26), transparent 20%),
    linear-gradient(180deg, rgba(91, 78, 49, 0.98), rgba(28, 31, 24, 0.98));
  font-size: 14px;
}

.title-menu__button:hover {
  border-color: #f1d17c;
  color: #fff6dc;
  background:
    linear-gradient(90deg, rgba(211, 91, 44, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(78, 76, 58, 0.98), rgba(24, 31, 29, 0.98));
  transform: translateY(-2px);
}

.title-menu__button:active {
  transform: translateY(1px);
}

.title-menu__button[hidden] {
  display: none;
}

.title-menu__notice {
  min-height: 14px;
  margin: 2px 0 -4px;
  color: #d7aa4c;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-align: center;
}

.title-screen__footer {
  position: absolute;
  bottom: 20px;
  margin: 0;
  color: rgba(243, 226, 190, 0.62);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.submenu-screen {
  overflow: hidden;
  color: #f5e5b7;
  background:
    linear-gradient(180deg, rgba(6, 10, 12, 0.48), rgba(18, 12, 8, 0.62)),
    var(--menu-bg) center 50% / cover no-repeat,
    #6b3828;
  isolation: isolate;
}

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

.submenu-screen::before {
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(158, 85, 44, 0.08), rgba(4, 7, 8, 0.72) 92%),
    linear-gradient(90deg, rgba(4, 7, 8, 0.45), transparent 20% 80%, rgba(4, 7, 8, 0.45));
}

.submenu-screen::after {
  z-index: 5;
  inset: 0;
  opacity: 0.1;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
}

.submenu-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  align-items: center;
  min-height: 76px;
  padding: 0 40px;
  border-bottom: 1px solid rgba(224, 183, 88, 0.42);
  background: linear-gradient(180deg, rgba(10, 14, 15, 0.96), rgba(5, 8, 9, 0.93));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

.submenu-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-align: center;
}

.submenu-back {
  justify-self: start;
  min-width: 112px;
  padding: 11px 18px;
  border: 1px solid rgba(224, 183, 88, 0.52);
  color: #f3dfac;
  background: rgba(27, 34, 33, 0.88);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.submenu-back:hover,
.deck-tab:hover {
  border-color: #efd079;
  color: #fff4d2;
}

.campaign-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  align-items: center;
  flex: 1;
  padding: 46px 50px 64px;
}

.campaign-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  height: 410px;
  overflow: hidden;
  padding: 22px 18px;
  border: 1px solid rgba(224, 183, 88, 0.4);
  color: #efe2c0;
  background:
    linear-gradient(180deg, transparent 10%, rgba(11, 15, 15, 0.26) 48%, rgba(7, 10, 10, 0.96) 100%),
    radial-gradient(circle at 50% 22%, rgba(203, 93, 45, 0.32), transparent 34%),
    linear-gradient(145deg, #4e493e, #171c1c 70%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  text-align: left;
}

.campaign-tile::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(230, 199, 126, 0.18);
  pointer-events: none;
}

.campaign-tile::after {
  content: "";
  position: absolute;
  top: 42px;
  left: 50%;
  width: 104px;
  height: 104px;
  border: 2px solid rgba(222, 176, 80, 0.35);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(201, 86, 46, 0.45), rgba(37, 27, 23, 0.9) 66%);
  box-shadow: 0 0 32px rgba(190, 79, 42, 0.18);
  transform: translateX(-50%);
}

.campaign-tile--active {
  border-color: #d9ad54;
  cursor: pointer;
}

.campaign-tile--active:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.46);
}

.campaign-tile:disabled {
  color: rgba(229, 220, 194, 0.44);
  filter: grayscale(0.7);
}

.campaign-tile__number,
.campaign-tile__status {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.campaign-tile strong {
  min-height: 58px;
  margin: 10px 0 8px;
  color: inherit;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.05em;
}

.campaign-tile__rule {
  height: 1px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #c99a40, transparent);
}

.campaign-tile__progress {
  font-size: 14px;
  letter-spacing: 0.08em;
}

.campaign-tile__status {
  margin-top: 9px;
  color: #d9ad54;
}

.deck-tabs {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 780px;
  margin: 22px auto 0;
}

.deck-tab {
  min-height: 46px;
  border: 1px solid rgba(224, 183, 88, 0.35);
  color: rgba(245, 229, 183, 0.66);
  background: rgba(15, 20, 20, 0.78);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.deck-tab.is-active {
  border-color: #dfb95f;
  color: #fff0c4;
  background: linear-gradient(180deg, rgba(83, 72, 49, 0.96), rgba(25, 30, 28, 0.96));
}

.deck-workspace {
  position: relative;
  z-index: 3;
  width: 1040px;
  margin: 18px auto 0;
  padding: 18px 24px 16px;
  border: 1px solid rgba(224, 183, 88, 0.4);
  background: rgba(8, 12, 12, 0.84);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.deck-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 0 2px;
  scrollbar-width: thin;
}

.deck-filter {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(224, 183, 88, 0.26);
  color: rgba(245, 229, 183, 0.58);
  background: rgba(30, 37, 35, 0.72);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.deck-filter.is-active {
  border-color: #d9ad54;
  color: #fff0c4;
  background: rgba(91, 72, 39, 0.86);
}

.deck-workspace__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 2px 12px;
  border-bottom: 1px solid rgba(224, 183, 88, 0.25);
}

.deck-workspace__eyebrow,
.deck-workspace__count,
.deck-workspace__instruction {
  color: #d2ad58;
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.deck-workspace h2 {
  margin: 5px 0 0;
  color: #f5e7c3;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.deck-card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  height: 310px;
  padding: 18px 0 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #a87d31 rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.deck-card {
  --card-accent: #b98a2d;
  --card-deep: #3d3026;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 294px;
  overflow: hidden;
  padding: 8px;
  border: 2px solid color-mix(in srgb, var(--card-accent) 55%, var(--paper-edge));
  color: #343a3b;
  background:
    linear-gradient(180deg, rgba(255, 247, 220, 0.72), transparent 30%),
    linear-gradient(180deg, #e8d5ac, #c7a66d);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.deck-card::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 72%, transparent);
  pointer-events: none;
}

.deck-card:hover {
  transform: translateY(-3px);
}

.deck-card.is-dimmed {
  opacity: 0.25;
  filter: grayscale(0.85) blur(0.6px);
}

.deck-card.is-selected {
  z-index: 3;
  border-color: #edc765;
  color: #f4e8c9;
  background: linear-gradient(160deg, #303a37, #0d1212 72%);
  box-shadow: 0 0 0 3px rgba(224, 183, 88, 0.3), 0 14px 28px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px) scale(1.025);
}

.deck-card__tag {
  position: relative;
  z-index: 1;
  color: var(--card-deep);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-align: left;
}

.deck-card__art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  margin: 7px 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--card-deep) 70%, black);
  color: #e7bd65;
  background: var(--card-deep);
  font: 400 50px/1 var(--font-display);
}

.deck-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04);
}

.deck-card--event { --card-accent: #b53f2c; --card-deep: #57251f; }
.deck-card--vehicle,
.deck-card--siegeUnit { --card-accent: #3d8990; --card-deep: #23474b; }
.deck-card--infantry { --card-accent: #68774a; --card-deep: #38412b; }
.deck-card--base { --card-accent: #9d8243; --card-deep: #394234; }
.deck-card--attack { --card-accent: #d06b2f; --card-deep: #612f22; }
.deck-card--unit { --card-accent: #4e8b79; --card-deep: #29483f; }
.deck-card--hero { --card-accent: #a73f31; --card-deep: #4e211d; }

.deck-card__name {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 42px;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

.deck-card__limit {
  position: relative;
  z-index: 1;
  color: #765d30;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
}

.deck-card__details {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.deck-card__details h3 {
  margin: 8px 0 14px;
  color: #f2c965;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.deck-card__details p {
  margin: 0;
  color: rgba(244, 232, 201, 0.82);
  font-size: 13px;
  line-height: 1.35;
}

.deck-card__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 12px 0 0;
  color: #dfc47f;
  font-size: 10px;
}

.deck-card__rank-stats {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  color: #dfc47f;
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.deck-card__perks {
  margin-top: 8px;
  color: rgba(244, 232, 201, 0.62);
  font-size: 10px;
  line-height: 1.25;
}

.deck-card__quantity {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 5px;
  margin-top: auto;
}

.deck-card__quantity button {
  height: 32px;
  border: 1px solid rgba(224, 183, 88, 0.55);
  color: #f4dfaa;
  background: #1c2422;
  cursor: pointer;
}

.deck-card__quantity button:disabled {
  opacity: 0.3;
  cursor: default;
}

.deck-card__quantity span {
  color: #f5e7c3;
  font-family: var(--font-display);
  font-size: 10px;
  text-align: center;
}

.deck-card__readonly {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(224, 183, 88, 0.3);
  color: #c8a558;
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-align: center;
}

.deck-workspace__instruction {
  margin: 0;
  color: rgba(239, 218, 166, 0.52);
  text-align: center;
}

.save-prompt {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 8, 0.72);
  backdrop-filter: blur(4px);
}

.save-prompt[hidden] {
  display: none;
}

.save-prompt__panel {
  width: 430px;
  padding: 28px;
  border: 1px solid rgba(224, 183, 88, 0.7);
  color: #f7e8c4;
  background:
    linear-gradient(180deg, rgba(31, 37, 35, 0.99), rgba(8, 12, 12, 0.99));
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.58);
  text-align: center;
}

.save-prompt__title {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

.save-prompt__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.save-prompt__button {
  min-height: 46px;
  border: 1px solid rgba(224, 183, 88, 0.42);
  color: #f7e8c4;
  background: #18201f;
  font-family: var(--font-display);
  font-size: 12px;
  cursor: pointer;
}

.save-prompt__button--yes {
  border-color: #d7aa4c;
  color: #18201f;
  background: linear-gradient(#e0bd69, #aa7d2e);
}

/* HUD — one full-width command bar, divided into sections */
.hud {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 52px;
  color: #fff;
  background: transparent;
}

.hud::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--game-bleed-x));
  background: linear-gradient(180deg, #0c0f13, #06090c);
  border-bottom: 1px solid rgba(224, 192, 120, 0.28);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}

/* each direct child is a section separated by a hairline divider */
.hud > * {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.hud > *:last-child {
  border-right: 0;
}

.hud__menu {
  margin-left: calc(-1 * var(--game-bleed-x));
  padding-left: calc(16px + var(--game-bleed-x));
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: #e0c074;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.hud__menu:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f2d488;
}

.hud__section--score {
  flex: 1.5;
  min-width: 168px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
}

.hud__score-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hud__section--score .hud__val {
  color: #f0cc75;
}

.score-bar {
  position: relative;
  height: 10px;
  margin: 0 9px 1px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.score-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d8a13a, #f3d066);
  transition: width 0.4s ease;
}

.score-bar__star {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  transform: translateY(-50%);
  color: #6f6a60;
  font-style: normal;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.score-bar__star::before {
  content: "★";
  font: 900 18px/18px Georgia, serif;
}

.score-bar__star.is-lit {
  color: #ffd86b;
  filter: drop-shadow(0 0 4px rgba(255, 216, 107, 0.85));
}

.hud__section--enemy {
  flex: 1.2;
  padding: 0;
}

.hud__section--base {
  flex: 1;
  min-width: 130px;
}

.bar {
  flex: 1;
  min-width: 40px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
}

.bar__fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #cf4538, #f37857);
  transition: width 0.35s ease;
}

.bar--enemy .bar__fill {
  background: linear-gradient(90deg, #a92f2a, #e55b49);
}

.bar--base .bar__fill {
  background: linear-gradient(90deg, #347665, #62b08c);
}

.hud__label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.hud__val {
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.hud__section--cannon {
  flex: 0 0 auto;
}

.hud__cannon-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d7fff4;
  cursor: default;
  user-select: none;
}

.hud__cannon-btn .hud__val {
  color: #aef5e6;
}

.hud__cannon-btn .cannon__bolt {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #bff7ec, #2f9c8a 72%);
  box-shadow: 0 0 6px rgba(120, 231, 205, 0.7);
}

.hud__cannon-btn.is-offline {
  opacity: 0.45;
}

.hud__cannon-btn.is-armed .cannon__bolt {
  box-shadow: 0 0 0 2px rgba(120, 231, 205, 0.55), 0 0 10px rgba(120, 231, 205, 0.85);
}

.hud__cannon-btn.is-charged .hud__val {
  padding: 0 7px;
  border-radius: 999px;
  background: #6fe7cf;
  color: #0c2522;
}

.hud__section--turn .hud__val {
  color: #e7d9b8;
}

/* Battlefield */
.stage {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rail-w);
  align-items: center;
  min-height: 0;
  padding: 0 10px;
}

.board-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  min-width: 0;
  min-height: 0;
}

.board-frame {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 47%;
  width: 820px;
  aspect-ratio: 600 / 440;
  transform: translate(-50%, -50%);
}

.board-frame::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 5%;
  height: 16%;
  border-radius: 50%;
  background: rgba(49, 61, 64, 0.25);
  filter: blur(22px);
  transform: translateY(18%);
  z-index: 0;
}

#board {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: manipulation;
}

.disc-shadow {
  fill: rgba(49, 55, 55, 0.3);
  filter: blur(8px);
}

.disc {
  fill: rgba(240, 224, 191, 0.92);
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 2;
  filter: drop-shadow(0 10px 10px rgba(55, 61, 61, 0.18));
}

.ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-opacity: 0.88;
  filter: drop-shadow(0 1px 0 rgba(255, 248, 218, 0.72));
}

.ring--outer {
  stroke-width: 2.2;
}

.quad {
  stroke: var(--gold);
  stroke-width: 2;
  stroke-opacity: 0.82;
}

.base-shield-quadrant {
  pointer-events: none;
}

.base-shield-recess {
  fill: #252824;
  stroke: #756342;
  stroke-width: 1;
  filter:
    drop-shadow(0 2px 1px rgba(34, 27, 19, 0.55))
    drop-shadow(0 -1px 0 rgba(222, 198, 139, 0.18));
}

.base-shield-quadrant.is-down .base-shield-recess {
  fill: #1d201d;
  stroke: #5f5138;
  opacity: 0.9;
}

.base-shield-wall-face {
  fill: #3f4738;
  stroke: #76633d;
  stroke-width: 1.2;
  filter:
    drop-shadow(0 3px 1px rgba(35, 27, 18, 0.58))
    drop-shadow(0 5px 3px rgba(35, 27, 18, 0.32));
}

.base-shield-cap {
  fill: #748064;
  stroke: #c8aa68;
  stroke-width: 1.4;
  filter: drop-shadow(0 1px 0 rgba(244, 228, 180, 0.38));
}

.base-shield-top-lip {
  fill: none;
  stroke: #e0c783;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.88;
}

.base-shield-detail {
  fill: none;
  stroke: rgba(231, 213, 165, 0.72);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.base-shield-rivet {
  fill: #d0bd86;
  stroke: #413b2e;
  stroke-width: 0.45;
}

.base-shield-lamp {
  fill: #3d2b21;
  stroke: #8a6b43;
  stroke-width: 0.7;
}

.base-shield-quadrant.is-active .base-shield-lamp {
  fill: #e7c36a;
  stroke: #fff0b4;
  filter: drop-shadow(0 0 2px rgba(239, 195, 94, 0.72));
}

.cannon-sprite {
  overflow: visible;
  filter:
    drop-shadow(0 1px 0 rgba(255, 246, 220, 0.2))
    drop-shadow(0 4px 3px rgba(28, 24, 18, 0.38));
}

.base-cannon.power-0 .cannon-sprite {
  filter:
    grayscale(0.48)
    brightness(0.78)
    drop-shadow(0 3px 3px rgba(28, 24, 18, 0.32));
}

.base-cannon.power-5 .cannon-sprite {
  filter:
    drop-shadow(0 1px 0 rgba(255, 246, 220, 0.24))
    drop-shadow(0 0 5px rgba(111, 231, 207, 0.48))
    drop-shadow(0 4px 3px rgba(28, 24, 18, 0.38));
}

.base-pad {
  fill: #e8e4da;
  stroke: #a7a199;
  stroke-width: 1.5;
}

.base-console {
  fill: #688879;
  stroke: #273f3d;
  stroke-width: 1.5;
}

.base-dome {
  fill: #b9d4ca;
  stroke: #476b66;
  stroke-width: 1.5;
}

.base-detail {
  fill: #2e5e62;
}

.base-core {
  filter: drop-shadow(0 7px 5px rgba(43, 33, 22, 0.34));
}

.base-label {
  display: none;
}

.token__stand {
  stroke: #918b81;
  stroke-width: 1;
  fill: #d8d3c9;
}

.token__stem {
  stroke: #85847f;
  stroke-width: 3;
  stroke-linecap: round;
}

.token__body {
  stroke-width: 1.4;
}

.token--enemy .token__body,
.token--enemy .token__head {
  fill: var(--enemy);
  stroke: var(--enemy-dark);
}

.token--enemy .token__head {
  fill: #252b2c;
}

.token--enemy .token__panel {
  fill: #656b6a;
}

.token--friendly .token__body,
.token--friendly .token__head {
  fill: var(--friendly);
  stroke: var(--friendly-dark);
}

.token--friendly .token__panel {
  fill: #7dbb8a;
}

.token__head {
  stroke-width: 1.2;
}

.token__panel {
  stroke: rgba(25, 34, 34, 0.5);
  stroke-width: 0.8;
}

.token__weapon {
  stroke: #303638;
  stroke-width: 3;
  stroke-linecap: round;
}

/* Enemy health: hidden until the piece is hovered or being targeted. */
.token__health {
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.token--enemy:hover .token__health,
.token--targetable .token__health {
  opacity: 1;
}

.token__health-plate {
  fill: rgba(18, 24, 26, 0.82);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 0.6;
}

.hp-seg {
  stroke: rgba(0, 0, 0, 0.3);
  stroke-width: 0.22;
}

.hp-seg.is-full {
  fill: #5fd0a6;
}

.hp-seg.is-empty {
  fill: rgba(255, 255, 255, 0.16);
}

/* Segments the armed attack would remove — flash to preview the hit. */
.hp-seg.is-risk {
  fill: #ff5d52;
  animation: hp-risk 0.52s steps(1, end) infinite;
}

.token__sprite {
  overflow: visible;
  filter:
    drop-shadow(0 1px 0 rgba(255, 245, 218, 0.25))
    drop-shadow(0 3px 2px rgba(30, 25, 18, 0.24));
}

.token--enemy {
  cursor: default;
}

.token--targetable {
  cursor: crosshair;
}

.token--targetable .token__sprite {
  filter:
    drop-shadow(0 0 2px #4b3212)
    drop-shadow(0 0 5px #c08b2e)
    drop-shadow(0 4px 2px rgba(30, 25, 18, 0.24));
}

.token--targetable .token__stand {
  stroke: #8c621d;
  stroke-width: 2;
}

.token--hit {
  animation: target-hit 0.48s ease;
}

.token--entering {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: deploy-drop 0.58s cubic-bezier(0.2, 0.8, 0.25, 1.25);
}

/* Enemy-health roster dropdown (HUD) */
.hud__enemy {
  position: relative;
  padding: 0;
}

.hud__enemy-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 6px 12px;
  border: 0;
  border-radius: 22px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.hud__caret {
  margin-left: 2px;
  font-size: 9px;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.hud__enemy-toggle.is-open .hud__caret {
  transform: rotate(180deg);
}

.enemy-roster {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(17, 23, 23, 0.94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.enemy-roster[hidden] {
  display: none;
}

.enemy-roster__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.enemy-roster__name {
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.enemy-roster__ring {
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.enemy-roster__bar {
  display: flex;
  gap: 3px;
}

.enemy-roster__seg {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.enemy-roster__seg.is-full {
  background: #5fd0a6;
}

.enemy-roster__empty {
  padding: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  text-align: center;
}

/* Central laser turret on the core */
.base-cannon {
  pointer-events: all;
  cursor: pointer;
  outline: none;
}

.base-cannon.is-offline {
  cursor: default;
}

.base-cannon.is-ready:hover .cannon-sprite,
.base-cannon.is-ready:focus .cannon-sprite {
  filter:
    drop-shadow(0 0 3px rgba(232, 199, 115, 0.82))
    drop-shadow(0 4px 3px rgba(28, 24, 18, 0.38));
}

.cannon-mount {
  fill: #cdc7ba;
  stroke: #9b958a;
  stroke-width: 1;
}

.cannon-base {
  fill: #33403e;
  stroke: #1d2a29;
  stroke-width: 1;
}

.cannon-head {
  fill: #566d69;
  stroke: #223230;
  stroke-width: 1;
}

.cannon-barrel-rect {
  fill: #46524f;
  stroke: #223230;
  stroke-width: 1;
}

.cannon-muzzle {
  fill: #173f3a;
  stroke: #6fe7cf;
  stroke-width: 1.5;
}

.cannon-eye {
  fill: #bff7ec;
}

.base-cannon.power-0 .cannon-eye,
.base-cannon.power-0 .cannon-muzzle {
  fill: #5a6b68;
  stroke: #5a6b68;
}

.base-cannon.power-3 .cannon-eye,
.base-cannon.power-5 .cannon-eye,
.base-cannon.power-5 .cannon-muzzle {
  filter: drop-shadow(0 0 4px #9bf8e6);
}

.base-cannon.is-armed {
  animation: cannon-arm 0.9s ease-in-out infinite;
}

.base-cannon.is-armed .cannon-eye {
  fill: #fff;
  filter: drop-shadow(0 0 6px #b9fff0);
}

/* Side cards */
.rail {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-height: 0;
  padding: 8px 2px 12px;
  transition: transform 0.2s ease;
}

.rail--left {
  transform: translateX(calc(-1 * var(--game-bleed-x)));
}

.rail--right {
  transform: translateX(var(--game-bleed-x));
}

.rail__label {
  align-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(29, 37, 42, 0.58);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail__cards {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 9px;
  min-height: 0;
}

.card {
  position: relative;
  width: 100%;
  min-height: 120px;
  flex: 0 1 166px;
  overflow: hidden;
  border: 2px solid var(--paper-edge);
  border-radius: 2px;
  color: #303638;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.54), transparent 40%),
    linear-gradient(180deg, #eee2c8, #d9c49d);
  box-shadow: 0 4px 12px rgba(37, 44, 46, 0.2);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    opacity 0.18s ease,
    filter 0.18s ease;
}

.card::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(185, 138, 45, 0.42);
  pointer-events: none;
}

.card:active {
  transform: scale(0.97);
}

.card.is-selected {
  z-index: 2;
  border-color: #f0c355;
  box-shadow: 0 0 0 3px rgba(255, 207, 93, 0.7), 0 7px 20px rgba(70, 56, 24, 0.3);
  transform: scale(1.035);
}

.card.is-dimmed {
  opacity: 0.38;
  filter: grayscale(0.8);
}

.card.is-dimmed:hover {
  opacity: 0.58;
  filter: grayscale(0.5);
}

.card--spent {
  opacity: 0.38;
  filter: grayscale(0.8);
  cursor: default;
  pointer-events: none;
}

.card--placeholder {
  cursor: default;
  pointer-events: none;
  color: rgba(222, 215, 197, 0.72);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.025) 0 5px,
      transparent 5px 10px
    ),
    linear-gradient(160deg, #353b39, #1a201f);
  border-color: rgba(229, 218, 190, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.46),
    0 3px 8px rgba(20, 24, 24, 0.2);
}

.card--placeholder::after {
  border-color: rgba(219, 200, 154, 0.28);
}

.card.card--placeholder::before {
  display: none;
}

.card__back {
  display: grid;
  place-items: center;
  height: calc(100% - 26px);
  min-height: 88px;
  margin: 6px;
  border: 1px solid rgba(224, 207, 164, 0.22);
  background:
    radial-gradient(circle at center, rgba(182, 159, 103, 0.12), transparent 46%),
    rgba(6, 11, 11, 0.24);
}

.card__back-emblem {
  width: min(58%, 64px);
  height: auto;
  opacity: 0.48;
}

.card__back-frame {
  fill: none;
  stroke: #dac99f;
  stroke-width: 1.5;
}

.card__back-head,
.card__back-body {
  fill: #dac99f;
}

.card--placeholder .card__name {
  color: rgba(229, 218, 190, 0.54);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.card--discarding {
  transform-origin: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.46);
}

.card__tag {
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 9px;
  color: var(--gold);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.card__art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 20px auto 7px;
  border: 2px solid var(--gold-bright);
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 35% 28%, #e8c977, #a9781d);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.18);
  font: 900 23px/1 Georgia, serif;
  overflow: hidden;
}

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

.card--unit .card__art {
  border-radius: 5px;
  color: #eaf8fb;
  background:
    linear-gradient(145deg, transparent 28%, rgba(255, 255, 255, 0.26) 29% 32%, transparent 33%),
    linear-gradient(160deg, #6aaa84, #245d61);
}

.card--unit .card__art:has(img) {
  width: calc(100% - 12px);
  height: calc(100% - 36px);
  min-height: 48px;
  margin: 6px 6px 4px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #6f816d;
}

.card--unit .card__art:has(img) img {
  object-position: center 34%;
  filter: saturate(0.88) contrast(1.03);
}

/* Provisional support cards: retro equipment dossiers with effect-specific art. */
.card--support .card__art {
  position: relative;
  width: calc(100% - 12px);
  height: calc(100% - 36px);
  min-height: 48px;
  margin: 6px 6px 4px;
  border: 1px solid rgba(89, 66, 35, 0.58);
  border-radius: 2px;
  color: #f1dfb3;
  background:
    linear-gradient(135deg, rgba(255, 246, 211, 0.12), transparent 38%),
    #47483e;
  box-shadow:
    inset 0 0 0 3px rgba(28, 29, 25, 0.28),
    inset 0 0 18px rgba(20, 18, 14, 0.28);
  overflow: hidden;
}

.card--support .card__art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background:
    repeating-linear-gradient(0deg, transparent 0 7px, currentColor 7px 8px),
    repeating-linear-gradient(90deg, transparent 0 11px, currentColor 11px 12px);
  pointer-events: none;
}

.card--effect-damageRing .card__art {
  color: #e6b96c;
  background:
    radial-gradient(circle at 50% 70%, rgba(230, 142, 68, 0.26), transparent 45%),
    linear-gradient(160deg, #6f4935, #302c28);
}

.card--effect-repairBase .card__art {
  color: #d7c784;
  background:
    radial-gradient(circle at 50% 42%, rgba(191, 190, 124, 0.25), transparent 48%),
    linear-gradient(160deg, #626650, #30342e);
}

.card--effect-freeze .card__art {
  color: #a9c5d0;
  background:
    radial-gradient(circle at 50% 45%, rgba(132, 168, 184, 0.27), transparent 50%),
    linear-gradient(160deg, #4a5260, #282d35);
}

.support-illustration {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.support-illustration__frame {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.34;
}

.support-illustration__ground {
  fill: currentColor;
  opacity: 0.2;
}

.support-illustration__projectile {
  fill: #ede0bc;
  stroke: currentColor;
  stroke-width: 1.2;
}

.support-illustration__trail,
.support-illustration__target,
.support-illustration__tool,
.support-illustration__antenna,
.support-illustration__wave,
.support-illustration__pulse,
.support-illustration__field {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-illustration__target {
  stroke-width: 1.5;
  opacity: 0.8;
}

.support-illustration__target--inner {
  stroke: #f4dfad;
}

.support-illustration__shield {
  fill: rgba(216, 203, 145, 0.18);
  stroke: currentColor;
  stroke-width: 2.4;
}

.support-illustration__cross {
  fill: #e7d59a;
  opacity: 0.88;
}

.support-illustration__tool-head {
  fill: #d8c78d;
  stroke: #554f3d;
  stroke-width: 1;
}

.support-illustration__emitter {
  fill: rgba(169, 197, 208, 0.2);
  stroke: currentColor;
  stroke-width: 2;
}

.support-illustration__wave {
  opacity: 0.46;
}

.support-illustration__pulse {
  stroke: #d9e6e8;
  stroke-width: 2.6;
}

.support-illustration__field {
  fill: rgba(167, 199, 210, 0.13);
  opacity: 0.82;
}

.card--support .card__tag {
  color: #6c552c;
}

.card--effect-damageRing {
  --support-accent: #9e4c2e;
}

.card--effect-repairBase {
  --support-accent: #66704e;
}

.card--effect-freeze {
  --support-accent: #53667a;
}

.card--support::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 24%;
  background: var(--support-accent);
  opacity: 0.78;
}

.card__name {
  position: absolute;
  z-index: 1;
  left: 6px;
  right: 6px;
  bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 1px 5px 0;
  color: #353b3d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.card__desc {
  display: none;
}

/* Bottom controls */
.dock {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  pointer-events: auto;
}

.command-panel {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 0;
  display: flex;
  align-items: stretch;
  width: fit-content;
  min-width: 150px;
  max-width: min(620px, calc(100% - 12px));
  min-height: 44px;
  overflow: hidden;
  border: 1px solid rgba(224, 192, 120, 0.52);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(31, 34, 32, 0.98), rgba(7, 10, 10, 0.98));
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.38),
    inset 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  transform: translateX(-50%);
}

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

.hint {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 450px;
  min-height: 42px;
  margin: 0;
  padding: 8px 16px;
  color: rgba(250, 247, 237, 0.92);
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
}

.hint strong {
  margin-right: 0.18em;
  color: #f1c663;
  font-size: 14px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.command-panel__action {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 9px 16px;
  border: 0;
  border-left: 1px solid rgba(224, 192, 120, 0.4);
  color: #171a18;
  background:
    linear-gradient(180deg, #e0bd69, #aa7d2e);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.command-panel__action:hover {
  background: linear-gradient(180deg, #edcf82, #bd8c34);
}

.command-panel__action[hidden] {
  display: none;
}

.dock__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.discard-pile {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  color: rgba(238, 225, 191, 0.72);
  pointer-events: auto;
}

.discard-pile::before,
.discard-pile__card {
  position: absolute;
  width: 28px;
  height: 38px;
  border: 1px solid rgba(225, 205, 159, 0.54);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(224, 192, 120, 0.16), transparent 42%),
    #242b29;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
}

.discard-pile::before {
  content: "";
  transform: translate(-4px, -2px) rotate(-7deg);
}

.discard-pile__card {
  display: grid;
  place-items: center;
  transform: rotate(4deg);
  font: 800 12px/1 Georgia, serif;
}

.discard-pile__count {
  position: absolute;
  z-index: 2;
  right: -1px;
  bottom: 0;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #fff;
  background: #111615;
  font-size: 9px;
  font-weight: 900;
}

.cannon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(120, 231, 205, 0.5);
  border-radius: 3px;
  color: #d7fff4;
  background: linear-gradient(#1f3a37, #122524);
  box-shadow: 0 5px 14px rgba(20, 40, 38, 0.3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: auto;
  cursor: pointer;
}

.cannon:disabled {
  opacity: 0.42;
  cursor: default;
}

.cannon__bolt {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #bff7ec, #2f9c8a 72%);
  box-shadow: 0 0 6px rgba(120, 231, 205, 0.7);
}

.cannon__power {
  min-width: 16px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(120, 231, 205, 0.18);
  color: #aef5e6;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.cannon.is-armed {
  border-color: #bff7ec;
  box-shadow: 0 0 0 2px rgba(120, 231, 205, 0.6), 0 6px 16px rgba(20, 40, 38, 0.4);
}

.cannon.is-charged .cannon__power {
  background: #6fe7cf;
  color: #0c2522;
}

.end-turn {
  min-width: 142px;
  padding: 11px 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 3px;
  color: #fff;
  background: linear-gradient(#303937, #171d1c);
  box-shadow: 0 5px 14px rgba(31, 38, 41, 0.22);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: auto;
  cursor: pointer;
}

.end-turn:disabled {
  opacity: 0.45;
}

.banner[hidden] {
  display: none;
}

.banner {
  position: absolute;
  z-index: 20;
  inset: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(24, 31, 35, 0.86);
  backdrop-filter: blur(8px);
  text-align: center;
}

.banner h2,
.banner p {
  margin: 0;
}

.banner button {
  padding: 10px 18px;
  border: 0;
  color: #fff;
  background: var(--gold);
  font-weight: 800;
}

#toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 88px;
  max-width: 80vw;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 33, 37, 0.9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.phase-label {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 18%;
  padding: 7px 18px;
  border: 1px solid rgba(230, 198, 126, 0.72);
  border-radius: 2px;
  color: #f7e9c9;
  background: rgba(22, 27, 26, 0.82);
  box-shadow: 0 5px 20px rgba(35, 24, 14, 0.28);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transform: translateX(-50%);
  animation: phase-in 0.2s ease-out;
}

.phase-label[hidden] {
  display: none;
}

.fire-trace {
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: fire-trace 0.16s cubic-bezier(0.1, 0.72, 0.2, 1) both;
}

.fire-trace--glow {
  stroke: rgba(77, 196, 188, 0.5);
  stroke-width: 7;
  filter: blur(1.2px);
}

.fire-trace--core {
  stroke: #efffdb;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 2px #63d8cb);
}

.fire-impact {
  fill: #fffbd1;
  stroke: #63d8cb;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: fire-impact 0.18s ease-out both;
}

.board--advance .token--enemy {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7));
}

.board--effect-damageRing {
  animation: board-barrage 0.48s ease;
}

.board--effect-repairBase .base-shield-quadrant.is-active .base-shield-wall-face,
.board--effect-repairBase .base-shield-quadrant.is-active .base-shield-cap,
.board--effect-repairBase .base-shield-quadrant.is-active .base-shield-lamp {
  animation: base-heal 0.48s ease;
}

.board--effect-freeze .disc {
  animation: ion-freeze 0.48s ease;
}

.is-resolving .card,
.is-resolving .hud__menu {
  pointer-events: none;
}

.rotate-device {
  display: none;
}

.discard-selected {
  position: fixed;
  z-index: 9;
  left: calc(var(--rail-w) + 22px);
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 64px;
  padding: 10px 14px;
  border: 1px solid rgba(224, 192, 120, 0.55);
  border-radius: 6px;
  color: #f1dfb3;
  background: linear-gradient(180deg, rgba(31, 34, 32, 0.96), rgba(7, 10, 10, 0.96));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  font: 600 10px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  animation: discard-pop 0.16s ease-out;
}

.discard-selected[hidden] {
  display: none;
}

.discard-selected:hover {
  border-color: #e0c074;
  background: linear-gradient(180deg, rgba(48, 52, 48, 0.97), rgba(15, 19, 18, 0.97));
}

.discard-selected:active {
  transform: scale(0.96);
}

.discard-selected__icon {
  font: 900 15px/1 Georgia, serif;
  color: #e0c074;
}

@keyframes discard-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes deploy-drop {
  0% { opacity: 0; translate: 0 -42px; scale: 1.35; }
  65% { opacity: 1; translate: 0 3px; scale: 0.94; }
  100% { opacity: 1; translate: 0 0; scale: 1; }
}

@keyframes fire-trace {
  0% { opacity: 0; stroke-dashoffset: 1; }
  12% { opacity: 1; }
  48% { opacity: 1; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}

@keyframes fire-impact {
  0%, 28% { opacity: 0; transform: scale(0.25); }
  48% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.8); }
}

@keyframes target-hit {
  0%, 100% { opacity: 1; }
  22% { opacity: 0.28; transform: translateX(-2px); }
  46% { opacity: 1; transform: translateX(2px); }
  70% { transform: translateX(-1px); }
}

@keyframes phase-in {
  from { opacity: 0; transform: translate(-50%, -5px); }
}

@keyframes hp-risk {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.22; }
}

@keyframes cannon-arm {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes board-barrage {
  0%, 100% { filter: none; }
  25% { filter: sepia(1) saturate(3) brightness(1.45); transform: translateX(-2px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}

@keyframes base-heal {
  50% {
    filter:
      brightness(1.45)
      drop-shadow(0 0 4px rgba(236, 198, 101, 0.84));
  }
}

@keyframes ion-freeze {
  50% { fill: rgba(184, 225, 231, 0.92); filter: drop-shadow(0 0 14px #b9f6ff); }
}

@media (max-aspect-ratio: 3 / 2) {
  .rotate-device {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: #f5e7c8;
    background:
      linear-gradient(rgba(24, 25, 22, 0.68), rgba(19, 18, 16, 0.88)),
      var(--battle-bg) center / cover no-repeat;
    text-align: center;
  }

  .rotate-device__glyph {
    position: relative;
    width: 88px;
    height: 58px;
    margin-bottom: 8px;
    border: 3px solid #d1ab58;
    border-radius: 10px;
    animation: rotate-prompt 2.4s ease-in-out infinite;
  }

  .rotate-device__glyph span {
    position: absolute;
    right: 5px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d1ab58;
    transform: translateY(-50%);
  }

  .rotate-device strong {
    font-family: var(--font-display);
    font-size: 23px;
    letter-spacing: 0.04em;
  }

  .rotate-device small {
    color: rgba(245, 231, 200, 0.72);
    font-size: 12px;
  }

  #app {
    visibility: hidden;
  }
}

@keyframes rotate-prompt {
  0%, 18% { transform: rotate(90deg); }
  48%, 100% { transform: rotate(0deg); }
}
