@font-face {
  font-family: "Eurostile";
  src:
    url("/public/fonts/eurostile.TTF") format("truetype"),
    url("/public/fonts/EuroStyle%20Normal.ttf") format("truetype"),
    local("Eurostile"),
    local("Eurostile Regular"),
    local("Eurostile LT Std"),
    local("Eurostile Extended"),
    local("Eurostyle"),
    local("EuroStyle Normal");
  font-display: swap;
}

@font-face {
  font-family: "04b03";
  src: url("/public/fonts/04B_03__.TTF") format("truetype");
  font-display: block;
}

:root {
  --bg-main: #120f1a;
  --bg-panel: #1f1a2d;
  --bg-card: #2a2140;
  --bg-card-2: #34224f;
  --text-main: #f4efff;
  --text-dim: #c8bce0;
  --accent-a: #7af4ff;
  --accent-b: #ff7ed4;
  --accent-c: #ffd86a;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Eurostile", "Eurostile Extended", "Eurostile LT Std", "Microgramma D Extended", "Bank Gothic", "Segoe UI", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  background-image:
    linear-gradient(180deg, rgba(7, 5, 20, 0.78), rgba(4, 3, 12, 0.88)),
    url("/output/imagegen/hub-wallpaper.png"),
    radial-gradient(circle at 10% 10%, rgba(122, 244, 255, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(255, 126, 212, 0.07) 0 2px, transparent 2px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0) 40%),
    linear-gradient(220deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0) 45%);
  background-size: cover, cover, 46px 46px, 74px 74px, 180% 180%, 180% 180%;
  background-position: center center;
  padding: 0;
}

body.game--frontline-tactics {
  font-family: "04b03", "Eurostile", sans-serif;
  background-color: #d6dbc0;
  background-image:
    linear-gradient(180deg, rgba(245, 241, 222, 0.9), rgba(214, 219, 192, 0.94)),
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.5), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(170, 190, 160, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(184, 198, 164, 0.2), rgba(223, 216, 185, 0.16));
  background-size: cover, auto, auto, auto;
  background-position: center center;
}

@media (min-width: 900px) {
  body.game--frontline-tactics {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.game--frontline-tactics .game-root {
    overflow: visible;
  }
}

body.game--frontline-tactics button,
body.game--frontline-tactics input,
body.game--frontline-tactics select,
body.game--frontline-tactics textarea,
body.game--frontline-tactics .back-link {
  font-family: "04b03", "Eurostile", sans-serif;
}

body.game--frontline-tactics #app {
  width: min(1880px, calc(100% - 0.6rem));
}

body.game--frontline-tactics .game-shell {
  width: min(1840px, calc(100% - 0.35rem));
  min-height: auto;
  grid-template-rows: auto auto auto;
}

#app {
  width: min(1100px, calc(100% - 1.25rem));
  margin: clamp(0.75rem, 2.4vw, 2rem) auto;
  overflow-x: clip;
}

.hub {
  display: grid;
  gap: clamp(1.1rem, 2.8vw, 1.8rem);
  padding-bottom: clamp(1rem, 3vw, 2rem);
}

.game-shell {
  width: min(1200px, calc(100% - 0.9rem));
  margin: clamp(0.4rem, 1.4vw, 0.95rem) auto;
  min-height: calc(100dvh - clamp(0.8rem, 2.8vw, 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
}

h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  letter-spacing: 0.05em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

p {
  margin: 0;
  overflow-wrap: anywhere;
}

.kicker {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-c);
  font-size: 0.75rem;
}

.hub__header,
.game-shell__top {
  padding: 1.4rem 1.7rem;
  border: 2px solid rgba(122, 244, 255, 0.28);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hub__header {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(8, 11, 32, 0.62), rgba(5, 8, 28, 0.82)),
    radial-gradient(circle at 50% 18%, rgba(137, 199, 255, 0.2), transparent 34%),
    radial-gradient(circle at 50% 110%, rgba(114, 94, 255, 0.14), transparent 40%),
    rgba(8, 10, 28, 0.58);
  backdrop-filter: blur(10px);
  border-color: rgba(137, 199, 255, 0.34);
  border-radius: 34px;
  box-shadow:
    0 22px 54px rgba(3, 6, 26, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.hub__header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(122, 244, 255, 0.35) 18%, transparent 32%),
    linear-gradient(270deg, transparent 0%, rgba(122, 244, 255, 0.35) 18%, transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 24%);
  pointer-events: none;
  z-index: 0;
}

.hub__header::after {
  content: "";
  position: absolute;
  inset: -28%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 216, 106, 0.42), transparent 34%),
    linear-gradient(120deg, transparent 22%, rgba(122, 244, 255, 0.42) 50%, transparent 78%);
  opacity: 0;
  transform: scale(0.82);
  pointer-events: none;
  z-index: 0;
}

.hub__eyebrow {
  margin: 0;
  color: rgba(143, 213, 255, 0.92);
  font-size: 0.78rem;
  letter-spacing: 0.44em;
  text-transform: uppercase;
}

.hub__header h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.3rem);
  letter-spacing: 0.05em;
  line-height: 0.98;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hub__header > * {
  position: relative;
  z-index: 1;
}

