:root {
  color-scheme: dark;
  --bg: #161716;
  --panel: #20231f;
  --panel-2: #282c26;
  --line: #3a4037;
  --text: #f4f1e8;
  --muted: #aaa99e;
  --p1: #3f9dff;
  --p2: #e66a5d;
  --accent: #f0b95b;
  --range: #725cff;
  --move: #62a96b;
  --danger: #d94c54;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(63, 157, 255, 0.09), transparent 26%),
    linear-gradient(315deg, rgba(230, 106, 93, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

body.combat-stage-active {
  overflow: hidden;
}

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

.squad-select {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(14, 15, 13, 0.94);
  padding: 18px;
}

.squad-select.hidden {
  display: none;
}

.squad-shell {
  width: min(1100px, 100%);
  max-height: min(900px, 94vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1c201b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  padding: 16px;
}

.squad-setup-shell {
  width: min(760px, 100%);
}

.welcome-screen {
  padding: 0;
  background: #050605;
}

.welcome-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 0.95fr) auto minmax(0, 0.55fr);
  place-items: center;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 5, 4, 0.12), rgba(4, 5, 4, 0.28) 56%, rgba(4, 5, 4, 0.72)),
    radial-gradient(circle at 50% 38%, rgba(240, 185, 91, 0.18), transparent 34%),
    url("assets/ui/welcome-hall.png") center / cover no-repeat;
  background-position: center center;
  background-size: cover;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.62);
}

.welcome-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.58), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.58));
  pointer-events: none;
}

.welcome-logo {
  position: relative;
  z-index: 1;
  align-self: end;
  width: min(56vw, 640px);
  max-height: 42vh;
  object-fit: contain;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.72));
}

.welcome-play-card {
  position: relative;
  z-index: 1;
  min-width: min(320px, 72vw);
  min-height: 74px;
  border: 1px solid rgba(240, 185, 91, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 233, 167, 0.2), rgba(138, 87, 33, 0.18)),
    rgba(22, 19, 13, 0.82);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.48),
    0 0 36px rgba(240, 185, 91, 0.2);
  color: var(--text);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
}

.welcome-play-card:hover,
.welcome-play-card:focus-visible {
  border-color: rgba(255, 219, 133, 0.95);
  box-shadow:
    0 26px 58px rgba(0, 0, 0, 0.52),
    0 0 48px rgba(240, 185, 91, 0.32);
}

.mode-menu-screen {
  padding: 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(219, 177, 91, 0.12), transparent 32%),
    rgba(7, 8, 7, 0.98);
}

.mode-menu-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(340px, 1.05fr);
  grid-template-rows: 1fr auto;
  gap: clamp(20px, 3vw, 42px);
  align-items: center;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  min-height: 520px;
  padding: clamp(28px, 4.2vw, 72px);
  background:
    linear-gradient(90deg, rgba(4, 5, 4, 0.76), rgba(12, 14, 12, 0.68) 42%, rgba(12, 14, 12, 0.9)),
    radial-gradient(circle at 74% 38%, rgba(219, 177, 91, 0.16), transparent 34%),
    url("assets/ui/welcome-hall.png") center / cover no-repeat;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.62);
}

.mode-menu-header {
  max-width: 620px;
}

.mode-menu-header span,
.mode-placeholder-eyebrow,
.mode-menu-context span {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mode-menu-header h1,
.mode-placeholder-shell h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.mode-menu-header p,
.mode-placeholder-shell p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.mode-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: clamp(108px, 14vh, 148px);
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.06), transparent),
    rgba(31, 36, 31, 0.88);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.mode-card:hover,
.mode-card:focus-visible,
.mode-card.is-active {
  border-color: rgba(219, 177, 91, 0.62);
  background:
    linear-gradient(180deg, rgba(219, 177, 91, 0.14), transparent),
    rgba(45, 50, 41, 0.92);
}

.mode-card-featured {
  border-color: rgba(219, 177, 91, 0.62);
  background:
    linear-gradient(180deg, rgba(219, 177, 91, 0.2), transparent),
    rgba(58, 48, 30, 0.94);
}

.mode-card span {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mode-card strong {
  margin-top: 12px;
  color: var(--text);
  font-size: clamp(1.45rem, 2.8vw, 2.8rem);
  line-height: 1.05;
}

.mode-menu-context {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 18px 20px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 8px;
  background: rgba(12, 14, 12, 0.68);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.mode-menu-context p {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  line-height: 1.35;
}

.mode-placeholder-shell {
  width: min(680px, 100%);
}

.mode-placeholder-shell button {
  margin-top: 20px;
  min-width: 160px;
  background: #31433a;
  border-color: #4a7565;
}

.competitive-flow {
  background:
    radial-gradient(circle at 50% 22%, rgba(219, 177, 91, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(63, 157, 255, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(230, 106, 93, 0.07), transparent 34%),
    rgba(10, 12, 10, 0.97);
  pointer-events: none;
}

.competitive-flow-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: min(calc(100vw - 36px), calc((100vh - 36px) * 16 / 9), 1280px);
  height: min(calc(100vh - 36px), calc((100vw - 36px) * 9 / 16), 720px);
  min-height: 520px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.06), transparent 38%),
    #171b16;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.48);
  overflow: hidden;
  pointer-events: auto;
}

.competitive-flow-shell::before,
.competitive-flow-shell::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(219, 177, 91, 0.54), transparent);
  pointer-events: none;
}

.competitive-flow-shell::before {
  top: 18%;
}

.competitive-flow-shell::after {
  bottom: 18%;
}

.competitive-back-btn {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border-color: rgba(219, 177, 91, 0.48);
  background: rgba(14, 15, 13, 0.72);
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

.competitive-flow-body {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(760px, calc(100% - 56px));
  height: 100%;
  padding: 72px 0 52px;
}

.competitive-flow-content {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(12px, 1.9vh, 20px);
  width: 100%;
  min-height: 100%;
  text-align: center;
}

.competitive-flow-eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.competitive-flow-content h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.competitive-flow-content p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.45;
}

.competitive-flow-note {
  color: var(--text) !important;
  font-weight: 800;
}

.competitive-side-choice {
  display: grid;
  gap: 12px;
  width: min(100%, 520px);
  padding: 14px;
  border: 1px solid rgba(219, 177, 91, 0.38);
  border-radius: 10px;
  background: rgba(10, 12, 10, 0.58);
}

.competitive-side-choice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.competitive-side-choice-actions button {
  min-width: 150px;
  padding: 12px 18px;
}

.competitive-side-choice-screen {
  min-height: 0;
  align-content: center;
  gap: clamp(10px, 1.4vh, 16px);
}

.competitive-flow-shell:has(.competitive-side-choice-screen) .competitive-flow-body {
  padding: 48px 0;
}

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

.competitive-coin-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(150px, 18vw, 230px);
  aspect-ratio: 1;
  margin: clamp(8px, 1.3vh, 16px) 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #19120a;
}

.competitive-coin-wrap:disabled {
  cursor: default;
}

.competitive-coin-halo {
  position: absolute;
  inset: -14px;
  border: 1px solid rgba(219, 177, 91, 0.22);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.competitive-coin-interaction {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 180ms ease;
}

.competitive-coin {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 5px solid rgba(219, 177, 91, 0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 242, 190, 0.45), transparent 22%),
    linear-gradient(145deg, #f4ca72, #8d5b25 62%, #3f2815);
  box-shadow:
    inset 0 0 0 10px rgba(48, 31, 17, 0.2),
    0 22px 48px rgba(0, 0, 0, 0.4),
    0 0 46px rgba(219, 177, 91, 0.18);
  color: #19120a;
  transition: box-shadow 180ms ease;
}

.competitive-coin span {
  display: grid;
  place-items: center;
  width: 72%;
  aspect-ratio: 1;
  border: 2px solid rgba(45, 27, 12, 0.32);
  border-radius: 50%;
  background: rgba(255, 236, 168, 0.18);
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 900;
}

.competitive-coin-face-img {
  display: block;
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(20, 12, 4, 0.28));
}

.competitive-coin-wrap.is-ready,
.competitive-coin-wrap.is-revealed {
  cursor: pointer;
}

.competitive-coin-wrap.is-ready .competitive-coin-halo,
.competitive-coin-wrap.is-revealed .competitive-coin-halo {
  opacity: 1;
  animation: competitiveCoinPulse 2.8s ease-in-out infinite;
}

.competitive-coin-wrap.is-ready:hover .competitive-coin-interaction,
.competitive-coin-wrap.is-ready:focus-visible .competitive-coin-interaction,
.competitive-coin-wrap.is-revealed:hover .competitive-coin-interaction,
.competitive-coin-wrap.is-revealed:focus-visible .competitive-coin-interaction {
  transform: scale(1.045);
}

.competitive-coin-wrap.is-ready:hover .competitive-coin,
.competitive-coin-wrap.is-ready:focus-visible .competitive-coin,
.competitive-coin-wrap.is-revealed:hover .competitive-coin,
.competitive-coin-wrap.is-revealed:focus-visible .competitive-coin {
  box-shadow:
    inset 0 0 0 10px rgba(48, 31, 17, 0.2),
    0 26px 54px rgba(0, 0, 0, 0.44),
    0 0 54px rgba(219, 177, 91, 0.26);
}

.competitive-coin-wrap.is-flipping .competitive-coin {
  animation: competitiveCoinFlip 0.72s cubic-bezier(0.45, 0.02, 0.24, 1) infinite;
}

.competitive-coin-continue {
  color: var(--muted) !important;
  font-size: 0.92rem !important;
  font-weight: 800;
}

.competitive-result-badge {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(219, 177, 91, 0.36);
  border-radius: 999px;
  background: rgba(219, 177, 91, 0.1);
  color: var(--muted);
  font-weight: 800;
}

.competitive-result-badge strong {
  color: var(--accent);
}

.competitive-phase-timer {
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
  margin-top: clamp(4px, 1vh, 12px);
}

.competitive-timer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.competitive-timer-row strong {
  color: var(--text);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.9;
}

.competitive-timer-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.06);
}

.competitive-timer-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--competitive-timer-color, #62a96b);
  transition: width 180ms linear;
}

.competitive-phase-timer.is-timer-high,
.competitive-draft-timer.is-timer-high {
  --competitive-timer-color: #62a96b;
}

.competitive-phase-timer.is-timer-mid,
.competitive-draft-timer.is-timer-mid {
  --competitive-timer-color: #f0b95b;
}

.competitive-phase-timer.is-timer-low,
.competitive-draft-timer.is-timer-low {
  --competitive-timer-color: #d94c54;
}

.competitive-next-btn {
  min-width: 180px;
  margin-top: 4px;
  border-color: rgba(219, 177, 91, 0.58);
  background:
    linear-gradient(180deg, rgba(219, 177, 91, 0.18), transparent),
    rgba(49, 67, 58, 0.8);
  color: var(--text);
  font-weight: 900;
}

.competitive-flow-shell:has(.competitive-lineup-screen) {
  width: min(1500px, calc(100vw - 32px));
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.competitive-flow-body:has(.competitive-lineup-screen) {
  width: 100%;
  height: 100%;
  padding: 0;
}

.competitive-lineup-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.28fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  width: 100%;
  height: 100%;
  padding: 54px 42px 34px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(70, 151, 240, 0.14), transparent 42%, transparent 58%, rgba(219, 72, 66, 0.14)),
    radial-gradient(circle at 50% 48%, rgba(219, 177, 91, 0.12), transparent 35%);
}

.competitive-lineup-header {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-transform: uppercase;
}

.competitive-lineup-header span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

.competitive-lineup-header strong {
  font-size: clamp(1.35rem, 2vw, 2.3rem);
  letter-spacing: 0;
}

.competitive-lineup-team {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.competitive-lineup-team-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 0 6px 8px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.competitive-lineup-team-header span {
  color: var(--text);
  font-size: clamp(1.1rem, 1.8vw, 1.8rem);
  font-weight: 900;
}

.competitive-lineup-team-header strong,
.competitive-lineup-team-header small {
  color: var(--accent);
}

.competitive-lineup-team-p2 .competitive-lineup-team-header {
  justify-content: flex-end;
}

.competitive-lineup-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}

.competitive-lineup-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 8px;
  background: #151915;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
}

.competitive-lineup-team-p1 .competitive-lineup-card {
  border-color: rgba(70, 151, 240, 0.45);
}

.competitive-lineup-team-p2 .competitive-lineup-card {
  border-color: rgba(219, 72, 66, 0.45);
}

