:root {
  color-scheme: dark;
  --bg: #152235;
  --panel: #1c2c41;
  --line: #34465b;
  --text: #e9edf1;
  --muted: #8ea1b5;
  --mint: #65edb1;
  --gold: #ffc969;
  --coral: #ff7d73;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
main {
  max-width: 1320px;
  margin: auto;
  padding: 0 42px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 86px;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: #e9edf1;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 750;
  display: flex;
  gap: 11px;
  align-items: center;
}
.brand-gem {
  font-size: 24px;
  color: var(--mint);
}
.brand-small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.5px;
  border-left: 1px solid var(--line);
  padding-left: 13px;
}
.header-actions {
  display: flex;
  gap: 10px;
}
.quiet {
  font-size: 11px;
  color: var(--muted);
  background: #ffffff03;
  border: 1px solid var(--line);
  padding: 10px 13px;
  border-radius: 8px;
}
.quiet:hover {
  background: #ffffff08;
  color: white;
}
kbd {
  font:
    9px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  border: 1px solid #46576b;
  border-radius: 4px;
  padding: 3px 5px;
  color: var(--muted);
  white-space: nowrap;
}
.quiet kbd {
  margin-left: 8px;
}
.intro {
  padding: 34px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eyebrow {
  font:
    9px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 1.8px;
  color: var(--muted);
}
h1 {
  font-family: "Arial Black", "Avenir Next", sans-serif;
  font-size: 62px;
  font-weight: 900;
  letter-spacing: -3px;
  margin: 10px 0 0;
  line-height: 1;
}
h1 span {
  display: inline-block;
  font-family: "Avenir Next", sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid #a28350;
  border-radius: 7px;
  vertical-align: middle;
  padding: 6px 8px;
  margin: 0 0 9px 17px;
}
.intro p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  margin: 26px 0 0;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  gap: 26px;
  align-items: start;
}
.arcade {
  border: 1px solid #445467;
  border-radius: 15px;
  overflow: hidden;
  background: #0d1928;
  box-shadow: 0 14px 35px #0002;
}
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 23px;
  background: #1c2c41;
  gap: 16px;
}
.hud > div > span {
  display: block;
  color: #8ea1b5;
  font:
    8px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 1.7px;
  margin-bottom: 7px;
}
.hud strong {
  font:
    21px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 1px;
}
.hud > div:first-child strong {
  color: var(--mint);
}
.lives strong {
  color: var(--coral);
  font-size: 17px;
  letter-spacing: 3px;
}
.stage {
  position: relative;
  aspect-ratio: 1.5;
  overflow: hidden;
  border-top: 1px solid #445467;
  border-bottom: 1px solid #445467;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #08142260;
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.overlay[hidden] {
  display: none;
}
.overlay-card {
  pointer-events: auto;
  background: #1c2e43ee;
  border: 1px solid #557085;
  border-radius: 19px;
  padding: 30px 34px;
  text-align: center;
  box-shadow: 0 12px 45px #0005;
  max-width: calc(100% - 28px);
}
.overlay-card .eyebrow {
  font-size: 8px;
  color: var(--mint);
}
.overlay-card h2 {
  font-size: 31px;
  letter-spacing: -1px;
  margin: 12px 0 14px;
  font-weight: 800;
}
.overlay-card p {
  color: #b1c0ce;
  font-size: 12px;
  line-height: 1.8;
  margin: 0 0 22px;
}
.primary {
  background: var(--mint);
  color: #173e31;
  border: 0;
  border-radius: 9px;
  padding: 13px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 35px;
  font-size: 13px;
  font-weight: 750;
  margin: 0 auto;
  min-width: 195px;
  box-shadow: 0 3px 0 #319374;
}
.primary:hover {
  background: #89ffc9;
}
.primary span {
  font-size: 18px;
}
.start-hint {
  font:
    8px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: #8ea1b5;
  display: block;
  margin-top: 20px;
}
.toast {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  white-space: nowrap;
  padding: 9px 14px;
  border-radius: 8px;
  background: #152235ed;
  border: 1px solid #586b7e;
  color: #e9edf1;
  pointer-events: none;
  opacity: 0;
}
.toast.visible {
  opacity: 1;
}
.bottom-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 21px;
  background: #1c2c41;
}
.gem-progress {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #b3c0ca;
  font-size: 10px;
}
.gem-mini {
  color: var(--mint);
  font-size: 18px;
  text-shadow: 0 0 15px #65edb166;
}
.progress,
.charge {
  height: 4px;
  border-radius: 5px;
  background: #0e1b2c;
  width: 64px;
  overflow: hidden;
}
.progress i,
.charge i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--mint);
  border-radius: 5px;
}
.weapon {
  display: flex;
  align-items: center;
  gap: 9px;
}
.weapon > span {
  font:
    7px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 0.7px;
  color: var(--gold);
}
.charge {
  width: 39px;
}
.charge i {
  background: var(--gold);
  width: 100%;
}
.fire-button {
  border: 1px solid #6a5b44;
  border-radius: 6px;
  background: #ffc96910;
  color: var(--gold);
  padding: 7px 9px;
  font-size: 10px;
}
.fire-button kbd {
  font-size: 7px;
  color: var(--gold);
  border-color: #6a5b44;
  margin-left: 4px;
}
aside {
  padding: 3px 0;
}
.mission {
  border-bottom: 1px solid var(--line);
  padding-bottom: 21px;
}
.mission h2 {
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: -0.8px;
  margin: 15px 0 13px;
}
.mission > p {
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 18px;
}
.mission-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  font:
    9px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 0.5px;
}
.mission-line > span:first-child {
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.mission-line b {
  margin-left: auto;
  font-weight: 500;
  color: #bcc8d1;
  letter-spacing: 0;
}
.gold-icon {
  color: var(--gold);
}
.monster-icon {
  color: var(--coral);
}
.field-notes {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
}
.field-notes > div {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.note-symbol {
  font-size: 16px;
  color: #8fa8bb;
  flex-shrink: 0;
  width: 20px;
}
.field-notes p {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}
.field-notes strong {
  display: block;
  font-size: 10px;
  color: #d1dbe3;
  font-weight: 650;
}
.controls {
  padding-top: 20px;
}
.controls p {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  color: #8ea1b5;
  margin: 13px 0 0;
}
.controls p kbd:first-child {
  min-width: 77px;
  text-align: center;
}
.touch-controls {
  display: none;
}
footer {
  margin-top: 27px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 26px;
  font-size: 9px;
  color: #8295a9;
}
footer a {
  color: #aab9c7;
  text-decoration: none;
}
footer a:hover {
  color: var(--mint);
}
@media (max-width: 1000px) {
  main {
    padding: 0 25px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 20px;
  }
  .hud {
    padding: 16px;
  }
  .hud strong {
    font-size: 17px;
  }
  .lives strong {
    font-size: 14px;
  }
  .bottom-hud {
    padding: 13px;
  }
  .progress {
    display: none;
  }
  .charge {
    display: none;
  }
  .weapon {
    gap: 6px;
  }
  .weapon > span {
    font-size: 6px;
  }
  .mission h2 {
    font-size: 23px;
  }
  .overlay-card {
    padding: 22px 26px;
  }
  .overlay-card h2 {
    font-size: 27px;
  }
  .overlay-card p {
    margin-bottom: 16px;
  }
  footer span:last-child {
    display: none;
  }
}
@media (max-width: 740px) {
  main {
    padding: 0 16px;
  }
  header {
    height: 70px;
  }
  .brand {
    font-size: 10px;
    letter-spacing: 1.4px;
    gap: 7px;
  }
  .brand-small {
    display: none;
  }
  .quiet {
    font-size: 10px;
    padding: 8px 9px;
  }
  .quiet kbd {
    display: none;
  }
  .intro {
    padding: 26px 0 22px;
    display: block;
  }
  h1 {
    font-size: 49px;
  }
  h1 span {
    font-size: 11px;
    padding: 5px 7px;
    margin-left: 12px;
    margin-bottom: 7px;
  }
  .intro p {
    margin: 14px 0 0;
    font-size: 11px;
  }
  .intro p br {
    display: none;
  }
  .intro .eyebrow {
    font-size: 7px;
    letter-spacing: 1.5px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 23px;
  }
  .hud {
    padding: 13px 14px;
    gap: 8px;
  }
  .hud strong {
    font-size: 16px;
  }
  .hud > div > span {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .lives strong {
    font-size: 13px;
    letter-spacing: 0;
  }
  .overlay-card {
    padding: 16px 21px;
    border-radius: 13px;
  }
  .overlay-card .eyebrow {
    font-size: 6px;
  }
  .overlay-card h2 {
    font-size: 23px;
    margin: 9px 0;
  }
  .overlay-card p {
    font-size: 10px;
    margin-bottom: 13px;
    line-height: 1.65;
  }
  .primary {
    font-size: 11px;
    min-width: 165px;
    padding: 10px 14px;
  }
  .start-hint {
    font-size: 6px;
    margin-top: 13px;
  }
  .bottom-hud {
    padding: 11px 13px;
  }
  .gem-progress {
    font-size: 9px;
    gap: 5px;
  }
  .weapon > span {
    display: none;
  }
  .fire-button {
    font-size: 10px;
  }
  .fire-button kbd {
    font-size: 6px;
  }
  .touch-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    background: #152235;
    border-top: 1px solid #34465b;
  }
  .dpad {
    display: grid;
    grid-template-columns: repeat(3, 39px);
    grid-template-rows: repeat(2, 34px);
    gap: 4px;
  }
  .dpad button {
    touch-action: none;
    user-select: none;
    background: #25374e;
    border: 1px solid #4a5b6f;
    border-radius: 7px;
    color: #c7d8e5;
    font-size: 18px;
  }
  .dpad button:active {
    background: #3f5b70;
  }
  .dpad button:first-child {
    grid-column: 2;
  }
  .dpad button:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .dpad button:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }
  .dpad button:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
  }
  .touch-fire {
    touch-action: none;
    background: #ffc96918;
    border: 1px solid #a17c47;
    color: var(--gold);
    height: 58px;
    width: 78px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 750;
  }
  aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .mission {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .mission h2 {
    font-size: 20px;
  }
  .mission > p {
    font-size: 10px;
  }
  .mission-line {
    font-size: 8px;
    gap: 6px;
  }
  .field-notes {
    padding-top: 0;
    border-bottom: 0;
    padding-bottom: 0;
  }
  .field-notes > div {
    margin-top: 12px;
  }
  .field-notes p {
    font-size: 9px;
    line-height: 1.65;
  }
  .field-notes strong {
    font-size: 9px;
  }
  .controls {
    display: none;
  }
  footer {
    font-size: 7px;
    line-height: 1.6;
    margin-top: 21px;
    gap: 8px;
  }
  .toast {
    font-size: 8px;
    top: 8px;
    padding: 6px 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