.hub__header h1,
.hub__header .hub__subtitle {
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.hub__header--token-reset {
  border-color: rgba(255, 219, 126, 0.92);
  box-shadow:
    0 28px 60px rgba(3, 6, 26, 0.5),
    0 0 0 1px rgba(255, 219, 126, 0.24),
    0 0 32px rgba(255, 219, 126, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hub__header--token-reset::after {
  animation: hubHeaderRecharge 1180ms ease-out;
}

.hub__header--token-reset h1 {
  color: #fff4c5;
}

.hub__header--token-reset .hub__subtitle {
  color: #ffe9a2;
}

.game-shell__top {
  background: linear-gradient(145deg, var(--bg-panel), #1b1530);
}

body.game--frontline-tactics .game-shell__top {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  justify-content: flex-start;
}

body.game--frontline-tactics .game-shell__top h1,
body.game--frontline-tactics .game-shell__top .kicker,
body.game--frontline-tactics .game-shell__top .hub__subtitle,
body.game--frontline-tactics .arcade-token-line,
body.game--frontline-tactics .arcade-token-note {
  color: #40513c;
  text-shadow: none;
}

body.game--frontline-tactics .game-shell__top .back-link,
body.game--frontline-tactics .arcade-new-run {
  color: #52664a;
}

body.game--frontline-tactics .game-shell__top > div {
  display: none;
}

body.game--frontline-tactics .game-shell__top .back-link {
  margin-right: 0;
  border: 2px solid #101010;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #182117;
  font-size: 0.72rem;
  padding: 0.46rem 0.78rem;
}

.hub__subtitle {
  color: rgba(228, 235, 255, 0.82);
  max-width: 36ch;
  line-height: 1.55;
  font-size: clamp(0.95rem, 2.2vw, 1.28rem);
}

.hub-token-line {
  margin-top: 0.95rem;
  color: var(--accent-a);
  font-size: 0.74rem;
  line-height: 1.5;
}

.hub__section-title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: rgba(241, 245, 255, 0.94);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.hub-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  color: #9be5ff;
  font-size: 0.7rem;
  border: 1px solid rgba(155, 229, 255, 0.4);
  border-radius: 999px;
  background: rgba(6, 11, 29, 0.72);
  padding: 0.28rem 0.65rem;
}

@keyframes hubHeaderRecharge {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }

  18% {
    opacity: 0.94;
    transform: scale(0.92);
  }

  68% {
    opacity: 0.5;
    transform: scale(1.02);
  }

  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

.token-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-block;
  object-fit: contain;
  image-rendering: pixelated;
}

.token-icon--tiny {
  width: 0.95rem;
  height: 0.95rem;
}

.hub__grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  align-items: stretch;
}

.game-card {
  min-height: 340px;
  border: 1px solid rgba(164, 204, 255, 0.28);
  border-radius: 24px;
  text-decoration: none;
  color: var(--text-main);
  background:
    linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  padding: 1rem;
  box-shadow:
    0 22px 44px rgba(4, 8, 27, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.95rem;
  transition: transform 0.14s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(7px);
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(157, 214, 255, 0.66);
  box-shadow:
    0 28px 56px rgba(4, 8, 27, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.game-card:focus-visible {
  outline: none;
}

.game-card.is-locked {
  opacity: 0.64;
  filter: grayscale(0.22);
  cursor: not-allowed;
}

.game-card.is-locked:hover,
.game-card.is-locked:focus-visible {
  transform: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.game-card > * {
  position: relative;
  z-index: 1;
}

.game-card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 0 4px rgba(16, 20, 44, 0.92);
  background: var(--accent);
  color: var(--bg-main);
}

.game-card-icon-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
}

.game-card-content {
  display: grid;
  gap: 0.6rem;
  align-content: end;
  min-height: 10rem;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(176, 211, 255, 0.16);
  background: linear-gradient(180deg, rgba(7, 11, 28, 0.48), rgba(6, 9, 24, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.game-card h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.08;
  color: #f9fbff;
  letter-spacing: 0.01em;
}

.game-card p {
  font-size: clamp(0.88rem, 1.4vw, 1rem);
  line-height: 1.45;
  color: rgba(229, 235, 255, 0.84);
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: auto;
}

.daily-pill {
  border: 1px solid rgba(255, 215, 123, 0.75);
  border-radius: 999px;
  color: #ffe39a;
  width: fit-content;
  padding: 0.36rem 0.72rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(48, 34, 6, 0.55);
}

.play-pill {
  border: 1px solid rgba(164, 208, 255, 0.72);
  color: #f4f8ff;
  width: fit-content;
  padding: 0.42rem 0.8rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, rgba(50, 110, 178, 0.9), rgba(20, 63, 118, 0.92));
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.game-card.is-locked .play-pill {
  color: rgba(244, 239, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.35);
}

.game-card--art {
  min-height: 340px;
  border-color: rgba(138, 188, 245, 0.42);
  background: linear-gradient(180deg, rgba(9, 6, 16, 0.16) 0%, rgba(9, 6, 16, 0.92) 78%);
}

.game-card--art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 30, 0.06) 0%, rgba(6, 11, 28, 0.68) 56%, rgba(3, 6, 20, 0.9) 100%),
    linear-gradient(118deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 30%);
  pointer-events: none;
}

.game-card--art .game-card-icon {
  width: 52px;
  height: 52px;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 3px rgba(8, 8, 16, 0.82);
}

.game-card--art .game-card-content {
  border-color: rgba(182, 214, 255, 0.2);
  background: linear-gradient(180deg, rgba(6, 10, 24, 0.3), rgba(6, 9, 22, 0.84));
}

.game-card--art h2 {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.game-card--art p {
  color: #e7e0fa;
}

.game-card--art .daily-pill {
  color: #ffe39a;
  background: rgba(44, 32, 7, 0.62);
}

.game-card--art .play-pill {
  color: #f7fbff;
  border-color: rgba(188, 221, 255, 0.74);
}

.game-card--art:hover .play-pill,
.game-card--art:focus-visible .play-pill {
  transform: translateY(-1px);
}

.hub__footer {
  margin-top: 1.8rem;
  color: var(--text-dim);
  padding: 0.95rem;
  border-left: 4px solid var(--accent-a);
  background: rgba(14, 10, 21, 0.7);
  line-height: 1.45;
}

.inline-link {
  color: var(--accent-c);
}

.game-shell__top {
  display: flex;
  justify-content: space-between;
  gap: clamp(0.65rem, 1.5vw, 1rem);
  align-items: flex-start;
  padding: clamp(0.8rem, 1.8vw, 1.1rem);
}

.game-shell__top h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.25rem, 3.2vw, 2rem);
  line-height: 1.12;
}

.game-shell__top .kicker {
  font-size: clamp(0.56rem, 1.1vw, 0.68rem);
}

.game-shell__top .hub__subtitle {
  max-width: 78ch;
  font-size: clamp(0.64rem, 1.3vw, 0.78rem);
  line-height: 1.45;
}

.back-link {
  font-size: 0.75rem;
  color: var(--accent-b);
  text-decoration: none;
  margin-right: 1rem;
  border: 2px solid rgba(122, 244, 255, 0.45);
  padding: 0.45rem 0.6rem;
  align-self: start;
  transition: background 0.2s ease;
}

.back-link:hover,
.back-link:focus-visible {
  background: rgba(122, 244, 255, 0.1);
}

.daily-badge {
  margin-top: 0.5rem;
  color: var(--accent-b);
  font-size: 0.72rem;
  border-left: 4px solid var(--accent-a);
  padding-left: 0.5rem;
}

.arcade-token-panel {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.34rem;
}

.arcade-token-line {
  color: var(--accent-a);
  font-size: 0.64rem;
  line-height: 1.4;
}

.arcade-token-note {
  color: var(--text-dim);
  font-size: 0.58rem;
  line-height: 1.35;
}

.arcade-new-run {
  margin-right: 0;
  justify-self: start;
  font-size: 0.58rem;
  padding: 0.42rem 0.58rem;
}

.arcade-new-run.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.game-shell__frame {
  margin-top: 0;
  padding: clamp(0.65rem, 1.6vw, 1rem);
  background: linear-gradient(180deg, #1f1840, #1a1433);
  border: 4px solid rgba(122, 244, 255, 0.25);
  min-height: 0;
  height: 100%;
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
}

body.game--frontline-tactics .game-shell__frame {
  background:
    linear-gradient(180deg, rgba(235, 232, 211, 0.96), rgba(205, 214, 181, 0.98));
  border-color: rgba(109, 143, 126, 0.28);
  box-shadow: 0 14px 30px rgba(86, 102, 72, 0.16);
  overflow: visible;
}

body.game--frontline-tactics .game-root {
  overflow: visible;
}

.game-root {
  width: 100%;
  min-height: 0;
  overflow: auto;
}

.game-shell__mini-list {
  margin-top: 0;
  padding: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

body.game--frontline-tactics .game-shell__mini-list {
  display: none;
}

body.game--frontline-tactics .api-settings {
  display: none;
}

body.game--frontline-tactics .mini-link {
  border-color: rgba(109, 143, 126, 0.22);
  color: #455548;
  background: rgba(255, 255, 255, 0.3);
}

.mini-link {
  border: 2px solid rgba(122, 244, 255, 0.2);
  color: var(--text-main);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  background: rgba(18, 15, 26, 0.65);
  font-size: 0.65rem;
}

.mini-link.current {
  color: var(--accent-a);
  border-color: var(--accent-a);
}

.mini-link.resumable {
  border-color: rgba(255, 216, 106, 0.55);
}

.mini-link.play-again {
  border-color: rgba(255, 126, 212, 0.55);
}

.mini-link.is-locked {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
}

.loading-placeholder {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.pixel-game {
  width: min(640px, 100%);
  margin: 0 auto;
  text-align: center;
  display: grid;
  gap: 1rem;
}

.pixel-game h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent-a);
}

.pixel-game p {
  margin: 0.2rem 0;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 0.82rem;
}

.pixel-controls {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.pixel-board {
  margin: 0 auto;
  width: calc(3 * 86px + 2 * 0.75rem);
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 0.75rem;
}

.pixel-tile {
  width: 84px;
  height: 84px;
  border: 4px solid #0f0c19;
  background: #1e1532;
  color: #1b1b1b;
  font-family: inherit;
  font-size: 2.3rem;
  image-rendering: pixelated;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.pixel-tile.on {
  background: linear-gradient(180deg, #6ff8ff, #3ac4d1);
  color: #10232f;
}

.pixel-tile:focus-visible {
  outline: 3px solid var(--accent-c);
  outline-offset: 2px;
}

.pixel-button {
  border: 3px solid rgba(122, 244, 255, 0.5);
  background: rgba(18, 15, 26, 0.75);
  color: var(--text-main);
  padding: 0.56rem 0.8rem;
  font-family: inherit;
  text-transform: uppercase;
  font-size: 0.65rem;
  cursor: pointer;
}

.pixel-status {
  min-height: 1.5rem;
  color: var(--accent-c);
  font-size: 0.8rem;
}

body.game--daily-globe {
  color: #23364b;
  background-color: #eef3f7;
  background-image:
    radial-gradient(circle at 12% 12%, rgba(174, 221, 246, 0.72), transparent 26%),
    radial-gradient(circle at 84% 16%, rgba(255, 231, 184, 0.82), transparent 22%),
    linear-gradient(180deg, #fbfdff 0%, #eef4f8 46%, #e7eef4 100%);
}

body.game--daily-globe .game-shell {
  width: calc(100% - 0.75rem);
  min-height: calc(100dvh - 0.75rem);
  margin: 0.375rem auto;
  display: block;
}

body.game--daily-globe .game-shell__top,
body.game--daily-globe .game-shell__mini-list,
body.game--daily-globe .api-settings {
  display: none;
}

body.game--daily-globe .game-shell__frame {
  height: calc(100dvh - 0.75rem);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: auto;
}

body.game--daily-globe .game-root {
  display: flex;
  overflow: auto;
}

.globe-game {
  width: 100%;
  min-height: 100%;
  margin: auto;
  padding: clamp(1rem, 1.4vw, 1.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem 1rem;
  align-items: start;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(145, 165, 185, 0.36);
  border-radius: 32px;
  box-shadow: 0 24px 56px rgba(103, 126, 151, 0.18);
  backdrop-filter: blur(12px);
}

.globe-main {
  min-width: 0;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.globe-back-link {
  justify-self: start;
  text-decoration: none;
  color: #4f6984;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(132, 158, 187, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(109, 132, 156, 0.1);
}

.globe-back-link:hover,
.globe-back-link:focus-visible {
  background: #f4f8fb;
}

.globe-game > h2,
.globe-main > h2 {
  margin: 0;
  font-size: clamp(2rem, 3.1vw, 2.9rem);
  color: #1f3249;
}

.globe-info {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.globe-target {
  margin: 0;
  color: #0f6a82;
  font-size: 1.35rem;
  font-weight: 700;
}

.globe-message {
  margin: 0;
  color: #334f68;
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 1.2rem;
}

.globe-attempts {
  margin: 0;
  font-size: 1rem;
  color: #708399;
  font-weight: 600;
}

.globe-hint {
  margin: 0;
  color: #6a7d92;
  font-size: 0.9rem;
}

.globe-pill {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  margin: 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.globe-pill.cold {
  color: #991b1b;
  background: rgba(185, 28, 28, 0.1);
}

.globe-pill.hot {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.globe-pill.exact {
  color: #8a6200;
  background: rgba(244, 197, 66, 0.16);
}

.globe-canvas-wrap {
  width: min(100%, calc(100dvh - 210px), 1120px);
  aspect-ratio: 1 / 1;
  margin: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(68, 101, 133, 0.22);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 38%, rgba(103, 155, 223, 0.15), transparent 30%),
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.13), transparent 12%),
    linear-gradient(180deg, rgba(10, 24, 44, 0.98), rgba(4, 12, 24, 1));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 22px 46px rgba(34, 57, 82, 0.22);
}

.globe-zoom-controls {
  justify-self: start;
  width: auto;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 0;
}

.globe-mobile-action {
  display: none;
}

.globe-mobile-control-break {
  display: none;
}

.globe-zoom-controls .globe-zoom-label {
  min-width: 3.8rem;
  text-align: center;
  color: #29435d;
  font-size: 0.78rem;
  padding: 0.48rem 0.58rem;
  border: 1px solid rgba(132, 158, 187, 0.44);
  border-radius: 14px;
  background: rgba(246, 249, 252, 0.96);
  font-weight: 700;
}

body.game--daily-globe .pixel-button,
body.game--daily-globe .globe-play-again {
  border: 1px solid rgba(132, 158, 187, 0.5);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #29435d;
  padding: 0.56rem 0.82rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(109, 132, 156, 0.12);
}

body.game--daily-globe .pixel-button:hover,
body.game--daily-globe .pixel-button:focus-visible,
body.game--daily-globe .globe-play-again:hover,
body.game--daily-globe .globe-play-again:focus-visible {
  background: #f4f8fb;
}

body.game--daily-globe .pixel-button--ghost {
  border-color: rgba(132, 158, 187, 0.5);
  background: rgba(243, 247, 251, 0.96);
}

.globe-renderer {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.globe-renderer:active {
  cursor: grabbing;
}

.globe-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.globe-confetti-piece {
  position: absolute;
  top: -10%;
  width: 10px;
  height: 18px;
  border-radius: 4px;
  opacity: 0;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

.globe-confetti.is-active .globe-confetti-piece {
  animation: globe-confetti-fall var(--duration, 2.4s) ease-in var(--delay, 0s) forwards;
}

@keyframes globe-confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg);
  }

  10% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 0px), 460px, 0) rotate(var(--rotation, 240deg));
  }
}

.globe-shadow {
  fill: rgba(0, 0, 0, 0.25);
}

.globe-shell {
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 3px;
  fill: #1e3b6b;
  fill-opacity: 0.85;
}

.globe-graticule {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 0.8px;
}

.globe-country {
  stroke-width: 0.6px;
  stroke: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: fill 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.globe-country:hover,
.globe-country:focus-visible {
  stroke: rgba(255, 255, 255, 0.75);
  outline: none;
}

.globe-country:focus {
  outline: none;
}

.globe-history {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.globe-history-panel {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(248, 251, 253, 0.88);
  border: 1px solid rgba(145, 165, 185, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.globe-history-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: clamp(0.84rem, 1.4vw, 1rem);
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  background: #eef3f7;
  color: #607287;
  flex-wrap: wrap;
  line-height: 1.35;
}

.globe-history-row span:last-child {
  color: inherit;
  font-weight: 600;
  margin-left: auto;
}

.globe-play-again {
  margin-right: 0;
  justify-self: start;
  text-decoration: none;
}

.globe-run-link {
  align-self: start;
}

.studio-shell {
  width: min(1320px, calc(100% - 1rem));
  margin: clamp(0.5rem, 1.2vw, 1rem) auto;
  display: grid;
  gap: 0.85rem;
}

.studio-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1.45fr) minmax(260px, 0.9fr);
  gap: 0.85rem;
  align-items: stretch;
  padding: clamp(0.8rem, 1.8vw, 1.2rem);
  border: 4px solid rgba(255, 216, 106, 0.3);
  box-shadow: var(--shadow);
  background:
    linear-gradient(140deg, rgba(11, 13, 24, 0.9), rgba(19, 30, 46, 0.78)),
    radial-gradient(circle at top left, rgba(255, 216, 106, 0.18), transparent 38%),
    linear-gradient(90deg, rgba(122, 244, 255, 0.06), rgba(255, 126, 212, 0.04));
}

.studio-kicker {
  margin: 0 0 0.55rem;
  color: var(--accent-c);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.studio-hero__copy h1 {
  margin: 0 0 0.55rem;
}

.studio-summary {
  border: 2px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem;
  background: rgba(6, 11, 20, 0.72);
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.studio-summary__stat {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.studio-summary__stat span {
  color: var(--accent-a);
  font-size: 1.25rem;
}

.studio-summary__stat small,
.studio-summary__note {
  color: var(--text-dim);
  font-size: 0.62rem;
  line-height: 1.5;
}

.studio-summary__note strong {
  color: var(--accent-c);
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 0.85rem;
  min-height: calc(100dvh - 12rem);
}

.studio-panel {
  background: linear-gradient(180deg, rgba(22, 20, 40, 0.95), rgba(13, 15, 29, 0.96));
  border: 3px solid rgba(122, 244, 255, 0.16);
  box-shadow: var(--shadow);
  padding: 0.85rem;
  min-width: 0;
}

.studio-panel--queue {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.studio-panel--detail {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.studio-panel__header {
  display: grid;
  gap: 0.3rem;
}

.studio-panel__header h2 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.studio-panel__eyebrow {
  margin: 0;
  color: var(--accent-b);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.studio-queue {
  display: grid;
  gap: 0.65rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.studio-queue__item {
  width: 100%;
  text-align: left;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 10, 18, 0.7);
  color: var(--text-main);
  padding: 0.7rem;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.45rem;
}

.studio-queue__item.is-active {
  border-color: rgba(255, 216, 106, 0.68);
  background: rgba(31, 28, 12, 0.42);
}

.studio-queue__top,
.studio-queue__bottom {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.studio-queue__top strong {
  font-size: 0.72rem;
}

.studio-queue__bottom {
  color: var(--text-dim);
  font-size: 0.53rem;
  line-height: 1.4;
}

.studio-queue__badge {
  padding: 0.14rem 0.38rem;
  border: 1px solid currentColor;
  text-transform: uppercase;
  font-size: 0.5rem;
}

.studio-queue__badge--pending {
  color: var(--text-dim);
}

.studio-queue__badge--generated {
  color: var(--accent-a);
}

.studio-queue__badge--approved {
  color: var(--accent-c);
}

.studio-asset-meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.studio-meta-pill {
  min-width: 120px;
  padding: 0.5rem 0.58rem;
  background: rgba(7, 8, 14, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 0.24rem;
}

.studio-meta-pill small {
  color: var(--text-dim);
  font-size: 0.5rem;
  text-transform: uppercase;
}

.studio-meta-pill strong {
  font-size: 0.63rem;
  color: var(--text-main);
}

.studio-status {
  color: var(--accent-a);
  font-size: 0.64rem;
  line-height: 1.55;
  min-height: 1.2rem;
}

.studio-brief {
  display: grid;
  gap: 0.5rem;
}

.studio-brief__row {
  display: grid;
  gap: 0.18rem;
  padding: 0.55rem 0.65rem;
  background: rgba(8, 11, 20, 0.68);
  border-left: 3px solid rgba(122, 244, 255, 0.28);
}

.studio-brief__row small {
  color: var(--accent-c);
  font-size: 0.52rem;
  text-transform: uppercase;
}

.studio-brief__row p {
  color: var(--text-dim);
  font-size: 0.64rem;
  line-height: 1.6;
}

.studio-command-block {
  background: rgba(5, 8, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.7rem;
}

.studio-command-block pre {
  margin: 0.4rem 0 0;
  white-space: pre-wrap;
  color: var(--accent-a);
  font-size: 0.63rem;
  line-height: 1.65;
}

.studio-approved {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 0.8rem;
  align-items: center;
  border: 2px solid rgba(255, 216, 106, 0.34);
  background: linear-gradient(135deg, rgba(35, 28, 8, 0.7), rgba(17, 12, 4, 0.86));
  padding: 0.75rem;
}

.studio-approved h3 {
  margin: 0.12rem 0 0.45rem;
  font-size: 0.9rem;
}

.studio-approved__copy p:last-child {
  color: var(--text-dim);
  font-size: 0.64rem;
  line-height: 1.55;
}

.studio-approved__art {
  display: grid;
  place-items: center;
  min-height: 132px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.06) 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}

.studio-approved__art img {
  width: min(120px, 100%);
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
}

.studio-approved__tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.studio-approved__tile {
  margin: 0;
  display: grid;
  gap: 0.22rem;
  justify-items: center;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
}

.studio-approved__tile img {
  width: min(88px, 100%);
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
}

.studio-approved__tile figcaption {
  color: var(--text-dim);
  font-size: 0.52rem;
}

.studio-candidates {
  display: grid;
  gap: 0.6rem;
}

.studio-candidates__header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: end;
}

.studio-candidates__hint {
  color: var(--text-dim);
  font-size: 0.58rem;
  line-height: 1.45;
}

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

.studio-candidate {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
  background: rgba(8, 10, 18, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.studio-candidate.is-approved {
  border-color: rgba(255, 216, 106, 0.7);
}

.studio-candidate.is-shortlisted {
  border-color: rgba(122, 244, 255, 0.65);
}

.studio-candidate__preview {
  min-height: 208px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    radial-gradient(circle at top, rgba(122, 244, 255, 0.08), transparent 45%);
  background-position: 0 0, 12px 12px, center;
  background-size: 24px 24px, 24px 24px, auto;
}

.studio-candidate__preview img {
  width: min(180px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  image-rendering: pixelated;
}

.studio-candidate__mini-tiles {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.22rem;
  margin-top: 0.45rem;
}

.studio-candidate__mini-tiles img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  image-rendering: pixelated;
  background: rgba(255, 255, 255, 0.04);
}

.studio-candidate__body {
  display: grid;
  gap: 0.35rem;
}

.studio-candidate__heading {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: start;
}

.studio-candidate__heading h3 {
  margin: 0;
  font-size: 0.74rem;
}

.studio-candidate__heading span,
.studio-candidate__meta,
.studio-candidate__note {
  font-size: 0.56rem;
}

.studio-candidate__heading span,
.studio-candidate__meta {
  color: var(--text-dim);
}

.studio-candidate__note {
  color: var(--accent-a);
  line-height: 1.45;
}

.studio-candidate__actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.studio-empty {
  padding: 1rem;
  border: 2px dashed rgba(255, 255, 255, 0.16);
  color: var(--text-dim);
  background: rgba(8, 10, 18, 0.5);
  display: grid;
  gap: 0.45rem;
}

@media (min-width: 980px) {
  .globe-history-panel {
    align-content: start;
    position: sticky;
    top: 0;
  }

  .globe-history {
    max-height: min(76vh, 840px);
    overflow: auto;
    align-content: start;
    padding-right: 0.2rem;
  }
}

@media (max-width: 1080px) {
  .studio-hero {
    grid-template-columns: 1fr;
  }

  .studio-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .studio-approved {
    grid-template-columns: 1fr;
  }

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

  .studio-candidate-grid {
    grid-template-columns: 1fr;
  }
}

body.game--guess-the-sahaba {
  color: #233044;
  background-color: #eef3fb;
  background-image:
    radial-gradient(circle at top left, rgba(171, 217, 255, 0.6), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 233, 184, 0.78), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, #edf3fb 50%, #e7eef8 100%);
}

body.game--guess-the-sahaba .game-shell {
  width: min(1380px, calc(100% - 1rem));
  min-height: calc(100dvh - 1rem);
  margin: 0.5rem auto;
  display: block;
}

body.game--guess-the-sahaba .game-shell__top,
body.game--guess-the-sahaba .game-shell__mini-list,
body.game--guess-the-sahaba .api-settings {
  display: none;
}

body.game--guess-the-sahaba .game-shell__frame {
  height: calc(100dvh - 1rem);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

body.game--guess-the-sahaba .game-root {
  overflow: hidden;
  display: flex;
}

body.game--guess-the-sahaba .loading-placeholder {
  margin: auto;
  max-width: 34rem;
  padding: 1.5rem;
  border: 1px solid rgba(112, 140, 173, 0.22);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  color: #51637a;
  text-align: center;
  box-shadow: 0 20px 44px rgba(93, 119, 150, 0.14);
}

.sahaba-game {
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 1rem;
  padding: 1rem;
}

.sahaba-game:focus,
.sahaba-game:focus-visible {
  outline: none;
}

.sahaba-main-panel,
.sahaba-sidebar {
  border: 1px solid rgba(115, 139, 171, 0.2);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 18px 44px rgba(96, 122, 150, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sahaba-main-panel {
  min-height: 0;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  grid-template-rows: auto auto auto;
  gap: 0.85rem;
  padding: 1rem 1rem 1.1rem;
  overflow: hidden;
  isolation: isolate;
}

.sahaba-intro {
  display: grid;
  gap: 0.55rem;
  text-align: center;
  justify-items: center;
}

.sahaba-intro h2 {
  margin: 0;
  font-size: clamp(2.1rem, 3.2vw, 3.15rem);
  letter-spacing: 0.02em;
  color: #243247;
}

.sahaba-subtitle {
  margin: 0;
  color: #617188;
  font-size: 1.04rem;
  line-height: 1.45;
}

.sahaba-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.42rem 0.82rem;
  border: 1px solid rgba(112, 140, 173, 0.24);
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.92);
  color: #54708c;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: transform 0.12s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.sahaba-home-link:hover,
.sahaba-home-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(93, 119, 150, 0.12);
}

.sahaba-legend {
  margin: 0;
  color: #5c7594;
  font-size: 1rem;
  line-height: 1.5;
}

.sahaba-hint-count {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.55rem 0.88rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99, 154, 209, 0.12), rgba(222, 237, 255, 0.75));
  border: 1px solid rgba(110, 160, 212, 0.2);
  color: #3b5e81;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sahaba-status {
  margin: 0;
  min-height: 1.35rem;
  color: #2f6289;
  font-size: 1.04rem;
}

.sahaba-board {
  --letters: 5;
  --tile-gap: clamp(0.32rem, 0.58vw, 0.5rem);
  --tile-size: clamp(4.8rem, min(6vw, 9dvh), 6.1rem);
  width: min(
    100%,
    calc((var(--letters) * var(--tile-size)) + ((var(--letters) - 1) * var(--tile-gap)))
  );
  display: grid;
  gap: var(--tile-gap);
  position: relative;
  z-index: 1;
}

.sahaba-answer-entry {
  width: min(100%, 520px);
  display: none;
  gap: 0.45rem;
  padding: 0.82rem 0.92rem 0.95rem;
  border: 1px solid rgba(112, 140, 173, 0.2);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.96), rgba(233, 243, 252, 0.9));
  box-shadow:
    0 12px 28px rgba(97, 124, 152, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sahaba-answer-entry[hidden] {
  display: none !important;
}

.sahaba-answer-label {
  color: #42627f;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sahaba-answer-form {
  display: block;
}

.sahaba-answer-input {
  width: 100%;
  min-height: 3.2rem;
  border: 1px solid #c7d7e7;
  border-radius: 16px;
  background: #ffffff;
  color: #213044;
  font-family: inherit;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.82rem 0.95rem;
}

.sahaba-answer-input::placeholder {
  color: #7d8ea2;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.sahaba-answer-input:focus-visible {
  outline: 2px solid #6da8d9;
  outline-offset: 2px;
  border-color: #6da8d9;
}

.sahaba-answer-input:disabled {
  cursor: default;
  opacity: 0.68;
}

.sahaba-answer-helper {
  color: #5c7594;
  font-size: 0.84rem;
  line-height: 1.45;
}

.sahaba-board-row {
  display: grid;
  grid-template-columns: repeat(var(--letters), minmax(0, 1fr));
  gap: var(--tile-gap);
}

.sahaba-tile {
  aspect-ratio: 1 / 1;
  border: 2px solid #d3deea;
  border-radius: 22px;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: clamp(1.5rem, 2.55vw, 2.15rem);
  color: #213044;
  text-transform: uppercase;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.08s ease;
  user-select: none;
}

.sahaba-tile.is-filled {
  border-color: #7aa4c9;
  background: #f5f9fe;
  transform: translateY(-1px);
}

.sahaba-tile.is-revealed {
  color: #f7f9ff;
  border-color: transparent;
}

.sahaba-tile.is-correct {
  background: #5d9c69;
}

.sahaba-tile.is-present {
  background: #d3ab43;
}

.sahaba-tile.is-absent {
  background: #94a3b5;
}

.sahaba-keyboard {
  width: min(100%, 700px);
  display: grid;
  gap: 0.38rem;
  position: relative;
  z-index: 1;
}

.sahaba-celebration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.sahaba-celebration-badge {
  position: absolute;
  left: 50%;
  top: 23%;
  transform: translate(-50%, -50%);
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: rgba(93, 156, 105, 0.12);
  border: 1px solid rgba(93, 156, 105, 0.25);
  color: #3f7b4b;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: sahabaCelebrationBadge 900ms ease both;
}

.sahaba-celebration-piece {
  position: absolute;
  left: var(--left);
  top: 25%;
  width: 0.5rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--color);
  opacity: 0;
  transform: translate(-50%, 0) rotate(0deg);
  animation: sahabaCelebrationFall var(--duration) ease-out var(--delay) forwards;
}

.sahaba-main-panel.is-celebrating .sahaba-board {
  animation: sahabaSolvedPulse 680ms ease-out both;
}

.sahaba-game.is-celebrating .sahaba-result {
  animation: sahabaSolvedCard 720ms ease-out 120ms both;
}

.sahaba-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.sahaba-actions[hidden],
.sahaba-result[hidden] {
  display: none !important;
}

.sahaba-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 0.34rem;
}

.sahaba-key {
  min-width: 3rem;
  height: 3.45rem;
  border: 1px solid #d5dfeb;
  border-radius: 16px;
  background: #eef4fa;
  color: #334962;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0.52rem;
  transition: transform 0.08s ease, background-color 0.12s ease, color 0.12s ease;
}

.sahaba-key:hover {
  background: #e5edf7;
}

.sahaba-key:active {
  transform: translateY(1px);
}

.sahaba-key:focus-visible,
.sahaba-home-link:focus-visible,
.sahaba-secondary-link:focus-visible,
.sahaba-secondary-button:focus-visible,
.sahaba-replay-button:focus-visible,
.sahaba-give-up-button:focus-visible {
  outline: 2px solid #6da8d9;
  outline-offset: 2px;
}

.sahaba-key.is-wide {
  min-width: 5.6rem;
  font-size: 0.76rem;
}

.sahaba-key.is-correct {
  background: #5d9c69;
  color: #ffffff;
}

.sahaba-key.is-present {
  background: #d3ab43;
  color: #ffffff;
}

.sahaba-key.is-absent {
  background: #94a3b5;
  color: #ffffff;
}

.sahaba-key:disabled {
  cursor: default;
  opacity: 0.88;
}

.sahaba-sidebar {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 249, 255, 0.96)),
    radial-gradient(circle at top right, rgba(122, 164, 201, 0.18), transparent 34%);
  overflow: auto;
}

.sahaba-sidebar-title,
.sahaba-result h3 {
  margin: 0;
  color: #294567;
  font-size: clamp(2.1rem, 3vw, 3rem);
}

.sahaba-sidebar-title-mobile {
  display: none;
}

.sahaba-hint-card {
  margin: 0;
  padding: 1.2rem 1.25rem;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(230, 241, 255, 0.98), rgba(244, 249, 255, 0.98));
  color: #465a73;
  font-size: 1.15rem;
  line-height: 1.65;
  border: 1px solid rgba(118, 165, 214, 0.24);
  border-left: 7px solid #73b3ff;
  box-shadow:
    0 12px 28px rgba(102, 135, 170, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sahaba-wallet {
  margin: 0;
  padding: 1rem 1.08rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(196, 224, 255, 0.58), rgba(225, 239, 255, 0.86));
  color: #436688;
  font-size: 1rem;
  border: 1px solid rgba(118, 165, 214, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.sahaba-give-up-button,
.sahaba-secondary-button,
.sahaba-secondary-link,
.sahaba-replay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  padding: 0.92rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.94rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  border: 1px solid rgba(112, 140, 173, 0.2);
  background: #f7fbff;
  color: #3b5876;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sahaba-secondary-link:hover,
.sahaba-secondary-button:hover,
.sahaba-secondary-link:focus-visible,
.sahaba-secondary-button:focus-visible,
.sahaba-replay-button:hover,
.sahaba-replay-button:focus-visible,
.sahaba-give-up-button:hover,
.sahaba-give-up-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(93, 119, 150, 0.14);
  color: #244f7d;
}

.sahaba-give-up-button {
  cursor: pointer;
}

.sahaba-give-up-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.sahaba-secondary-button {
  display: none;
  cursor: pointer;
}

.sahaba-secondary-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.sahaba-result {
  border: 1px solid rgba(120, 148, 180, 0.18);
  border-radius: 18px;
  background: #f7fbff;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
}

.sahaba-result p {
  margin: 0;
  line-height: 1.5;
  color: #5a6f87;
  font-size: 0.98rem;
}

.sahaba-reveal-name {
  color: #243247 !important;
  font-weight: 700;
}

@keyframes sahabaCelebrationFall {
  0% {
    opacity: 0;
    transform: translate(-50%, -0.2rem) rotate(0deg) scale(0.8);
  }

  10% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), 10.5rem) rotate(210deg) scale(1);
  }
}

@keyframes sahabaCelebrationBadge {
  0% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(0.84);
  }

  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -28%) scale(1);
  }
}

@keyframes sahabaSolvedPulse {
  0% {
    transform: scale(0.98);
    filter: saturate(1);
  }

  45% {
    transform: scale(1.02);
    filter: saturate(1.08);
  }

  100% {
    transform: scale(1);
    filter: saturate(1);
  }
}

@keyframes sahabaSolvedCard {
  0% {
    transform: translateY(0.45rem);
    box-shadow: 0 0 0 rgba(93, 156, 105, 0);
  }

  100% {
    transform: translateY(0);
    box-shadow: 0 16px 34px rgba(93, 156, 105, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sahaba-main-panel.is-celebrating .sahaba-board,
  .sahaba-main-panel.is-celebrating .sahaba-result,
  .sahaba-celebration-badge,
  .sahaba-celebration-piece {
    animation: none !important;
  }
}

@media (max-width: 1120px) {
  .sahaba-game {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .sahaba-board {
    --tile-gap: clamp(0.26rem, 0.5vw, 0.42rem);
    --tile-size: clamp(3.9rem, min(5vw, 7.2dvh), 4.8rem);
  }

  .sahaba-key {
    min-width: 2.1rem;
    height: 2.45rem;
  }
}


@media (max-height: 920px) and (min-width: 861px) {
  .sahaba-game {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .sahaba-main-panel {
    gap: 0.42rem;
    padding-top: 0.72rem;
  }

  .sahaba-intro {
    gap: 0.25rem;
  }

  .sahaba-intro h2 {
    font-size: clamp(1.12rem, 1.6vw, 1.55rem);
  }

  .sahaba-subtitle,
  .sahaba-status,
  .sahaba-legend,
  .sahaba-hint-count,
  .sahaba-hint-card,
  .sahaba-wallet,
  .sahaba-result p {
    font-size: 0.64rem;
  }

  .sahaba-home-link {
    min-height: 1.85rem;
    font-size: 0.54rem;
    padding: 0.35rem 0.68rem;
  }

  .sahaba-board {
    --tile-gap: 0.2rem;
    --tile-size: clamp(3.2rem, min(4.3vw, 5.6dvh), 3.95rem);
  }

  .sahaba-board-row {
    gap: var(--tile-gap);
  }

  .sahaba-tile {
    border-radius: 13px;
    font-size: 0.96rem;
  }

  .sahaba-keyboard {
    width: min(100%, 430px);
    gap: 0.18rem;
  }

  .sahaba-keyboard-row {
    gap: 0.18rem;
  }

  .sahaba-key {
    min-width: 1.6rem;
    height: 1.88rem;
    font-size: 0.5rem;
    border-radius: 10px;
  }

  .sahaba-key.is-wide {
    min-width: 2.9rem;
    font-size: 0.42rem;
  }

  .sahaba-sidebar {
    gap: 0.55rem;
    padding: 0.72rem;
  }

  .sahaba-sidebar-title,
  .sahaba-result h3 {
    font-size: 1.35rem;
  }

  .sahaba-hint-card {
    padding: 0.72rem 0.82rem;
    border-radius: 18px;
  }

  .sahaba-actions {
    gap: 0.45rem;
  }

  .sahaba-secondary-button,
  .sahaba-secondary-link,
  .sahaba-replay-button,
  .sahaba-give-up-button {
    min-height: 2.2rem;
    padding: 0.58rem 0.82rem;
    font-size: 0.58rem;
  }
}

@media (max-width: 860px) {
  body.game--guess-the-sahaba .game-shell {
    min-height: auto;
  }

  body.game--guess-the-sahaba .game-shell__frame {
    height: auto;
    min-height: calc(100dvh - 1rem);
    overflow: auto;
  }

  body.game--guess-the-sahaba .game-root {
    overflow: auto;
  }

  .sahaba-game {
    grid-template-columns: 1fr;
  }

  .sahaba-board {
    --tile-gap: clamp(0.24rem, 0.7vw, 0.38rem);
    --tile-size: clamp(3.25rem, min(15vw, 5.8dvh), 4.5rem);
  }

  .sahaba-answer-entry {
    display: grid;
  }

  .sahaba-answer-input {
    min-height: 3.35rem;
    font-size: 1rem;
  }

  .sahaba-keyboard {
    display: none;
  }

  .sahaba-sidebar {
    overflow: visible;
    order: -1;
  }

  .sahaba-sidebar-title-desktop,
  .sahaba-legend,
  .sahaba-hint-count,
  .sahaba-wallet {
    display: none;
  }

  .sahaba-sidebar-title-mobile {
    display: inline;
  }

  .sahaba-sidebar-title {
    font-size: 1.85rem;
  }

  .sahaba-hint-card {
    font-size: 1rem;
    line-height: 1.55;
  }

  .sahaba-answer-helper {
    font-size: 0.8rem;
  }

  .sahaba-actions {
    gap: 0.55rem;
  }

  .sahaba-secondary-button {
    display: inline-flex;
  }

  .sahaba-give-up-button,
  .sahaba-secondary-button,
  .sahaba-secondary-link {
    min-height: 2.8rem;
    padding: 0.72rem 0.95rem;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
  }
}

.api-settings {
  margin-top: 1rem;
  border: 2px solid rgba(122, 244, 255, 0.3);
  background: rgba(12, 10, 20, 0.72);
  box-shadow: var(--shadow);
}

.api-settings__summary {
  cursor: pointer;
  padding: 0.75rem 0.9rem;
  color: var(--accent-a);
  user-select: none;
  font-size: 0.78rem;
}

.api-settings__body {
  border-top: 1px solid rgba(122, 244, 255, 0.2);
  padding: 0.85rem;
  display: grid;
  gap: 0.65rem;
}

.api-settings__hint {
  color: var(--text-dim);
  font-size: 0.68rem;
  line-height: 1.5;
}

.api-settings__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.api-settings__row--wrap {
  flex-wrap: wrap;
}

.api-settings__input {
  flex: 1 1 320px;
  min-width: 0;
  border: 2px solid rgba(122, 244, 255, 0.3);
  background: rgba(17, 15, 29, 0.9);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.66rem;
  padding: 0.55rem 0.6rem;
}

.api-settings__input::placeholder {
  color: rgba(200, 188, 224, 0.55);
}

.api-settings__button {
  font-size: 0.6rem;
}

.api-settings__status {
  min-height: 1rem;
  color: var(--accent-c);
  font-size: 0.65rem;
}

@media (max-height: 820px) {
  .game-shell__top .hub__subtitle {
    display: none;
  }

  .globe-canvas-wrap {
    width: min(100%, clamp(260px, 56vh, 640px));
  }

  .globe-zoom-controls {
    width: min(100%, clamp(260px, 56vh, 640px));
  }
}

@media (max-width: 980px) {
  .hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #app {
    width: calc(100% - 0.75rem);
    margin: 0.55rem auto;
  }

  .game-shell {
    width: calc(100% - 0.5rem);
    margin: 0.25rem auto;
    min-height: calc(100dvh - 0.5rem);
    gap: 0.5rem;
  }

  .hub__header,
  .game-shell__top,
  .game-shell__frame {
    padding: 0.8rem;
    border-width: 3px;
  }

  .hub__subtitle {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .game-card {
    min-height: auto;
    padding: 0.85rem;
  }

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

  .game-card-content {
    min-height: auto;
    padding: 0.9rem;
  }

  .back-link {
    margin-right: 0;
  }

  .game-shell__top {
    flex-wrap: wrap;
  }

  .game-shell__top h1 {
    font-size: clamp(1.05rem, 7vw, 1.5rem);
    margin-bottom: 0.3rem;
  }

  .game-shell__top .hub__subtitle {
    font-size: 0.66rem;
    line-height: 1.4;
  }

  .arcade-token-line {
    font-size: 0.6rem;
  }

  .arcade-token-note {
    font-size: 0.56rem;
  }

  .game-shell__mini-list {
    padding: 0.65rem;
  }

  .globe-canvas-wrap {
    width: min(100%, clamp(220px, 54vh, 520px));
  }

  .globe-zoom-controls {
    width: auto;
    gap: 0.35rem;
  }

  .globe-mobile-action {
    display: inline-flex;
  }

  .globe-mobile-control-break {
    display: block;
    flex-basis: 100%;
    height: 0;
    order: 1;
  }

  .globe-zoom-controls > :not(.globe-control-reset):not(.globe-mobile-action) {
    order: 1;
  }

  .globe-zoom-controls .globe-control-reset,
  .globe-zoom-controls .globe-mobile-action {
    order: 2;
  }

  .globe-zoom-controls .globe-zoom-label {
    min-width: 3.3rem;
    padding-left: 0.48rem;
    padding-right: 0.48rem;
  }

  body.game--daily-globe .globe-zoom-controls .pixel-button,
  body.game--daily-globe .globe-zoom-controls .globe-play-again {
    padding: 0.52rem 0.72rem;
    font-size: 0.68rem;
  }

  body.game--daily-globe .globe-zoom-controls .globe-mobile-run-link,
  body.game--daily-globe .globe-zoom-controls .globe-mobile-action {
    white-space: nowrap;
  }

  body.game--daily-globe .globe-zoom-controls .globe-control-reset,
  body.game--daily-globe .globe-zoom-controls .globe-mobile-action {
    flex: 0 0 auto;
  }

  .sahaba-game {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .sahaba-toolbar,
  .sahaba-main-panel,
  .sahaba-sidebar {
    border-radius: 22px;
  }

  .sahaba-toolbar,
  .sahaba-sidebar,
  .sahaba-main-panel {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .sahaba-board {
    width: min(100%, min(40dvh, 340px));
  }

  .sahaba-answer-entry {
    padding-left: 0.78rem;
    padding-right: 0.78rem;
  }

  .sahaba-answer-input {
    min-height: 3.05rem;
    font-size: 0.94rem;
    padding-left: 0.78rem;
    padding-right: 0.78rem;
  }

  .sahaba-key {
    min-width: 1.58rem;
    height: 2.2rem;
    font-size: 0.5rem;
    padding: 0 0.26rem;
  }

  .sahaba-key.is-wide {
    min-width: 2.7rem;
    font-size: 0.46rem;
  }

  .api-settings__summary {
    font-size: 0.7rem;
    padding: 0.65rem 0.75rem;
  }

  .api-settings__body {
    padding: 0.7rem;
  }

  .api-settings__row {
    flex-wrap: wrap;
  }

  .api-settings__input {
    flex: 1 1 100%;
    width: 100%;
  }
}

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

  .globe-canvas-wrap {
    width: min(100%, 860px);
  }

  .globe-history-panel {
    position: static;
  }
}

.frontline-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.frontline-ui-surface {
  background:
    linear-gradient(170deg, rgba(10, 10, 22, 0.84), rgba(10, 10, 22, 0.96)),
    url("/output/imagegen/frontline-ui-panel.png") center / cover no-repeat;
  border: 2px solid rgba(120, 190, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.frontline-topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.12rem;
  align-items: start;
  padding: 0.28rem 0.55rem 0.22rem;
  background:
    linear-gradient(180deg, rgba(7, 10, 18, 0.88), rgba(7, 10, 18, 0.94));
  border-color: rgba(124, 177, 187, 0.34);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.frontline-turn-meta {
  display: grid;
  gap: 0.02rem;
  min-width: 0;
  width: 100%;
  align-content: center;
  justify-items: center;
  text-align: center;
  overflow-wrap: normal;
  word-break: normal;
}

.frontline-turn-meta h2 {
  margin: 0;
  font-size: clamp(0.7rem, 1vw, 0.82rem);
  color: #506351;
  letter-spacing: 0.02em;
  text-transform: none;
}

.frontline-topbar-title {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frontline-topbar-title__text {
  flex: 0 0 auto;
  white-space: nowrap;
}

.frontline-topbar-title__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
  font-family:
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    sans-serif;
  font-size: 1em;
  transform: translateY(-0.02em);
  flex: 0 0 auto;
}

.frontline-topbar-subtitle {
  margin: 0;
  width: 100%;
  font-size: 0.56rem;
  line-height: 1.08;
  color: rgba(66, 80, 71, 0.72);
  letter-spacing: 0.03em;
  text-transform: none;
}

.frontline-layout {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  width: min(100%, calc(100vw - 1.5rem));
}

.frontline-stage {
  display: grid;
  grid-template-columns: 248px max-content 248px;
  gap: 1rem;
  align-items: start;
  justify-content: center;
  width: 100%;
}

.frontline-stage__center {
  display: grid;
  gap: 0.24rem;
  justify-items: center;
  align-content: start;
  min-width: 0;
}

.frontline-board-wrap {
  position: relative;
  border: 3px solid #101010;
  background: #0d1022;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: none;
  overscroll-behavior: none;
  touch-action: none;
}

.frontline-corner-chip {
  position: absolute;
  z-index: 4;
  min-height: 20px;
  padding: 0.16rem 0.34rem;
  border: 2px solid rgba(16, 16, 16, 0.92);
  background: rgba(248, 248, 244, 0.9);
  color: #2f3a35;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  text-transform: uppercase;
}

.frontline-corner-chip--left {
  left: 8px;
  top: 8px;
}

.frontline-corner-chip--right {
  right: 8px;
  top: 8px;
}

.frontline-audio-controls {
  position: absolute;
  z-index: 5;
  top: 46px;
  right: 8px;
  display: grid;
  gap: 0.35rem;
}

.frontline-audio-toggle {
  position: relative;
  min-width: 84px;
  min-height: 34px;
  padding: 0.28rem 0.46rem;
  border: 2px solid rgba(16, 16, 16, 0.92);
  background: rgba(248, 248, 244, 0.97);
  color: #2f3a35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  font: inherit;
  font-size: 0.46rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.frontline-audio-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: square;
  stroke-linejoin: miter;
  flex: 0 0 auto;
}

.frontline-audio-toggle__slash {
  position: absolute;
  width: 22px;
  height: 2px;
  background: #d4513f;
  transform: rotate(-38deg) scaleX(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

.frontline-audio-toggle__text {
  line-height: 1;
}

.frontline-audio-toggle[data-state="off"] {
  background: rgba(239, 228, 220, 0.96);
  color: #6e5145;
}

.frontline-audio-toggle[data-state="off"] .frontline-audio-toggle__slash {
  transform: rotate(-38deg) scaleX(1);
}

.frontline-audio-toggle[data-state="ready"] {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 12px rgba(123, 192, 255, 0.24);
}

.frontline-audio-toggle:hover,
.frontline-audio-toggle:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.frontline-funds-hud {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  min-width: 160px;
  padding: 0.22rem 0.56rem 0.26rem;
  border: 2px solid rgba(16, 16, 16, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 247, 212, 0.98), rgba(244, 233, 177, 0.98));
  color: #2f3a35;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
  text-align: center;
}

.frontline-funds-hud__label {
  font-size: 0.4rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(89, 83, 38, 0.92);
}

.frontline-funds-hud__value {
  display: block;
  margin-top: 0.04rem;
  font-size: 0.72rem;
  line-height: 1;
  color: #3d3720;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.45);
}

.frontline-map-turn-button {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 6;
  min-width: 152px;
  min-height: 38px;
  padding: 0.34rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 18px rgba(189, 108, 55, 0.28);
}

.frontline-map-turn-button:disabled {
  opacity: 0.88;
  box-shadow: 0 8px 14px rgba(94, 93, 90, 0.2);
}

.frontline-map-turn-button:hover,
.frontline-map-turn-button:focus-visible {
  transform: translateX(-50%);
  outline: none;
}

.frontline-overlay-toggle {
  position: absolute;
  right: 8px;
  bottom: 72px;
  z-index: 6;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid #101010;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2924;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(49, 58, 45, 0.18);
}

.frontline-overlay-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.frontline-overlay-toggle.is-active {
  background: rgba(27, 37, 33, 0.92);
  color: #f2f7f1;
}

.frontline-overlay-toggle:hover,
.frontline-overlay-toggle:focus-visible {
  outline: none;
}

.frontline-money-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  white-space: nowrap;
  vertical-align: middle;
}

.frontline-money-inline__icon {
  width: 0.9em;
  height: 0.9em;
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 auto;
}

.frontline-money-inline__value,
.frontline-money-inline__suffix {
  line-height: 1;
}

.frontline-money-inline__suffix {
  opacity: 0.92;
}

.frontline-money-inline--hud {
  gap: 0.16rem;
}

.frontline-money-inline--hud .frontline-money-inline__icon {
  width: 1em;
  height: 1em;
}

.frontline-money-inline--shop {
  gap: 0.16rem;
}

.frontline-money-inline--shop .frontline-money-inline__icon {
  width: 0.92em;
  height: 0.92em;
}

.frontline-power-hud {
  position: absolute;
  z-index: 4;
  min-width: 126px;
  padding: 0.2rem 0.28rem 0.22rem;
  border: 2px solid rgba(16, 16, 16, 0.92);
  background: rgba(248, 248, 244, 0.92);
  color: #2f3a35;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  cursor: pointer;
}

.frontline-power-hud--blue {
  left: 8px;
  bottom: 8px;
}

.frontline-power-hud--red {
  right: 8px;
  bottom: 8px;
}

.frontline-power-hud__label {
  font-size: 0.38rem;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
  margin-bottom: 0.16rem;
}

.frontline-power-hud__meter {
  width: 100%;
  height: 8px;
  border: 1px solid rgba(16, 16, 16, 0.85);
  background: rgba(62, 73, 67, 0.15);
  overflow: hidden;
}

.frontline-power-hud__fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #79c0ff, #2e75d6);
}

.frontline-power-hud--red .frontline-power-hud__fill {
  background: linear-gradient(90deg, #ffbc7b, #ff7d58);
}

.frontline-power-hud__button {
  margin-top: 0.18rem;
  width: 100%;
  min-height: 22px;
  border: 1px solid rgba(16, 16, 16, 0.9);
  background: #ffffff;
  color: #233228;
  font: inherit;
  font-size: 0.42rem;
  line-height: 1;
}

.frontline-power-hud__button[hidden] {
  display: none;
}

.frontline-power-hud.is-ready {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 10px rgba(114, 164, 255, 0.22);
}

.frontline-power-hud.is-active .frontline-power-hud__meter {
  background: rgba(106, 201, 134, 0.26);
}

.frontline-power-info {
  position: absolute;
  z-index: 5;
  width: min(210px, calc(100% - 16px));
  padding: 0.32rem 0.36rem 0.34rem;
  border: 2px solid rgba(16, 16, 16, 0.92);
  background: rgba(252, 252, 248, 0.96);
  color: #2f3a35;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
}

.frontline-power-info__title {
  font-size: 0.42rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.frontline-power-info__body {
  margin-top: 0.2rem;
  font-size: 0.38rem;
  line-height: 1.2;
}

.frontline-power-info__meta {
  margin-top: 0.2rem;
  font-size: 0.32rem;
  line-height: 1.1;
  text-transform: uppercase;
  color: rgba(45, 58, 53, 0.72);
}

.frontline-power-info--blue {
  border-top-color: #4d73cf;
  border-bottom-color: #3f67d4;
}

.frontline-power-info--red {
  border-top-color: #ef8760;
  border-bottom-color: #d7674f;
}

.frontline-power-info.is-pinned {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 5px 16px rgba(0, 0, 0, 0.16);
}

.frontline-power-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.frontline-power-overlay[hidden],
.frontline-power-dialog[hidden],
.frontline-power-splash[hidden] {
  display: none !important;
}

.frontline-power-dialog {
  width: min(88%, 420px);
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: stretch;
  border: 3px solid #101010;
  background: rgba(248, 248, 244, 0.97);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.frontline-power-dialog__portrait {
  position: relative;
  min-height: 112px;
  background: linear-gradient(180deg, rgba(255, 208, 208, 0.96), rgba(255, 255, 255, 0.92));
  overflow: hidden;
}

.frontline-power-overlay[data-team="red"] .frontline-power-dialog__portrait {
  background: linear-gradient(180deg, rgba(135, 189, 255, 0.88), rgba(255, 255, 255, 0.8));
}

.frontline-power-dialog__image,
.frontline-power-dialog__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.frontline-power-dialog__image {
  top: 0;
  left: 50%;
  width: 122%;
  height: 165%;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%);
  image-rendering: pixelated;
}

.frontline-power-dialog__fallback {
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #223128;
}

.frontline-power-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  padding: 0.5rem 0.56rem;
  border-left: 1px solid rgba(16, 16, 16, 0.16);
}

.frontline-power-dialog__name {
  display: block;
  font-size: 0.48rem;
  line-height: 1;
}

.frontline-power-dialog__power {
  align-self: flex-start;
  padding: 0.12rem 0.18rem;
  border: 1px solid rgba(16, 16, 16, 0.16);
  background: rgba(241, 223, 164, 0.94);
  color: #5d2a16;
  font-size: 0.42rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.frontline-power-dialog__text {
  margin: 0;
  font-size: 0.5rem;
  line-height: 1.25;
  color: #203128;
}

.frontline-power-splash {
  width: min(92%, 480px);
  padding: 1rem 0.75rem;
  border: 4px solid #ffffff;
  background: linear-gradient(135deg, rgba(221, 66, 66, 0.94), rgba(255, 128, 108, 0.92));
  text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.frontline-power-overlay[data-team="red"] .frontline-power-splash {
  background: linear-gradient(135deg, rgba(59, 99, 228, 0.94), rgba(118, 157, 255, 0.92));
}

.frontline-power-splash__title {
  font-size: 0.54rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.16rem;
  letter-spacing: 0.08em;
}

.frontline-power-splash__name {
  font-size: clamp(1rem, 4vw, 1.7rem);
  line-height: 0.95;
  color: #ffffff;
  text-shadow:
    -2px 0 #31539b,
    0 2px #31539b,
    2px 0 #31539b,
    0 -2px #31539b;
}

.frontline-board {
  width: auto;
  height: auto;
  min-width: 0;
  display: block;
  image-rendering: pixelated;
}

body.game--frontline-tactics .frontline-topbar {
  background:
    linear-gradient(180deg, rgba(236, 233, 215, 0.88), rgba(226, 223, 204, 0.94));
  border-color: rgba(118, 134, 110, 0.24);
  box-shadow:
    0 8px 18px rgba(109, 121, 89, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

body.game--frontline-tactics .frontline-topbar-subtitle {
  color: #425047;
}

body.game--frontline-tactics .frontline-corner-chip {
  background: rgba(247, 245, 236, 0.92);
  border-color: rgba(31, 31, 31, 0.92);
  color: #38443c;
}

.frontline-turn-banner {
  position: absolute;
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  background: rgba(8, 12, 30, 0.88);
  border: 2px solid rgba(255, 236, 128, 0.85);
  color: #ffeb99;
  font-size: 0.72rem;
  padding: 0.45rem 0.7rem;
  pointer-events: none;
  z-index: 5;
}

.frontline-day-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 5;
}

.frontline-day-card[hidden] {
  display: none !important;
}

.frontline-day-card__ring {
  position: absolute;
  width: min(68%, 360px);
  aspect-ratio: 1;
  border: 8px solid rgba(91, 82, 217, 0.42);
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.38);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.15);
}

.frontline-day-card__label {
  position: relative;
  padding: 0.35rem 0.85rem 0.28rem;
  background: rgba(255, 255, 255, 0.82);
  color: #5f54db;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.frontline-day-card.is-animating .frontline-day-card__ring {
  animation: frontline-day-ring 1.6s ease forwards;
}

.frontline-day-card.is-animating .frontline-day-card__label {
  animation: frontline-day-label 1.6s cubic-bezier(0.22, 0.8, 0.2, 1) forwards;
}

.frontline-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0.75rem;
  background: rgba(10, 13, 21, 0.34);
  backdrop-filter: blur(2px);
}

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

.frontline-result-overlay__confetti {
  position: absolute;
  inset: -16% 0 0;
  pointer-events: none;
  opacity: 0;
}

.frontline-result-overlay__confetti-piece {
  position: absolute;
  top: -16%;
  left: calc(2% + (var(--piece-index) * 3.5%));
  width: 12px;
  height: 24px;
  border: 2px solid rgba(17, 17, 17, 0.22);
  background: #ffd264;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset;
  transform: rotate(calc((var(--piece-index) - 14) * 7deg));
  animation: none;
}

.frontline-result-overlay__confetti-piece:nth-child(3n) {
  background: #ff8a5d;
}

.frontline-result-overlay__confetti-piece:nth-child(4n) {
  background: #77cbff;
}

.frontline-result-overlay__confetti-piece:nth-child(5n) {
  background: #fff4b3;
}

.frontline-result-card {
  width: min(96vw, 720px);
  max-height: calc(100svh - 1.5rem);
  display: grid;
  gap: 0.72rem;
  padding: 1.1rem 1.1rem 1.16rem;
  border: 4px solid #111;
  background: rgba(248, 248, 244, 0.97);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  overflow-y: auto;
}

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

.frontline-result-card::before {
  top: -28%;
  left: -24%;
  width: 70%;
  height: 170%;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.12) 40%, rgba(255, 255, 255, 0.5) 50%, transparent 62%);
  opacity: 0;
  transform: translateX(-48%) rotate(10deg);
}

.frontline-result-card::after {
  right: -14%;
  bottom: -22%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 212, 105, 0.22), transparent 72%);
  opacity: 0.55;
}

.frontline-result-card > * {
  position: relative;
  z-index: 1;
}

.frontline-result-card__ribbon {
  justify-self: center;
  padding: 0.26rem 0.78rem;
  border: 2px solid #111;
  background: linear-gradient(180deg, #ffe28a, #f2b84e);
  color: #433014;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  box-shadow: 0 4px 0 rgba(17, 17, 17, 0.12);
}

.frontline-result-card__celebration {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 136px;
}

.frontline-result-card__celebration::before {
  content: "";
  position: absolute;
  width: 184px;
  height: 184px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 241, 192, 0.96) 0%, rgba(255, 211, 92, 0.4) 38%, rgba(255, 211, 92, 0) 72%);
  opacity: 0.86;
}

.frontline-result-card__celebration-burst {
  position: absolute;
  inset: 0;
}

.frontline-result-card__celebration-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 68px;
  margin-left: -3px;
  margin-top: -58px;
  background: linear-gradient(180deg, rgba(255, 210, 100, 0), rgba(255, 210, 100, 0.95));
  border-radius: 999px;
  transform-origin: center 58px;
  transform: rotate(calc(var(--ray-index) * 45deg)) scaleY(0.7);
  opacity: 0.82;
}

.frontline-result-card__seal {
  position: relative;
  z-index: 1;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  border: 4px solid #111;
  display: grid;
  align-content: center;
  justify-items: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.52), transparent 30%),
    linear-gradient(180deg, #ffd869, #f29245);
  box-shadow:
    0 10px 18px rgba(191, 96, 43, 0.22),
    inset 0 0 0 2px rgba(255, 248, 228, 0.42);
}

.frontline-result-card__seal-code {
  font-size: 1.7rem;
  line-height: 0.82;
  color: #3b2412;
}

.frontline-result-card__seal-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(59, 36, 18, 0.82);
}

.frontline-result-card__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5e665d;
}

.frontline-result-card__title {
  font-size: 2.35rem;
  line-height: 0.88;
  color: #222;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.28);
}

.frontline-result-card__subhead {
  font-size: 0.68rem;
  line-height: 1.35;
  color: #6b6558;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.frontline-result-card__body {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.48;
  color: #38443c;
  max-width: 34rem;
  justify-self: center;
}

.frontline-result-card__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.48rem;
}

.frontline-result-card__stat {
  display: grid;
  place-items: center;
  gap: 0.14rem;
  min-height: 72px;
  padding: 0.45rem 0.35rem;
  border: 2px solid rgba(83, 91, 78, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 236, 214, 0.96)),
    rgba(241, 236, 212, 0.92);
  color: #38443c;
  box-shadow: 0 8px 18px rgba(48, 57, 46, 0.08);
}