.competitive-lineup-art,
.competitive-lineup-art img {
  display: block;
  width: 100%;
  height: 100%;
}

.competitive-lineup-art {
  position: absolute;
  inset: 0;
}

.competitive-lineup-art img {
  object-fit: cover;
}

.competitive-lineup-art b {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
}

.competitive-lineup-art.art-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2e3430, #171b16);
}

.competitive-lineup-card-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), transparent 34%, rgba(0, 0, 0, 0.78)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.36), transparent 50%);
}

.competitive-lineup-pick-order {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 28px;
  border: 1px solid rgba(219, 177, 91, 0.44);
  border-radius: 999px;
  background: rgba(14, 15, 13, 0.72);
  color: var(--accent);
  font-weight: 900;
}

.competitive-lineup-card-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  gap: 6px;
}

.competitive-lineup-card-meta span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.competitive-lineup-card-meta strong {
  color: var(--text);
  font-size: clamp(1.05rem, 1.4vw, 1.55rem);
  line-height: 1;
}

.competitive-lineup-card-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.competitive-lineup-card-row em {
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
}

.competitive-lineup-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.competitive-lineup-center {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: clamp(2rem, 5vw, 5.2rem);
  font-weight: 900;
  text-shadow: 0 0 32px rgba(219, 177, 91, 0.28);
}

.competitive-lineup-footer {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
}

.competitive-lineup-footer .competitive-phase-timer {
  width: min(620px, 56vw);
  margin-top: 0;
}

.competitive-positioning-placeholder {
  min-height: 360px;
  align-content: center;
}

.competitive-flow-shell:has(.competitive-positioning-screen) {
  width: min(1500px, calc(100vw - 32px), calc((100vh - 32px) * 16 / 9));
  height: min(844px, calc(100vh - 32px), calc((100vw - 32px) * 9 / 16));
  max-height: calc(100vh - 32px);
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.competitive-flow-body:has(.competitive-positioning-screen) {
  width: 100%;
  height: 100%;
  padding: 0;
}

.competitive-positioning-screen {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(188px, 0.58fr) minmax(480px, 1.25fr) minmax(188px, 0.58fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.35vh, 16px);
  width: 100%;
  height: 100%;
  padding: clamp(18px, 3.2vh, 42px) clamp(18px, 2.2vw, 34px) clamp(14px, 2.1vh, 28px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(63, 157, 255, 0.12), transparent 36%, transparent 64%, rgba(230, 106, 93, 0.12)),
    linear-gradient(180deg, rgba(244, 241, 232, 0.04), transparent 42%);
  pointer-events: auto;
}

.competitive-positioning-header {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
  align-items: end;
  gap: 18px;
}

.competitive-positioning-header span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.competitive-positioning-header h1 {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 2vw, 2.25rem);
  line-height: 1;
}

.competitive-positioning-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.competitive-positioning-timer {
  min-width: 0;
}

.competitive-positioning-timer.is-grace .competitive-timer-track i {
  background: linear-gradient(90deg, var(--danger), #f0b95b);
}

.competitive-positioning-timer.is-grace .competitive-timer-row span {
  color: #f2a2a7;
}

.competitive-positioning-reserve {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background: rgba(18, 21, 18, 0.72);
  padding: 10px;
  pointer-events: auto;
}

.competitive-positioning-reserve-p1 {
  border-color: rgba(63, 157, 255, 0.38);
}

.competitive-positioning-reserve-p2 {
  border-color: rgba(230, 106, 93, 0.38);
}

.competitive-positioning-reserve header {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.competitive-positioning-reserve header span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.competitive-positioning-reserve header strong {
  color: var(--text);
  font-size: clamp(1rem, 1.5vw, 1.45rem);
}

.competitive-positioning-reserve-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.competitive-positioning-reserve-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 70px;
  padding: 7px;
  border-color: rgba(244, 241, 232, 0.12);
  background: rgba(42, 47, 40, 0.78);
  text-align: left;
  pointer-events: auto;
  touch-action: manipulation;
}

.competitive-positioning-reserve-card > * {
  pointer-events: none;
}

.competitive-positioning-reserve-card.is-selectable {
  border-color: rgba(219, 177, 91, 0.46);
}

.competitive-positioning-reserve-card.is-selected {
  border-color: var(--accent);
  background: rgba(58, 51, 36, 0.92);
}

.competitive-positioning-reserve-card.is-placed {
  opacity: 0.68;
  border-color: rgba(115, 214, 92, 0.34);
}

.competitive-positioning-reserve-card.is-locked:not(.is-placed) {
  opacity: 0.48;
}

.competitive-positioning-reserve-art {
  position: relative;
  display: block;
  width: 54px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.16);
  border-radius: 7px;
  background: var(--panel-2);
}

.competitive-positioning-reserve-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
}

.competitive-positioning-reserve-art b {
  position: absolute;
  right: 4px;
  bottom: 3px;
  border-radius: 999px;
  background: rgba(14, 15, 13, 0.72);
  padding: 1px 5px;
  font-size: 0.62rem;
}

.competitive-positioning-reserve-art.art-fallback {
  display: grid;
  place-items: center;
}

.competitive-positioning-reserve-card span {
  min-width: 0;
}

.competitive-positioning-reserve-card strong,
.competitive-positioning-reserve-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competitive-positioning-reserve-card strong {
  color: var(--text);
  font-size: 0.9rem;
}

.competitive-positioning-reserve-card small {
  color: var(--muted);
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 800;
}

.competitive-positioning-center {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  gap: 10px;
}

.competitive-positioning-board {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: min(100%, 54vh, 620px);
  max-width: 620px;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: #131712;
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

.competitive-positioning-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(244, 241, 232, 0.055);
  border-radius: 0;
  background: #22271f;
  color: var(--muted);
  padding: 0;
  pointer-events: auto;
  touch-action: manipulation;
}

.competitive-positioning-cell > * {
  pointer-events: none;
}

.competitive-positioning-cell.alt {
  background: #1c211b;
}

.competitive-positioning-cell.deployment {
  background: linear-gradient(180deg, rgba(244, 241, 232, 0.035), rgba(244, 241, 232, 0.015)), #22271f;
}

.competitive-positioning-cell.terrain-tree {
  background: #243321;
}

.competitive-positioning-cell.terrain-plateau {
  background: #34372a;
}

.competitive-positioning-cell.terrain-mountain,
.competitive-positioning-cell.obstacle {
  background: #333430;
}

.competitive-positioning-cell.is-legal {
  cursor: pointer;
  outline: 2px solid rgba(219, 177, 91, 0.58);
  outline-offset: -3px;
  background: linear-gradient(180deg, rgba(219, 177, 91, 0.16), rgba(219, 177, 91, 0.05)), #263027;
}

.competitive-positioning-cell.is-selected {
  outline-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(219, 177, 91, 0.86);
}

.competitive-positioning-cell.is-occupied {
  cursor: default;
}

.competitive-positioning-terrain {
  color: rgba(244, 241, 232, 0.42);
  font-size: 0.75rem;
  font-weight: 900;
}

.competitive-positioning-token-shell {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58%;
  aspect-ratio: 3 / 4;
  pointer-events: none;
}

.competitive-positioning-token {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(244, 241, 232, 0.2);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(14, 15, 13, 0.82);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
  pointer-events: none;
}

.competitive-positioning-token.has-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.competitive-positioning-token.has-art b {
  display: none;
}

.competitive-positioning-token-shell.player-one .competitive-positioning-token {
  border-color: rgba(63, 157, 255, 0.72);
  box-shadow: 0 0 22px rgba(63, 157, 255, 0.22);
}

.competitive-positioning-token-shell.player-two .competitive-positioning-token {
  border-color: rgba(230, 106, 93, 0.72);
  box-shadow: 0 0 22px rgba(230, 106, 93, 0.22);
}

.competitive-positioning-token-shell.is-preview .competitive-positioning-token {
  opacity: 0.72;
  border-style: dashed;
}

.competitive-positioning-cell .coords {
  position: absolute;
  left: 4px;
  bottom: 3px;
  color: rgba(244, 241, 232, 0.3);
  font-size: 0.58rem;
}

.competitive-positioning-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background: rgba(18, 21, 18, 0.78);
  padding: 8px 10px;
  pointer-events: auto;
}

.competitive-positioning-actions span {
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
}

.competitive-positioning-actions button {
  min-width: 120px;
  border-color: rgba(219, 177, 91, 0.58);
  background: #3a3324;
  color: var(--text);
  font-weight: 900;
  pointer-events: auto;
  touch-action: manipulation;
}

@keyframes competitiveCoinFlip {
  0% {
    transform: rotateY(0deg) scale(1);
  }

  50% {
    transform: rotateY(720deg) scale(1.04);
  }

  100% {
    transform: rotateY(1440deg) scale(1);
  }
}

@keyframes competitiveCoinPulse {
  0%, 100% {
    opacity: 0.32;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.72;
    transform: scale(1.06);
  }
}

.squad-selection-screen {
  overflow: hidden;
  padding: clamp(10px, 1.4vw, 18px);
}

.squad-esports-frame {
  display: grid;
  grid-template-columns: minmax(140px, 0.18fr) minmax(560px, 1fr) minmax(140px, 0.18fr);
  gap: clamp(8px, 1vw, 14px);
  width: min(100%, calc((100vh - 36px) * 16 / 9));
  max-height: calc(100vh - 36px);
  aspect-ratio: 16 / 9;
  overflow: visible;
}

.squad-picker-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: none;
  min-width: 0;
  overflow: auto;
}

.squad-center-header {
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(244, 241, 232, 0.1);
}

.squad-title-block {
  min-width: 0;
}

.squad-picker-shell .squad-header h1 {
  font-size: 1.55rem;
  line-height: 1.1;
}

.squad-picker-shell .squad-header p {
  margin-top: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.squad-picker-shell .squad-header,
.squad-picker-shell .squad-toolbar,
.squad-picker-shell .squad-summary,
.squad-picker-shell .squad-footer {
  flex: 0 0 auto;
}

.squad-picker-shell .squad-toolbar {
  align-items: center;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid rgba(244, 241, 232, 0.09);
  border-radius: 8px;
  background: rgba(244, 241, 232, 0.035);
}

.squad-picker-shell .squad-summary {
  padding: 7px 2px 0;
}

.squad-picker-shell .squad-footer {
  position: sticky;
  bottom: -16px;
  z-index: 25;
  margin: 0 -16px -16px;
  padding: 11px 16px 16px;
  border-top: 1px solid rgba(244, 241, 232, 0.1);
  background:
    linear-gradient(180deg, rgba(28, 32, 27, 0.82), #1c201b 42%),
    #1c201b;
}

.squad-picker-shell .squad-cards {
  flex: 1 1 auto;
  min-height: 0;
  margin: 10px 0 12px;
  overflow: visible;
}

.squad-picker-shell .squad-card-list {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.squad-current-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.squad-current-summary span {
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.045);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.squad-pick-column {
  --team-accent: var(--accent);
  --team-accent-border: rgba(219, 177, 91, 0.7);
  --team-accent-soft: rgba(219, 177, 91, 0.28);
  --team-accent-slot: rgba(219, 177, 91, 0.38);
  --team-accent-text: rgba(219, 177, 91, 0.78);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 241, 232, 0.06), transparent 18%),
    #151914;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.squad-pick-column-p1 {
  --team-accent: #d8a753;
  --team-accent-border: rgba(216, 167, 83, 0.7);
  --team-accent-soft: rgba(216, 167, 83, 0.28);
  --team-accent-slot: rgba(216, 167, 83, 0.38);
  --team-accent-text: rgba(216, 167, 83, 0.78);
}

.squad-pick-column-p2 {
  --team-accent: #78b8c8;
  --team-accent-border: rgba(120, 184, 200, 0.7);
  --team-accent-soft: rgba(120, 184, 200, 0.28);
  --team-accent-slot: rgba(120, 184, 200, 0.38);
  --team-accent-text: rgba(120, 184, 200, 0.78);
}

.squad-pick-column.active {
  border-color: var(--team-accent-border);
  box-shadow:
    inset 0 0 0 1px var(--team-accent-soft),
    0 18px 52px rgba(0, 0, 0, 0.38);
}

.squad-pick-column-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: end;
  padding: 10px;
  border-bottom: 1px solid rgba(244, 241, 232, 0.1);
  background: rgba(244, 241, 232, 0.04);
}

