* {
  box-sizing: border-box;
}
/* Base da página e superfície do jogo. */
html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: #0c1013;
  color: #efe8d8;
  font-family: Arial, sans-serif;
}
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 560px;
  background: #171b20;
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #20262c;
}
.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  padding: 27px 34px;
  background: #0d1419f5;
  border: 1px solid #c6aa68;
  box-shadow: 0 20px 100px #000e;
  text-align: center;
}
.panel small {
  color: #c6aa68;
  font: 10px monospace;
  letter-spacing: 0.18em;
}
.panel h1 {
  font:
    700 58px/1 Georgia,
    serif;
  letter-spacing: 0.09em;
  margin: 13px 0 7px;
}
.panel h1 span {
  color: #c6aa68;
}
.panel > p {
  color: #b5b5ac;
  font-size: 13px;
  margin: 0 0 19px;
}
.choice-title {
  color: #9f9b8e;
  font: 10px monospace;
  text-align: left;
  letter-spacing: 0.14em;
  margin: 17px 0 7px;
}
.choice-row,
.style-row {
  display: flex;
  gap: 7px;
}
.choice,
.secondary,
.primary,
.style-card {
  flex: 1;
  padding: 9px 7px;
  background: #192329;
  color: #c9c4b3;
  border: 1px solid #59615d;
  font: 10px monospace;
  cursor: pointer;
}
.choice.active,
.choice:hover,
.style-card.active,
.style-card:hover {
  background: #c6aa68;
  color: #15191b;
  border-color: #c6aa68;
}
.style-card {
  text-align: left;
  min-height: 58px;
}
.style-card b,
.style-card span {
  display: block;
}
.style-card span {
  font-size: 9px;
  line-height: 1.35;
  margin-top: 5px;
  opacity: 0.75;
}
.primary {
  display: block;
  width: 100%;
  margin-top: 21px;
  background: #c6aa68;
  color: #15191b;
  border-color: #c6aa68;
  font-weight: bold;
}
.primary:hover {
  background: #f0dfad;
}
.secondary {
  display: block;
  width: 100%;
  margin-top: 9px;
}
.keys-summary {
  margin-top: 15px;
  border-top: 1px solid #394346;
  padding-top: 11px;
  color: #999e97;
  font: 10px/1.7 monospace;
  text-align: left;
}
.hidden {
  display: none !important;
}
.close {
  float: right;
  background: none;
  border: 0;
  color: #c6aa68;
  font-size: 25px;
  cursor: pointer;
}
.panel h2 {
  font:
    22px Georgia,
    serif;
  margin: 0 0 7px;
  text-align: left;
}
.hint {
  font-size: 10px;
  color: #aeb3aa;
  line-height: 1.5;
}
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #363e40;
  padding: 9px 0;
  font: 11px monospace;
}
.controls-row button {
  min-width: 70px;
  background: #1d2528;
  border: 1px solid #747463;
  color: #eee5cd;
  padding: 7px;
  font: 11px monospace;
  cursor: pointer;
}
.controls-row button.waiting {
  color: #15191b;
  background: #c6aa68;
}
/* HUD da luta: nomes, barras de vida, guarda e rounds. */
.names {
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 90vw);
  display: flex;
  justify-content: space-between;
  font: 11px monospace;
}
.p1name {
  color: #84c6a9;
}
.p2name {
  color: #df706a;
}
.names b {
  font-size: 9px;
  color: #c6aa68;
}
.guard-lines {
  position: absolute;
  top: 37px;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 90vw);
  display: flex;
  justify-content: space-between;
  gap: 30px;
}
.guard {
  height: 3px;
  background: #252c31;
  width: 48%;
  overflow: hidden;
}
.guard i {
  display: block;
  height: 100%;
  width: 100%;
  background: #d8c17d;
  transition:
    width 0.16s,
    background 0.16s;
}
.guard.p2 i {
  margin-left: auto;
}
.guard.low i {
  background: #dc925c;
}
.guard.danger i {
  background: #d76560;
}
.health {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 90vw);
  display: flex;
  justify-content: space-between;
  gap: 30px;
}
.bar {
  height: 13px;
  border: 1px solid #d6cba8;
  background: #252c31;
  width: 48%;
  padding: 2px;
}
.bar i {
  display: block;
  height: 100%;
  width: 100%;
  transition: width 0.12s;
}
.bar.p1 i {
  background: #77b99b;
}
.bar.p2 i {
  background: #c96360;
  margin-left: auto;
}
.round-info {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 11px;
  color: #d7c9a1;
  font: 11px monospace;
}
.round-info button,
.training-hud button {
  background: #161d20cc;
  color: #d7c9a1;
  border: 1px solid #76705d;
  padding: 5px 8px;
  font: 10px monospace;
  cursor: pointer;
}
.training-hud,
.stats-hud {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 13px;
  align-items: center;
  color: #99aaa2;
  background: #0c1215d9;
  border: 1px solid #3b514e;
  padding: 7px 10px;
  font: 9px monospace;
}
.training-hud {
  bottom: 28px;
}
.stats-hud {
  bottom: 10px;
  color: #a9b3ac;
}
.training-hud b,
.stats-hud b {
  color: #dcc789;
}
/* Cartões de resultado e sobreposições da partida. */
.result-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #0d1419f7;
  border: 1px solid #c6aa68;
  padding: 29px 36px;
  text-align: center;
  box-shadow: 0 20px 80px #000;
  min-width: 330px;
}
.result-card h2 {
  font:
    32px Georgia,
    serif;
  margin: 0 0 12px;
}
.result-card p {
  color: #b9b7ae;
  font-size: 12px;
  line-height: 1.55;
}
.result-card .metrics {
  text-align: left;
  border-top: 1px solid #3d4644;
  border-bottom: 1px solid #3d4644;
  padding: 10px 0;
  margin: 12px 0;
  font: 10px/1.8 monospace;
  color: #bfc2b8;
}
.result-card button {
  margin: 12px 4px 0;
  background: transparent;
  color: #e7ddc7;
  border: 1px solid #c6aa68;
  padding: 9px;
  font: 10px monospace;
  cursor: pointer;
}
@media (max-width: 600px) {
  .panel {
    padding: 23px 20px;
  }
  .panel h1 {
    font-size: 47px;
  }
  .style-row {
    flex-direction: column;
  }
  .style-card {
    min-height: auto;
  }
  .round-info {
    font-size: 9px;
  }
  .names,
  .health,
  .guard-lines {
    width: 90vw;
  }
  .training-hud,
  .stats-hud {
    font-size: 8px;
    gap: 5px;
  }
  .training-hud button {
    padding: 4px;
  }
}
/* Cenas, personagens e animações do modo história. */
.story-card small {
  color: #c6aa68;
  font: 10px monospace;
  letter-spacing: 0.16em;
}
.story-card h2 {
  color: #efe8d8;
}
.story-enemy {
  color: #d8c17d !important;
  font: 10px monospace !important;
  letter-spacing: 0.08em;
}

