@font-face {
  font-family: Grenze;
  src: url(../fontes/grenze-gotisch-800.woff2) format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b1523;
  --panel: #16263b;
  --surface: #1c3048;
  --ink: #f6f6ed;
  --muted: #b3c6d2;
  --line: #38516a;
  --gold: #ffd982;
  --green: #65edd2;
  --coral: #ffac8c;
  font-family: system-ui,sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 85% 12%,#1b354a 0,transparent 42%),var(--bg);
}

button,select {
  font: inherit;
  color: inherit;
}

button,select,summary {
  cursor: pointer;
}

button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.wrap {
  width: min(1120px,calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  background: #101e30;
  border-bottom: 1px solid var(--line);
}

.topbar-inner,.brand,.intro,.field-top,.intent,.energy,.record {
  display: flex;
  align-items: center;
}

.topbar-inner {
  justify-content: space-between;
  gap: 15px;
  min-height: 68px;
}

.brand {
  gap: 15px;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 650;
}

.brand img {
  width: 108px;
  height: 42px;
  object-fit: contain;
}

.brand span {
  padding-inline-start: 15px;
  border-inline-start: 1px solid var(--line);
}

.brand:hover span {
  text-decoration: underline;
}

select,#retry {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 10px;
  border-radius: 7px;
}

.intro {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
  margin: clamp(20px,4vw,48px) 0 24px;
}

h1,h2,p {
  margin: 0;
}

h1 {
  font: 800 clamp(38px,5vw,66px)/1.04 Grenze,Georgia,serif;
  color: var(--gold);
}

.intro p,.local,.report p,.panel p {
  color: var(--muted);
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0,1.8fr) minmax(265px,1fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 36px;
}

.field,.panel {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: 0 15px 35px #020b1830;
  overflow: hidden;
}

.field-top {
  justify-content: space-between;
  gap: 8px;
  padding: 13px 19px;
  background: #15283e;
}

.field-top span {
  font-weight: 750;
}

.field-top b {
  font-size: .82rem;
  color: var(--gold);
}

.scene {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(235px,31vw,365px);
  overflow: hidden;
  background: #132944;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,#0c1b38c9 0%,#0c284759 35%,#163e6d12 70%,#08162d4d 100%),url(../mapas/misticaArena/visao.webp) 48% 55%/auto 118% no-repeat;
  z-index: -1;
  image-rendering: pixelated;
}

.side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 15px clamp(10px,2vw,24px) 18px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vital {
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  background: #09182bdd;
  border: 1px solid #587488;
  border-radius: 8px;
  padding: 9px 11px;
  box-shadow: 0 4px 14px #03132a55;
  line-height: 1.1;
}