.frontline-result-card__stat-value {
  font-size: 1.08rem;
  line-height: 1;
  color: #2d352d;
}

.frontline-result-card__stat-label {
  font-size: 0.44rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #677163;
}

.frontline-result-card__badge-intro {
  font-size: 0.62rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #75653d;
}

.frontline-result-card__badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.frontline-result-card__career {
  padding: 0.55rem 0.7rem;
  border: 2px solid rgba(116, 108, 75, 0.18);
  background: rgba(246, 240, 219, 0.72);
  font-size: 0.62rem;
  line-height: 1.42;
  color: #4a564c;
}

.frontline-result-badge {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas:
    "stamp body"
    "stamp meta";
  align-items: start;
  gap: 0.3rem 0.54rem;
  min-height: 92px;
  padding: 0.56rem 0.58rem;
  border: 2px solid rgba(17, 17, 17, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 237, 212, 0.96)),
    linear-gradient(90deg, rgba(255, 214, 121, 0.14), transparent 42%);
  text-align: left;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
}

.frontline-result-badge__stamp {
  grid-area: stamp;
  display: grid;
  place-items: center;
  min-height: 56px;
  border: 2px solid #111;
  background: linear-gradient(180deg, #fff1a3, #f4b85b);
  color: #442b12;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.frontline-result-badge__body {
  grid-area: body;
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.frontline-result-badge__title {
  font-size: 0.74rem;
  line-height: 1.08;
  color: #263126;
}

.frontline-result-badge__description {
  font-size: 0.54rem;
  line-height: 1.28;
  color: #647064;
}

.frontline-result-badge__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
  align-items: center;
}

.frontline-result-badge__count,
.frontline-result-badge__fresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 22px;
  padding: 0 0.28rem;
  border: 1px solid rgba(17, 17, 17, 0.16);
  font-size: 0.48rem;
  text-transform: uppercase;
}

