@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800;900&family=DM+Sans:wght@400;500;600;700&display=swap");
:root {
  font-family: "DM Sans", sans-serif;
  color: #f7f0d9;
  background: #101c2b;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 60% 0, #263c48 0, transparent 65%), #101c2b;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #f5cd65;
  outline-offset: 4px;
}
button {
  color: inherit;
}
#app {
  max-width: 1600px;
  margin: auto;
  padding: 0 4.1vw;
}
.topbar {
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.brand {
  font-family: "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -1px;
  font-size: 36px;
  font-weight: 900;
  color: #fbf1d6;
  text-decoration: none;
}
.brand span {
  color: #f4bd64;
}
.brand i {
  font-style: normal;
  font-size: 24px;
  color: #f4bd64;
  margin-left: 12px;
}
.edition {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #b4bdbf;
}
.edition b {
  margin: 0 12px;
  color: #e5b975;
}
.icon-button {
  background: none;
  border: 1px solid #52616a;
  border-radius: 25px;
  padding: 10px 16px;
  font-size: 18px;
}
.icon-button span {
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-left: 8px;
}
#shell {
  border: 1px solid #52646a;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 25px 70px #040b1644;
}
.stage-top,
.stage-bottom {
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 23px;
  font-size: 9px;
  letter-spacing: 1.8px;
  background: #1c2c38;
  color: #b5c6c6;
}
.stage-top a {
  color: #b5c6c6;
  text-decoration: none;
}
.live-dot {
  display: inline-block;
  background: #99dab7;
  height: 6px;
  width: 6px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px #99dab7;
}
.stage-bottom {
  height: 43px;
  color: #c2c6bd;
  font-size: 9px;
}
.stage-bottom i {
  font-style: normal;
  color: #f3bb5a;
  margin: 0 16px;
}
#viewport {
  position: relative;
  height: min(68vw, 660px);
  min-height: 510px;
  overflow: hidden;
  background: #6ca5a0;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px #112f3833;
}
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 4% 5.5%;
  pointer-events: none;
}
#overlay > * {
  pointer-events: auto;
}
.hero {
  width: 48%;
  align-self: flex-start;
  margin-top: 1.5%;
  text-shadow: 0 2px 18px #14313d44;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  border: 1px solid #f4edda66;
  padding: 5px 9px;
  border-radius: 4px;
  color: #fff1ca;
  font-size: 9px;
  letter-spacing: 1.5px;
}
.hero h1 {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-weight: 900;
  font-size: clamp(84px, 10.1vw, 152px);
  line-height: 0.79;
  letter-spacing: -3px;
  margin: 28px 0 22px;
  color: #fff0cf;
  text-shadow:
    0 5px 0 #224d5f,
    0 10px 35px #183a4a33;
}
.hero h1 span {
  color: #ffd279;
}
.hero p {
  font-size: 15px;
  line-height: 1.65;
  max-width: 355px;
  color: #edf1dd;
}
.hero .tagline {
  font-family: "Barlow Condensed";
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.7px;
  color: #fff0cf;
  margin-bottom: 8px;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}
