:root {
  color-scheme: dark;
  font: 15px Tahoma, Verdana, system-ui, sans-serif;
  --white: #ecf8ff;
  --text: #d4e5f8;
  --muted: #a2b5cb;
  --cyan: #7cead5;
  --ink: #0a1020;
  --top: env(safe-area-inset-top, 0px);
  --right: env(safe-area-inset-right, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --left: env(safe-area-inset-left, 0px);
}
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: transparent; color: inherit; }
[hidden] { display: none !important; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  color: var(--text);
  background: #070e1c;
}
body {
  background:
    radial-gradient(ellipse at 50% 24%, #172e50 0%, #101d34 44%, #070e1c 80%);
}
button { color: inherit; font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .38; }
button:focus-visible { outline: 2px solid #b3ffec; outline-offset: 3px; }
.menu, .game {
  position: fixed;
  inset: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
.menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--top) + clamp(22px, 5.5dvh, 60px)) max(16px, var(--right))
    calc(var(--bottom) + 14px) max(16px, var(--left));
}
.menu::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(0deg, transparent 0 3px, #03070e24 3px 4px);
}
.masthead { width: min(510px, 100%); text-align: center; flex: none; }
h1 {
  margin: 0;
  color: var(--white);
  font: 900 clamp(2.8rem, 13vw, 5.8rem)/1.05 "Arial Black", Tahoma, system-ui, sans-serif;
  letter-spacing: -.075em;
  text-shadow: 0 2px #152c48, 0 5px 1px #0a111e, 0 0 32px #438ffe40;
  transform: skew(-7deg);
}
h1 span + span { color: var(--cyan); }
.title-rule {
  height: 4px;
  margin: 12px 4% 0;
  background: linear-gradient(90deg, transparent, #1f5876 16%, #99eccc 50%, #1f5876 84%, transparent);
  box-shadow: 0 7px 12px #286d9c2b;
}
.menu-body { flex: 1; display: grid; place-items: center; width: 100%; min-height: 0; padding-block: 8px; }
.window {
  border: 1px solid #6881a5;
  border-bottom-color: #172643;
  border-right-color: #263b62;
  border-radius: 5px;
  background: linear-gradient(145deg, #1b2d4c, #111e35 58%, #10192c);
  box-shadow: inset 0 0 0 1px #070d1a, inset 1px 1px #30466b, 0 18px 50px #02060b9c;
}
.launcher { width: min(380px, 100%); padding: 10px; }
.window-strip {
  height: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid #354e75;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#304e77, #233657 51%, #172642 52%, #182a46);
}
.window-strip b {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5fa8ac;
  box-shadow: 0 0 6px #48858c;
}
.window-strip b:first-child { background: #a0f9d3; }
.icon-bay {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  height: clamp(76px, 28dvh, 220px);
  border: 1px solid #456081;
  border-top-color: #030914;
  background: radial-gradient(ellipse at 50% 61%, #154c5e, #10243e 45%, #070e1b 83%);
  overflow: hidden;
}
.icon-bay::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 35px #040810cf;
  background: linear-gradient(158deg, #a0ccff16 0%, transparent 28%);
}
.bay-grid {
  position: absolute;
  inset: 38% -24% -40%;
  background: repeating-linear-gradient(90deg, transparent 0 25px, #2a8d9740 25px 26px),
    repeating-linear-gradient(0deg, transparent 0 17px, #2a8d9755 17px 18px);
  transform: perspective(115px) rotateX(42deg);
  transform-origin: 50% 35%;
  mask-image: linear-gradient(transparent, #000 35%);
  z-index: -1;
}
.icon-bay img {
  display: block;
  width: auto;
  height: 88%;
  max-width: 83%;
  min-height: 0;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 17%;
  border: 1px solid #91ffd742;
  box-shadow: 0 0 25px #66ffcf32, 0 8px 22px #000a;
}
.launcher-buttons { display: grid; gap: 7px; margin-top: 10px; }
.chrome-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .65em;
  min-height: 43px;
  padding: 7px 11px;
  border: 1px solid #7087a9;
  border-right-color: #344867;
  border-bottom-color: #273953;
  border-radius: 4px;
  color: #eff7ff;
  background: linear-gradient(#526d95, #364e75 49%, #273d63 52%, #2c466e);
  box-shadow: inset 0 1px #a8c2e457, inset 0 -1px #071225, 0 2px 5px #0004;
  font-weight: 700;
  text-shadow: 0 1px #072015;
}
.chrome-button:hover:not(:disabled), .tool-button:hover:not(:disabled) { filter: brightness(1.2); }
.chrome-button:active:not(:disabled), .game-button:active { filter: brightness(.82); transform: translateY(1px); }
.chrome-button.green {
  color: #07221d;
  text-shadow: 0 1px #d4ffdc9e;
  border-color: #b4f5c1 #46987c #236b54 #80d1a5;
  background: linear-gradient(#b6f4c0, #81d9a5 47%, #5cc68f 51%, #6ad5a2);
  box-shadow: inset 0 1px #e3ffe7b3, inset 0 -1px #318063, 0 2px 7px #060e148c;
}
#start { font-size: 1.1rem; }
.gear { font-size: 1.2em; line-height: 1; }
.triangle {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: .47em solid transparent;
  border-bottom: .47em solid transparent;
  border-left: .72em solid currentColor;
}
.patch {
  align-self: flex-start;
  flex: none;
  width: min(245px, 100%);
  background: #131e33;
  box-shadow: 0 5px 14px #03050c8c;
}
.panel-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 3px 9px;
  color: var(--white);
  background: linear-gradient(#48678f, #2c4468 49%, #223555 50%, #233a5e);
  box-shadow: inset 0 1px #8da7cb88, 0 1px #090f1b;
  border-radius: 4px 4px 0 0;
  font-size: .81rem;
  font-weight: 700;
}
.panel-caption h2 { margin: 0; font-size: 1rem; }
.version { font: .7rem "Courier New", monospace; color: #c7dfed; }
.patch p { margin: 7px 9px; font-size: .73rem; line-height: 1.4; color: #b5c8de; }
.patch .offline-status { color: #9be8b3; display: flex; align-items: center; gap: 7px; }
.offline-status span {
  width: 6px;
  height: 6px;
  margin-left: 1px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.game {
  padding: var(--top) var(--right) var(--bottom) var(--left);
  background: #080e1b;
}
#board { display: block; width: 100%; height: 100%; touch-action: none; }
.game-button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #5a7899;
  border-right-color: #233c5d;
  border-bottom-color: #233c5d;
  border-radius: 5px;
  color: #d1f6f3;
  background: linear-gradient(#334e6d, #162543 52%, #1b2d4a);
  box-shadow: inset 0 1px #a4ddf244, 0 2px 7px #01040b9c;
}
.pause-button { top: calc(var(--top) + 8px); right: calc(var(--right) + 8px); }
.pause-glyph { width: 13px; height: 16px; border-inline: 4px solid currentColor; }
.launch-button {
  left: 50%;
  bottom: calc(var(--bottom) + clamp(59px, 12dvh, 105px));
  transform: translateX(-50%);
  color: #b5f1d3;
  box-shadow: 0 0 20px #70ffcc21, inset 0 1px #abd2e958;
}
.launch-button:active { transform: translate(-50%, 1px); }
.launch-button .triangle { margin-left: 2px; }
dialog.window {
  position: fixed;
  width: min(490px, calc(100% - 24px - var(--left) - var(--right)));
  max-height: calc(100dvh - 18px - var(--top) - var(--bottom));
  color: var(--text);
  padding: 0;
  overflow: auto;
  touch-action: pan-y;
}
dialog::backdrop { background: #02050bd6; }
.dialog-body { padding: 12px; }
.close-button, .caption-button, .tool-button {
  border: 1px solid #7693b1;
  border-right-color: #2c4260;
  border-bottom-color: #263a58;
  border-radius: 3px;
  color: var(--white);
  background: linear-gradient(#3b547c, #223556);
  box-shadow: inset 0 1px #bdd5ea38;
}
.close-button { width: 30px; height: 30px; font: 23px/1 system-ui,sans-serif; }
.caption-button { min-height: 30px; font-size: .72rem; white-space: nowrap; }
.slots, .choices { display: grid; gap: 8px; }
.slot { padding: 8px; border: 1px solid #324b70; background: #0c172b; }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.slot-title { font-size: .89rem; font-weight: 700; }
.slot-note { margin: 3px 0 0; color: var(--muted); font-size: .72rem; }
.slot-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.slot-head .chrome-button { min-height: 34px; font-size: .8rem; }
.tool-button { min-height: 33px; padding: 3px 8px; font-size: .73rem; }
.tool-button.danger { color: #ffc2bc; }
.status { color: #aaf1cf; margin: 9px 0 0; font-size: .82rem; }
.settings { display: grid; gap: 12px; }
.settings fieldset { margin: 0; padding: 8px; border: 1px solid #40577a; }
.settings legend { color: var(--white); padding-inline: 5px; font-weight: 700; }
.segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.segments button {
  min-height: 41px;
  border: 1px solid #4d6489;
  border-radius: 3px;
  color: #d1e5f9;
  background: linear-gradient(#2b4265,#192945);
}
.segments button[aria-pressed="true"] {
  color: #b0ffda;
  background: #11291f;
  border-color: #75bd9e;
  box-shadow: inset 0 1px 6px #050e10;
  font-weight: 700;
}
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stats { margin: 0 0 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.stats div { background: #0b1426; border: 1px solid #364c6b; padding: 7px; }
.stats dt { font-size: .7rem; color: var(--muted); }
.stats dd { margin: 3px 0 0; color: var(--white); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wall-score { margin: 0 0 9px; font-size: .8rem; color: var(--muted); }
.choice {
  text-align: left;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 8px;
}
.choice-icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #688fb9;
  border-radius: 3px;
  background: #142843;
  color: #b4ffe8;
  font: 700 1rem "Courier New", monospace;
}
.choice b, .choice small { display: block; }
.choice small { margin-top: 3px; color: #c3d6eb; font-weight: 400; }
@media (max-height: 460px) {
  .menu { padding-top: calc(var(--top) + 7px); padding-bottom: calc(var(--bottom) + 5px); }
  h1 { font-size: clamp(2rem, 11dvh, 3.2rem); }
  .title-rule { margin-top: 4px; }
  .icon-bay { height: clamp(55px, 22dvh, 95px); }
  .launcher { padding: 5px; }
  .launcher-buttons { margin-top: 4px; gap: 3px; }
  .launcher-buttons button { min-height: 33px; }
  .patch p { margin-block: 4px; }
  .patch .panel-caption { min-height: 24px; }
}