.frontline-result-badge__count {
  background: rgba(255, 255, 255, 0.84);
  color: #4a564c;
}

.frontline-result-badge__fresh {
  background: linear-gradient(180deg, #ff9566, #ef6259);
  color: #fff6ec;
}

.frontline-result-badge.is-new {
  border-color: rgba(230, 134, 61, 0.45);
  box-shadow: 0 10px 22px rgba(225, 130, 54, 0.18);
}

.frontline-result-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.frontline-result-card__button {
  min-height: 54px;
  padding: 0.42rem 0.68rem;
  border: 2px solid rgba(92, 110, 95, 0.34);
  border-radius: 10px;
  font: inherit;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.frontline-result-card__button--primary {
  background: linear-gradient(180deg, rgba(247, 166, 106, 0.97), rgba(225, 124, 70, 0.98));
  border-color: rgba(146, 83, 44, 0.62);
  color: #fff8ec;
}

.frontline-result-card__button--secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 233, 215, 0.96));
  border-color: rgba(122, 132, 108, 0.44);
  color: #4a564c;
}

.frontline-result-overlay[data-result="victory"] .frontline-result-card {
  background:
    radial-gradient(circle at top, rgba(255, 237, 171, 0.9), rgba(248, 248, 244, 0.97) 42%),
    rgba(248, 248, 244, 0.97);
  box-shadow: 0 24px 46px rgba(204, 126, 61, 0.28);
  animation: frontline-victory-card 620ms cubic-bezier(0.2, 0.9, 0.25, 1.15);
}

