@charset "UTF-8";

:root {
  color-scheme: dark;
  --void: #020304;
  --black: #07090a;
  --screen: #050607;
  --steel-0: #171b1c;
  --steel-1: #303637;
  --steel-2: #555a59;
  --steel-3: #89908b;
  --paper: #e4e6dc;
  --dim: #969b94;
  --amber: #e7a72d;
  --amber-dim: #7d531b;
  --cyan: #80dfed;
  --green: #27d65d;
  --hint: #f0b323;
  --mono: "Lucida Console", Consolas, "Liberation Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html { background: var(--void); }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 14%, #1b2522 0, #070b0d 28%, transparent 55%),
    linear-gradient(#000000aa, #000000dd),
    url("./assets/night.svg") center / cover fixed no-repeat,
    #020304;
  color: var(--paper);
  font: 13px/1.55 var(--mono);
  letter-spacing: .02em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, #000c 92%);
}
button, summary { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; stroke-linejoin: miter; }

.app-shell { width: min(1120px, calc(100% - 44px)); margin: 0 auto; }
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 16px;
  border-bottom: 1px solid #74766d55;
}
.heading-copy { min-width: 0; }
h1 {
  margin: 0 0 6px;
  color: #f0eee1;
  font-size: clamp(29px, 4.5vw, 48px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .18em;
  text-shadow: 0 0 4px #ffffff88, 0 0 22px #b6d9d022;
}
.heading-copy > p {
  margin: 0;
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.heading-copy > p span { color: var(--amber); margin-left: 10px; }
.more-menu { position: relative; z-index: 5; margin-bottom: 3px; }
summary { display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary svg { width: 13px; height: 13px; transition: transform .15s; }
details[open] > summary svg { transform: rotate(180deg); }
.more-menu > summary {
  min-height: 36px;
  padding: 5px 0 5px 10px;
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.more-menu > summary:hover { color: var(--paper); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 252px;
  padding: 5px;
  background: #101415;
  border: 2px solid #626966;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px #272c2d, 0 18px 35px #000e;
}
.menu-panel button {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--paper);
  background: #111617;
  border: 0;
  border-bottom: 1px solid #55503966;
  text-align: left;
  font-size: 10px;
  letter-spacing: .04em;
}
.menu-panel button:last-child { border-bottom: 0; }
.menu-panel button:hover { color: var(--amber); background: #202626; }

.intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 4px 14px;
  color: var(--dim);
  font-size: 11px;
}
.intro p { margin: 0; }
.order-note { color: var(--paper); }
.order-note strong { color: var(--amber); font-weight: 400; }

.workspace {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  background:
    linear-gradient(140deg, #656b6866, transparent 22%, #151a1b 23% 78%, #777c7666 79%),
    #303637;
  border: 7px solid #555b59;
  border-radius: 4px;
  clip-path: polygon(1.4% 0, 98.6% 0, 100% 2%, 100% 98%, 98.6% 100%, 1.4% 100%, 0 98%, 0 2%);
  box-shadow: inset 0 0 0 2px #9da39e55, inset 0 0 0 6px #15191a, inset 0 0 42px #000b, 0 22px 60px #000e;
}
.workspace::before {
  content: "STOLAS ASTRO-PROCESSING UNIT  //  LIGHT MATRIX";
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  color: #adb3a833;
  font-size: 8px;
  letter-spacing: .17em;
  white-space: nowrap;
  pointer-events: none;
}
.workspace::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border: 1px solid #a7aaa055;
  clip-path: polygon(1% 0,99%0,100%1%,100%99%,99%100%,1%100%,0 99%,0 1%);
  pointer-events: none;
}
.console, .solution-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 5px solid var(--steel-2);
  border-radius: 3px;
  background: var(--steel-1);
  clip-path: polygon(1.2% 0, 98.8% 0, 100% 2%, 100% 98%, 98.8% 100%, 1.2% 100%, 0 98%, 0 2%);
  box-shadow:
    inset 0 0 0 1px #b3b9b044,
    inset 0 0 0 4px #111516,
    inset 0 0 28px #000d,
    0 16px 50px #000d;
}
.console::before, .solution-panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border: 1px solid #a7aca855;
  pointer-events: none;
  opacity: .7;
}
.console::after, .solution-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .1;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #dfe3d51a 3px 4px);
  mix-blend-mode: screen;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 11px 18px 9px;
  color: var(--paper);
  background: linear-gradient(#15191a, #090b0c);
  border-bottom: 2px solid var(--amber-dim);
  box-shadow: inset 0 1px #c2c6b933;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .11em;
}
.panel-heading > span:last-child { color: var(--amber); font-size: 10px; }
.board-area {
  padding: 24px 24px 0;
  background:
    linear-gradient(125deg, #ffffff06, transparent 42%, #00000055),
    url("./assets/plate.svg");
  box-shadow: inset 0 12px 18px #0007;
}
.board-wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #737974;
  border-radius: 1px;
  background:
    linear-gradient(135deg, #7b817d22, transparent 23%, #0007 24% 75%, #89908a22 76%),
    #1a2021;
  clip-path: polygon(7% 0, 93% 0, 100% 7%, 100% 93%, 93% 100%, 7% 100%, 0 93%, 0 7%);
  box-shadow: inset 0 0 0 2px #090d0e, inset 0 0 12px #000c;
  transition: border-color .12s, filter .12s, transform .08s;
}
.cell::before {
  content: "";
  position: absolute;
  inset: 24%;
  z-index: -1;
  border: 3px solid #7f8580;
  border-radius: 50%;
  background: #080b0c;
  box-shadow:
    0 2px 0 #0a0c0c,
    0 -2px 0 #bac0b966,
    inset 0 0 0 2px #252a29,
    0 0 0 1px #121718;
}
.cell::after {
  content: "";
  position: absolute;
  inset: 9%;
  z-index: -2;
  border: 1px solid #a6aa9e22;
  clip-path: polygon(7% 0,93%0,100%7%,100%93%,93%100%,7%100%,0 93%,0 7%);
}
.bulb {
  display: block;
  width: 42%;
  height: 42%;
  border-radius: 50%;
  transition: background .14s, box-shadow .14s;
}
.cell.blue .bulb {
  background: #dbeafe;
  box-shadow: 0 0 10px 3px #2563eb, 0 0 27px 7px #2563ebaa;
}
.cell.red .bulb {
  background: #ffe4e6;
  box-shadow: 0 0 10px 3px #ef4444, 0 0 27px 7px #ef4444b0;
}
.cell.affected { border-color: #d4d8c588; filter: brightness(1.15); }
.cell:active { transform: scale(.96); }
.cell.hint {
  border-color: var(--hint);
  box-shadow: inset 0 0 0 1px #e3a72788, inset 0 0 18px #d9901e20, 0 0 0 1px #000;
}
.badge {
  display: none;
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 16px;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  color: #1c1303;
  background: var(--hint);
  border: 1px solid #ffe38a;
  border-radius: 1px;
  box-shadow: 0 1px 4px #000b;
  font-size: 10px;
  font-weight: 700;
}
.cell.hint .badge { display: flex; }
.board-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 39px;
  padding: 10px 0 8px;
  color: #b3b7ae;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.board-caption strong { color: var(--amber); font-weight: 400; }
.input-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 51px;
  padding: 7px 24px;
  background: linear-gradient(#1d2323, #101516);
  border-top: 1px solid #858b8055;
}
.text-button {
  flex-shrink: 0;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--paper);
  background: #23292a;
  border: 1px solid #686e69;
  border-radius: 1px;
  box-shadow: inset 0 1px #d9dfd422;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.text-button:hover { color: var(--amber); border-color: var(--amber); }
#inputNote { max-width: 220px; color: var(--dim); font-size: 9px; text-align: right; }
.play-controls {
  display: flex;
  gap: 7px;
  padding: 10px 24px 14px;
  background: #101516;
}
.btn {
  flex: 1;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--paper);
  background: #262d2d;
  border: 1px solid #6b726e;
  border-radius: 1px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.btn:hover { color: var(--amber); border-color: var(--amber); }

.solution-panel {
  padding: 24px;
  background:
    linear-gradient(#0007, #0007),
    #101415;
  border-color: #626866;
}
.solution-panel::before {
  inset: 12px;
  border: 5px solid #343a3a;
  box-shadow: inset 0 0 0 2px #090b0c, 0 0 0 1px #9aa09455;
}
.solution-panel::after { inset: 16px; opacity: .16; }
.solution-panel > * { position: relative; z-index: 1; }
h2 {
  margin: 10px 0 17px;
  padding: 0 0 12px;
  color: var(--amber);
  border-bottom: 1px solid #bc802b;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .12em;
  text-shadow: 0 0 7px #e7a72d55;
}
.solution-count {
  display: flex;
  align-items: baseline;
  gap: 13px;
  margin: 0 0 17px;
}
.solution-count strong {
  color: var(--cyan);
  font-size: 58px;
  font-weight: 400;
  letter-spacing: -.08em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 9px #69e4ef66;
}
.solution-count span { color: var(--dim); font-size: 10px; text-transform: uppercase; }
.solution-summary {
  min-height: 68px;
  margin: 0 0 20px;
  color: #c5cbc0;
  font-size: 10px;
  line-height: 1.8;
}
.solution-instruction {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px 0;
  border-top: 1px solid #77735e66;
  border-bottom: 1px solid #77735e66;
}
.sample-badge {
  display: flex;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  color: #281904;
  background: var(--hint);
  border: 1px solid #ffe28b;
  border-radius: 1px;
  font-size: 10px;
  font-weight: 700;
}
.solution-instruction p {
  margin: 0;
  color: #d4d8ca;
  font-size: 10px;
  line-height: 1.8;
}
.solution-instruction strong { color: var(--amber); font-weight: 400; }
.legend {
  display: flex;
  gap: 21px;
  align-items: center;
  padding: 19px 0;
  color: var(--dim);
  font-size: 9px;
  text-transform: uppercase;
}
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-blue { background: #dbeafe; box-shadow: 0 0 7px #2563eb; }
.legend-red { background: #ffe4e6; box-shadow: 0 0 7px #ef4444; }
.rules { padding-top: 0; }
.rules summary { min-height: 34px; color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .11em; }
.rules p { margin: 13px 0 0; color: #aeb5aa; font-size: 10px; line-height: 1.8; }
.win-banner {
  margin-top: 17px;
  padding: 11px;
  color: var(--green);
  background: #06220e66;
  border: 1px solid #24bc4b99;
  font-size: 10px;
  text-transform: uppercase;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 3px 22px;
  color: #707872;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.site-footer a { color: #929d93; text-underline-offset: 4px; }
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 8px 10px;
  color: #07100b;
  background: var(--cyan);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 721px) and (max-height: 980px) {
  .app-shell { width: min(1020px, calc(100% - 38px)); }
  .page-heading { padding-top: 17px; padding-bottom: 10px; }
  h1 { font-size: clamp(29px, 4.5vw, 40px); }
  .intro { padding-top: 10px; padding-bottom: 8px; }
  .workspace { padding: 12px; gap: 12px; }
  .board-area { padding: 17px 17px 0; }
  .solution-panel { padding: 17px; }
  .solution-panel::before { inset: 8px; }
  h2 { margin-top: 6px; margin-bottom: 10px; }
}
@media (min-width: 721px) and (max-height: 800px) {
  .app-shell { width: min(860px, calc(100% - 38px)); }
  .workspace { padding: 10px; gap: 10px; }
  .panel-heading { min-height: 37px; padding: 8px 13px 7px; }
  .board-area { padding: 12px 12px 0; }
  .board-wrap { gap: 6px; }
  .board-caption { min-height: 33px; padding: 7px 0 6px; }
  .input-tools { min-height: 44px; padding: 5px 12px; }
  .text-button { min-height: 32px; padding: 5px 8px; }
  .solution-panel { padding: 14px; }
  .solution-panel::before { inset: 6px; }
  .solution-panel::after { inset: 9px; }
  h2 { margin: 4px 0 8px; font-size: 15px; }
  .solution-count { margin-bottom: 10px; }
  .solution-count strong { font-size: 48px; }
  .solution-summary { min-height: 52px; margin-bottom: 10px; line-height: 1.65; }
  .solution-instruction { padding: 10px 0; }
  .legend { padding: 12px 0; }
  .site-footer { padding-top: 10px; padding-bottom: 12px; }
  .site-footer { display: none; }
}
@media (max-width: 720px) {
  .app-shell { width: min(520px, calc(100% - 26px)); }
  .page-heading { align-items: center; padding: 22px 0 12px; }
  h1 { font-size: 31px; letter-spacing: .12em; }
  .heading-copy > p { font-size: 8px; }
  .more-menu > summary { font-size: 9px; }
  .intro { display: block; padding: 14px 2px 12px; font-size: 10px; }
  .order-note { margin-top: 4px !important; }
  .workspace { display: flex; flex-direction: column; gap: 13px; padding: 12px; }
  .board-area { padding: 17px 17px 0; }
  .panel-heading { min-height: 39px; padding-inline: 13px; }
  .input-tools { padding-inline: 17px; }
  #inputNote { max-width: 165px; font-size: 8px; }
  .solution-panel { min-height: 0; padding: 19px; }
  .solution-panel::before { inset: 8px; border-width: 3px; }
  .solution-panel::after { inset: 11px; }
  h2 { font-size: 14px; margin-top: 4px; }
  .solution-count strong { font-size: 49px; }
  .site-footer { padding-bottom: 18px; }
}
@media (max-width: 360px) {
  .app-shell { width: calc(100% - 18px); }
  h1 { font-size: 27px; }
  .workspace { padding: 8px; }
  .board-area { padding: 13px 13px 0; }
  .board-wrap { gap: 5px; }
  .input-tools { padding-inline: 13px; }
  .solution-panel { padding: 16px; }
  #inputNote { max-width: 145px; font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