.squad-pick-column-header span {
  color: var(--team-accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.squad-pick-column-header strong {
  color: var(--text);
  font-size: 1rem;
}

.squad-pick-column-header small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
}

.squad-pick-slots {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 10px;
}

.squad-pick-slot {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 7px;
  background: #20251f;
}

.squad-pick-slot.filled {
  border-color: var(--team-accent-slot);
}

.squad-pick-slot.filled::after,
.squad-pick-slot.preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 30%, rgba(14, 15, 13, 0.86) 100%),
    linear-gradient(90deg, transparent 45%, rgba(14, 15, 13, 0.42) 100%);
  pointer-events: none;
  z-index: 1;
}

.squad-pick-slot.preview {
  border-style: dashed;
  border-color: var(--team-accent-border);
  box-shadow: inset 0 0 0 1px var(--team-accent-soft);
}

.squad-pick-slot.empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--muted);
}

.squad-pick-slot-number {
  position: absolute;
  left: 9px;
  top: 7px;
  color: var(--team-accent-text);
  font-weight: 800;
}

.squad-pick-slot-art {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: #111410;
}

.squad-pick-slot-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
}

.squad-pick-slot-art b,
.squad-pick-slot-art.art-fallback b {
  display: none;
}

.squad-pick-slot-meta {
  position: absolute;
  right: 9px;
  bottom: 8px;
  z-index: 2;
  max-width: calc(100% - 18px);
  text-align: right;
}

.squad-pick-slot.empty .squad-pick-slot-meta {
  position: static;
  max-width: 100%;
  padding: 16px 8px;
  text-align: center;
}

.squad-pick-slot-meta strong,
.squad-pick-slot-meta span {
  display: block;
}

.squad-pick-slot-meta strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}

.squad-pick-slot-meta span {
  margin-top: 3px;
  color: var(--team-accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}

.squad-selection-screen .squad-card:has(.squad-card-art:hover) {
  z-index: 30;
}

.squad-selection-screen .squad-card-art:hover img,
.squad-selection-screen .squad-card-art:focus-visible img {
  z-index: 40;
}

.squad-header,
.squad-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.squad-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.squad-header p,
.squad-footer span {
  margin: 5px 0 0;
  color: var(--muted);
}

.squad-budget {
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #262b25;
  padding: 9px;
  text-align: center;
}

.squad-budget span,
.squad-budget strong {
  display: block;
}

.squad-budget span {
  color: var(--muted);
  font-size: 0.72rem;
}

.squad-budget strong {
  margin-top: 3px;
  color: var(--accent);
}

.squad-budget strong.over {
  color: var(--danger);
}

.squad-toolbar,
.squad-settings,
.squad-tabs,
.squad-nav-actions,
.team-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.squad-toolbar {
  justify-content: space-between;
  margin-top: 14px;
}

.squad-settings {
  flex-wrap: wrap;
}

.squad-setup-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.squad-tabs button {
  min-width: 116px;
  min-height: 38px;
  border-color: rgba(244, 241, 232, 0.12);
  background: rgba(244, 241, 232, 0.04);
  color: var(--muted);
  font-weight: 800;
}

.squad-tabs button.active,
.team-controls button.cpu {
  border-color: var(--accent);
  background: #3a3324;
  color: var(--text);
  box-shadow: inset 0 -2px 0 rgba(219, 177, 91, 0.48);
}

.squad-settings label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.squad-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.squad-summary strong {
  color: var(--text);
}

.squad-summary span {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.045);
}

.squad-cards {
  display: block;
  margin: 16px 0;
}

.squad-list-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(244, 241, 232, 0.09);
  border-radius: 8px;
  background: rgba(14, 15, 13, 0.24);
}

.squad-role-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-filter-chip {
  min-height: 32px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
}

.role-filter-chip.active {
  border-color: var(--accent);
  background: rgba(219, 177, 91, 0.14);
  color: var(--text);
}

.squad-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.squad-sort-control select {
  min-height: 32px;
}

.squad-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  overflow: visible;
}

.squad-card-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.06);
  color: var(--text);
  font-size: 0.68rem;
  line-height: 1.2;
}

.squad-card {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  min-height: 112px;
  padding: 10px;
  text-align: left;
  overflow: visible;
  border-color: rgba(244, 241, 232, 0.1);
}

.squad-card:has(.squad-card-art:hover) {
  z-index: 5;
}

.squad-card.selected {
  border-color: var(--accent);
  background: #3a3324;
}

.squad-card.unavailable {
  opacity: 0.58;
  border-color: rgba(217, 76, 84, 0.28);
}

.squad-card-lock {
  margin-top: 5px;
  color: #f2a2a7 !important;
  font-weight: 800;
}

.squad-card-art {
  position: relative;
  grid-row: span 2;
  display: block;
  width: 64px;
  aspect-ratio: 3 / 4;
  overflow: visible;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 7px;
  background: var(--panel-2);
  z-index: 1;
}

.squad-card-art::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(244, 241, 232, 0.04);
  pointer-events: none;
  z-index: 2;
}

.squad-card-art img,
.unit-portrait-frame img,
.tooltip-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.squad-card-art img {
  display: block;
  border-radius: 6px;
  pointer-events: none;
  transition: width 130ms ease, height 130ms ease, transform 130ms ease, box-shadow 130ms ease, border-color 130ms ease;
}

.squad-card-art:hover img,
.squad-card-art:focus-visible img {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 20;
  width: clamp(118px, 17vw, 168px);
  height: auto;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(244, 241, 232, 0.28);
  border-radius: 8px;
  background: #111410;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46);
  transform: translateY(-50%);
}

.tooltip-portrait img {
  transform: scale(1.34);
}

.squad-card-art b,
.unit-portrait-frame b,
.tooltip-portrait b {
  position: absolute;
  right: 4px;
  bottom: 3px;
  border-radius: 999px;
  background: rgba(14, 15, 13, 0.72);
  color: var(--text);
  padding: 1px 5px;
  font-size: 0.64rem;
  line-height: 1.3;
}

.squad-card-art.art-fallback,
.unit-portrait-frame.art-fallback,
.tooltip-portrait.art-fallback {
  display: grid;
  place-items: center;
}

.squad-card-art.art-fallback b,
.unit-portrait-frame.art-fallback b,
.tooltip-portrait.art-fallback b {
  position: static;
  background: transparent;
  padding: 0;
  font-size: 0.9rem;
}

.squad-card-info {
  min-width: 0;
}

.squad-card strong {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.18;
}

.squad-card small,
.squad-card p {
  display: block;
  color: var(--muted);
}

.squad-card em {
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.squad-card p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.squad-footer button {
  min-width: 150px;
  background: #31433a;
  border-color: #4a7565;
}

.squad-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.squad-nav-actions button {
  min-height: 38px;
  background: #30362f;
  border-color: var(--line);
}

.squad-footer-actions #backToSetupBtn {
  min-width: 172px;
  background: #30362f;
  border-color: var(--line);
}

.squad-footer-actions #startMatchBtn {
  min-width: 168px;
  font-weight: 800;
}

.competitive-draft-screen .squad-tabs {
  display: none;
}

.competitive-draft-screen .squad-picker-shell {
  overflow: auto;
}

.competitive-draft-screen .squad-summary {
  align-items: center;
}

.competitive-draft-screen .competitive-draft-timer {
  width: min(760px, 100%);
  margin: 0 auto;
}

.competitive-draft-screen #backToSetupBtn {
  position: fixed;
  left: 24px;
  top: 24px;
  z-index: 260;
  display: grid;
  place-items: center;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(219, 177, 91, 0.48);
  background: rgba(14, 15, 13, 0.82);
  color: var(--accent);
  font-size: 1.35rem;
}

.competitive-draft-screen #startMatchBtn {
  border-color: rgba(219, 177, 91, 0.62);
  background: #3a3324;
  color: var(--text);
}

.competitive-draft-screen.squad-selection-screen {
  padding: clamp(8px, 1vw, 14px);
  background:
    radial-gradient(circle at 18% 18%, rgba(80, 146, 210, 0.16), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(207, 79, 74, 0.14), transparent 30%),
    #090b0a;
}

.competitive-draft-screen .squad-esports-frame {
  grid-template-columns: minmax(170px, 0.16fr) minmax(660px, 1fr) minmax(170px, 0.16fr);
  width: min(100%, calc((100vh - 28px) * 16 / 9));
  max-height: calc(100vh - 28px);
}

.competitive-draft-screen .squad-picker-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 14px 16px 0;
}

.competitive-draft-screen .squad-center-header {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 8px 0 10px;
  text-align: center;
}

.competitive-draft-screen .squad-title-block {
  display: grid;
  justify-items: center;
  width: 100%;
}

.competitive-draft-screen .squad-picker-shell .squad-header h1 {
  font-size: clamp(2rem, 4.8vw, 4.2rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.competitive-draft-screen #squadSelectionSubtitle,
.competitive-draft-screen .squad-current-summary,
.competitive-draft-screen .squad-budget {
  display: none;
}

.competitive-draft-screen .squad-picker-shell .squad-toolbar {
  display: none;
}

.competitive-draft-screen .squad-picker-shell .squad-cards {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin: 10px 0 0;
  overflow: hidden;
}

.competitive-draft-screen .squad-picker-shell .squad-card-list {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 0 8px 20px 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.competitive-draft-screen .squad-picker-shell .squad-footer {
  position: static;
  z-index: auto;
  margin: 0 -16px;
  padding: 12px 16px 14px;
  justify-content: center;
}

.competitive-draft-screen .squad-footer #squadHint {
  display: none;
}

.competitive-draft-screen .squad-footer-actions {
  width: 100%;
  justify-content: center;
}

.competitive-draft-screen .squad-pick-column-p1 {
  --team-accent: #66b7ff;
  --team-accent-border: rgba(102, 183, 255, 0.76);
  --team-accent-soft: rgba(102, 183, 255, 0.22);
  --team-accent-slot: rgba(102, 183, 255, 0.42);
  --team-accent-text: rgba(132, 207, 255, 0.86);
}

.competitive-draft-screen .squad-pick-column-p2 {
  --team-accent: #ff756f;
  --team-accent-border: rgba(255, 117, 111, 0.76);
  --team-accent-soft: rgba(255, 117, 111, 0.22);
  --team-accent-slot: rgba(255, 117, 111, 0.42);
  --team-accent-text: rgba(255, 148, 142, 0.88);
}

.competitive-draft-screen .squad-pick-column-header.pd-primary {
  grid-template-columns: 1fr;
  align-items: start;
}

.competitive-draft-screen .squad-pick-column-header.pd-primary strong {
  color: var(--text);
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.05;
}

.competitive-draft-screen .squad-pick-slot.empty.compact .squad-pick-slot-meta {
  padding: 10px 6px;
}

.competitive-draft-screen .squad-pick-slot.empty.compact .squad-pick-slot-meta strong {
  font-size: 0.9rem;
}

.competitive-draft-screen .squad-pick-slot.empty.compact .squad-pick-slot-meta span:empty {
  display: none;
}

.competitive-draft-screen .squad-pick-slot.current {
  border-color: var(--team-accent-border);
  box-shadow: inset 0 0 0 1px var(--team-accent-soft);
}

.competitive-draft-screen .squad-summary {
  display: grid;
  justify-items: center;
  min-height: 92px;
  margin-top: 0;
  padding: 4px 0 10px;
  border-bottom: 1px solid rgba(244, 241, 232, 0.1);
}

.competitive-draft-timer {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
}

.competitive-draft-screen.active-p1 .competitive-draft-timer-context {
  color: #91ceff;
}

.competitive-draft-screen.active-p2 .competitive-draft-timer-context {
  color: #ff9a93;
}

.competitive-draft-timer-context,
.competitive-draft-timer-label {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.competitive-draft-timer-label {
  color: var(--muted);
}

.competitive-draft-timer.is-grace .competitive-draft-timer-label {
  color: #f2a2a7;
}

.competitive-draft-clock {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: clamp(12px, 2.1vw, 26px);
  width: min(700px, 100%);
}

.competitive-draft-clock strong {
  min-width: 2ch;
  color: var(--text);
  font-size: clamp(2.8rem, 6vw, 5.3rem);
  line-height: 0.88;
  text-align: center;
}

.competitive-draft-clock-bar {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.11);
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.06);
}

.competitive-draft-clock-bar-left i,
.competitive-draft-clock-bar-right i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--competitive-timer-color, #62a96b);
}

.competitive-draft-clock-bar-left i {
  margin-left: auto;
}