.frontline-result-overlay[data-result="victory"] .frontline-result-card::before {
  opacity: 0.86;
  animation: frontline-victory-sheen 2600ms linear infinite;
}

.frontline-result-overlay[data-result="victory"] .frontline-result-card__title {
  color: #bf5c2b;
}

.frontline-result-overlay[data-result="victory"] {
  background:
    radial-gradient(circle at center, rgba(255, 219, 122, 0.2), rgba(10, 13, 21, 0.46) 58%),
    rgba(10, 13, 21, 0.38);
}

.frontline-result-overlay[data-result="victory"] .frontline-result-overlay__confetti {
  opacity: 1;
}

.frontline-result-overlay[data-result="victory"] .frontline-result-overlay__confetti-piece {
  animation: frontline-victory-confetti calc(1750ms + (var(--piece-index) * 26ms)) linear infinite;
  animation-delay: calc(var(--piece-index) * 70ms);
}

.frontline-result-overlay[data-result="victory"] .frontline-result-card__celebration::before {
  animation: frontline-victory-halo 1900ms ease-in-out infinite;
}

.frontline-result-overlay[data-result="victory"] .frontline-result-card__celebration-burst span {
  animation: frontline-victory-ray 1800ms ease-in-out infinite;
  animation-delay: calc(var(--ray-index) * 95ms);
}

