/* Intentionally awkward early-web styling: earnest, loud, and just a bit misaligned. */
:root {
  color-scheme: light;
  --wall: #c6c6c6;
  --paper: #fffef0;
  --ink: #111111;
  --blue: #000080;
  --link: #0000ee;
  --visited: #551a8b;
  --acid: #ccff00;
  --red: #cf0000;
  --rule: #777777;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--wall); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--wall);
  background-image: repeating-linear-gradient(135deg, #00000008 0, #00000008 2px, transparent 2px, transparent 5px);
  font: 13px/1.45 Verdana, Arial, sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--link); }
a:visited { color: var(--visited); }

.site-shell { width: min(100% - 28px, 790px); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.masthead {
  min-height: 83px;
  margin-top: 16px;
  padding: 10px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 3px ridge #dedede;
  background: var(--blue);
}
.wordmark { color: var(--acid); text-decoration: underline; font: bold 27px/1 Georgia, 'Times New Roman', serif; letter-spacing: -.06em; }
.wordmark:visited { color: var(--acid); }
.wordmark span { color: #ffcf00; padding-left: 2px; }
.masthead-right { max-width: 185px; color: #ffffff; text-align: right; font: bold 10px/1.35 'Courier New', monospace; text-transform: uppercase; }
.status-dot { display: none; }

.game {
  width: min(100%, 688px);
  margin: 30px 0 34px 8%;
  padding: 19px 24px 26px 18px;
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  column-gap: 23px;
  align-content: start;
  border: 4px ridge #aaaaaa;
  background: var(--paper);
  box-shadow: 7px 7px 0 #777777;
}
.level-topline { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding-top: 7px; }
#level-kicker { color: var(--red); font: bold 11px/1.4 'Courier New', monospace; text-decoration: underline; text-transform: uppercase; }
#difficulty { max-width: 100px; color: #555555; font: italic 11px/1.4 Georgia, 'Times New Roman', serif; }
.progress-track { grid-column: 1; grid-row: 2 / span 7; justify-self: start; width: 12px; min-height: 175px; margin: 27px 0 0 1px; padding: 1px; border: 1px solid #555555; background: #eeeeee; }
.progress-track div { width: 100%; height: var(--progress, 0%); background: linear-gradient(to bottom, #00c900 0 48%, #ffea00 52% 70%, #ef1717 72%); transition: height .35s steps(5, end); }
h1 { grid-column: 2; grid-row: 1; margin: 1px -4px 20px 0; padding: 7px 10px 8px; color: #000066; background: #ffff8a; border: 2px dotted #e0007a; font: bold clamp(24px, 4.2vw, 35px)/1.08 Georgia, 'Times New Roman', serif; letter-spacing: -.045em; text-decoration: underline; text-decoration-color: #d00000; text-decoration-thickness: 1px; }
.puzzle-copy { grid-column: 2; grid-row: 2; max-width: 525px; color: #181818; font: 15px/1.7 'Times New Roman', Times, serif; }
.puzzle-copy p { margin: 0 0 17px; }
.puzzle-copy strong { color: #000080; font-weight: bold; }
.puzzle-copy .poem { white-space: pre-line; margin: 16px 0 23px -9px; padding: 9px 10px 9px 13px; border-left: 4px double #d00000; border-top: 1px dashed #999999; border-bottom: 1px dashed #999999; color: #171717; background: #f7f4dc; font: 15px/1.8 'Times New Roman', Times, serif; letter-spacing: .025em; }
.puzzle-copy code, .puzzle-copy .code-line { display: block; width: fit-content; max-width: 100%; margin: 13px 0 21px; padding: 7px 9px; border: 2px outset #dddddd; color: #006000; background: #d8ffd8; font: bold 12px/1.8 'Courier New', monospace; overflow-wrap: anywhere; }
.puzzle-copy .code-block { max-width: 100%; margin: 14px 0 20px -5px; padding: 10px 12px; overflow-x: auto; border: 3px ridge #bdbdbd; color: #003d00; background: #e6ffe6; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 'Courier New', monospace; }
.puzzle-copy .json-artifact { background: #fffce0; color: #151515; border-color: #c8bd72; }
.letter-grid { margin: 13px 0 19px; border-collapse: collapse; border: 2px ridge #999999; background: #fffde7; font: bold 18px/1 'Courier New', monospace; }
.letter-grid td { width: 37px; height: 34px; padding: 5px; border: 1px solid #999999; text-align: center; }
.inspect-sample { width: fit-content; min-width: 120px; margin: 13px 0 20px; padding: 12px; border: 2px dashed #a00000; color: #000080; background: #ffffc8; font: bold 14px 'Courier New', monospace; text-align: center; }
.tile-row { display: flex; flex-wrap: nowrap; gap: 6px; width: fit-content; max-width: 100%; margin: 12px 0 21px; }
.order-tile { min-width: 37px; padding: 8px 10px; border: 3px outset #dddddd; color: #000080; background: #eeeeee; font: bold 15px 'Courier New', monospace; text-align: center; }
.waveform-frame { max-width: 100%; margin: 14px 0 22px -6px; padding: 8px 7px 5px; overflow-x: auto; border: 2px inset #bdbdbd; background: #ffffff; }
.waveform-svg { display: block; max-width: none; }
.waveform-svg text { font: 9px 'Courier New', monospace; fill: #111111; }
.waveform-frame figcaption { padding-top: 3px; color: #555555; font: 10px 'Courier New', monospace; }
.vector-artifact { display: block; width: 330px; max-width: 100%; height: auto; margin: 12px 0 20px; padding: 6px; border: 2px groove #cccccc; background: #fffde5; }
.vector-artifact text { fill: #000080; font: bold 7px 'Courier New', monospace; }
.puzzle-copy .sequence { display: block; width: fit-content; margin: 12px 0 22px -7px; padding: 3px 8px; border: 1px solid #999999; color: #b00000; background: #e8e8e8; font: bold 15px/2 'Courier New', monospace; letter-spacing: .1em; }
.seal { width: 62px; height: 76px; margin: 1px 0 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 3px ridge #cccccc; background: #ffffd7; }
.seal svg { width: 44px; height: 44px; }
.seal figcaption { color: #000080; font: bold 8px/1 'Courier New', monospace; text-decoration: underline; text-transform: uppercase; }

.answer-form { grid-column: 2; grid-row: 4; display: flex; gap: 4px; max-width: 540px; margin: 26px 0 0 -10px; padding: 9px; border: 2px groove #cccccc; background: #e3e3e3; }
.answer-form input { min-width: 0; flex: 1; border: 2px inset #d0d0d0; border-radius: 0; outline: none; color: #111111; background: #ffffff; padding: 7px 8px; font: 14px 'Courier New', monospace; }
.answer-form input::placeholder { color: #888888; font: italic 12px Georgia, serif; }
.answer-form input:focus { outline: 2px dotted #d00000; outline-offset: 1px; }
.answer-form button, .special-button { min-height: 34px; border: 3px outset #dddddd; border-radius: 0; color: #000000; background: #d1d1d1; padding: 3px 10px; font: bold 11px 'Courier New', monospace; text-transform: uppercase; cursor: pointer; }
.answer-form button:hover, .special-button:hover { color: #ffffff; background: #000080; }
.answer-form button:active, .special-button:active { border-style: inset; }
.answer-form button span { padding-left: 5px; font-size: 10px; }
.feedback { grid-column: 2; grid-row: 5; min-height: 22px; margin: 8px 0 0 -7px; color: #006400; font: bold 11px/1.5 'Courier New', monospace; }
.feedback.error { color: #c00000; }
.tools-row { grid-column: 2; grid-row: 6; display: flex; flex-wrap: wrap; align-items: baseline; gap: 19px; margin: 12px 0 0 -7px; }
.text-button { padding: 0; border: 0; color: var(--link); background: transparent; font: bold 11px 'Times New Roman', serif; text-decoration: underline; cursor: pointer; }
.text-button:hover { color: #ff0000; background: #ffff00; }
.text-button.subdued { color: #666666; font-weight: normal; }
.text-button:disabled { color: #999999; text-decoration: none; cursor: default; }
.hint-panel { grid-column: 2; grid-row: 7; margin: 15px 0 0 -7px; padding: 10px 12px; border: 2px dotted #777777; border-left: 6px ridge #a00000; color: #333333; background: #fffbd7; font: 13px/1.55 'Times New Roman', Times, serif; }
.hint-panel p { margin: 0 0 7px; }.hint-panel p:last-child { margin-bottom: 0; }
.hint-panel button { border: 0; padding: 0; background: transparent; color: var(--link); cursor: pointer; font-size: 12px; text-decoration: underline; }
#interaction-slot { grid-column: 2; grid-row: 3; }
.special-button { width: 40px; min-height: 40px; margin: 3px 0 0 -10px; padding: 0; color: #a00000; background: #ffff8a; font: 25px Georgia, serif; }
.debug-panel { grid-column: 2; grid-row: 8; margin: 33px 0 0 -7px; border-top: 3px double #8b8b8b; padding-top: 9px; color: #4e4e4e; font: 10px/1.65 'Courier New', monospace; }
.debug-panel p { margin: 0 0 8px; }
.debug-panel pre { white-space: pre-wrap; color: #666666; font: inherit; }
.debug-panel button { margin: 4px 4px 0 0; padding: 4px 7px; border: 2px outset #dddddd; color: #000080; background: #eeeeee; font: 10px 'Courier New', monospace; cursor: pointer; }
.complete-mark { width: 38px; height: 38px; margin: 25px 0 0; display: grid; place-items: center; border: 3px ridge #777777; color: #006400; background: #ccff00; font: bold 16px Georgia, serif; }

footer { min-height: 43px; margin-top: auto; padding: 8px 5px; border-top: 2px groove #f1f1f1; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #4b4b4b; font: 10px/1.35 'Courier New', monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .site-shell { width: min(100% - 18px, 500px); }
  .masthead { min-height: 69px; margin-top: 8px; padding: 9px; }
  .wordmark { font-size: 22px; }
  .masthead-right { max-width: 125px; font-size: 9px; }
  .game { width: 100%; margin: 20px 0 27px; padding: 13px 12px 19px 10px; grid-template-columns: 70px minmax(0, 1fr); column-gap: 12px; box-shadow: 4px 4px 0 #777777; }
  .level-topline { gap: 5px; }
  #level-kicker { font-size: 9px; }
  #difficulty { font-size: 10px; }
  .progress-track { width: 9px; min-height: 155px; }
  .progress-track div { height: var(--progress, 0%); }
  h1 { padding: 7px; font-size: clamp(21px, 7vw, 30px); }
  .puzzle-copy { font-size: 14px; }
  .puzzle-copy .poem { font-size: 14px; }
  .answer-form { gap: 3px; margin-left: -5px; padding: 6px; }
  .answer-form input { padding: 6px 5px; font-size: 12px; }
  .answer-form button { padding: 3px 6px; font-size: 10px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