.competitive-draft-timer.is-grace .competitive-draft-clock-bar i {
  background: linear-gradient(90deg, #f2a2a7, var(--danger));
}

.competitive-draft-controls {
  position: relative;
  z-index: 4;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  pointer-events: auto;
}

.competitive-draft-filters {
  flex: 1 1 auto;
}

.competitive-draft-screen .squad-cards,
.competitive-draft-screen .competitive-draft-card-list,
.competitive-draft-controls label,
.competitive-draft-controls input,
.competitive-draft-controls select,
.competitive-draft-controls button,
.competitive-draft-card {
  pointer-events: auto;
}

.draft-role-filter-chip {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.draft-role-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.draft-role-icon svg,
.draft-profile-icon svg,
.draft-card-state svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.draft-role-filter-chip.active .draft-role-icon,
.draft-role-filter-chip:hover .draft-role-icon {
  color: var(--text);
}

.draft-role-icon-luchador {
  color: #f0a15e;
}

.draft-role-icon-tanque {
  color: #dfc277;
}

.draft-role-icon-mago {
  color: #9bc7ff;
}

.draft-role-icon-tirador {
  color: #96d67e;
}

.draft-role-icon-soporte {
  color: #c9a8ff;
}

.draft-role-icon-todos {
  color: var(--muted);
}

.draft-role-icon-asesino,
.draft-role-icon-duelista {
  color: #f0a15e;
}

.draft-role-icon-hostigador,
.draft-role-icon-movilidad {
  color: #96d67e;
}

.draft-role-icon-control,
.draft-role-icon-utilidad,
.draft-role-icon-tactico {
  color: #9bc7ff;
}

.draft-role-icon-trampa,
.draft-role-icon-invocador,
.draft-role-icon-curador,
.draft-role-icon-proteccion,
.draft-role-icon-curacion,
.draft-role-icon-iniciador {
  color: #c9a8ff;
}

.competitive-draft-search {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.competitive-draft-search input {
  width: min(190px, 18vw);
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #20251f;
  color: var(--text);
  padding: 0 9px;
  font: inherit;
}

.competitive-draft-card {
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  min-height: 140px;
  padding: 8px;
  overflow: visible;
  background:
    linear-gradient(135deg, rgba(244, 241, 232, 0.055), transparent 46%),
    #202720;
  box-shadow: inset 0 0 0 1px rgba(244, 241, 232, 0.025);
  transition: border-color 130ms ease, background 130ms ease, box-shadow 130ms ease;
}

.competitive-draft-card:hover:not(:disabled),
.competitive-draft-card:focus-visible:not(:disabled) {
  border-color: rgba(219, 177, 91, 0.52);
  background:
    linear-gradient(135deg, rgba(219, 177, 91, 0.1), transparent 48%),
    #242b23;
  box-shadow:
    inset 0 0 0 1px rgba(244, 241, 232, 0.05),
    0 0 22px rgba(219, 177, 91, 0.1);
}

.competitive-draft-card.selected {
  border-color: var(--team-accent-border, var(--accent));
  background:
    linear-gradient(135deg, var(--team-accent-soft, rgba(219, 177, 91, 0.14)), transparent 48%),
    #252d26;
}

.competitive-draft-screen.active-p1 .competitive-draft-card.selected {
  --team-accent-border: rgba(102, 183, 255, 0.78);
  --team-accent-soft: rgba(102, 183, 255, 0.14);
}

.competitive-draft-screen.active-p2 .competitive-draft-card.selected {
  --team-accent-border: rgba(255, 117, 111, 0.78);
  --team-accent-soft: rgba(255, 117, 111, 0.14);
}

.competitive-draft-card.unavailable {
  opacity: 0.72;
  background:
    linear-gradient(135deg, rgba(12, 13, 12, 0.5), rgba(12, 13, 12, 0.18)),
    #1c211c;
  filter: saturate(0.64);
}

.competitive-draft-card.unavailable-picked {
  border-color: rgba(139, 198, 132, 0.34);
}

.competitive-draft-card.unavailable-pd {
  border-color: rgba(240, 185, 91, 0.36);
}

.competitive-draft-card.unavailable-completion {
  border-color: rgba(217, 76, 84, 0.36);
}

.competitive-draft-card .draft-card-art {
  grid-row: 1 / span 2;
  width: 78px;
  height: 124px;
  aspect-ratio: auto;
  overflow: hidden;
  border-color: rgba(244, 241, 232, 0.2);
  background: #111410;
}

.competitive-draft-card .draft-card-art img {
  height: 100%;
  object-position: 50% 34%;
  transform: scale(1.12);
}

.competitive-draft-card .draft-card-art:hover img,
.competitive-draft-card .draft-card-art:focus-visible img {
  position: static;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  box-shadow: none;
  transform: scale(1.12);
}

.competitive-draft-screen .squad-card:has(.squad-card-art:hover) {
  z-index: auto;
}

.competitive-draft-card .draft-card-art b {
  right: 5px;
  bottom: 4px;
}

.draft-card-info {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 124px;
}

.competitive-draft-card .squad-card-info strong {
  font-size: 0.95rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.draft-card-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

.draft-card-topline em {
  color: var(--accent);
  font-size: 0.96rem;
}

.draft-card-role-icons {
  gap: 4px;
  margin-top: 0;
}

.draft-card-role-icons .draft-role-icon {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 7px;
  background: rgba(14, 15, 13, 0.34);
}

.draft-card-role-icons .draft-role-icon.is-secondary {
  width: 19px;
  height: 19px;
  opacity: 0.78;
  align-self: end;
}

.draft-profile-bars {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.draft-profile-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.draft-profile-icon {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.draft-profile-meter {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
}

.draft-profile-meter i {
  display: block;
  height: 7px;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 2px;
  background: rgba(244, 241, 232, 0.06);
}

.draft-profile-meter i.filled {
  border-color: rgba(244, 241, 232, 0.16);
}

.draft-profile-endurance .draft-profile-icon {
  color: #dfc277;
}

.draft-profile-endurance .draft-profile-meter i.filled {
  background: linear-gradient(180deg, #f3d990, #9f7135);
}

.draft-profile-damage .draft-profile-icon {
  color: #f0a15e;
}

.draft-profile-damage .draft-profile-meter i.filled {
  background: linear-gradient(180deg, #ffbc73, #b44a2c);
}

.draft-profile-utility .draft-profile-icon {
  color: #8fc8ff;
}

.draft-profile-utility .draft-profile-meter i.filled {
  background: linear-gradient(180deg, #9dd7ff, #315fa8);
}

.draft-card-state {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 999px;
  background: rgba(14, 15, 13, 0.72);
  color: var(--muted);
  pointer-events: none;
}

.draft-card-state-picked {
  color: #9ad48e;
}

.draft-card-state-pd {
  color: #f0b95b;
}

.draft-card-state-completion {
  color: #f2a2a7;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #30362f;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  min-height: 42px;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #30362f;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
}

.app {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
}

body.combat-stage-active .app {
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions button {
  min-width: 90px;
}

.competitive-turn-clock {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(246, 190, 91, 0.45);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(32, 36, 32, 0.95), rgba(17, 20, 18, 0.95));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  padding: 9px 10px;
  margin-top: 8px;
}

.competitive-turn-clock.hidden {
  display: none;
}

.competitive-turn-clock-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.competitive-turn-clock-label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.competitive-turn-clock-label strong {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}

.competitive-turn-clock-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.competitive-turn-clock-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5fd0f2, var(--accent));
  transition: width 0.2s linear;
}

.competitive-turn-clock.is-grace {
  border-color: rgba(255, 125, 97, 0.72);
}

.competitive-turn-clock.is-grace .competitive-turn-clock-label strong {
  color: #ff8b6e;
}

.competitive-turn-clock.is-grace .competitive-turn-clock-track i {
  background: linear-gradient(90deg, #ffcf5a, #ff6f5f);
}

#undoBtn {
  min-width: 44px;
  width: 44px;
  padding: 0;
  font-size: 1.3rem;
}

.team-controls {
  padding: 0;
}

.team-controls button {
  min-width: 98px;
}

.team-controls select {
  width: 82px;
}

.log-dropdown,
.combat-stats-dropdown {
  position: relative;
  min-width: 250px;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #20231f;
  padding: 8px 10px;
}

.combat-stats-dropdown {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  max-width: none;
  min-height: 0;
  overflow: hidden;
}

.log-dropdown span,
.combat-stats-dropdown span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.log-dropdown strong,
.combat-stats-dropdown strong {
  display: block;
  margin-top: 3px;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.log-popover,
.combat-stats-popover {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: auto;
  display: none;
  width: min(460px, 90vw);
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 17, 0.98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
  padding: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.log-popover {
  height: 520px;
  min-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.combat-stats-popover {
  position: static;
  z-index: auto;
  top: auto;
  right: auto;
  left: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0 0;
  gap: 8px;
}

.log-dropdown.open .log-popover {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.log-line {
  border-radius: 5px;
  cursor: pointer;
  padding: 2px 4px;
  white-space: normal;
  line-height: 1.3;
}

.log-line:hover,
.log-line:focus {
  background: rgba(255, 205, 91, 0.12);
  color: var(--text);
  outline: none;
}

.combat-stat-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.combat-stat-filters button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 28px;
  border-radius: 6px;
  padding: 4px 3px;
  font-size: 0.62rem;
  font-weight: 800;
}

.combat-stat-filters button.active {
  border-color: var(--accent);
  background: #3a3325;
  color: var(--accent);
}

.combat-stats-list {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 5px;
  padding-right: 2px;
}

.log-popover div {
  border-bottom: 1px solid rgba(244, 241, 232, 0.08);
  padding-bottom: 7px;
}

.combat-stat-row {
  display: grid;
  grid-template-columns: 18px 28px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid rgba(244, 241, 232, 0.08);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  background: #20231f;
  padding: 5px 6px;
}

.combat-stat-row.player-one {
  border-left-color: var(--p1);
}

.combat-stat-row.player-two {
  border-left-color: var(--p2);
}

.combat-stat-row.is-dead {
  opacity: 0.62;
}

.combat-stat-rank {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.combat-stat-portrait {
  position: relative;
  display: block;
  width: 28px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.18);
  border-radius: 50%;
  background: #2a2f28;
}

.combat-stat-portrait b {
  display: none;
}

.combat-stat-portrait img,
.mvp-mini img,
.mvp-splash img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.combat-stat-portrait img,
.mvp-mini img {
  transform: scale(1.34);
}

.combat-stat-identity {
  min-width: 0;
}

.combat-stat-identity strong,
.combat-stat-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-stat-identity strong {
  margin: 0;
  color: var(--text);
  font-size: 0.72rem;
}

.combat-stat-identity small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.62rem;
}

.combat-stat-value {
  min-width: 28px;
  color: var(--accent);
  font-size: 0.8rem;
  text-align: right;
}

.combat-stat-main header,
.combat-stat-line {
  display: grid;
  grid-template-columns: 58px minmax(80px, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.combat-stat-main header {
  grid-template-columns: auto 1fr;
  margin-bottom: 5px;
}

.combat-stat-main header strong {
  color: var(--text);
}

.combat-stat-main header span,
.combat-stat-line span,
.combat-stat-line b {
  font-size: 0.7rem;
}

.combat-stat-line b {
  color: var(--text);
  text-align: right;
}

.combat-stat-track {
  display: flex;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(244, 241, 232, 0.08);
}

.combat-stat-track i {
  display: block;
  height: 100%;
}

.combat-stat-track .damage {
  background: #d94c54;
}

.combat-stat-track .true-damage {
  background: #f4f1e8;
}

.combat-stat-track .heal,
.combat-stat-track .utility-buff {
  background: #73d65c;
}

.combat-stat-track .utility-debuff {
  background: #f0b95b;
}

.combat-stat-track .utility-other {
  background: #65d4ff;
}

.combat-stage {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(520px, 1fr) minmax(300px, 360px);
  gap: 14px;
  width: min(100%, calc(100vh * 16 / 9));
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  margin: 0 auto;
  min-height: 620px;
}

.combat-info-panel,
.sidepanel {
  min-height: 0;
  overflow: hidden;
}

.combat-info-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.combat-info-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 35, 31, 0.92);
  padding: 10px;
}

.combat-info-eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.combat-turn-card > strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 1.1rem;
}

.combat-turn-card > small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.combat-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.combat-info-grid div {
  min-width: 0;
  border: 1px solid rgba(244, 241, 232, 0.08);
  border-radius: 7px;
  background: var(--panel-2);
  padding: 7px;
}

.combat-info-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.combat-info-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.combat-match-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

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

.combat-info-actions button {
  min-width: 0;
}

#exitMatchBtn {
  border-color: #74433c;
  background: #4a322e;
}

.battlefield {
  --combat-timeline-height: 140px;
  --combat-board-size: min(100%, calc(100vh - 32px - var(--combat-timeline-height)), 980px);
  position: relative;
  display: grid;
  grid-template-rows: var(--combat-timeline-height) minmax(0, 1fr);
  justify-items: center;
  align-items: end;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.mvp-overlay {
  position: absolute;
  z-index: 45;
  bottom: 0;
  left: 50%;
  display: grid;
  place-items: center;
  width: var(--combat-board-size);
  aspect-ratio: 1;
  padding: 16px;
  background: rgba(12, 14, 12, 0.58);
  backdrop-filter: blur(3px);
  transform: translateX(-50%);
}

.mvp-overlay.hidden {
  display: none;
}

.truco-overlay {
  position: absolute;
  z-index: 50;
  bottom: 0;
  left: 50%;
  display: grid;
  place-items: center;
  width: var(--combat-board-size);
  aspect-ratio: 1;
  padding: 16px;
  background: rgba(12, 14, 12, 0.68);
  backdrop-filter: blur(3px);
  transform: translateX(-50%);
}

.truco-overlay.hidden {
  display: none;
}

.truco-card {
  width: min(620px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid rgba(240, 185, 91, 0.5);
  border-radius: 8px;
  background: rgba(22, 24, 21, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
  padding: 14px;
}

.truco-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.truco-header span,
.truco-card p,
.truco-panels span {
  color: var(--muted);
}

.truco-header h2 {
  margin: 2px 0 0;
}

.truco-header strong,
.truco-center.positive b,
.truco-center.positive em {
  color: #9ee87d;
}

.truco-header strong.negative,
.truco-center.negative b,
.truco-center.negative em {
  color: #ff7777;
}

.truco-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

.truco-playing-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  min-height: 142px;
  padding: 16px 10px 12px;
  border: 1px solid rgba(73, 42, 24, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), transparent 34%),
    linear-gradient(145deg, #f2e7cf, #c99d64);
  color: #21150d;
  text-align: center;
  box-shadow:
    inset 0 0 0 5px rgba(111, 70, 34, 0.2),
    inset 0 0 0 8px rgba(255, 255, 255, 0.24);
}

.truco-playing-card.unrevealed {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, rgba(240, 185, 91, 0.2), rgba(240, 185, 91, 0.2) 8px, rgba(32, 36, 30, 0.95) 8px, rgba(32, 36, 30, 0.95) 16px);
  color: var(--muted);
}

.truco-card-value {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgba(255, 250, 235, 0.9);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.truco-card-name {
  font-weight: 800;
  font-size: 0.82rem;
}

.truco-corner {
  position: absolute;
  font-size: 0.72rem;
  font-weight: 900;
}

.truco-corner-top {
  top: 8px;
  left: 10px;
}

.truco-corner-bottom {
  right: 10px;
  bottom: 8px;
  transform: rotate(180deg);
}

.truco-suit-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 8px;
  font-weight: 900;
}

.truco-playing-card.suit-espada {
  color: #263342;
}

.truco-playing-card.suit-basto {
  color: #4d321d;
}

.truco-playing-card.suit-oro {
  color: #9b6415;
}

.truco-playing-card.suit-copa {
  color: #7c2634;
}

.truco-center {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.truco-center span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.truco-center b {
  font-size: 2.4rem;
  line-height: 1;
}

.truco-center em {
  font-style: normal;
  font-weight: 800;
}

.truco-panels {
  display: grid;
  gap: 8px;
}

.truco-panels div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.truco-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin-top: 12px;
}

.mvp-card {
  position: relative;
  width: min(620px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid rgba(244, 241, 232, 0.22);
  border-radius: 8px;
  background: rgba(24, 27, 23, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  padding: 12px;
}

.mvp-close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
}

.mvp-hero {
  display: grid;
  grid-template-columns: minmax(116px, 168px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.mvp-splash {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(240, 185, 91, 0.55);
  border-radius: 8px;
  background: #2a2f28;
}

.mvp-splash b {
  color: var(--accent);
  font-size: 1.6rem;
}

.mvp-copy span {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.mvp-copy h2 {
  margin: 6px 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.mvp-copy p {
  margin: 0;
  color: var(--muted);
}

.mvp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mvp-mini-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 8px;
  background: #20231f;
  padding: 7px;
}

.mvp-mini {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 50%;
  background: #2a2f28;
}

.mvp-mini b {
  display: none;
}

.mvp-mini.empty {
  color: var(--muted);
}

.mvp-mini-card strong,
.mvp-mini-card small {
  display: block;
}

.mvp-mini-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mvp-mini-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.map-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: stretch;
  width: min(100%, 980px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.map-timeline::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 4%;
  left: 4%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(244, 241, 232, 0.18));
  content: "";
}

.map-timeline-slot {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 100%;
}

.map-timeline-slot small {
  position: absolute;
  top: calc(50% + 36px);
  right: 0;
  left: 0;
  display: block;
  color: var(--muted);
  font-size: clamp(0.62rem, 1.2vw, 0.82rem);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.map-timeline-portrait {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(48px, 78%);
  aspect-ratio: 3 / 4;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.map-timeline-portrait-art {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgba(244, 241, 232, 0.2);
  border-radius: 4px;
  background: #252a24;
  pointer-events: none;
}

.map-timeline-portrait-art.has-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.map-timeline-portrait-art.has-art b {
  display: none;
}

.map-timeline-slot.player-one .map-timeline-portrait-art {
  border-color: rgba(63, 157, 255, 0.72);
}

.map-timeline-slot.player-two .map-timeline-portrait-art {
  border-color: rgba(230, 106, 93, 0.72);
}

.map-timeline-slot.is-current .map-timeline-portrait-art {
  box-shadow: 0 0 0 2px rgba(219, 177, 91, 0.8), 0 0 16px rgba(219, 177, 91, 0.36);
}

.map-timeline-cycle-boundary {
  position: absolute;
  z-index: 0;
  top: 12px;
  bottom: 24px;
  left: 0;
  width: 1px;
  background: rgba(244, 241, 232, 0.38);
  pointer-events: none;
}

.map-timeline-cycle-eclipse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 241, 232, 0.72);
  border-radius: 50%;
  background: #181b17;
  box-shadow: inset -3px 0 0 rgba(244, 241, 232, 0.38);
  transform: translate(-50%, -50%);
}

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: var(--combat-board-size);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: #10120f;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 241, 232, 0.06);
  background: #272c25;
  overflow: hidden;
}

.cell::before,
.cell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.cell > * {
  z-index: 2;
}

.cell.alt {
  background: #22271f;
}

.cell.obstacle {
  background:
    repeating-linear-gradient(45deg, #4c5149 0 8px, #393e37 8px 16px);
}

.cell.terrain-tree {
  background:
    radial-gradient(circle at 50% 44%, rgba(80, 136, 73, 0.42), transparent 42%),
    #172b1e;
}

.cell.terrain-plateau {
  background:
    linear-gradient(135deg, rgba(217, 176, 111, 0.36), rgba(128, 91, 53, 0.18)),
    #6a5238;
}

.cell.terrain-mountain {
  background:
    repeating-linear-gradient(45deg, rgba(67, 47, 36, 0.82) 0 8px, rgba(45, 35, 29, 0.86) 8px 16px),
    #332820;
}

.cell.zone-fire {
  box-shadow: inset 0 0 0 2px rgba(217, 76, 84, 0.34);
}

.cell.zone-purify {
  box-shadow: inset 0 0 0 2px rgba(240, 211, 123, 0.34);
}

.cell.zone-shadow {
  box-shadow: inset 0 0 0 2px rgba(126, 95, 190, 0.42);
}

.cell.zone-stink {
  box-shadow: inset 0 0 0 2px rgba(167, 223, 121, 0.78), inset 0 0 20px rgba(91, 143, 77, 0.28);
}

.cell.zone-poison {
  box-shadow: inset 0 0 0 2px rgba(127, 216, 78, 0.58), 0 0 14px rgba(159, 64, 190, 0.16);
}

.cell.zone-smoke {
  box-shadow: inset 0 0 0 2px rgba(178, 182, 178, 0.42);
}

.cell.zone-smoke-p1 {
  box-shadow: inset 0 0 0 2px rgba(63, 157, 255, 0.5);
}

.cell.zone-smoke-p2 {
  box-shadow: inset 0 0 0 2px rgba(230, 106, 93, 0.5);
}

.cell.zone-drill-smoke {
  box-shadow: inset 0 0 0 2px rgba(83, 48, 110, 0.78), 0 0 14px rgba(35, 18, 48, 0.34);
}

.cell.zone-barrier {
  box-shadow: inset 0 0 0 2px rgba(255, 88, 244, 0.7), 0 0 16px rgba(255, 88, 244, 0.18);
}

.cell.zone-collapse {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 143, 151, 0.28) 0 5px,
      rgba(255, 143, 151, 0.05) 5px 12px
    ),
    #272c25;
  box-shadow: inset 0 0 0 2px rgba(217, 76, 84, 0.34);
}

.cell.alt.zone-collapse {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 143, 151, 0.26) 0 5px,
      rgba(255, 143, 151, 0.04) 5px 12px
    ),
    #22271f;
}

.cell.obstacle.zone-collapse {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 143, 151, 0.24) 0 5px,
      rgba(255, 143, 151, 0.03) 5px 12px
    ),
    repeating-linear-gradient(45deg, #4c5149 0 8px, #393e37 8px 16px);
}

.cell.zone-warning {
  outline: 3px dashed rgba(240, 185, 91, 0.72);
  outline-offset: -8px;
}

.cell.zone-fire::before {
  background:
    linear-gradient(135deg, rgba(217, 76, 84, 0.42) 0 50%, transparent 50%),
    radial-gradient(circle at 18% 18%, rgba(255, 157, 97, 0.32), transparent 38%);
}

.cell.zone-purify::after {
  background:
    linear-gradient(315deg, rgba(240, 211, 123, 0.4) 0 50%, transparent 50%),
    radial-gradient(circle at 82% 18%, rgba(255, 243, 171, 0.22), transparent 40%);
}

.cell.zone-stink::after {
  background:
    radial-gradient(circle at 24% 28%, rgba(179, 231, 125, 0.3), transparent 32%),
    radial-gradient(circle at 72% 70%, rgba(86, 158, 96, 0.28), transparent 42%),
    repeating-radial-gradient(circle at 52% 48%, rgba(219, 255, 167, 0.1) 0 2px, transparent 3px 10px);
}

.cell.zone-poison::after {
  background:
    radial-gradient(circle at 26% 28%, rgba(163, 255, 87, 0.24), transparent 36%),
    radial-gradient(circle at 70% 66%, rgba(180, 74, 210, 0.22), transparent 40%);
}

.cell.zone-smoke::after {
  background:
    radial-gradient(circle at 34% 36%, rgba(190, 193, 187, 0.24), transparent 42%),
    radial-gradient(circle at 70% 64%, rgba(132, 137, 132, 0.2), transparent 46%);
}

.cell.zone-smoke-p1::after {
  background:
    radial-gradient(circle at 34% 36%, rgba(63, 157, 255, 0.25), transparent 42%),
    radial-gradient(circle at 70% 64%, rgba(190, 193, 187, 0.18), transparent 46%);
}

.cell.zone-smoke-p2::after {
  background:
    radial-gradient(circle at 34% 36%, rgba(230, 106, 93, 0.25), transparent 42%),
    radial-gradient(circle at 70% 64%, rgba(190, 193, 187, 0.18), transparent 46%);
}

.cell.zone-drill-smoke::after {
  background:
    radial-gradient(circle at 30% 34%, rgba(45, 29, 56, 0.62), transparent 43%),
    radial-gradient(circle at 70% 66%, rgba(20, 17, 25, 0.58), transparent 48%);
}

.cell.zone-barrier::after {
  background:
    linear-gradient(135deg, rgba(255, 88, 244, 0.28) 0 50%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 186, 252, 0.2), transparent 46%);
}

.cell.zone-barrier-overlap::after {
  background:
    linear-gradient(135deg, rgba(255, 88, 244, 0.3) 0 50%, transparent 50%),
    linear-gradient(315deg, rgba(255, 88, 244, 0.24) 0 50%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 220, 254, 0.24), transparent 46%);
}

.cell > .rose-sanctuary-overlay {
  position: absolute;
  inset: 3px;
  z-index: 1;
  pointer-events: none;
  border: 1px solid rgba(255, 185, 228, 0.64);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 238, 250, 0.26), transparent 54%),
    linear-gradient(135deg, rgba(244, 137, 198, 0.18), rgba(255, 225, 245, 0.1));
  box-shadow: inset 0 0 12px rgba(255, 190, 231, 0.22), 0 0 10px rgba(243, 132, 194, 0.16);
}

.cell.zone-fire.zone-purify {
  box-shadow:
    inset 0 0 0 2px rgba(240, 211, 123, 0.48),
    inset 0 0 0 5px rgba(217, 76, 84, 0.38);
}

.cell.move {
  outline: 4px solid rgba(116, 232, 130, 0.92);
  outline-offset: -5px;
}

.cell.range {
  outline: 3px solid rgba(151, 132, 255, 0.62);
  outline-offset: -10px;
}

.cell.target {
  outline: 4px solid rgba(151, 132, 255, 0.95);
  outline-offset: -5px;
}

.cell.danger {
  outline: 4px solid rgba(255, 102, 113, 0.95);
  outline-offset: -5px;
}

.cell.deployment {
  box-shadow: inset 0 0 0 3px rgba(101, 212, 255, 0.38);
}

.cell.bone-placement {
  outline: 4px solid rgba(244, 241, 232, 0.95);
  outline-offset: -6px;
  box-shadow: inset 0 0 18px rgba(244, 241, 232, 0.28);
}

.cell.area-preview.area-fire {
  outline: 4px solid rgba(255, 102, 113, 0.95);
  outline-offset: -4px;
  box-shadow: inset 0 0 26px rgba(217, 76, 84, 0.34);
}

.cell.area-preview.area-purify {
  outline: 4px solid rgba(255, 232, 138, 0.95);
  outline-offset: -4px;
  box-shadow: inset 0 0 26px rgba(240, 211, 123, 0.3);
}

.cell.area-preview.area-stink {
  outline: 4px solid rgba(167, 223, 121, 0.92);
  outline-offset: -4px;
  box-shadow: inset 0 0 26px rgba(130, 178, 92, 0.28);
}

.cell.area-preview.area-poison {
  outline: 4px solid rgba(163, 255, 87, 0.92);
  outline-offset: -4px;
  box-shadow: inset 0 0 26px rgba(180, 74, 210, 0.24);
}

.cell.area-preview.area-barrier {
  outline: 4px solid rgba(255, 88, 244, 0.94);
  outline-offset: -4px;
  box-shadow: inset 0 0 26px rgba(255, 88, 244, 0.26);
}

.cell.passive-preview {
  outline: 4px solid rgba(101, 212, 255, 0.9);
  outline-offset: -12px;
}

.cell.selected {
  box-shadow: inset 0 0 0 4px var(--accent);
}

.cell.inspected {
  box-shadow: inset 0 0 0 3px rgba(244, 241, 232, 0.45);
}

.cell.active-turn {
  box-shadow: inset 0 0 0 4px var(--accent);
}

.active-marker {
  position: absolute;
  top: 5px;
  right: 5px;
  border: 1px solid rgba(240, 185, 91, 0.75);
  border-radius: 999px;
  background: rgba(18, 18, 16, 0.86);
  color: var(--accent);
  padding: 2px 6px;
  font-size: 0.56rem;
  font-weight: 800;
  pointer-events: none;
}

.map-object {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 241, 232, 0.55);
  border-radius: 50%;
  background: rgba(244, 241, 232, 0.14);
  color: #f4f1e8;
  font-size: 0.65rem;
  font-weight: 900;
  pointer-events: none;
}

.map-object.player-one {
  color: #3f9dff;
  border-color: rgba(63, 157, 255, 0.58);
  background: rgba(63, 157, 255, 0.13);
}

.map-object.player-two {
  color: #ef5f58;
  border-color: rgba(239, 95, 88, 0.58);
  background: rgba(239, 95, 88, 0.13);
}

.map-object.neutral {
  color: #f4f1e8;
  border-color: rgba(244, 241, 232, 0.45);
  background: rgba(18, 18, 16, 0.22);
}

.map-object.bone {
  box-shadow: 0 0 12px rgba(244, 241, 232, 0.22);
}

.map-object.grubBarrier {
  color: #ffd7ff;
  border-color: rgba(255, 88, 244, 0.72);
  background: rgba(95, 34, 101, 0.38);
  box-shadow: 0 0 14px rgba(255, 88, 244, 0.24);
}

.map-object.tree {
  color: #8fd47f;
  border-color: rgba(143, 212, 127, 0.55);
  background: rgba(31, 80, 43, 0.22);
}

.map-object.plateau {
  color: #efc986;
  border-radius: 8px;
  border-color: rgba(239, 201, 134, 0.55);
  background: rgba(118, 82, 45, 0.24);
}

.map-object.mountain {
  color: #c7a07b;
  border-color: rgba(199, 160, 123, 0.58);
  background: rgba(66, 45, 34, 0.28);
}

.map-object svg {
  width: 78%;
  height: 78%;
  fill: currentColor;
  stroke: rgba(244, 241, 232, 0.62);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.42));
}