.frontline-result-overlay[data-result="victory"] .frontline-result-card__seal {
  animation: frontline-victory-pulse 1500ms ease-in-out infinite;
}

.frontline-result-overlay[data-result="victory"] .frontline-result-badge {
  animation: frontline-victory-badge 520ms ease-out forwards;
  animation-delay: var(--badge-delay, 0ms);
}

.frontline-result-overlay[data-result="defeat"] .frontline-result-card__title {
  color: #4f6fae;
}

.frontline-result-overlay[data-result="defeat"] .frontline-result-card__ribbon {
  background: linear-gradient(180deg, #d7e3ff, #97b1df);
  color: #2a4269;
}

.frontline-result-overlay[data-result="defeat"] .frontline-result-card__seal {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.42), transparent 30%),
    linear-gradient(180deg, #dce7ff, #8ea8dc);
}

.frontline-result-overlay[data-result="defeat"] .frontline-result-card__badge-grid {
  display: none;
}

@media (max-width: 640px) {
  .frontline-result-overlay {
    padding: 0.45rem;
  }

  .frontline-result-card {
    width: min(100%, 540px);
    padding: 0.88rem 0.78rem 0.92rem;
    gap: 0.56rem;
  }

  .frontline-result-card__title {
    font-size: 1.8rem;
  }

  .frontline-result-card__body {
    font-size: 0.68rem;
  }

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

  .frontline-result-card__badge-grid {
    grid-template-columns: 1fr;
  }

  .frontline-result-card__actions {
    grid-template-columns: 1fr;
  }
}

@keyframes frontline-victory-card {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.9);
  }
  62% {
    opacity: 1;
    transform: translateY(-6px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes frontline-victory-sheen {
  0% {
    transform: translateX(-58%) rotate(10deg);
  }
  100% {
    transform: translateX(188%) rotate(10deg);
  }
}

@keyframes frontline-victory-badge {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes frontline-victory-pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.04);
  }
}

@keyframes frontline-victory-halo {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.74;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes frontline-victory-ray {
  0%,
  100% {
    opacity: 0.48;
    transform: rotate(calc(var(--ray-index) * 45deg)) scaleY(0.58);
  }
  50% {
    opacity: 0.94;
    transform: rotate(calc(var(--ray-index) * 45deg)) scaleY(1);
  }
}

@keyframes frontline-victory-confetti {
  0% {
    transform: translateY(-12%) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(135%) rotate(340deg);
    opacity: 0;
  }
}

@keyframes frontline-day-ring {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  18% {
    opacity: 0.75;
    transform: scale(1);
  }
  72% {
    opacity: 0.55;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes frontline-day-label {
  0% {
    opacity: 0;
    transform: translateX(-26%) scale(0.94);
  }
  18% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  72% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(18%) scale(1.02);
  }
}

.frontline-action-menu,
.frontline-attack-panel {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  bottom: auto;
  z-index: 6;
  display: grid;
  gap: 0.28rem;
  padding: 0.35rem;
  width: auto;
  background:
    linear-gradient(180deg, rgba(6, 10, 20, 0.94), rgba(5, 8, 18, 0.96)),
    radial-gradient(circle at top left, rgba(122, 244, 255, 0.08), transparent 58%);
  border: 2px solid rgba(116, 208, 255, 0.38);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.frontline-build-menu {
  width: min(252px, calc(100% - 1rem));
  gap: 0;
}

.frontline-action-menu[hidden],
.frontline-attack-panel[hidden],
.frontline-turn-banner[hidden] {
  display: none !important;
}

.frontline-action-menu h4,
.frontline-attack-panel h4 {
  margin: 0;
  color: #4b4a44;
  font-size: 0.46rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.02rem 0.18rem 0.08rem;
}

.frontline-build-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  padding: 0.16rem 0.45rem 0.24rem;
  font-size: 8px;
  line-height: 1.1;
  color: #3d3d3d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.frontline-build-summary__label {
  color: #6a5d4a;
}

.frontline-build-summary__funds {
  color: #8a6700;
  font-size: 14px;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.45);
}

.frontline-build-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.frontline-build-pager {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.36rem 0.2rem;
  border-top: 1px solid rgba(83, 83, 83, 0.12);
}

.frontline-build-pager[hidden] {
  display: none !important;
}

.frontline-build-pager__button {
  min-height: 24px;
  padding: 0.08rem 0.2rem;
  border: 1px solid rgba(70, 70, 70, 0.2);
  background: rgba(255, 255, 255, 0.55);
  color: #4f4a3c;
  font: inherit;
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
}

.frontline-build-pager__button:disabled {
  opacity: 0.35;
  cursor: default;
}

.frontline-build-pager__label {
  text-align: center;
  color: #6a5d4a;
  font-size: 11px;
  line-height: 1;
}

.frontline-build-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 0.32rem;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0.24rem 0.42rem;
  border: 0;
  border-top: 1px solid rgba(83, 83, 83, 0.12);
  background: transparent;
  color: #222;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
}

.frontline-build-card:hover:not(:disabled),
.frontline-build-card:focus-visible:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
  outline: none;
}

.frontline-build-card:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.frontline-build-card__art {
  width: 34px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

.frontline-build-card__sprite {
  width: 30px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
}

.frontline-build-card__main {
  min-width: 0;
  display: contents;
}

.frontline-build-card__title {
  font-size: 18px;
  color: #202020;
  font-weight: 400;
  line-height: 1;
}

.frontline-build-card__cost {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  font-size: 18px;
  color: #7a5c00;
  background: transparent;
  padding: 0;
  justify-self: end;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.32);
}

.frontline-build-card__subtitle,
.frontline-build-card__afford {
  margin: 0;
  font-size: 0.51rem;
  line-height: 1.35;
}

.frontline-build-card__subtitle {
  display: none;
}

.frontline-build-card__stats {
  display: none;
}

.frontline-build-card__stats span {
  font-size: 0.46rem;
  color: #eef3ff;
  border: 1px solid rgba(122, 244, 255, 0.22);
  background: rgba(122, 244, 255, 0.08);
  padding: 0.14rem 0.22rem;
}

.frontline-build-card__afford {
  display: none;
}

.frontline-build-close {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.frontline-action-choice {
  display: grid;
  gap: 0.08rem;
  width: 100%;
  text-align: left;
  text-transform: none;
  min-height: 54px;
  padding: 0.28rem 0.42rem;
  border: 0;
  border-top: 1px solid rgba(83, 83, 83, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.frontline-action-choice__main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 0.14rem;
  min-width: 0;
}

.frontline-action-choice__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  transform: translateY(0);
}

.frontline-action-choice:hover,
.frontline-action-choice:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  outline: none;
}

.frontline-action-choice--quiet {
  color: #58616d;
}

.frontline-action-choice__title {
  display: block;
  font-size: 23px;
  color: #202020;
  letter-spacing: 0;
  line-height: 0.9;
}

.frontline-action-choice__hint {
  display: block;
  font-size: 0.45rem;
  line-height: 1.35;
  color: #9dbad9;
}

.frontline-attack-choice {
  text-align: left;
}

.frontline-inline-panel {
  min-width: 112px;
  max-width: 260px;
}