.primary,
.secondary {
  border: 0;
  border-radius: 6px;
  padding: 15px 24px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  transition:
    transform 0.15s,
    background 0.15s;
}
.primary {
  background: #ffce76;
  color: #293c43;
  box-shadow: 0 4px 0 #a67840;
}
.primary:hover {
  background: #ffdda0;
  transform: translateY(-2px);
}
.secondary {
  background: #203f4bbd;
  border: 1px solid #c8d4c466;
  color: #fff4d8;
}
.secondary:hover {
  background: #365662;
}
.tiny {
  font-size: 9px;
  letter-spacing: 1.7px;
  margin-top: 20px;
  color: #e4ecda;
}
.scene-caption {
  position: absolute;
  right: 5%;
  bottom: 11%;
  text-align: right;
  font-size: 10px;
  letter-spacing: 2px;
  color: #fff1cc;
}
.scene-caption strong {
  display: block;
  font-family: "Barlow Condensed";
  font-size: 26px;
  letter-spacing: 1px;
  margin-top: 5px;
}
.corner-label {
  position: absolute;
  bottom: 18px;
  left: 24px;
  font-size: 8px;
  letter-spacing: 2px;
  opacity: 0.65;
  pointer-events: none;
}
.corner-label span {
  margin-left: 16px;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 2px;
  color: #85999f;
  font-size: 9px;
  letter-spacing: 1px;
}
.hidden {
  display: none !important;
}
.panel {
  margin: auto;
  background: #102c39ee;
  border: 1px solid #91b5ae77;
  box-shadow: 0 20px 70px #061c3577;
  border-radius: 13px;
  padding: 30px;
  text-align: center;
  width: min(780px, 100%);
  backdrop-filter: blur(15px);
}
.panel h2 {
  font-family: "Barlow Condensed";
  font-weight: 800;
  font-size: 48px;
  margin: 6px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.panel p {
  font-size: 13px;
  color: #bacfcf;
  line-height: 1.6;
}
.select-grid {
  display: flex;
  gap: 14px;
  margin-top: 20px;
}
.player-select {
  flex: 1;
  padding: 16px;
  background: #253e4c;
  border-radius: 8px;
  border: 1px solid #56717a;
}
.player-select h3 {
  font-size: 11px;
  letter-spacing: 2px;
  color: #ffd080;
  margin: 0 0 13px;
}
.character-options {
  display: flex;
  gap: 7px;
}
.character-choice {
  flex: 1;
  background: #182f3d;
  border: 1px solid #5c7580;
  border-radius: 7px;
  padding: 14px 6px;
  font-size: 11px;
}
.character-choice.selected {
  background: #416566;
  border-color: #ffcf76;
  box-shadow: inset 0 -3px #ffcf76;
}
.character-choice b {
  display: block;
  font-family: "Barlow Condensed";
  font-size: 25px;
  margin-bottom: 6px;
}
.keys {
  font-size: 10px;
  color: #c6d6d3;
  margin-top: 14px;
}
kbd {
  display: inline-block;
  background: #e3e6d8;
  color: #243e49;
  border-radius: 3px;
  padding: 3px 7px;
  font: 700 10px "DM Sans";
  box-shadow: 0 2px #91a2a7;
  margin: 0 2px;
}
.panel .actions {
  justify-content: center;
}
.help-grid {
  display: flex;
  gap: 25px;
  text-align: left;
  margin: 24px 0;
}
.help-grid > div {
  flex: 1;
}
.help-grid b {
  color: #ffcf76;
}
#hud {
  position: absolute;
  top: 18px;
  left: 23px;
  right: 23px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  gap: 12px;
}
.hud-card {
  background: #112c39de;
  border: 1px solid #63888b8a;
  backdrop-filter: blur(8px);
  padding: 10px 15px;
  border-radius: 7px;
  min-width: 150px;
}
.hud-card small {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #b6d1cb;
}
.hud-card strong {
  font-family: "Barlow Condensed";
  font-size: 23px;
  letter-spacing: 1px;
  display: block;
}
.hearts {
  color: #ffce7b;
  font-size: 14px;
  letter-spacing: 5px;
}
.hud-center {
  text-align: center;
}
.hud-center strong {
  font-size: 19px;
}
.hud-center small {
  font-size: 8px;
}
.hud-right {
  display: flex;
  gap: 10px;
}
.hud-right button {
  pointer-events: auto;
  background: #112c39de;
  border: 1px solid #63888b8a;
  border-radius: 7px;
  width: 40px;
}
.control-strip {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1px;
  color: #e0eed9;
  pointer-events: none;
}
.control-strip span {
  background: #173442bd;
  border-radius: 20px;
  padding: 9px 15px;
}
.result-stat {
  color: #ffce76;
  font-family: "Barlow Condensed";
  font-size: 42px;
  margin: 14px;
}
.level-list {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 20px;
}
.level-list span {
  border: 1px solid #9cbaaf;
  border-radius: 50%;
  width: 33px;
  height: 33px;
  padding: 7px;
  font-size: 12px;
}
.level-list .done {
  background: #ffcd77;
  color: #233f47;
  border-color: #ffcd77;
}
#toast {
  position: absolute;
  top: 25%;
  width: 100%;
  text-align: center;
  font-family: "Barlow Condensed";
  font-size: 42px;
  font-weight: 700;
  pointer-events: none;
  text-shadow: 0 2px 8px #142f40;
  opacity: 0;
  transition: opacity 0.2s;
}
.journal {
  max-width: 1000px;
  margin: 40px auto;
  padding: 25px;
}
.journal h1 {
  font-family: "Barlow Condensed";
  font-size: 56px;
}
.journal a {
  color: #ffcf76;
}
.journal section {
  padding: 20px;
  background: #203543;
  margin: 16px 0;
  border: 1px solid #42606b;
  border-radius: 10px;
}
.journal li {
  line-height: 1.8;
  font-size: 14px;
}
.journal img {
  max-width: 100%;
  border-radius: 8px;
}
.journal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.journal td,
.journal th {
  text-align: left;
  padding: 9px;
  border-bottom: 1px solid #51616b;
}
@media (max-width: 800px) {
  #app {
    padding: 0 12px;
  }
  .topbar {
    height: 75px;
  }
  .edition {
    display: none;
  }
  .stage-top,
  .stage-bottom {
    padding: 0 12px;
    font-size: 7px;
    letter-spacing: 1px;
  }
  #viewport {
    min-height: 580px;
  }
  .hero {
    width: 85%;
  }
  .hero h1 {
    font-size: 105px;
  }
  .hero p {
    max-width: 290px;
    font-size: 13px;
  }
  .scene-caption {
    display: none;
  }
  .panel {
    padding: 20px;
  }
  .panel h2 {
    font-size: 38px;
  }
  .character-options {
    flex-direction: column;
  }
  .character-choice {
    padding: 7px;
  }
  .character-choice b {
    display: inline;
    margin-right: 8px;
    font-size: 18px;
  }
  .hud-card {
    min-width: 90px;
    padding: 8px;
  }
  .hud-card strong {
    font-size: 16px;
  }
  .site-footer {
    font-size: 7px;
    gap: 20px;
  }
  .hero .actions {
    flex-direction: column;
    width: 230px;
  }
}