.map-object i {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -6px;
  height: 3px;
  border-radius: 999px;
  background: #f4f1e8;
}

.map-object .object-damage {
  top: -20px;
  right: -14px;
}

.coords {
  position: absolute;
  left: 5px;
  bottom: 4px;
  color: rgba(244, 241, 232, 0.25);
  font-size: 0.62rem;
}

.unit {
  position: relative;
  display: grid;
  place-items: center;
  width: 68%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #111;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  overflow: visible;
}

.unit::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: 0;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: rgba(12, 14, 12, 0.32);
  box-shadow: 0 0 14px currentColor;
  opacity: 0.95;
  pointer-events: none;
}

.unit.player-one {
  background: radial-gradient(circle at 35% 30%, #dcebff, var(--p1));
  color: #3f9dff;
}

.unit.player-two {
  background: radial-gradient(circle at 35% 30%, #ffe1dc, var(--p2));
  color: #ef5f58;
}

.unit.current {
  box-shadow: 0 0 0 4px rgba(240, 185, 91, 0.55), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.unit.has-art {
  background: #111;
  color: var(--text);
}

.unit.has-art.player-one {
  color: #3f9dff;
}

.unit.has-art.player-two {
  color: #ef5f58;
}

.unit.ally {
  color: #3f9dff;
}

.unit.enemy {
  color: #ef5f58;
}

.unit-art-crop {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  border-radius: 50%;
}

.unit.has-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.38);
}

.unit-initials {
  position: relative;
  z-index: 2;
}

.unit.has-art .unit-initials {
  position: absolute;
  right: 3px;
  bottom: 3px;
  border-radius: 999px;
  background: rgba(12, 14, 12, 0.72);
  color: var(--text);
  padding: 1px 4px;
  font-size: 0.56rem;
  line-height: 1.2;
}

.facing-arrow {
  position: absolute;
  z-index: 3;
  top: -11px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--accent);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
  pointer-events: none;
}