body.game--frontline-tactics .frontline-action-menu,
body.game--frontline-tactics .frontline-attack-panel {
  background: #f8f8f8;
  border: 2px solid #111;
  box-shadow: 0 4px 10px rgba(37, 44, 29, 0.12);
  color: #222;
}

body.game--frontline-tactics .frontline-action-menu::before,
body.game--frontline-tactics .frontline-attack-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 5px;
  background: #f06a53;
}

body.game--frontline-tactics .frontline-action-menu::after,
body.game--frontline-tactics .frontline-attack-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: #4a6cff;
}

body.game--frontline-tactics .frontline-build-menu {
  padding-top: 0.22rem;
}

body.game--frontline-tactics .frontline-unit-menu,
body.game--frontline-tactics .frontline-target-menu {
  min-width: 118px;
  width: auto;
  padding-top: 0.22rem;
}

body.game--frontline-tactics .frontline-action-choice--compact {
  padding: 0.24rem 0.42rem;
}

body.game--frontline-tactics .frontline-action-choice--compact .frontline-action-choice__title {
  font-size: 1.46rem;
  line-height: 0.9;
}

.frontline-side {
  display: grid;
  gap: 0.6rem;
}

.frontline-commander-rail {
  align-self: start;
  width: 248px;
  position: relative;
}