.portrait {
  display: block;
  width: 100%;
  max-width: 120px;
  height: 126px;
  object-fit: contain;
  margin: 0 auto 7px;
  filter: drop-shadow(0 7px 5px #071d3977);
}
.character-choice {
  padding: 8px 6px 13px;
}
.scene-caption {
  bottom: 21%;
  right: 4%;
  background: #1b455555;
  padding: 10px 13px;
  border-radius: 5px;
}
.hero {
  position: relative;
}
.hero:before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30px -45px;
  background: radial-gradient(ellipse, #1b4c5133, transparent 70%);
}
@media (min-width: 801px) and (max-height: 850px) {
  #viewport {
    height: calc(100vh - 210px);
    min-height: 470px;
  }
  .topbar {
    height: 78px;
  }
  .hero h1 {
    font-size: 112px;
    margin: 20px 0;
  }
  .hero p {
    font-size: 13px;
  }
  .hero .actions {
    margin-top: 15px;
  }
  .hero .tiny {
    margin-top: 13px;
  }
  .site-footer {
    padding: 18px 2px;
  }
  .hero {
    margin-top: 0;
  }
  .panel {
    padding: 20px;
  }
  .panel h2 {
    font-size: 38px;
  }
  .portrait {
    height: 100px;
  }
  .select-grid {
    margin-top: 10px;
  }
}

#overlay:has(.hero) {
  background: linear-gradient(
    90deg,
    #174957b8 0%,
    #17495755 40%,
    transparent 67%
  );
}
.scene-caption {
  bottom: auto;
  top: 7%;
  background: #1b455544;
}
.hero h1 {
  white-space: nowrap;
}
.character-choice.selected {
  background: #42645f;
}
.hud-card {
  box-shadow: 0 3px 14px #0b243222;
}

#overlay:has(.panel) {
  padding-top: 18px;
  padding-bottom: 18px;
}
.panel {
  max-height: 100%;
  overflow-y: auto;
}
@media (max-height: 850px) {
  .panel p {
    margin: 9px 0;
  }
  .panel .actions {
    margin-top: 16px;
  }
  .panel .tiny {
    margin-top: 12px;
  }
}