.facing-arrow.facing-south {
  top: auto;
  bottom: -11px;
  border-bottom: 0;
  border-top: 10px solid var(--accent);
}

.facing-arrow.facing-east {
  top: 50%;
  left: auto;
  right: -11px;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid var(--accent);
  border-right: 0;
}

.facing-arrow.facing-west {
  top: 50%;
  left: -11px;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 10px solid var(--accent);
  border-left: 0;
}

.predicted-facing-arrow {
  position: absolute;
  z-index: 7;
  top: -18px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 13px solid rgba(101, 212, 255, 0.62);
  filter: drop-shadow(0 0 7px rgba(101, 212, 255, 0.65));
  opacity: 0.82;
  pointer-events: none;
}

.predicted-facing-arrow.facing-south {
  top: auto;
  bottom: -18px;
  border-bottom: 0;
  border-top: 13px solid rgba(101, 212, 255, 0.62);
}

.predicted-facing-arrow.facing-east {
  top: 50%;
  left: auto;
  right: -18px;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 13px solid rgba(101, 212, 255, 0.62);
  border-right: 0;
}

.predicted-facing-arrow.facing-west {
  top: 50%;
  left: -18px;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 13px solid rgba(101, 212, 255, 0.62);
  border-left: 0;
}

.unit.passive-affected::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px dashed #65d4ff;
  border-radius: 50%;
  animation: pulse-ring 1000ms ease-in-out infinite alternate;
  pointer-events: none;
}

.unit.pit-fetid-aura::before {
  inset: -11px;
  border-color: rgba(167, 223, 121, 0.72);
  background: radial-gradient(circle, rgba(126, 186, 96, 0.18), rgba(43, 77, 46, 0.04) 64%, transparent 72%);
  box-shadow: 0 0 17px rgba(130, 178, 92, 0.5);
}