/* Aberturas da campanha: cada capítulo ganha uma cena própria, sem card central. */
.story-opening {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #080f20;
  color: #efe8d8;
  isolation: isolate;
}
.story-opening::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #05091399 0%, transparent 45%, #05091344 100%),
    linear-gradient(0deg, #050913 0%, transparent 42%);
  z-index: -1;
}
.story-skyline {
  position: absolute;
  inset: 42% 0 0;
  background: repeating-linear-gradient(
    90deg,
    #101a30 0 70px,
    #172441 70px 128px,
    #0d172b 128px 205px
  );
  clip-path: polygon(
    0 26%,
    8% 18%,
    15% 30%,
    24% 12%,
    33% 28%,
    42% 9%,
    52% 23%,
    61% 14%,
    70% 29%,
    79% 17%,
    88% 27%,
    100% 11%,
    100% 100%,
    0 100%
  );
  opacity: 0.94;
}
.story-skyline::after {
  content: '';
  position: absolute;
  inset: 15% 0 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 26px,
    #d8b96a 27px 32px,
    transparent 33px 70px
  );
  opacity: 0.45;
}
.story-moon {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  right: 14%;
  top: 15%;
  background: #f5e8b5;
  box-shadow: 0 0 42px #f5e8b577;
}
.story-moon::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  left: 28px;
  top: -14px;
  background: #0c1630;
}
.story-copy {
  position: absolute;
  z-index: 2;
  left: 10%;
  top: 20%;
  max-width: min(560px, 70vw);
}
.story-copy small {
  display: block;
  color: #c6aa68;
  font: 11px monospace;
  letter-spacing: 0.2em;
}
.story-copy h2 {
  margin: 13px 0 5px;
  color: #f1dfad;
  font:
    clamp(40px, 7vw, 78px) / 0.95 Georgia,
    serif;
  letter-spacing: 0.04em;
  text-shadow: 0 5px 20px #000;
}
.story-location {
  color: #b5c7c4;
  font: 11px monospace;
  letter-spacing: 0.16em;
}
.story-copy p {
  max-width: 440px;
  color: #d6d2c5;
  font:
    15px/1.65 Arial,
    sans-serif;
  margin: 25px 0 20px;
}
.story-enemy {
  color: #b9b6a8;
  font: 10px monospace;
  letter-spacing: 0.12em;
}
.story-enemy b {
  display: block;
  color: #e5c875;
  font-size: 13px;
  margin-top: 6px;
}
.story-actions {
  position: absolute;
  z-index: 3;
  left: 10%;
  bottom: 11%;
  display: flex;
  gap: 10px;
}
.story-actions button {
  background: #101a25dd;
  border: 1px solid #c6aa68;
  color: #f0dfad;
  padding: 13px 17px;
  font: 10px monospace;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.story-actions button:first-child {
  background: #c6aa68;
  color: #15191b;
  font-weight: bold;
}
.chapter-1 {
  background: linear-gradient(135deg, #121b31 0%, #38506b 54%, #9a6b5c 100%);
}
.chapter-1 .story-moon {
  width: 110px;
  height: 110px;
  top: 18%;
  right: 18%;
  opacity: 0.75;
}
.chapter-1 .story-moon::after {
  width: 110px;
  height: 110px;
}
.chapter-2 {
  background: linear-gradient(135deg, #080e22 0%, #162d4b 48%, #163e4a 100%);
}
.chapter-2::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    105deg,
    transparent 0 23px,
    #9ed1d122 24px 25px
  );
  transform: skewX(-12deg);
}
.chapter-2 .story-moon {
  background: #9fd0cb;
  width: 95px;
  height: 95px;
  right: 22%;
  top: 17%;
  box-shadow: 0 0 32px #73c2c055;
}
.chapter-2 .story-moon::after {
  background: #142b48;
  width: 95px;
  height: 95px;
}
.chapter-3 {
  background: linear-gradient(135deg, #130f1c 0%, #322b40 50%, #5b3d3b 100%);
}
.chapter-3 .story-skyline {
  background: repeating-linear-gradient(
    90deg,
    #191525 0 44px,
    #403044 45px 90px,
    #11131f 91px 160px
  );
  clip-path: polygon(
    0 20%,
    12% 26%,
    22% 11%,
    34% 29%,
    46% 13%,
    60% 25%,
    74% 8%,
    86% 27%,
    100% 12%,
    100% 100%,
    0 100%
  );
}
.chapter-3 .story-moon {
  width: 80px;
  height: 80px;
  right: 24%;
  top: 25%;
  background: #d8bda0;
  box-shadow: none;
}
.chapter-3 .story-moon::after {
  width: 80px;
  height: 80px;
  background: #30283c;
}
.chapter-4 {
  background: linear-gradient(135deg, #050918 0%, #101e42 53%, #27365e 100%);
}
.chapter-4 .story-moon {
  width: 210px;
  height: 210px;
  right: 15%;
  top: 10%;
  box-shadow: 0 0 70px #f5e8b599;
}
.chapter-4 .story-moon::after {
  width: 210px;
  height: 210px;
  left: 40px;
  top: -20px;
  background: #101e42;
}
.chapter-4 .story-copy h2 {
  font-size: clamp(45px, 8vw, 88px);
}
@media (max-width: 600px) {
  .story-copy {
    left: 8%;
    top: 18%;
    max-width: 84vw;
  }
  .story-copy p {
    font-size: 12px;
    line-height: 1.45;
    margin: 17px 0;
  }
  .story-moon {
    right: 4%;
    top: 12%;
    width: 100px;
    height: 100px;
  }
  .story-moon::after {
    width: 100px;
    height: 100px;
  }
  .story-actions {
    left: 8%;
    bottom: 8%;
    flex-direction: column;
    width: 220px;
  }
  .story-actions button {
    width: 100%;
  }
}

/* Abertura automática: a câmera mergulha na arena e a luta começa sem tela intermediária. */
.story-camera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #080f20;
  color: #efe8d8;
  isolation: isolate;
  transform-origin: 50% 58%;
  animation: arena-camera-in 1.35s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}
.story-camera::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #05091399 0%, transparent 45%, #05091344 100%),
    linear-gradient(0deg, #050913 0%, transparent 42%);
  z-index: 2;
  pointer-events: none;
}
.camera-vignette {
  position: absolute;
  z-index: 3;
  inset: 0;
  box-shadow: inset 0 0 130px #02050ddd;
  pointer-events: none;
}
.camera-title {
  position: absolute;
  z-index: 4;
  left: 10%;
  top: 21%;
  display: grid;
  gap: 8px;
  text-shadow: 0 4px 18px #000;
  opacity: 0;
  animation: camera-title-in 0.65s 0.35s ease-out forwards;
}
.camera-title small {
  color: #c6aa68;
  font: 10px monospace;
  letter-spacing: 0.2em;
}
.camera-title h2 {
  margin: 4px 0 0;
  color: #f1dfad;
  font:
    clamp(40px, 7vw, 78px) / 0.92 Georgia,
    serif;
  letter-spacing: 0.04em;
}
.camera-title span {
  color: #b5c7c4;
  font: 10px monospace;
  letter-spacing: 0.16em;
}
.camera-title b {
  color: #e5c875;
  font: 11px monospace;
  letter-spacing: 0.12em;
  margin-top: 22px;
}
.story-camera .story-skyline {
  z-index: 0;
}
.story-camera .story-moon {
  z-index: 1;
}
@keyframes arena-camera-in {
  0% {
    transform: scale(1.38) translateY(-12%);
    filter: brightness(0.62);
  }
  55% {
    filter: brightness(0.9);
  }
  100% {
    transform: scale(1) translateY(0);
    filter: brightness(1);
  }
}
@keyframes camera-title-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 600px) {
  .camera-title {
    left: 8%;
    top: 18%;
  }
  .camera-title h2 {
    font-size: clamp(36px, 12vw, 60px);
  }
  .camera-title b {
    margin-top: 12px;
  }
}
/* Configurações de áudio, controles e seleção de mapa. */
.settings-audio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #363e40;
  border-bottom: 1px solid #363e40;
  padding: 11px 0;
  margin: 14px 0 10px;
  color: #c9c4b3;
  font: 10px monospace;
  letter-spacing: 0.08em;
}
.settings-toggle {
  background: #c6aa68;
  color: #15191b;
  border: 1px solid #c6aa68;
  padding: 7px 11px;
  font: 10px monospace;
  font-weight: bold;
  cursor: pointer;
}
.settings-toggle.off {
  background: #1d2528;
  color: #9da39c;
  border-color: #59615d;
}
.map-choice-row {
  flex-wrap: wrap;
}
.map-choice-row .choice {
  min-width: calc(50% - 4px);
}
#controls-menu {
  width: min(760px, 94vw);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}