.frontline-commander-card {
  position: relative;
  justify-items: stretch;
  padding: 0.68rem 0.66rem 0.58rem;
  gap: 0.5rem;
  background:
    linear-gradient(180deg, rgba(244, 241, 226, 0.98), rgba(226, 220, 196, 0.96));
  border: 1px solid rgba(129, 135, 111, 0.36);
  border-radius: 22px;
  box-shadow:
    0 10px 24px rgba(95, 104, 79, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.frontline-commander-card__portrait {
  position: relative;
  width: 188px;
  height: 188px;
  min-height: 0;
  margin: 0 auto;
  border: 4px solid rgba(54, 71, 92, 0.86);
  border-radius: 999px;
  background: #ffffff;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow:
    0 10px 22px rgba(59, 70, 52, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.frontline-commander-card__portrait--interactive {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.frontline-commander-card__portrait--interactive:hover,
.frontline-commander-card__portrait--interactive:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow:
    0 10px 22px rgba(59, 70, 52, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 0 0 4px rgba(152, 173, 145, 0.24);
}

.frontline-commander-card__portrait--interactive.is-disabled {
  cursor: default;
}

.frontline-commander-card__portrait--interactive.is-disabled:hover,
.frontline-commander-card__portrait--interactive.is-disabled:focus-visible {
  transform: none;
  box-shadow:
    0 10px 22px rgba(59, 70, 52, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.frontline-commander-card__image {
  width: 82%;
  height: 82%;
  object-fit: contain;
  image-rendering: auto;
  display: block;
}

.frontline-commander-card__image--generated {
  transform: translateY(7%) scale(1.16);
}

.frontline-commander-card__image--generated.frontline-commander-card__image--flipped {
  transform: translateY(7%) scaleX(-1) scale(1.16);
}

.frontline-commander-card__image--opponent {
  transform: scale(0.9) translateY(-8%);
  transform-origin: center 34%;
}

.frontline-commander-card__placeholder {
  padding: 0;
  text-align: center;
  font-size: 2rem;
  color: rgba(59, 70, 63, 0.72);
  line-height: 1;
}

.frontline-commander-card__banner {
  display: grid;
  gap: 0.18rem;
  justify-items: center;
  padding: 0.42rem 0.48rem 0.36rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(89, 119, 166, 0.18), rgba(255, 255, 255, 0.26));
}

.frontline-commander-card__name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 0;
  width: 100%;
}

.frontline-commander-card__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 26px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #5a8ae0, #395eae);
  color: #f7fbff;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.frontline-commander-card__tag--opponent {
  background: linear-gradient(180deg, #ffb572, #e78354);
}

.frontline-commander-card__name {
  display: block;
  text-align: center;
  font-size: 0.86rem;
  line-height: 1;
  color: #31413b;
  text-transform: uppercase;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frontline-commander-card__name-edit {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(92, 110, 95, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #334039;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.56rem;
  cursor: pointer;
}

.frontline-commander-card__name-edit:hover,
.frontline-commander-card__name-edit:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 6px 14px rgba(69, 82, 59, 0.12);
}

.frontline-commander-card__name-edit.is-open {
  background: #eef3da;
  box-shadow:
    0 0 0 3px rgba(162, 184, 151, 0.35),
    0 6px 14px rgba(69, 82, 59, 0.12);
}

.frontline-commander-card__name-input {
  width: 100%;
  margin-top: 0.1rem;
  min-height: 36px;
  padding: 0.28rem 0.46rem;
  font-size: 0.46rem;
}

.frontline-commander-card__country {
  min-height: 50px;
  padding: 0.5rem 0.84rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  color: #405148;
  font-size: 0.9rem;
  line-height: 1.1;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.46rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.frontline-commander-card__flag {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 1.18rem;
  line-height: 1;
}

.frontline-commander-card__country-text {
  min-width: 0;
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frontline-commander-card__stats {
  display: grid;
  gap: 0.32rem;
  padding: 0.46rem 0.52rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.44);
}

.frontline-commander-card__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem;
  align-items: baseline;
}

.frontline-commander-card__row--funds {
  padding: 0.08rem 0.18rem;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 245, 198, 0.95), rgba(241, 230, 171, 0.92));
}

.frontline-commander-card__row-label {
  color: rgba(64, 81, 72, 0.88);
  font-size: 0.52rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.frontline-commander-card__row-value {
  color: #2f3d36;
  font-size: 0.68rem;
  line-height: 1.1;
  text-align: right;
}

.frontline-commander-card__row-value--funds {
  color: #654c00;
  font-size: 0.72rem;
}

.frontline-commander-card__row-value--funds .frontline-money-inline,
.frontline-build-summary__funds .frontline-money-inline,
.frontline-build-card__cost .frontline-money-inline {
  justify-content: flex-end;
}

.frontline-funds-hud__value .frontline-money-inline {
  justify-content: center;
}

.frontline-commander-card__button {
  min-height: 46px;
  padding: 0.36rem 0.56rem;
  border: 1px solid rgba(92, 110, 95, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: #334039;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.52rem;
  text-transform: uppercase;
  cursor: pointer;
}

.frontline-commander-card__tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
}

.frontline-commander-card__editor {
  display: grid;
  gap: 0.48rem;
  padding: 0.1rem 0;
}

.frontline-commander-card__editor[hidden] {
  display: none !important;
}

.frontline-map-tuner {
  display: grid;
  gap: 0.34rem;
  padding: 0.42rem 0.48rem 0.46rem;
  border: 1px solid rgba(122, 132, 108, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(241, 236, 217, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.frontline-map-tuner__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.frontline-map-tuner__value {
  font-size: 0.58rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #42503f;
}

.frontline-map-tuner__hint {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: #5b6755;
  font-weight: 600;
}

.frontline-card .frontline-map-tuner__hint {
  color: #5b6755;
  font-size: 0.7rem;
  line-height: 1.4;
}

.frontline-map-tuner__range {
  width: 100%;
  margin: 0;
  accent-color: #d27a43;
}

.frontline-map-tuner__scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.46rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5c6857;
  font-weight: 600;
}

.frontline-map-tuner__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.26rem;
}

.frontline-map-tuner__chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.12rem 0.34rem;
  border: 1px solid rgba(122, 132, 108, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.46rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: #465443;
}

.frontline-commander-card__gender-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
}

.frontline-commander-card__gender-button {
  min-height: 42px;
  padding: 0.38rem 0.5rem;
  border: 1px solid rgba(92, 110, 95, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #2f3d36;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  font: inherit;
  font-size: 0.52rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.frontline-commander-card__gender-button:hover,
.frontline-commander-card__gender-button:focus-visible,
.frontline-commander-card__gender-button.is-selected {
  transform: translateY(-1px);
  outline: none;
  background: #eef3da;
  box-shadow: 0 6px 14px rgba(69, 82, 59, 0.12);
}

.frontline-commander-card__gender-button.is-selected {
  box-shadow:
    0 0 0 3px rgba(162, 184, 151, 0.45),
    0 6px 14px rgba(69, 82, 59, 0.12);
}

.frontline-commander-card__gender-icon {
  font-size: 0.68rem;
  line-height: 1;
}

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

.frontline-game--hud-hidden .frontline-corner-chip--left,
.frontline-game--hud-hidden .frontline-audio-controls,
.frontline-game--hud-hidden .frontline-power-hud,
.frontline-game--hud-hidden .frontline-power-info {
  display: none !important;
}

.frontline-game--hud-hidden .frontline-action-menu:not([hidden]),
.frontline-game--hud-hidden .frontline-attack-panel:not([hidden]) {
  display: grid !important;
}

.frontline-commander-card__primary-action {
  display: grid;
  gap: 0.38rem;
}

.frontline-commander-card__primary-action .frontline-commander-card__button {
  width: 100%;
}

.frontline-commander-card__toggle {
  min-height: 46px;
  padding: 0.36rem 0.56rem;
  border: 1px solid rgba(92, 110, 95, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: #334039;
  font: inherit;
  font-size: 0.52rem;
  text-transform: uppercase;
  cursor: pointer;
}

.frontline-commander-card__toggle:hover,
.frontline-commander-card__toggle:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 6px 14px rgba(69, 82, 59, 0.12);
}

.frontline-commander-card__button:hover,
.frontline-commander-card__button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 6px 14px rgba(69, 82, 59, 0.12);
}

.frontline-map-turn-button.frontline-commander-card__button:hover,
.frontline-map-turn-button.frontline-commander-card__button:focus-visible {
  transform: translateX(-50%);
}

.frontline-commander-card__button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.frontline-commander-card__button--primary {
  background: linear-gradient(180deg, rgba(247, 166, 106, 0.97), rgba(225, 124, 70, 0.98));
  border-color: rgba(146, 83, 44, 0.62);
  color: #fff8ec;
  box-shadow: 0 8px 18px rgba(189, 108, 55, 0.24);
}

.frontline-commander-card__button--secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 233, 215, 0.96));
  border-color: rgba(122, 132, 108, 0.44);
  color: #4a564c;
}

.frontline-commander-card__status {
  margin: 0;
  min-height: 2.2em;
  padding: 0.12rem 0.28rem 0;
  font-size: 0.46rem;
  line-height: 1.3;
  color: #51645a;
  text-align: center;
}

.frontline-commander-card .frontline-commander-card__status {
  color: #60705e;
}

.frontline-picker-dock {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(920px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem 1rem;
  background: rgba(243, 240, 226, 0.98);
  border: 2px solid rgba(31, 31, 31, 0.92);
  border-radius: 18px;
  box-shadow: 0 28px 60px rgba(18, 24, 18, 0.38);
  box-sizing: border-box;
  max-height: min(780px, calc(100vh - 2rem));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.frontline-picker-dock[hidden] {
  display: none !important;
}

.frontline-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.frontline-picker-title {
  font-size: 0.7rem;
  color: #29352f;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.frontline-picker-done {
  min-height: 38px;
  padding: 0.28rem 0.68rem;
  border: 1px solid rgba(92, 110, 95, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #334039;
  font: inherit;
  font-size: 0.48rem;
  text-transform: uppercase;
  cursor: pointer;
}

.frontline-picker-summary {
  margin: 0;
  color: #415040;
  font-size: 0.48rem;
  line-height: 1.35;
}

.frontline-picker-group {
  display: grid;
  gap: 0.35rem;
}

.frontline-picker-label {
  margin: 0;
  color: #50614d;
  font-size: 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.frontline-commander-card .frontline-picker-label {
  color: #5d6d53;
}

.frontline-picker-input {
  min-height: 42px;
  padding: 0.38rem 0.5rem;
  border: 1px solid rgba(92, 110, 95, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #2f3d36;
  font: inherit;
  font-size: 0.56rem;
}

.frontline-picker-hint {
  margin: 0;
  color: #5b6958;
  font-size: 0.46rem;
  line-height: 1.35;
}

.frontline-commander-card .frontline-picker-hint {
  color: #5b6958;
}

.frontline-mobile-profile-toggle {
  display: none;
}

.frontline-mobile-turn-button {
  display: none;
}

.frontline-picker-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
}

.frontline-picker-icons--gender {
  gap: 0.28rem;
}

.frontline-picker-shortlist {
  margin: 0;
  color: #5b4730;
  font-size: 0.48rem;
}

.frontline-picker-icon {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid #101010;
  border-radius: 999px;
  background: #ffffff;
  color: #121212;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.frontline-picker-icon:hover,
.frontline-picker-icon:focus-visible,
.frontline-picker-icon.is-selected {
  background: #eef3da;
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 6px 16px rgba(37, 44, 29, 0.1);
}

.frontline-picker-icon.is-selected {
  box-shadow:
    0 0 0 3px rgba(162, 184, 151, 0.65),
    0 6px 16px rgba(37, 44, 29, 0.12);
}

.frontline-picker-icon__glyph {
  display: block;
  font-size: 0.9rem;
  line-height: 1;
}

.frontline-picker-icon--gender .frontline-picker-icon__glyph {
  font-size: 1rem;
}

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

.frontline-picker-group--roster {
  gap: 0.45rem;
}

.frontline-picker-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.frontline-picker-empty {
  margin: 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #4f5f55;
  font-size: 0.5rem;
  line-height: 1.4;
}

.frontline-roster-card {
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem;
  border: 2px solid rgba(64, 78, 66, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.frontline-roster-card.is-selected {
  border-color: rgba(58, 112, 208, 0.52);
  box-shadow:
    0 0 0 3px rgba(88, 138, 224, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.frontline-roster-card.is-shortlisted {
  background: linear-gradient(180deg, rgba(255, 249, 228, 0.95), rgba(255, 255, 255, 0.82));
}

.frontline-roster-card__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 35%, #fefefe, #dfe4d8 72%);
}

.frontline-roster-card__label {
  color: #2d3a34;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.frontline-roster-card__variant {
  margin: 0;
  color: #55655d;
  font-size: 0.42rem;
  line-height: 1.35;
  min-height: 3.2em;
}

.frontline-roster-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.frontline-roster-card__button {
  min-height: 34px;
  padding: 0.28rem 0.4rem;
  border: 1px solid rgba(86, 101, 89, 0.28);
  border-radius: 10px;
  background: rgba(247, 248, 244, 0.98);
  color: #31403a;
  font: inherit;
  font-size: 0.42rem;
  text-transform: uppercase;
  cursor: pointer;
}

.frontline-roster-card__button:disabled {
  opacity: 0.6;
  cursor: default;
}

.frontline-roster-card__button--shortlist.is-active {
  background: linear-gradient(180deg, rgba(255, 220, 126, 0.98), rgba(240, 185, 72, 0.98));
  border-color: rgba(167, 115, 28, 0.54);
}

.frontline-card {
  padding: 0.62rem;
  display: grid;
  gap: 0.38rem;
}

.frontline-card h3 {
  margin: 0;
  font-size: 0.64rem;
  color: #9ad0ff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.frontline-card p {
  margin: 0;
  font-size: 0.56rem;
  color: #dae6ff;
  line-height: 1.45;
}

.frontline-log-card {
  min-height: 180px;
}

.frontline-log {
  display: grid;
  gap: 0.3rem;
  max-height: 230px;
  overflow: auto;
  padding-right: 0.12rem;
}

.frontline-log p {
  margin: 0;
  font-size: 0.53rem;
  color: #efe9bc;
  line-height: 1.4;
}

@media (max-width: 1024px) {
  .frontline-stage {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .frontline-commander-rail {
    width: auto;
  }

  .frontline-commander-card {
    width: 100%;
    max-width: 360px;
    grid-template-columns: auto 1fr;
    align-items: start;
    justify-items: stretch;
    gap: 0.6rem;
  }

  .frontline-commander-card__portrait {
    grid-row: 1 / span 5;
    width: 126px;
    height: 126px;
    margin: 0;
  }

  .frontline-commander-card__banner,
  .frontline-commander-card__country,
  .frontline-commander-card__stats,
  .frontline-map-tuner,
  .frontline-commander-card__tools,
  .frontline-commander-card__status {
    grid-column: 2;
  }

  .frontline-commander-card__status {
    text-align: left;
    padding-left: 0;
  }

  .frontline-picker-dock {
    width: min(760px, calc(100vw - 20px));
  }
}

@media (max-width: 920px) {
  .frontline-topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 700px) {
  .frontline-topbar {
    grid-template-columns: 1fr;
  }

  .frontline-action-menu,
  .frontline-attack-panel {
    max-width: min(260px, calc(100% - 1rem));
  }

  .frontline-build-grid {
    grid-template-columns: 1fr;
  }

  .frontline-picker-dock {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 1rem);
    padding-inline: 0.75rem;
  }

  .frontline-picker-group--gender {
    justify-self: start;
  }

  .frontline-picker-icons {
    gap: 0.35rem;
  }

  .frontline-picker-icon {
    width: 48px;
    height: 48px;
  }

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

@media (max-width: 960px) {
  body.game--frontline-tactics,
  body.game--frontline-tactics #app,
  body.game--frontline-tactics .game-shell {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
  }

  body.game--frontline-tactics .game-shell {
    gap: 0;
  }

  body.game--frontline-tactics .game-shell__top {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    z-index: 60;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    width: auto;
    min-width: 0;
  }

  body.game--frontline-tactics .game-shell__frame {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  body.game--frontline-tactics .frontline-topbar,
  body.game--frontline-tactics .frontline-commander-rail--opponent {
    display: none;
  }

  body.game--frontline-tactics .frontline-stage {
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    min-height: 100dvh;
    justify-items: center;
    align-items: center;
  }

  body.game--frontline-tactics .frontline-board-wrap {
    border-width: 0;
    box-shadow: none;
  }

  body.game--frontline-tactics .frontline-commander-rail--player {
    display: none;
  }

  body.game--frontline-tactics .frontline-commander-rail--player.is-open {
    display: block;
    position: fixed;
    top: calc(max(8px, env(safe-area-inset-top)) + 44px);
    left: max(8px, env(safe-area-inset-left));
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(360px, calc(100vw - 16px));
    z-index: 55;
    overflow: auto;
  }

  body.game--frontline-tactics .frontline-mobile-profile-toggle {
    position: fixed;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.42rem 0.72rem;
    border: 2px solid #101010;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #182117;
    font: inherit;
    font-size: 0.58rem;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(49, 58, 45, 0.18);
  }

  body.game--frontline-tactics .frontline-map-turn-button {
    min-height: 42px;
    min-width: 168px;
    padding: 0.42rem 0.86rem;
    font-size: 0.58rem;
    letter-spacing: 0.04em;
  }

  body.game--frontline-tactics .frontline-overlay-toggle {
    width: 42px;
    height: 42px;
    bottom: 74px;
  }

  body.game--frontline-tactics .frontline-mobile-turn-button {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(84px, calc(env(safe-area-inset-right) + 84px));
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.42rem 0.8rem;
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 18px rgba(189, 108, 55, 0.28);
  }

  body.game--frontline-tactics .frontline-mobile-turn-button:disabled {
    opacity: 0.84;
  }

  body.game--frontline-tactics .frontline-commander-card__status {
    display: none;
  }

  body.game--frontline-tactics .frontline-mobile-profile-toggle:hover,
  body.game--frontline-tactics .frontline-mobile-profile-toggle:focus-visible,
  body.game--frontline-tactics .frontline-mobile-turn-button:hover,
  body.game--frontline-tactics .frontline-mobile-turn-button:focus-visible {
    outline: none;
    transform: translateY(-1px);
  }

  body.game--frontline-tactics .frontline-overlay-toggle:hover,
  body.game--frontline-tactics .frontline-overlay-toggle:focus-visible {
    transform: none;
  }

  body.game--frontline-tactics .frontline-map-turn-button:hover,
  body.game--frontline-tactics .frontline-map-turn-button:focus-visible {
    transform: translateX(-50%);
  }
}

@media (max-width: 960px) and (orientation: landscape) {
  body.game--frontline-tactics .game-shell__top .back-link {
    font-size: 0.62rem;
    padding: 0.36rem 0.58rem;
  }

  body.game--frontline-tactics .game-shell__frame,
  body.game--frontline-tactics .game-root,
  body.game--frontline-tactics .frontline-game,
  body.game--frontline-tactics .frontline-layout,
  body.game--frontline-tactics .frontline-stage {
    min-height: 100dvh;
  }

  body.game--frontline-tactics .frontline-board-wrap {
    background: transparent;
  }

  body.game--frontline-tactics .frontline-mobile-profile-toggle {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: auto;
  }

  body.game--frontline-tactics .frontline-map-turn-button {
    min-width: 152px;
  }

  body.game--frontline-tactics .frontline-overlay-toggle {
    bottom: 70px;
  }

  body.game--frontline-tactics .frontline-mobile-turn-button {
    left: max(8px, env(safe-area-inset-left));
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    min-width: 152px;
  }
}

.map-lab-shell {
  width: min(1440px, calc(100% - 1rem));
  margin: 0.75rem auto 1.5rem;
  display: grid;
  gap: 0.9rem;
}

.map-lab-hero {
  padding: 1.4rem 1.6rem;
  border: 4px solid rgba(109, 143, 126, 0.35);
  box-shadow: 0 12px 28px rgba(78, 92, 67, 0.16);
  background:
    radial-gradient(circle at top right, rgba(135, 164, 145, 0.2), transparent 26%),
    linear-gradient(180deg, rgba(241, 236, 212, 0.98), rgba(214, 219, 188, 0.98));
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 1rem;
  align-items: end;
}

.map-lab-hero__copy {
  display: grid;
  gap: 0.8rem;
}

.map-lab-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.map-lab-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.map-lab-summary__stat,
.map-lab-summary__note,
.map-lab-panel,
.map-lab-size-section,
.map-lab-card {
  border: 3px solid rgba(104, 133, 114, 0.22);
  background: rgba(255, 251, 240, 0.74);
  box-shadow: 0 10px 24px rgba(86, 92, 66, 0.12);
}

.map-lab-summary__stat,
.map-lab-summary__note {
  padding: 0.9rem;
}

.map-lab-summary__stat span {
  display: block;
  font-size: 1.35rem;
  color: #4e674a;
}

.map-lab-summary__stat small,
.map-lab-summary__note {
  color: #5e6f58;
  line-height: 1.45;
}

.map-lab-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.map-lab-jump__pill {
  display: inline-flex;
  flex-direction: column;
  gap: 0.16rem;
  padding: 0.7rem 0.92rem;
  text-decoration: none;
  color: #47614d;
  background: rgba(250, 244, 230, 0.82);
  border: 3px solid rgba(104, 133, 114, 0.24);
}

.map-lab-jump__pill span {
  font-size: 0.55rem;
  color: #7d8e72;
}

.map-lab-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.map-lab-sidebar {
  position: sticky;
  top: 0.75rem;
}

.map-lab-panel {
  padding: 1rem;
}

.map-lab-panel h2,
.map-lab-size-section h2,
.map-lab-card h3 {
  margin: 0;
  color: #43553f;
}

.map-lab-panel__eyebrow,
.map-lab-card__eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8f8b57;
}

.map-lab-sidebar__copy,
.map-lab-size-header__copy {
  color: #5f7058;
  line-height: 1.6;
}

.map-lab-kept-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.map-lab-kept-item {
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 0.8rem;
  border: 2px solid rgba(87, 119, 99, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: #43553f;
  cursor: pointer;
  display: grid;
  gap: 0.3rem;
}

.map-lab-kept-item span {
  font-size: 0.56rem;
  color: #6f7c64;
}

.map-lab-sidebar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.map-lab-button {
  appearance: none;
  border: 2px solid rgba(70, 102, 78, 0.32);
  background: linear-gradient(180deg, #f7f2dc, #e1e2c5);
  color: #445645;
  padding: 0.6rem 0.85rem;
  font: inherit;
  cursor: pointer;
  min-width: 110px;
}

.map-lab-button--ghost {
  background: rgba(255, 255, 255, 0.6);
}

.map-lab-button--active {
  background: linear-gradient(180deg, #d7ecb6, #b9d697);
  border-color: rgba(90, 130, 76, 0.56);
}

.map-lab-export {
  margin: 1rem 0 0;
  padding: 0.85rem;
  background: #211b14;
  color: #f3efd7;
  overflow: auto;
  min-height: 180px;
  line-height: 1.55;
}

.map-lab-main {
  display: grid;
  gap: 1rem;
}

.map-lab-size-section {
  padding: 1rem;
}

.map-lab-size-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.map-lab-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 0.9rem;
}

.map-lab-card {
  padding: 0.9rem;
  display: grid;
  gap: 0.75rem;
}

.map-lab-card.is-kept {
  border-color: rgba(100, 146, 84, 0.58);
  box-shadow: 0 12px 28px rgba(108, 143, 83, 0.16);
}

.map-lab-card__header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
}

.map-lab-card__meta,
.map-lab-card__stats,
.map-lab-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.map-lab-card__meta span,
.map-lab-card__stats span,
.map-lab-card__tags span {
  padding: 0.34rem 0.45rem;
  background: rgba(241, 236, 214, 0.92);
  border: 1px solid rgba(96, 116, 87, 0.18);
  color: #5a6a54;
  font-size: 0.56rem;
}

.map-lab-canvas {
  width: 100%;
  height: auto;
  display: block;
  background:
    linear-gradient(180deg, rgba(63, 88, 74, 0.14), rgba(63, 88, 74, 0.04)),
    rgba(220, 225, 197, 0.78);
  border: 3px solid rgba(92, 117, 96, 0.24);
}

.map-lab-card__notes {
  margin: 0;
  padding-left: 1rem;
  color: #5c6d57;
  line-height: 1.65;
}

.loading-placeholder {
  color: #6c7b62;
}

@media (max-width: 1180px) {
  .map-lab-layout {
    grid-template-columns: 1fr;
  }

  .map-lab-sidebar {
    position: static;
  }
}

@media (max-width: 960px) {
  .map-lab-hero {
    grid-template-columns: 1fr;
  }

  .map-lab-size-header {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 700px) {
  .map-lab-shell {
    width: min(100%, calc(100% - 0.55rem));
  }

  .map-lab-summary {
    grid-template-columns: 1fr;
  }

  .map-lab-card__header {
    flex-direction: column;
  }

  .map-lab-button {
    width: 100%;
  }
}