@keyframes pulse-ring {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.unit .hpbar {
  position: absolute;
  z-index: 2;
  left: 8%;
  right: 8%;
  bottom: -9px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.unit .hpbar i,
.unit .hpbar em,
.unit .hpbar strong,
.unit .hpbar b,
.unit .hpbar u,
.unit .hpbar small {
  display: block;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
}

.unit .hpbar i {
  background: #75d95a;
}

.unit .hpbar em {
  background: rgba(217, 76, 84, 0.85);
}

.unit .hpbar strong {
  background: rgba(244, 241, 232, 0.88);
  opacity: 0.94;
}

.unit .hpbar b {
  background: rgba(217, 76, 84, 0.78);
  border-right: 1px solid #f4f1e8;
}

.unit .hpbar u {
  background: rgba(244, 241, 232, 0.78);
  border-left: 1px solid rgba(244, 241, 232, 0.95);
  text-decoration: none;
}

.unit .hpbar small {
  background: rgba(116, 232, 130, 0.58);
  border-left: 1px solid rgba(174, 255, 183, 0.95);
}

.cell.prediction {
  outline-offset: -3px;
}

.cell.prediction-path {
  box-shadow: inset 0 0 0 3px rgba(101, 212, 255, 0.58);
}

.cell.prediction-orb-self {
  box-shadow: inset 0 0 0 3px rgba(255, 94, 114, 0.72);
}

.cell.prediction-orb-echo {
  box-shadow: inset 0 0 0 3px rgba(86, 235, 142, 0.72);
}

.cell.prediction-orb-self.prediction-orb-echo {
  box-shadow:
    inset 0 0 0 3px rgba(255, 94, 114, 0.72),
    inset 0 0 0 6px rgba(86, 235, 142, 0.58);
}

.cell.prediction-landing {
  outline: 4px solid rgba(101, 212, 255, 0.9);
  box-shadow: inset 0 0 24px rgba(101, 212, 255, 0.22);
}

.cell.prediction-push {
  outline: 4px dashed rgba(240, 185, 91, 0.95);
  box-shadow: inset 0 0 24px rgba(240, 185, 91, 0.22);
}

.cell.prediction-area {
  outline: 4px solid rgba(244, 241, 232, 0.82);
  box-shadow: inset 0 0 28px rgba(244, 241, 232, 0.14);
}

.cell.prediction-target {
  box-shadow: inset 0 0 0 4px rgba(255, 102, 113, 0.62);
}

body.competitive-combat-theme {
  background: #15170f url("assets/ui/competitive/stone-combat-background-16x9.png") center / cover no-repeat;
}

body.competitive-combat-theme .board {
  background: #10120f url("assets/ui/competitive/stone-board-8x8.png") center / 100% 100% no-repeat;
}

body.competitive-combat-theme .board .cell:not(.obstacle):not(.terrain-tree):not(.terrain-plateau):not(.terrain-mountain),
body.competitive-combat-theme .board .cell.alt:not(.obstacle):not(.terrain-tree):not(.terrain-plateau):not(.terrain-mountain) {
  background: transparent;
}

body.competitive-combat-theme .board .cell.zone-collapse:not(.obstacle):not(.terrain-tree):not(.terrain-plateau):not(.terrain-mountain) {
  background: repeating-linear-gradient(45deg, rgba(217, 76, 84, 0.3) 0 8px, rgba(217, 76, 84, 0.12) 8px 16px);
}

body.competitive-combat-theme .board .coords {
  color: rgba(244, 241, 232, 0.46);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

.unit.prediction-ghost {
  position: absolute;
  z-index: 3;
  width: 62%;
  opacity: 0.48;
  filter: saturate(0.8);
  pointer-events: none;
  transform: translateY(2px);
}

.unit.prediction-ghost-stay {
  opacity: 0.32;
  filter: saturate(0.5) contrast(1.08);
}

.unit.prediction-stay-source {
  opacity: 0.66;
  filter: saturate(0.68) contrast(1.08);
}

.prediction-stay-label {
  position: absolute;
  left: 50%;
  bottom: -18px;
  z-index: 8;
  transform: translateX(-50%);
  border: 1px solid rgba(101, 212, 255, 0.62);
  border-radius: 999px;
  background: rgba(12, 14, 12, 0.9);
  color: #d8f4ff;
  padding: 1px 6px;
  font-size: 0.56rem;
  font-weight: 900;
}

.unit.prediction-ghost::before {
  border-style: dashed;
  opacity: 0.75;
}

.prediction-ghost-label {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  border: 1px solid rgba(101, 212, 255, 0.55);
  border-radius: 999px;
  background: rgba(12, 14, 12, 0.84);
  color: #d8f4ff;
  padding: 1px 6px;
  font-size: 0.56rem;
  font-weight: 900;
}

.unit.predicted-death .unit-art-crop,
.unit.predicted-death .unit-initials {
  filter: grayscale(1) brightness(0.72);
}

.death-cross {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 230, 232, 0.92);
  border-radius: 50%;
  background: rgba(126, 18, 24, 0.94);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
}

.object-cross {
  top: -12px;
  right: -12px;
}

.map-object.predicted-destroyed {
  filter: grayscale(0.9) brightness(0.78);
}

.prediction-effect-stack {
  position: absolute;
  z-index: 8;
  left: -10px;
  top: -9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.prediction-effect {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border: 1px solid rgba(244, 241, 232, 0.55);
  border-radius: 999px;
  background: rgba(18, 18, 16, 0.9);
  color: var(--text);
  padding: 0 4px;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
}

.prediction-effect.buff {
  border-color: rgba(116, 232, 130, 0.7);
  color: #9ff0a9;
}

.prediction-effect.debuff {
  border-color: rgba(255, 102, 113, 0.72);
  color: #ffb8be;
}

.damage-float {
  position: absolute;
  z-index: 9;
  top: -16px;
  right: -9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  border: 1px solid rgba(217, 76, 84, 0.9);
  border-radius: 999px;
  background: rgba(31, 13, 14, 0.94);
  color: #ffd9dc;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 900;
  pointer-events: none;
}

.map-status-stack {
  position: absolute;
  top: -8px;
  right: -8px;
  display: flex;
  gap: 2px;
  pointer-events: none;
}

.map-status-icon {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(244, 241, 232, 0.55);
  border-radius: 50%;
  background: #1a1d18;
  color: var(--text);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
}

.map-status-icon.frost {
  color: #9edfff;
  border-color: #73c7ee;
}

.map-status-icon.silence {
  color: #d8d1f2;
  border-color: #9f8bea;
}

.map-status-icon.rally,
.map-status-icon.lightStep {
  color: #86e491;
  border-color: #61bf70;
}

.map-status-icon.roseBlessing {
  color: #ffc0df;
  border-color: #e47aae;
}

.map-status-icon.roseBurdened {
  color: #f08fbe;
  border-color: #a94879;
}

.map-status-icon.holdLineRes {
  color: #f0d37b;
  border-color: #d3ad42;
}

.map-status-icon.stun {
  color: #ffd4a0;
  border-color: #ff9f45;
}

.map-status-icon.burn {
  color: #ff9f45;
  border-color: #e66a5d;
}

.map-status-icon.bleed {
  color: #ff7a7a;
  border-color: #c74747;
}

.map-status-icon.gauchoSlow {
  color: #f0d37b;
  border-color: #d3ad42;
}

.map-status-icon.boleadoraBoost {
  color: #86e491;
  border-color: #61bf70;
}

.map-status-icon.bitten,
.map-status-icon.stink,
.map-status-icon.poison,
.map-status-icon.pollutionReady,
.map-status-icon.boneMouth {
  color: #a7df79;
  border-color: #76ad5a;
}

.map-status-icon.stinkBuff {
  color: #86e491;
  border-color: #61bf70;
}

.map-status-icon.fear {
  color: #d6b2ff;
  border-color: #9b6ad7;
}

.map-status-icon.unleashed {
  color: #ffdf7c;
  border-color: #f0b95b;
}

.map-status-icon.frozen {
  color: #d5f4ff;
  border-color: #a7e8ff;
}

.map-status-icon.marked {
  color: #ffdf7c;
  border-color: #f0b95b;
}

.map-status-icon.snap {
  color: #ff9470;
  border-color: #e66a5d;
}

.map-status-icon.perfectSparkReady {
  color: #ffd08a;
  border-color: #ff9f45;
}

.map-status-icon.radiance,
.map-status-icon.purifySlow,
.map-status-icon.captive {
  color: #ffe88a;
  border-color: #f0d35d;
}

.floater-stack {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: -31px;
  display: grid;
  gap: 2px;
  transform: translateX(-50%);
  pointer-events: none;
}

.combat-floater {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 28px;
  border: 1px solid rgba(244, 241, 232, 0.22);
  border-radius: 999px;
  background: rgba(18, 20, 17, 0.94);
  padding: 2px 7px;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  animation: float-pop 2200ms ease-out forwards;
}

.combat-floater.damage {
  color: #ff8f96;
  border-color: rgba(217, 76, 84, 0.75);
}

.combat-floater.true-damage {
  color: #f4f1e8;
  border-color: rgba(244, 241, 232, 0.76);
}

.combat-floater.shield-damage {
  color: #f4f1e8;
  border-color: rgba(244, 241, 232, 0.72);
}

.combat-floater.shield-gain {
  color: #f4f1e8;
  border-color: rgba(244, 241, 232, 0.72);
}

.combat-floater.heal {
  color: #85df73;
  border-color: rgba(115, 214, 92, 0.75);
}

.combat-floater.mana-gain {
  color: #72d5ff;
  border-color: rgba(101, 212, 255, 0.75);
}

.combat-floater.mana-loss {
  color: #b9b9b1;
  border-color: rgba(185, 185, 177, 0.55);
}

.combat-floater.status {
  color: #f0d05d;
  border-color: rgba(240, 208, 93, 0.85);
}

.combat-floater.pit-fetid-aura {
  color: #b9ec8b;
  border-color: rgba(167, 223, 121, 0.88);
  background: rgba(29, 51, 29, 0.95);
}

.combat-floater b {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.58rem;
}

@keyframes float-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1);
  }
}

.ability-tooltip {
  position: fixed;
  z-index: 100;
  width: min(320px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 17, 0.98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
  padding: 12px;
  color: var(--muted);
  pointer-events: none;
}

.ability-tooltip.hidden {
  display: none;
}

.flyout-title {
  color: var(--text);
  font-weight: 900;
}

.flyout-owner {
  margin-top: 2px;
  color: var(--accent);
  font-size: 0.78rem;
}

.ability-tooltip p {
  margin: 8px 0;
  line-height: 1.35;
  font-size: 0.84rem;
}

.flyout-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  border-top: 1px solid rgba(244, 241, 232, 0.09);
  padding-top: 8px;
}

.flyout-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.flyout-grid strong {
  color: var(--text);
  font-size: 0.8rem;
  text-align: right;
}

.status-disclaimer {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(244, 241, 232, 0.09);
  margin-top: 8px;
  padding-top: 8px;
}

.status-disclaimer-item {
  display: grid;
  grid-template-columns: 20px auto 1fr;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
}

.status-disclaimer-item .map-status-icon {
  position: static;
}

.status-disclaimer-item b {
  color: var(--text);
}

.status-disclaimer-item small {
  line-height: 1.25;
}

.flyout-target {
  border-top: 1px solid rgba(244, 241, 232, 0.09);
  margin-top: 8px;
  padding-top: 8px;
  line-height: 1.35;
  font-size: 0.82rem;
}

.flyout-target strong {
  display: block;
  color: var(--text);
}

.flyout-target span {
  color: var(--muted);
}

.map-tooltip {
  position: fixed;
  z-index: 20;
  width: min(270px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 17, 0.97);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
  padding: 12px;
  pointer-events: none;
}

.map-tooltip.hidden {
  display: none;
}

.splash-preview {
  position: fixed;
  z-index: 80;
  width: 260px;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(244, 241, 232, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: #111410;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.splash-preview.hidden {
  display: none;
}

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

.map-tooltip strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.tooltip-head {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 9px;
  align-items: start;
}

.tooltip-portrait {
  position: relative;
  display: block;
  width: 48px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 50%;
  background: var(--panel-2);
}

.tooltip-portrait.has-art b {
  display: none;
}

.object-portrait {
  display: grid;
  place-items: center;
  color: #f4f1e8;
}

.object-portrait.player-one {
  color: #3f9dff;
}

.object-portrait.player-two {
  color: #ef5f58;
}

.object-portrait.neutral {
  color: #efc986;
}

.object-portrait svg {
  width: 76%;
  height: 76%;
  fill: currentColor;
  stroke: rgba(244, 241, 232, 0.62);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-tooltip p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.3;
  font-size: 0.82rem;
}

.map-tooltip small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.3;
}

.tooltip-hp {
  margin: 8px 0;
}

.tooltip-hp i {
  background: linear-gradient(90deg, #77d65c, #d5ed71);
}

.tooltip-hp em {
  background: rgba(217, 76, 84, 0.58);
  border-left: 2px solid var(--danger);
}

.tooltip-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.tooltip-stats span {
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 6px;
  background: #262b25;
  padding: 5px 6px;
  font-size: 0.76rem;
}

.sidepanel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(360px, clamp(360px, 39vh, 480px));
  gap: 10px;
}

.sidepanel section {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 35, 31, 0.92);
  padding: 10px;
}

.unit-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(28px, 34px) auto;
  gap: 8px;
}

.actions-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.sidepanel h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.unit-hero {
  min-width: 0;
}

.unit-portrait {
  display: grid;
  place-items: center;
  container-type: size;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 2px 0;
}

.unit-portrait-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100cqw, 75cqh);
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 8px;
  background: var(--panel-2);
}

.unit-portrait-frame img {
  transform: none;
}

.unit-portrait-frame.has-art b {
  display: none;
}

.unit-panel h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #323931;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.unit-stat-grid > .resource-panel,
.unit-stat-grid > .stat-grid {
  display: contents;
}

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

.resource-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.resource-top span,
.stat-grid span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stat-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
}

.hp-icon {
  border-radius: 50%;
  color: #88dc62;
}

.hp-icon::before,
.mana-icon::before,
.move-stat-icon::before,
.range-icon::before,
.speed-icon::before,
.shield-icon::before {
  content: "";
  position: absolute;
}

.hp-icon::before {
  left: 5px;
  top: 2px;
  width: 2px;
  height: 8px;
  background: currentColor;
  box-shadow: -3px 3px 0 currentColor, 3px 3px 0 currentColor;
}

.mana-icon {
  color: #65d4ff;
  border-radius: 2px 2px 8px 8px;
  transform: rotate(45deg);
}

