/* Battle HUD: one fighter, one readable sequence. All dimensions share the arena. */
:root {
  --ink: #080f16;
  --gold: #dfc58f;
  --mint: #86e5bc;
  --muted: #9dafb6;
  --line: #c8dcdf22;
}
html,
body {
  background: #080f16;
  color: #eef0e7;
  font-family: "Segoe UI", sans-serif;
}
.app {
  min-width: 760px;
  max-width: 1920px;
  background: #080f16;
}
.topbar {
  height: 64px;
  background: #0a141bed;
  padding: 0 28px;
  border-bottom: 1px solid #d2b98525;
}
.brand strong {
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 5px;
}
.brand small {
  letter-spacing: 3.5px;
  color: #bca981;
}
.crest {
  border: 0;
  font-size: 30px;
}
.match-state {
  font-size: 10px;
}
.players {
  gap: 16px;
}
.player-life b {
  font-family: Georgia, serif;
}
.player-life span {
  font-size: 9px;
}
.game-shell {
  height: calc(100vh - 310px);
  min-height: 490px;
  max-height: 900px;
  grid-template-columns: minmax(0, 1fr) 286px;
}
.arena-wrap {
  background: #10262a;
}
.arena-wrap canvas {
  object-fit: fill;
}
.arena-wrap:after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 65px #0610169c;
  pointer-events: none;
}
.fog-curtain {
  left: 0;
  right: 0;
  top: 0;
  height: 44%;
  background: linear-gradient(#10212a99, #17343a55, transparent);
  backdrop-filter: none;
  border: 0;
  mask-image: none;
  justify-content: flex-start;
  padding-top: 26px;
  pointer-events: none;
}
.fog-curtain span {
  font-size: 9px;
  letter-spacing: 3px;
  border: 1px solid #d8b28a44;
  border-radius: 30px;
  padding: 9px 17px;
  background: #12202baa;
  color: #cfbca5;
}
.fog-curtain small {
  display: none;
}
.arena-legend {
  font-size: 8px;
  bottom: 15px;
  color: #b5cbc7;
}
.arena-legend .auto {
  opacity: 0.55;
}
.side-panel {
  padding: 16px 18px;
  background: radial-gradient(ellipse at 50% 30%, #20393866, transparent 65%),
    #0c1820;
  border-left: 1px solid #d8c49322;
  overflow: hidden;
}
.side-head {
  margin: 0 0 10px;
}
.kicker {
  color: #9bafb4;
  font-size: 8px;
  letter-spacing: 2px;
}
.squad {
  gap: 4px;
}
.squad-card {
  aspect-ratio: 1;
  border: 0;
  border-bottom: 2px solid #66756e55;
  border-radius: 0;
  background: transparent;
  filter: saturate(0.4);
  overflow: hidden;
}
.squad-card canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.squad-card span {
  font-size: 7px;
  inset: auto 0 0;
  background: linear-gradient(transparent, #0b1820);
  padding: 5px 0 2px;
  border-radius: 0;
}
.squad-card.active {
  box-shadow: none;
  border-color: var(--char);
  filter: none;
}
.squad-card.selected {
  background: radial-gradient(ellipse at center, var(--char), transparent 70%);
  background-color: #15332f;
}
.squad-card.selected:after {
  display: none;
}
.inspector {
  padding: 0;
  margin-top: 11px;
  border: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.hero-stage {
  height: 145px;
  position: relative;
  flex-shrink: 1;
  min-height: 100px;
  background: radial-gradient(
    ellipse at 50% 80%,
    color-mix(in srgb, var(--char), transparent 88%),
    transparent 65%
  );
}
.hero-stage canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-stage:after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 22%;
  right: 22%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--char), transparent);
  opacity: 0.6;
}
.hero-head {
  display: block;
  text-align: center;
}
.hero-head h2 {
  font:
    400 25px Georgia,
    serif;
  margin: 3px 0 6px;
}
.hero-head p {
  font-size: 9px;
  color: #8eaaa9;
}
.hero-head .kicker {
  font-size: 7px;
  color: var(--char);
}
.stat-strip {
  justify-content: center;
  margin-top: 8px;
  gap: 4px;
}
.stat-strip span {
  width: 25px;
  height: 3px;
}
.stat-strip i {
  opacity: 0.6;
}
.skills {
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 17px;
}
.skill {
  border: 1px solid #baa87866;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #29403e, #0b171d 80%);
  font: inherit;
  color: #e3d6b5;
  box-shadow:
    inset 0 0 0 3px #07141b,
    0 4px 9px #0006;
  padding: 8px;
}
.skill svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.skill b {
  width: 14px;
  min-width: 14px;
  height: 14px;
  right: -2px;
  bottom: -3px;
  font-size: 8px;
  background: #172c31;
  color: #e6c991;
  border: 1px solid #c6af7855;
}
.skill:hover,
.skill.armed {
  border-color: var(--char);
  box-shadow:
    0 0 16px color-mix(in srgb, var(--char), transparent 65%),
    inset 0 0 0 3px #07141b;
}
.skill.spent {
  opacity: 0.3;
}
.skill-name {
  text-align: center;
  font-size: 10px;
  color: #ddd3b9;
  min-height: 13px;
}
.skill-desc {
  text-align: center;
  font-size: 8px;
  color: #729395;
  line-height: 1.5;
  margin: 4px 8px 10px;
}
.economy {
  padding-top: 11px;
  margin-top: 10px;
}
.economy b {
  font:
    20px Georgia,
    serif;
}
.economy span {
  font-size: 7px;
  color: #94a5a3;
}
.planning {
  height: 180px;
  padding: 14px 32px 8px;
  background: radial-gradient(ellipse at 50% 0, #1c343b66, transparent 65%),
    #0c1820;
  color: #eceddf;
  box-shadow: 0 -12px 40px #021013aa;
  border-top: 1px solid #d6c59b35;
  position: relative;
}
.planning-head {
  margin-bottom: 2px;
  align-items: center;
}
.planning h1 {
  font:
    400 18px Georgia,
    serif;
  margin: 3px 0 0;
}
.planning-help {
  font-size: 9px;
  color: #86a3a6;
  gap: 10px;
}
.planning-help strong {
  color: #e7c58a;
  font-weight: 400;
}
.planning .kicker {
  color: #c7b88f;
  font-size: 7px;
}
.timeline {
  display: block;
  position: relative;
}
.plan-squad {
  display: flex;
  gap: 6px;
  align-items: center;
}
.plan-tab {
  border: 0;
  background: transparent;
  position: relative;
  color: #809c9f;
  padding: 4px 10px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
}
.plan-tab.active {
  color: #efe2b9;
  border-color: #d8c086;
}
.plan-tab b {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #243637;
  font-size: 8px;
  display: grid;
  place-items: center;
  color: #c7d0bb;
}
.timeline-row {
  display: block;
  height: 94px;
}
.lane-title,
.ruler-row,
.timeline-key {
  display: none;
}
.lane {
  position: absolute;
  left: 32px;
  right: 32px;
  top: 38px;
  height: 66px;
  background: none;
  border: 0;
  border-radius: 0;
}
.lane:before {
  top: 25px;
  height: 3px;
  background: linear-gradient(90deg, #d8bc83, #557f7c 60%, #2d4c55);
  box-shadow: 0 0 16px #98e6c533;
  clip-path: polygon(0 50%, 2% 0, 98% 0, 100% 50%, 98% 100%, 2% 100%);
}
.lane:after {
  display: none;
}
.beat-mark {
  position: absolute;
  top: 19px;
  transform: translateX(-50%);
  pointer-events: none;
}
.beat-mark i {
  display: block;
  width: 4px;
  height: 13px;
  background: #acbbaa99;
  border-radius: 2px;
  box-shadow: 0 0 8px #c1ddd222;
}
.beat-mark span {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #8aa3a3;
  white-space: nowrap;
}
.beat-mark.major i {
  background: #cfbb8d;
}
.chapter-label {
  position: absolute;
  top: -5px;
  font-size: 7px;
  letter-spacing: 2.5px;
  color: #617e83;
  pointer-events: none;
}
.timeline-event {
  overflow: visible;
  position: absolute;
  top: 6px;
  height: 39px;
  width: 39px !important;
  min-width: 39px;
  padding: 0;
  display: grid;
  place-items: center;
  translate: -50%;
  border-radius: 50%;
  border: 1px solid #d2c395;
  background: radial-gradient(circle, #294238, #0b1a22 80%);
  color: #f1e2b9;
  box-shadow:
    0 0 0 4px #0d1c23,
    0 0 18px color-mix(in srgb, var(--char), transparent 75%);
  z-index: 3;
}
.timeline-event svg {
  width: 21px;
  height: 21px;
}
.timeline-event small {
  position: absolute;
  top: 44px;
  font:
    600 8px "Segoe UI",
    sans-serif;
  color: #dfd7bd;
  background: #101e25;
  padding: 1px 5px;
  border-radius: 5px;
  white-space: nowrap;
}
.duration-trail {
  position: absolute;
  top: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--char);
  opacity: 0.6;
  pointer-events: none;
  box-shadow: 0 0 10px var(--char);
}
.duration-trail.cast-time {
  top: 19px;
  background: repeating-linear-gradient(
    90deg,
    #eee0b9 0 3px,
    transparent 3px 6px
  );
  height: 2px;
  opacity: 0.75;
}
.duration-trail:after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 2px;
  height: 7px;
  background: inherit;
}
.timeline-event.executed {
  opacity: 0.4;
  box-shadow: none;
}
.timeline-event.firing {
  box-shadow:
    0 0 24px var(--char),
    0 0 0 5px #e4f7d722;
  border-color: #fff;
}
.time-comet {
  position: absolute;
  top: 19px;
  width: 14px;
  height: 14px;
  background: #fff2c9;
  border-radius: 50%;
  translate: -50%;
  box-shadow:
    0 0 16px #ffd987,
    0 0 35px #ffd987;
  z-index: 5;
  pointer-events: none;
}
.time-comet[hidden] {
  display: none;
}
.drop-marker {
  position: absolute;
  top: 0;
  translate: -50%;
  height: 52px;
  width: 2px;
  background: #e4f4cf;
  box-shadow: 0 0 10px #baffcf;
  pointer-events: none;
  z-index: 8;
}
.drop-marker span {
  position: absolute;
  bottom: 55px;
  left: 50%;
  translate: -50%;
  padding: 5px 10px;
  border-radius: 12px;
  background: #274840;
  color: #e8f5d7;
  white-space: nowrap;
  font-size: 10px;
}
.ribbon-empty {
  position: absolute;
  left: 50%;
  top: 7px;
  translate: -50%;
  font:
    italic 12px Georgia,
    serif;
  color: #8caaa2;
  background: #0e1c24;
  padding: 8px 18px;
  pointer-events: none;
  white-space: nowrap;
}
.future {
  display: none;
}
.footer {
  height: 66px;
  background: #09141b;
  border-top: 1px solid #aac4bd15;
  padding: 0 30px;
}
.primary-button {
  border-radius: 3px 18px 3px 18px;
  background: linear-gradient(120deg, #e0cf9f, #baa171);
  font-size: 10px;
  padding: 13px 25px;
  box-shadow: 0 0 20px #d8c99813;
}
.secondary-button {
  border: 0;
  background: transparent;
  color: #94aaa6;
}
.logline {
  max-width: 44%;
  font-size: 10px;
  color: #91aaa5;
}
.skill-tooltip {
  font-size: 11px;
  border-color: #c6b88455;
  background: #0b1a22f5;
}
.skill-tooltip b {
  color: #ead6ab;
}
.skill-tooltip span {
  font-size: 11px;
  line-height: 1.5;
}
.skill-tooltip em {
  font-size: 10px;
}
.ghost-button {
  font-size: 9px;
}
.toast {
  font-size: 12px;
  border-radius: 20px;
  bottom: 18px;
}
.battle-banner {
  font-family: Georgia, serif;
}
.tile-prompt {
  z-index: 6;
  border-radius: 25px;
}
.tile-prompt button {
  font-size: 11px;
}
@media (min-height: 1000px) {
  .hero-stage {
    height: 190px;
  }
  .skills {
    gap: 9px;
    margin-top: 22px;
  }
  .hero-head h2 {
    font-size: 28px;
  }
  .side-panel {
    padding-top: 22px;
  }
}
@media (max-width: 1050px) {
  .game-shell {
    grid-template-columns: minmax(0, 1fr) 235px;
  }
  .side-panel {
    padding: 12px;
  }
  .planning {
    padding-inline: 20px;
  }
  .planning-help {
    font-size: 8px;
  }
  .topbar {
    padding: 0 16px;
  }
  .brand strong {
    font-size: 16px;
  }
  .hero-stage {
    height: 125px;
  }
  .skills {
    gap: 4px;
  }
  .skill {
    padding: 6px;
  }
  .players {
    gap: 7px;
  }
  .match-state {
    gap: 6px;
    font-size: 8px;
  }
  .footer {
    padding: 0 16px;
  }
  .secondary-button {
    font-size: 8px;
  }
  .plan-tab {
    padding: 4px 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .toast,
  .battle-banner,
  .fog-curtain {
    transition: none;
  }
}

/* Side deployment and explicit squad editing. */
.squad-slot { position: relative; min-width: 0; }
.squad-slot .squad-card { width:100%; }
.squad-toggle { position:absolute; top:0; right:0; width:22px; height:22px; border:1px solid #72998b66; background:#112b2b; color:#c4f9df; border-radius:50%; font-size:17px; line-height:17px; cursor:pointer; }
.squad-toggle[aria-pressed="false"] { background:#18242c; color:#a1b9b6; }
.squad-toggle:disabled { visibility:hidden; }
.squad-hint { color:#9aafa9; font-size:10px; margin:8px 0 10px; text-align:center; }
.deployment-controls { position:absolute; top:18px; left:18px; display:flex; align-items:center; gap:12px; color:#b9ded4; font-size:12px; letter-spacing:2px; }
.fog-curtain { left:55%; right:5%; top:32%; width:auto; height:49%; padding-top:30px; background:linear-gradient(90deg,transparent,#302b3555); }
/* Foresight gets its own readable ribbon; it must never cover the battle button. */
body[data-phase="foresight"] .game-shell { height:calc(100vh - 450px); min-height:410px; }
body[data-phase="foresight"] .planning { height:auto; min-height:320px; }
.timeline-row.future { display:block; height:135px; margin-top:6px; }
.future .lane-title { display:flex; color:#93d1f4; padding:4px 0 10px; font-size:10px; letter-spacing:1px; }
.future .sight-lane { position:relative; left:0; right:0; top:0; height:95px; border:1px solid #63bcff40; background:linear-gradient(100deg,#17485c66,#10283222); }
.future .sight-lane:before { background:linear-gradient(90deg,#78caff33,#a4eaff88,#78caff22); }
.future .timeline-event { width:30px; height:30px; opacity:.95; }
.fog-curtain span { font-size:8px; letter-spacing:1.5px; }
body[data-side="right"] .fog-curtain { left:5%; right:55%; }

/* Four-point paper-bomb placement, deliberately compact. */
.tile-prompt.trap-picker{max-width:calc(100% - 28px);gap:10px;padding:10px 14px;border-color:#e1b57599;background:#10212cf5;flex-wrap:wrap;justify-content:center;white-space:normal}
.trap-picker #targetTitle{color:#ffdb9d;font-size:10px;letter-spacing:1px}
.target-steps{display:flex;gap:5px}.target-steps i{font-style:normal;font-size:17px;color:#66777d}.target-steps i.set{color:#ffd292}
.trap-picker #undoTarget{font-size:22px;color:#f5d49c;width:30px;padding:0}
.trap-picker #confirmTarget{background:#e8c78e;color:#172330;border-radius:5px;font-weight:700;padding:7px 12px}
.trap-picker button:disabled{opacity:.35;cursor:default}
.trap-picker #cancelTarget{color:#cad8dc}
@media(max-width:600px){.trap-picker #targetTitle{display:none}.trap-picker #targetHint{font-size:10px}.tile-prompt.trap-picker{bottom:12px;gap:7px}.trap-picker #confirmTarget{padding:6px 8px}}
.trap-picker #undoTarget{width:auto;display:inline-flex;align-items:center;gap:4px}.trap-picker #undoTarget kbd{font:9px 'Segoe UI';color:#b7c7ca}