/* Indicadores da rede neural e roda de adaptação do Mahoraga. */
.mahoraga-status {
  margin-top: 12px;
  padding: 9px;
  border: 1px solid #7d6caa;
  background: #17152a;
  color: #c7b9e9;
  font: 10px/1.5 monospace;
  text-align: left;
}
.adaptation-hud {
  position: absolute;
  left: 50%;
  bottom: 43px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  align-items: center;
  color: #c7b9e9;
  background: #17152ad9;
  border: 1px solid #7d6caa;
  padding: 7px 10px;
  font: 9px monospace;
}
.adaptation-hud b {
  color: #f0d58b;
}
.adaptation-hud span:last-child {
  color: #aaa1c8;
}
.mahoraga-wheel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.wheel-graphic {
  position: relative;
  width: 132px;
  height: 132px;
  border: 4px solid #fff;
  border-radius: 50%;
  color: #fff;
  opacity: 0;
  transform: scale(0.72);
  filter: drop-shadow(0 0 14px currentColor);
}
.wheel-graphic::before {
  content: '';
  position: absolute;
  inset: 13px;
  border: 3px solid currentColor;
  border-radius: 50%;
}
.wheel-graphic i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 112px;
  border-radius: 4px;
  background: currentColor;
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(var(--wheel-rotation));
}
.wheel-graphic i:nth-child(1) {
  --wheel-rotation: 0deg;
}
.wheel-graphic i:nth-child(2) {
  --wheel-rotation: 45deg;
}
.wheel-graphic i:nth-child(3) {
  --wheel-rotation: 90deg;
}
.wheel-graphic i:nth-child(4) {
  --wheel-rotation: 135deg;
}
.wheel-graphic i:nth-child(5) {
  --wheel-rotation: 180deg;
}
.wheel-graphic i:nth-child(6) {
  --wheel-rotation: 225deg;
}
.wheel-graphic i:nth-child(7) {
  --wheel-rotation: 270deg;
}
.wheel-graphic i:nth-child(8) {
  --wheel-rotation: 315deg;
}
.wheel-graphic b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 25px;
  height: 25px;
  border: 4px solid currentColor;
  border-radius: 50%;
  background: #101829;
  transform: translate(-50%, -50%);
}
.mahoraga-wheel.spin .wheel-graphic {
  animation: mahoraga-wheel-turn 0.95s cubic-bezier(0.2, 0.7, 0.25, 1) forwards;
}
@keyframes mahoraga-wheel-turn {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(0deg);
    color: #fff;
  }
  12% {
    opacity: 1;
  }
  42% {
    color: #f8edba;
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(360deg);
    color: #e1b94f;
  }
}
/* Lista de capítulos da campanha. */
#chapter-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}
.chapter-option {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 10px;
  background: #192329;
  border: 1px solid #59615d;
  color: #c9c4b3;
  text-align: left;
  font: 10px monospace;
  cursor: pointer;
}
.chapter-option:hover {
  background: #c6aa68;
  color: #15191b;
  border-color: #c6aa68;
}
.chapter-option span {
  color: #c6aa68;
}
.chapter-option b {
  font:
    12px Georgia,
    serif;
  color: #efe8d8;
}
.chapter-option small {
  color: #9ba39d;
  font-size: 9px;
  text-align: right;
}
.chapter-option.complete span {
  color: #73b99b;
}
.chapter-option.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.chapter-option.locked b,
.chapter-option.locked small {
  color: #8f9690;
}
@media (max-width: 600px) {
  .chapter-option {
    grid-template-columns: 48px 1fr;
  }
  .chapter-option small {
    grid-column: 2;
    text-align: left;
  }
}