.mana-icon::before {
  left: 4px;
  top: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.move-stat-icon {
  color: var(--move);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}

.range-icon {
  color: var(--range);
  border-radius: 50%;
}

.range-icon::before {
  left: 4px;
  top: 4px;
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.speed-icon {
  color: var(--accent);
  border-radius: 50%;
}

.speed-icon::before {
  left: 6px;
  top: 2px;
  width: 1px;
  height: 6px;
  background: currentColor;
  transform-origin: bottom center;
  transform: rotate(45deg);
}

.shield-icon {
  color: #f4f1e8;
  border-radius: 3px 3px 8px 8px;
  background: rgba(244, 241, 232, 0.1);
}

.resource-top span,
.resource-row small {
  color: var(--muted);
  font-size: 0.74rem;
}

.resource-top strong {
  color: var(--text);
}

.resource-meter {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.resource-meter i,
.resource-meter em,
.resource-meter strong,
.resource-meter b {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: block;
  border-radius: 999px;
  transition: width 120ms ease;
}

#hpFill {
  background: linear-gradient(90deg, #77d65c, #d5ed71);
}

#shieldFill,
.resource-meter .shield-fill {
  background: rgba(244, 241, 232, 0.9);
  box-shadow: inset 0 0 0 1px rgba(24, 27, 23, 0.36);
  opacity: 0.92;
}

#shieldAfterFill,
.resource-meter .shield-preview {
  background: rgba(217, 76, 84, 0.72);
  border-right: 2px solid #f4f1e8;
}

#manaFill {
  background: linear-gradient(90deg, #5188ff, #65d4ff);
}

#manaAfterFill {
  background: rgba(240, 185, 91, 0.5);
  border-left: 2px solid #f0b95b;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.stat-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 7px;
  min-height: 42px;
}

.stat-grid span {
  color: var(--muted);
  font-size: 0.67rem;
}

.stat-grid strong {
  display: block;
  margin-top: 0;
  font-size: 0.98rem;
  white-space: nowrap;
}

.stat-grid strong.buff {
  color: #85df73;
}

.stat-grid strong.debuff {
  color: var(--danger);
}

.status-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
  max-height: 34px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  white-space: nowrap;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.status {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #343a32;
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.2;
}

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

.status.preview {
  border-color: rgba(101, 212, 255, 0.45);
  background: rgba(101, 212, 255, 0.1);
  color: #d9f3ff;
}

.status.preview.debuff {
  border-color: rgba(255, 102, 113, 0.48);
  background: rgba(255, 102, 113, 0.1);
  color: #ffd8dc;
}

.status.preview.buff {
  border-color: rgba(132, 226, 103, 0.48);
  background: rgba(132, 226, 103, 0.1);
  color: #e1ffd8;
}

.rose-cleanse-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.rose-cleanse-option {
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
}

.rose-cleanse-option:hover,
.rose-cleanse-option:focus-visible {
  border-color: rgba(219, 177, 91, 0.72);
  background: #464433;
  outline: none;
}

.rose-cleanse-option:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status-preview-line {
  flex: 0 0 auto;
  border: 1px solid rgba(101, 212, 255, 0.32);
  border-radius: 7px;
  background: rgba(101, 212, 255, 0.08);
  color: #d9f3ff;
  padding: 4px 8px;
  font-size: 0.75rem;
  pointer-events: none;
}

.passive-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191c18;
  padding: 8px;
  min-height: 50px;
  cursor: help;
}

.passive-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.passive-card strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.passive-card p {
  margin: 0;
}

.passive-card.has-area-preview {
  cursor: help;
}

.passive-card.has-area-preview:hover {
  border-color: rgba(101, 212, 255, 0.65);
  background: #1d2524;
}

.action-bar {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(46px, auto);
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.action {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  max-height: 76px;
  padding: 8px;
  text-align: left;
  overflow: hidden;
}

.action strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.action small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.ability-delivery-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ability-stats {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 5px;
  min-width: 0;
  overflow: hidden;
}

.ability-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 6px;
  background: #1b1f1a;
  padding: 2px 5px;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1;
}

.ability-stat b {
  max-width: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.ability-stat em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
}

.ability-stat .cd-current.ready {
  color: #85df73;
}

.ability-stat.definitive-stat {
  border-color: rgba(240, 185, 91, 0.52);
  background: #35291b;
  color: var(--accent);
}

.ability-tag {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  margin-left: 6px;
  border: 1px solid rgba(240, 185, 91, 0.55);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--accent);
  background: #35291b;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  vertical-align: middle;
}

.ability-quote {
  display: block;
  color: #d9d1bd;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.35;
}

.meta-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.meta-icon::before,
.meta-icon::after {
  content: "";
  position: absolute;
}

.meta-icon.mana {
  border: 1px solid #65d4ff;
  border-radius: 2px 2px 7px 7px;
  transform: rotate(45deg) scale(0.85);
}

.meta-icon.cd {
  border: 1px solid #f0b95b;
  border-radius: 50%;
}

.meta-icon.cd::before {
  width: 1px;
  height: 5px;
  background: #f0b95b;
}

.meta-icon.cd::after {
  width: 4px;
  height: 1px;
  background: #f0b95b;
  transform: translate(2px, 2px);
}

.meta-icon.range::before {
  width: 12px;
  height: 12px;
  border: 1px solid #a79cff;
  border-radius: 50%;
}

.meta-icon.range::after {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a79cff;
}

.meta-icon.damage::before {
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: var(--danger);
  transform: rotate(-38deg);
}

.meta-icon.effect::before {
  width: 12px;
  height: 12px;
  border: 1px solid #f0d35d;
  border-radius: 50%;
  background: rgba(240, 211, 93, 0.12);
}

.meta-icon.uses::before {
  width: 11px;
  height: 11px;
  border: 1px solid var(--accent);
  border-radius: 3px;
}

.kind-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #20251f;
}

.kind-icon::before,
.kind-icon::after {
  content: "";
  position: absolute;
}

.kind-icon.damage::before,
.kind-icon.hybrid::before {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--danger);
  transform: rotate(-38deg);
}

.kind-icon.status-kind::before,
.kind-icon.hybrid::after {
  width: 13px;
  height: 13px;
  border: 2px solid var(--range);
  border-radius: 50%;
}

.kind-icon.utility::before {
  width: 16px;
  height: 16px;
  border-top: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
  transform: rotate(45deg);
}

.kind-icon.move-icon::before {
  width: 14px;
  height: 14px;
  border-left: 3px solid var(--move);
  border-bottom: 3px solid var(--move);
  transform: rotate(-45deg);
}

.kind-icon.confirm-icon::before {
  width: 16px;
  height: 9px;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: translateY(-2px) rotate(-45deg);
}

.action.confirm-action {
  border-color: rgba(240, 185, 91, 0.68);
  background: #3a3223;
}

.action.confirm-action strong {
  color: var(--accent);
}

.inspection-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191c18;
  padding: 12px;
}

.inspection-note strong,
.inspection-note span {
  display: block;
}

.inspection-note span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.action.active {
  border-color: var(--accent);
  background: #423827;
}

.action.unavailable {
  color: var(--muted);
  background: #252824;
  filter: grayscale(0.8);
  opacity: 0.58;
}

.preview-title {
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 800;
}

.preview-row,
.target-preview {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(244, 241, 232, 0.08);
  padding-top: 7px;
  margin-top: 7px;
}

.preview-row strong,
.target-preview strong {
  color: var(--text);
}

.target-preview {
  display: grid;
  grid-template-columns: 1fr;
}

.target-preview span {
  color: var(--muted);
}

.end-turn {
  width: 100%;
  margin-top: 8px;
  background: #4a322e;
  border-color: #74433c;
}

.exit-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 8, 0.72);
  padding: 20px;
}

.exit-confirm-modal.hidden {
  display: none;
}

.exit-confirm-card {
  width: min(420px, 100%);
  border: 1px solid rgba(240, 185, 91, 0.38);
  border-radius: 8px;
  background: rgba(25, 28, 24, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
  padding: 18px;
  text-align: center;
}

.exit-confirm-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.exit-confirm-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.exit-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.exit-confirm-actions .danger {
  border-color: #8a4c44;
  background: #58352f;
}

.team-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 7px;
}

.team-dot.player-one {
  background: var(--p1);
}

.team-dot.player-two {
  background: var(--p2);
}

@media (max-height: 760px) and (min-width: 981px) {
  .competitive-positioning-screen {
    gap: 8px;
    padding: 16px 24px 14px;
  }

  .competitive-positioning-header h1 {
    font-size: clamp(1.25rem, 1.75vw, 1.9rem);
  }

  .competitive-positioning-header p {
    margin-top: 4px;
  }

  .competitive-positioning-reserve {
    padding: 8px;
  }

  .competitive-positioning-reserve-list {
    gap: 6px;
  }

  .competitive-positioning-reserve-card {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 58px;
    padding: 6px;
  }

  .competitive-positioning-reserve-art {
    width: 44px;
  }

  .competitive-positioning-board {
    width: min(100%, 49vh, 560px);
  }

  .competitive-positioning-actions {
    min-height: 46px;
  }
}


@media (max-width: 980px) {
  .combat-stage {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .competitive-flow-shell:has(.competitive-lineup-screen) {
    width: 100%;
    min-height: calc(100vh - 20px);
    aspect-ratio: auto;
  }

  .competitive-lineup-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    padding: 66px 18px 24px;
    overflow: auto;
  }

  .competitive-lineup-team-p2 .competitive-lineup-team-header {
    justify-content: flex-start;
  }

  .competitive-lineup-stack {
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    min-height: 340px;
  }

  .competitive-lineup-center,
  .competitive-lineup-footer {
    grid-column: 1;
  }

  .competitive-lineup-footer .competitive-phase-timer {
    width: min(100%, 520px);
  }

  .competitive-flow-shell:has(.competitive-positioning-screen) {
    width: 100%;
    min-height: calc(100vh - 20px);
    aspect-ratio: auto;
  }

  .competitive-positioning-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    padding: 66px 18px 24px;
    overflow: auto;
  }

  .competitive-positioning-header {
    grid-template-columns: 1fr;
  }

  .competitive-positioning-reserve-list {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    overflow-x: auto;
  }

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

  .board {
    width: 100%;
  }

  .map-timeline {
    width: 100%;
  }

  .mvp-overlay {
    width: 100%;
  }

  .sidepanel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 10px;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .squad-toolbar,
  .squad-settings {
    align-items: stretch;
    flex-direction: column;
  }

  .squad-tabs,
  .squad-nav-actions,
  .team-controls {
    width: 100%;
  }

  .squad-list-controls {
    flex-direction: column;
  }

  .squad-sort-control,
  .squad-sort-control select {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

  .competitive-turn-clock {
    flex: 1 1 168px;
  }

  .team-controls select {
    flex: 1;
    width: auto;
  }

  .log-dropdown,
  .combat-stats-dropdown {
    order: 3;
    width: 100%;
    max-width: none;
  }

  .mvp-hero,
  .mvp-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mvp-splash {
    max-height: 230px;
  }

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

  .coords {
    display: none;
  }
}

:root {
  --game-presentation-width: 1280px;
  --game-presentation-height: 720px;
  --game-presentation-scale: 1;
}

.game-presentation-frame {
  display: contents;
}

body.game-presentation-mode {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden !important;
  overscroll-behavior: none;
  background: #000 !important;
}

body.game-presentation-mode .game-presentation-frame {
  position: fixed;
  left: 50%;
  top: 50%;
  display: block;
  width: var(--game-presentation-width);
  height: var(--game-presentation-height);
  min-width: var(--game-presentation-width);
  min-height: var(--game-presentation-height);
  overflow: hidden;
  background: var(--bg);
  transform: translate(-50%, -50%) scale(var(--game-presentation-scale));
  transform-origin: center center;
  isolation: isolate;
}

#gamePresentationToggle {
  position: fixed;
  z-index: 2147483647;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 8px;
  background: rgba(12, 14, 12, 0.82);
  color: #f4f1e8;
  backdrop-filter: blur(5px);
  touch-action: manipulation;
}

#gamePresentationToggle.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(240, 185, 91, 0.45);
}

.game-landscape-hint {
  position: fixed;
  z-index: 2147483646;
  top: max(58px, calc(env(safe-area-inset-top) + 50px));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.76);
  color: var(--text);
  font-size: 0.78rem;
  pointer-events: none;
  white-space: nowrap;
}

.game-landscape-hint.hidden {
  display: none;
}

body.game-presentation-mode .squad-select { position: absolute; inset: 0; width: 100%; height: 100%; }
body.game-presentation-mode .squad-shell { max-height: 677px; }
body.game-presentation-mode .welcome-stage,
body.game-presentation-mode .mode-menu-shell { width: 100%; height: 100%; min-height: 0; }
body.game-presentation-mode .welcome-logo { width: 640px; max-height: 302px; }
body.game-presentation-mode .mode-menu-shell { gap: 38px; padding: 54px; }
body.game-presentation-mode .competitive-flow-shell { width: 1216px; height: 684px; min-height: 0; max-height: none; }
body.game-presentation-mode .competitive-flow-shell:has(.competitive-lineup-screen) { width: 1248px; height: 702px; min-height: 0; }
body.game-presentation-mode .competitive-flow-shell:has(.competitive-positioning-screen) { width: 1223px; height: 688px; min-height: 0; max-height: none; }
body.game-presentation-mode .competitive-positioning-board { width: min(100%, 389px, 620px); }
body.game-presentation-mode .squad-selection-screen { padding: 18px; }
body.game-presentation-mode .squad-esports-frame { width: 1216px; max-height: 684px; gap: 13px; }
body.game-presentation-mode .app { width: 100%; height: 100%; min-height: 0; padding: 16px; }
body.game-presentation-mode .combat-stage { width: 100%; height: 688px; max-height: 688px; min-height: 0; }
body.game-presentation-mode .battlefield { --combat-board-size: min(100%, 548px, 980px); }
body.game-presentation-mode .competitive-coin-wrap { width: 230px; margin: 9px 0; }
body.game-presentation-mode .competitive-lineup-footer .competitive-phase-timer { width: 620px; }
