:root {
  --bg: #0a1118;
  --panel: #121d26;
  --panel2: #17242d;
  --line: #ffffff14;
  --paper: #e9e5d8;
  --ink: #202b2b;
  --gold: #d4b374;
  --green: #70dda9;
  --red: #e57d68;
  --blue: #62bceb;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 50% 0, #192b36, #081018 65%);
  color: #edf1eb;
  font-family:
    Manrope,
    Segoe UI,
    sans-serif;
}
button {
  font: inherit;
  color: inherit;
}
.app {
  min-width: 1100px;
  max-width: 1920px;
  margin: auto;
  min-height: 100vh;
  box-shadow: 0 0 90px #0009;
}
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: linear-gradient(180deg, #15232d, #101a22);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.crest {
  width: 38px;
  height: 42px;
  border: 1px solid #d7bd8766;
  color: #dfc28b;
  display: grid;
  place-items: center;
  font: 26px serif;
  clip-path: polygon(
    10% 0,
    90% 0,
    100% 12%,
    100% 88%,
    90% 100%,
    10% 100%,
    0 88%,
    0 12%
  );
}
.brand strong {
  font-size: 17px;
  letter-spacing: 4px;
}
.brand small {
  display: block;
  color: #a9a28f;
  font-size: 7px;
  letter-spacing: 3px;
  margin-top: 3px;
}
.match-state {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #a9b5ba;
}
.match-state b {
  color: #e7d5ab;
}
.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
}
.separator {
  width: 1px;
  height: 15px;
  background: #ffffff22;
}
.players {
  display: flex;
  align-items: center;
  gap: 12px;
}
.player-life {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-life span {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #8fcfb1;
}
.player-life b {
  font:
    25px Newsreader,
    serif;
}
.player-life.enemy span {
  color: #e7a191;
}
.versus {
  color: #71818a;
}
.ghost-button,
.secondary-button {
  border: 1px solid #ffffff20;
  background: #ffffff08;
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.8px;
}
.ghost-button:hover,
.secondary-button:hover {
  background: #ffffff13;
}
.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  height: min(59vh, 650px);
  min-height: 500px;
}
.arena-wrap {
  position: relative;
  overflow: hidden;
  background: #14232b;
}
.arena-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.fog-curtain {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 3%;
  height: 47%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse, #182939e8, #0a151ed9 70%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #f1b7a733;
  mask-image: linear-gradient(#000 80%, transparent);
  transition: 0.7s;
}
.fog-curtain span {
  font-size: 10px;
  letter-spacing: 3.5px;
  color: #dba797;
}
.fog-curtain small {
  font-size: 9px;
  color: #8f9aa2;
  margin-top: 8px;
}
.fog-curtain.reveal {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}
.battle-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  translate: -50% -50%;
  font:
    600 46px Newsreader,
    serif;
  letter-spacing: 3px;
  color: #fff4d7;
  text-shadow:
    0 4px 30px #000,
    0 0 35px #ffc66c66;
  opacity: 0;
  transform: scale(0.8);
  transition: 0.3s;
  pointer-events: none;
}
.battle-banner.show {
  opacity: 1;
  transform: scale(1);
}
.tile-prompt {
  position: absolute;
  left: 50%;
  bottom: 27px;
  translate: -50%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0e1c24e8;
  border: 1px solid #6ee5b566;
  border-radius: 8px;
  padding: 11px 14px;
  box-shadow: 0 8px 30px #0008;
}
.tile-prompt[hidden] {
  display: none;
}
.tile-prompt b {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #92e0b7;
}
.tile-prompt span {
  font-size: 10px;
  color: #c6d0cc;
}
.tile-prompt button {
  border: 0;
  background: transparent;
  color: #d89e8f;
  cursor: pointer;
  font-size: 9px;
}
.arena-legend {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 14px;
  display: flex;
  gap: 18px;
  font-size: 8px;
  letter-spacing: 1.2px;
  color: #d6dfdb;
  text-shadow: 0 1px 4px #000;
}
.arena-legend i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.arena-legend .ally {
  background: var(--green);
}
.arena-legend .enemy {
  background: var(--red);
}
.arena-legend .auto {
  margin-left: auto;
}
.side-panel {
  background: linear-gradient(150deg, #15242d, #101920);
  border-left: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 11px;
}
.kicker {
  font-size: 8px;
  letter-spacing: 2.2px;
  color: #91a0a4;
}
.side-head b {
  font-size: 10px;
  color: #b6c6c3;
}
.squad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.squad-card {
  aspect-ratio: 0.82;
  border: 1px solid #ffffff18;
  border-radius: 8px;
  overflow: hidden;
  background: #101a22;
  position: relative;
  cursor: pointer;
  padding: 0;
  filter: saturate(0.65);
}
.squad-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.squad-card span {
  position: absolute;
  inset: auto 2px 2px;
  background: #091117cc;
  border-radius: 4px;
  font-size: 7px;
  padding: 3px 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.squad-card.active {
  border-color: var(--char);
  box-shadow: 0 0 12px color-mix(in srgb, var(--char), transparent 60%);
  filter: saturate(1);
}
.squad-card.selected:after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid #fff9;
  border-radius: 5px;
}
.inspector {
  margin-top: 15px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  min-height: 210px;
}
.hero-head {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 11px;
}
.hero-head img {
  width: 62px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--char);
}
.hero-head h2 {
  font:
    600 25px Newsreader,
    serif;
  margin: 2px 0;
}
.hero-head p {
  margin: 0;
  color: #8fa0a4;
  font-size: 9px;
}
.stat-strip {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.stat-strip span {
  height: 5px;
  width: 22px;
  border-radius: 4px;
  background: #ffffff12;
  overflow: hidden;
}
.stat-strip i {
  display: block;
  height: 100%;
  background: var(--char);
}
.skills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 13px;
}
.skill {
  aspect-ratio: 1;
  border: 1px solid #ffffff20;
  background: linear-gradient(145deg, #23343e, #14212a);
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: grab;
  position: relative;
  font: 600 19px serif;
  color: #e9efe9;
  touch-action: none;
}
.skill:hover {
  border-color: var(--char);
  translate: 0 -2px;
}
.skill b {
  position: absolute;
  right: -3px;
  bottom: -4px;
  background: #d4b374;
  color: #182025;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  font: 700 8px Manrope;
  display: grid;
  place-items: center;
}
.skill.spent {
  opacity: 0.35;
  cursor: not-allowed;
}
.skill-name {
  font-size: 10px;
  margin-top: 10px;
  color: #e2e7e3;
}
.skill-desc {
  font-size: 8px;
  color: #91a0a4;
  line-height: 1.45;
  margin-top: 4px;
}
.economy {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.economy div {
  text-align: center;
  border-right: 1px solid var(--line);
}
.economy div:last-child {
  border: 0;
}
.economy span {
  display: block;
  font-size: 7px;
  letter-spacing: 1.4px;
  color: #7f9095;
}
.economy b {
  display: block;
  margin-top: 2px;
  color: #e1c68d;
}
.planning {
  background: linear-gradient(175deg, #ede9dc, #dcd8ca);
  color: var(--ink);
  padding: 16px 28px 13px;
  box-shadow: 0 -9px 30px #0005;
}
.planning-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 10px;
}
.planning h1 {
  font:
    600 23px Newsreader,
    serif;
  margin: 3px 0 0;
}
.planning-help {
  font-size: 9px;
  color: #737c76;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mouse-mark {
  width: 10px;
  height: 14px;
  border: 1px solid #69736c;
  border-radius: 5px;
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ruler-row,
.timeline-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  height: 31px;
}
.ruler-row {
  height: 19px;
}
.lane-title {
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #66716a;
}
.lane-title img {
  width: 23px;
  height: 23px;
  object-fit: cover;
  border-radius: 50%;
}
.ruler,
.lane {
  position: relative;
}
.ruler span {
  position: absolute;
  translate: -50%;
  font-size: 8px;
  color: #757d75;
}
.ruler span:first-child {
  translate: 0;
}
.ruler span:last-child {
  translate: -100%;
}
.lane {
  border-radius: 5px;
  background: repeating-linear-gradient(
      90deg,
      #2230260b 0,
      #2230260b calc(8.333% - 1px),
      #26372c1d calc(8.333% - 1px),
      #26372c1d 8.333%
    ),
    #f6f3e8;
}
.lane:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #37443a22;
}
.lane:after {
  content: "";
  position: absolute;
  left: 80%;
  right: 0;
  inset-block: 0;
  background: repeating-linear-gradient(
    135deg,
    #9a554313 0,
    #9a554313 5px,
    transparent 5px,
    transparent 10px
  );
  border-left: 1px solid #bd7b6966;
}
.timeline-event {
  position: absolute;
  top: 3px;
  height: 25px;
  min-width: 24px;
  border: 0;
  border-radius: 6px;
  background: var(--char);
  color: #fff;
  translate: -50%;
  box-shadow: 0 2px 7px #0003;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0 7px;
  z-index: 2;
  font: 600 12px serif;
}
.timeline-event .event-cast {
  position: absolute;
  inset: 0 auto 0 0;
  background: #0004;
  border-right: 1px solid #fff6;
}
.timeline-event .event-active {
  position: absolute;
  inset: 0;
  background: #fff1;
}
.timeline-event span {
  position: relative;
  z-index: 2;
}
.drop-preview {
  position: absolute;
  top: 1px;
  height: 29px;
  border: 1px dashed #3f7255;
  background: #69b98755;
  border-radius: 6px;
  translate: -50%;
  z-index: 4;
}
.timeline-key {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 7px;
  font-size: 8px;
  color: #747b73;
}
.timeline-key i {
  display: inline-block;
  width: 13px;
  height: 6px;
  margin-right: 4px;
  border-radius: 2px;
}
.timeline-key .cast {
  background: #40544b66;
}
.timeline-key .active {
  background: #7fc49d77;
}
.timeline-key .overtime {
  background: repeating-linear-gradient(
    135deg,
    #b36f5b55 0,
    #b36f5b55 3px,
    transparent 3px,
    transparent 6px
  );
}
.footer {
  height: 66px;
  background: #101a22;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
.secondary-button small {
  color: #d9ba7f;
  margin-left: 6px;
}
.logline {
  font-size: 10px;
  color: #8fa0a6;
}
.actions {
  display: flex;
  gap: 10px;
}
.primary-button {
  border: 1px solid #ead19b88;
  background: linear-gradient(120deg, #e0c58c, #b99761);
  color: #162229;
  border-radius: 6px;
  padding: 13px 21px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 5px 18px #0004;
}
.primary-button:hover {
  filter: brightness(1.08);
}
.primary-button span {
  margin-left: 28px;
}
.primary-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.skill-tooltip {
  position: fixed;
  width: 250px;
  padding: 12px;
  background: #0e1b24f2;
  border: 1px solid #ffffff22;
  border-radius: 9px;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 15px 40px #0009;
}
.skill-tooltip b {
  display: block;
  font-size: 12px;
}
.skill-tooltip span {
  display: block;
  font-size: 9px;
  color: #a6b3b4;
  line-height: 1.45;
  margin-top: 4px;
}
.skill-tooltip em {
  display: block;
  font-style: normal;
  color: #ddc18a;
  font-size: 8px;
  margin-top: 7px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  translate: -50% 15px;
  background: #172a25;
  color: #ddf4e7;
  border: 1px solid #73b59066;
  padding: 10px 15px;
  border-radius: 7px;
  font-size: 10px;
  opacity: 0;
  transition: 0.2s;
  z-index: 80;
}
.toast.show {
  opacity: 1;
  translate: -50% 0;
}
.timeline-row.future { display:block; height:120px; margin-top:14px; }
.future .lane-title { color:#88caff; padding-bottom:8px; letter-spacing:1px; }
.future .sight-lane { height:95px; border:1px solid #63bcff40; background:linear-gradient(90deg,#23649024 0%,#23649024 25%,#101a2200 25%); }
.future .timeline-event { width:30px; height:30px; opacity:.9; }
.timeline-event[draggable=true] { cursor:grab; outline:1px solid #8bddff66; }
@media (max-width: 1250px) {
  .game-shell {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .side-panel {
    padding: 13px;
  }
  .skills {
    gap: 4px;
  }
  .ruler-row,
  .timeline-row {
    grid-template-columns: 105px 1fr;
  }
  .planning {
    padding-inline: 20px;
  }
}