.vital small,.intent small {
  display: block;
  grid-column: 1/-1;
  color: var(--green);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.foe .vital small {
  color: var(--coral);
}

.vital strong {
  grid-column: 1/-1;
  min-width: 0;
  font-size: clamp(.95rem,1.4vw,1.2rem);
}

.vital span {
  font-size: .74rem;
  color: #e5f2f9;
  font-variant-numeric: tabular-nums;
}

progress {
  appearance: none;
  border: 0;
  width: 100%;
  height: 7px;
  background: #35475d;
  border-radius: 5px;
  overflow: hidden;
  align-self: center;
}

progress::-webkit-progress-bar {
  background: #35475d;
}

progress::-webkit-progress-value {
  background: var(--green);
}

progress::-moz-progress-bar {
  background: var(--green);
}

.foe progress::-webkit-progress-value {
  background: var(--coral);
}

.foe progress::-moz-progress-bar {
  background: var(--coral);
}

.fighter {
  width: clamp(86px,15vw,168px);
  aspect-ratio: 1;
  position: relative;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  filter: drop-shadow(0 7px 3px #07152499);
}

.fighter.hit {
  animation: hit .27s ease-out;
}

@keyframes hit {
  0%,100% {
    transform: translateX(0);
  }
  35% {
    filter: brightness(1.7);
    transform: translateX(6px);
  }
  70% {
    transform: translateX(-4px);
  }
}

.intent {
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #21364c;
  padding: 15px 18px;
}

.intent small {
  color: var(--gold);
  margin-bottom: 4px;
}

.intent b {
  font-size: .93rem;
}

.intent-light {
  width: 10px;
  height: 10px;
  background: var(--gold);
  box-shadow: 0 0 12px #f5b94db0;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.panel,.report {
  padding: clamp(14px,2vw,22px);
}

h2 {
  font-size: 1.2rem;
  line-height: 1.25;
}

.report h2 {
  font-size: 1rem;
}

.report p {
  margin-top: 6px;
  font-size: .92rem;
  min-height: 1.45em;
}

.report details {
  margin-top: 12px;
  font-size: .85rem;
  color: var(--muted);
}

.report summary {
  color: var(--ink);
  padding: 5px 0;
}

.report ol {
  padding-left: 20px;
  line-height: 1.45;
}

.roster {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 7px;
  margin: 16px 0;
}

.roster button {
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  min-width: 0;
  font-weight: 670;
  font-size: .8rem;
  border-radius: 8px;
  padding: 4px;
}

.roster button[aria-pressed=true] {
  border-color: var(--gold);
  background: #3c3b39;
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.roster img {
  width: 48px;
  height: 46px;
  object-fit: contain;
  image-rendering: pixelated;
}

.primary,.secondary,.action {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 46px;
  font-weight: 700;
}

.primary {
  background: var(--gold);
  color: #2a2216;
  border-color: var(--gold);
}

.primary:hover {
  background: #ffe7a8;
}

.secondary {
  background: var(--surface);
  margin-top: 9px;
}

.energy {
  margin: 16px 0 10px;
  justify-content: space-between;
  color: var(--muted);
  font-size: .85rem;
}

.energy b {
  color: var(--gold);
}

.action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: start;
  padding: 10px 12px;
  margin-bottom: 8px;
  gap: 8px;
  background: var(--surface);
}

.action:not(:disabled):hover,.roster button:not([aria-pressed=true]):hover,.secondary:hover {
  border-color: var(--green);
}

.action span {
  display: grid;
  gap: 3px;
}

.action small {
  font-weight: 450;
  color: var(--muted);
  font-size: .8rem;
}

.action:disabled {
  background: #142337;
  color: #b1bfcd;
}

.action:disabled small {
  color: #9eafc3;
}

kbd {
  color: var(--gold);
  font: 600 .73rem ui-monospace,monospace;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
}

.record {
  border-top: 1px solid var(--line);
  gap: 20px;
  margin: 18px 0 8px;
  padding-top: 15px;
}

.record dt {
  font-size: .73rem;
  color: var(--muted);
}

.record dd {
  margin: 1px 0 0;
  font-size: 1.05rem;
  font-weight: 740;
}

.panel .local {
  font-size: .77rem;
}

.panel #result-text {
  margin: 12px 0 16px;
}

#loading,#retry {
  margin-bottom: 12px;
  color: var(--ink);
}

@media(max-width:760px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .wrap {
    width: min(600px,calc(100% - 24px));
  }
  .intro {
    margin: 20px 0 14px;
  }
  .scene {
    min-height: 210px;
  }
  .side {
    padding: 10px 11px 14px;
  }
  .fighter {
    width: 100px;
  }
  .roster {
    grid-template-columns: repeat(6,minmax(0,1fr));
  }
  .roster button {
    font-size: .72rem;
  }
  .report {
    padding-block: 12px;
  }
  .topbar-inner {
    min-height: 54px;
  }
  .brand img {
    width: 80px;
    height: 36px;
  }
}

@media(max-width:470px) {
  .roster {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .topbar-inner .brand span {
    padding-left: 8px;
  }
  .brand {
    gap: 7px;
  }
  .vital {
    padding: 7px;
  }
  .side {
    padding-inline: 8px;
  }
  .field-top,.intent {
    padding: 10px 13px;
  }
  .record {
    margin-top: 12px;
  }
  .scene {
    min-height: 185px;
  }
  .fighter {
    width: 85px;
  }
  .intro p {
    font-size: .92rem;
  }
  .roster img {
    height: 36px;
  }
}

@media(prefers-reduced-motion:reduce) {
  .fighter.hit {
    animation: none;
  }
}

.lesson-open {
  margin-top: 14px;
  padding: 9px 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--gold);
  font-weight: 650;
}

.lesson {
  width: min(860px, 94vw);
  max-height: 94vh;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
}

.lesson::backdrop {
  background: #041020d9;
}

.lesson header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lesson header button {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 10px;
}

.lesson video {
  display: block;
  width: 100%;
  max-height: 77vh;
  aspect-ratio: 1080 / 880;
  background: var(--bg);
  border-radius: 8px;
}

.lesson video::cue {
  font-family: system-ui, sans-serif;
  font-size: clamp(12px, 2.3vw, 20px);
}