/* San Francisco after dark: reserve the bright colors for the playable plane. */
:root {
  background: #0c1320;
  color: #ede9de;
}
body {
  background:
    radial-gradient(ellipse at 70% 0, #243346, transparent 60%), #0c1320;
}
#viewport {
  background: #172532;
}
.stage-top,
.stage-bottom {
  background: #172230;
}
#shell {
  border-color: #39495a;
}
#vignette {
  box-shadow: inset 0 0 100px #060d1e44;
}
.hero {
  text-shadow: 0 2px 24px #0008;
}
#toast {
  pointer-events: none;
  opacity: 0;
  position: absolute;
  top: 94px;
  right: auto;
  left: 24px;
  width: max-content;
  max-width: 80%;
  height: auto;
  bottom: auto;
  transform: translateY(10px);
  padding: 10px 18px;
  border: 1px solid #dbba7970;
  background: #101c2ae8;
  border-radius: 6px;
  color: #f3d4a0;
  font-size: 11px;
  letter-spacing: 1px;
  transition:
    opacity 0.2s,
    transform 0.2s;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}
.knockout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 7% 9%;
  background: radial-gradient(ellipse, transparent 20%, #030815a0 100%);
  pointer-events: none !important;
}
.knockout:before,
.knockout:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 7%;
  background: #090f19;
}
.knockout:before {
  top: 0;
}
.knockout:after {
  bottom: 0;
}
.knockout span {
  font-size: 12px;
  letter-spacing: 3px;
  color: #ffae8b;
}
.knockout strong {
  font:
    800 44px "Barlow Condensed",
    sans-serif;
  letter-spacing: 1px;
  color: #fff1d4;
}
.cinematic #hud,
.cinematic .corner-label {
  opacity: 0.15;
}
.cinematic #toast {
  opacity: 0;
}
.control-strip {
  font-size: 9px;
}
.in-game #game {
  position: absolute;
  top: 94px;
  height: calc(100% - 94px);
}
.in-game:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 94px;
  background: #142230;
  border-bottom: 1px solid #3b4d5b;
}
.in-game #hud {
  top: 0;
  bottom: auto;
  height: 94px;
}
.in-game #hud .hud-card {
  padding: 10px 14px;
}
.in-game .hud-center small {
  margin: 0;
}
.in-game .hud-center strong {
  margin: 3px 0;
  font-size: 17px;
}
.in-game #toast {
  top: 104px;
}

.in-game #hud {
  align-items: center;
}
@media (max-height: 850px) {
  .panel .tiny {
    margin-top: 8px;
    padding-bottom: 6px;
  }
  .character-choice {
    padding-bottom: 9px;
  }
}

/* The playable view ends at the actual arena bounds, like the original applet. */
#shell:has(.in-game) {
  width: min(100%, calc((100dvh - 370px) * 608 / 368));
  margin-inline: auto;
  container-type: inline-size;
}
#viewport.in-game {
  height: auto;
  min-height: 0;
  padding-top: 94px;
  padding-bottom: 38px;
}
.in-game #game {
  position: relative;
  top: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 608 / 368;
}
.in-game #hud { left: 14px; right: 14px; gap: 8px; }
.in-game .hud-card { min-width: 0; }
.in-game #hud > div:first-child .hud-card { width: 108px; }
.in-game .hud-right .hud-card { min-width: 83px; }
.in-game .hud-center { max-width: 190px; }
.in-game .corner-label { display: none; }
.in-game .control-strip { bottom: 0; height: 38px; display: grid; place-items: center; background: #142230; }
.in-game .control-strip span { display: inline-block; max-width: 97%; padding: 0; background: none; font-size: 8px; letter-spacing: .3px; line-height: 1.65; }
@media (max-height: 850px) {
  #shell:has(.in-game) { width: min(100%, calc((100dvh - 340px) * 608 / 368)); }
}
@container (max-width: 650px) {
  .in-game #hud { left: 8px; right: 8px; gap: 5px; }
  .in-game #hud > div:first-child .hud-card { width: 83px; }
  .in-game #hud .hud-card { padding: 8px 7px; }
  .in-game .hud-card small { font-size: 8px; letter-spacing: .3px; }
  .in-game .hud-center strong { font-size: 14px; }
  .in-game .hud-right { gap: 5px; }
  .in-game .hud-right .hud-card { min-width: 66px; }
  .in-game .hud-right .hud-card strong { font-size: 20px; }
  .in-game .hud-right button { width: 30px; }
  .stage-bottom > span:first-child { display: none; }
  .stage-bottom { justify-content: center; }
  .stage-top { font-size: 7px; letter-spacing: .5px; padding-inline: 12px; }
}
