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oRsvqwRJHVvaDqLXaHsoPkkV5W4zwKCwGhauYnjqCUrcw0HYjg0jrSZkhQnimPXFiO/KUIoC9M7eEqTxc5+3toBMj3Qd7iLobdP9m8BzliCt5ziAH0ReYayzrof9xLaNgj+tzBHHjXt0HTk8TizrXcKqsZaHdJ5qHdoE0SrkPFA760NHg1o0r71pZc7PI7jOVozHRaPDU1tRDIpU1jDaT5yifSvntFnGCzOHI46SlOEISr5bHrs9CXghDEWQxt+QNEmPpKkxO/k8sQC9Lnq6V9SOWyACTzpzE9I4CWjWmu2hV+SWpRI0UpZEf0Z2t/lm2ub5B+3x+wfr4KG5x/dO/sXi/BAAAAA==") format("woff2"),
    url("fonts/C64_Pro_Mono-STYLE.woff") format("woff"),
    url("fonts/C64_Pro_Mono-STYLE.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --border-blue: #a5a5ff;
  --screen-blue: #4242e7;
  --c64-text: #a5a5ff;
  --c64-white: #a5a5ff;
  --line-height: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--border-blue);
}

body {
  min-height: 100dvh;
  overflow: hidden;
  color: var(--c64-text);
  font-family: "C64 Pro Mono", monospace;
  font-weight: 400;
  text-transform: uppercase;
  font-synthesis: none;
  font-variant-ligatures: none;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

.machine {
  width: 100vw;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 8.9vh, 72px) clamp(20px, 5.55vw, 68px);
  background: var(--border-blue);
}

.terminal {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: min(
    1100px,
    calc(100vw - (2 * clamp(20px, 5.55vw, 68px))),
    calc((100dvh - (2 * clamp(20px, 8.9vh, 72px))) * 1.6)
  );
  aspect-ratio: 320 / 200;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: var(--screen-blue);
  color: var(--c64-text);
  box-shadow: none;
  outline: none;
  cursor: text;
  scrollbar-width: none;
}

.terminal::-webkit-scrollbar {
  display: none;
}

.output {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 0;
  overflow: visible;
  font-size: calc(100cqi / 40);
  line-height: var(--line-height);
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: none;
}

.line {
  width: 100%;
  height: 1em;
  min-height: 1em;
  margin: 0;
  padding: 0;
}

.line.center {
  text-align: center;
}

.line.dim {
  opacity: 0.74;
}

.input-line {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  height: 1em;
  min-height: 1em;
  margin: 0;
  margin-inline-start: 0;
  padding: 0;
  padding-inline-start: 0;
  text-indent: 0;
  font-size: calc(100cqi / 40);
  line-height: var(--line-height);
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: none;
}

.input-line.is-hidden {
  visibility: hidden;
}

.cursor {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin: 0;
  color: var(--screen-blue);
  background: var(--c64-text);
  animation: c64-cursor 1s steps(1, end) infinite;
  vertical-align: top;
}

@keyframes c64-cursor {
  0%, 49.999% { background: var(--c64-text); }
  50%, 100% { background: transparent; }
}

.command-input {
  position: fixed;
  left: -1000px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0.001;
  pointer-events: none;
}

/*
 * Desktop keeps the invisible hardware-keyboard input off-screen.
 * Touch devices need an input that is physically inside the visible page;
 * iOS/iPadOS will not reliably summon the software keyboard for an
 * off-screen one-pixel field. It remains visually transparent and simply
 * feeds the C64-rendered input line above it.
 */
.touch-input .command-input {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  height: max(44px, 3em);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  opacity: 0.01;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  font-size: 16px;
  line-height: 1;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.touch-input .command-input:disabled {
  pointer-events: none;
}

.crt-layer {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

@supports not (font-size: 1cqi) {
  .output,
  .input-line {
    font-size: clamp(13px, 2.5vw, 27.5px);
  }
}


@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation-duration: 1.6s;
  }
}

.graphic-frame {
  position: relative;
  width: 100%;
  height: 4em;
  min-height: 4em;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.graphic-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.wordle-row {
  display: flex;
  width: 100%;
  height: 1em;
  min-height: 1em;
  margin: 0;
  padding: 0;
  align-items: stretch;
  white-space: nowrap;
  overflow: hidden;
}

.wordle-label {
  display: inline-block;
  width: 10em;
  min-width: 10em;
  height: 1em;
  overflow: hidden;
}

.wordle-tile {
  display: inline-flex;
  width: 2em;
  min-width: 2em;
  height: 1em;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.wordle-count {
  display: inline-block;
  width: 4em;
  min-width: 4em;
  height: 1em;
  margin-left: 1em;
  color: var(--c64-text);
}

.pong-layer {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--screen-blue);
  color: var(--c64-text);
  font-size: calc(100cqi / 40);
  line-height: 1;
}

.pong-layer.is-hidden,
.pong-panel.is-hidden,
.pong-canvas.is-hidden {
  display: none;
}


.pong-panel {
  width: 34em;
  max-width: 100%;
  min-height: 15em;
  padding: 1em;
  border: 1em solid var(--c64-text);
  background: var(--screen-blue);
}

.pong-title {
  height: 2em;
  text-align: center;
  color: #edf171;
}

.pong-body {
  min-height: 10em;
  white-space: pre;
}

.pong-menu-line {
  height: 1em;
  overflow: hidden;
}

.pong-footer {
  min-height: 2em;
  color: #75cec8;
}

.pong-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}

.private-line {
  width: 100%;
  background: #000000;
  opacity: 1;
}


/* C64 DOOM — local single-player game layer */
.doom-layer {
  position: absolute;
  z-index: 14;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000000;
  touch-action: none;
  user-select: none;
}

.doom-layer.is-hidden {
  display: none;
}

.doom-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.doom-touch {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

.doom-touch-pad,
.doom-touch-actions {
  position: absolute;
  bottom: max(0.6rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, minmax(2.5rem, 11vw));
  gap: 0.35rem;
  pointer-events: auto;
}

.doom-touch-pad { left: max(0.6rem, env(safe-area-inset-left)); }
.doom-touch-actions { right: max(0.6rem, env(safe-area-inset-right)); }

.doom-touch button {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.25rem;
  border: 0.16rem solid rgba(237, 241, 113, 0.9);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  font: inherit;
  line-height: 1;
  touch-action: none;
}

.doom-touch button:active {
  background: rgba(129, 51, 56, 0.9);
}

/* v1.19 — stable touch layout, square D-pad and iOS selection suppression */
.mobile-game-controls {
  display: none;
}

/* Prevent iOS long-press selection/callout while using the virtual controls. */
.touch-input,
.touch-input .machine,
.touch-input .terminal,
.touch-input .mobile-game-controls,
.touch-input .mobile-game-controls * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.touch-input .mobile-game-controls,
.touch-input .mobile-game-controls * {
  touch-action: none;
}

/* The software keyboard may resize the visual viewport, but the C64 layout
   keeps the height captured before the keyboard opened. The real input stays
   on-screen at the top-left so iOS can focus it without panning the page. */
.touch-input body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--spy-layout-height, 100svh);
  min-height: 0;
  overflow: hidden;
}

.touch-input .machine,
.touch-input.keyboard-active .machine {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--spy-layout-height, 100svh);
  min-height: 0;
  padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.touch-input .terminal,
.touch-input.keyboard-active .terminal {
  width: min(
    calc(100vw - 16px),
    calc((var(--spy-layout-height, 100svh) - max(16px, env(safe-area-inset-top))) * 1.6)
  );
  flex: 0 0 auto;
}

.touch-input .command-input,
.touch-input.keyboard-active .command-input {
  position: fixed;
  z-index: 30;
  left: 1px;
  top: 1px;
  right: auto;
  bottom: auto;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.01;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  font-size: 16px;
  pointer-events: none;
  transform: none;
  appearance: none;
  -webkit-appearance: none;
}

/* The earlier in-canvas DOOM touch overlay is replaced by the shared control
   panel below the C64 screen. */
.doom-touch { display: none !important; }

@media (pointer: coarse) {
  .touch-input.game-controls-active .machine {
    justify-content: flex-start;
    gap: clamp(6px, 1.6vh, 12px);
  }

  .touch-input.game-controls-active .terminal {
    width: min(
      calc(100vw - 16px),
      calc((var(--spy-layout-height, 100svh) - 172px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 1.6)
    );
  }

  .touch-input.game-controls-active .mobile-game-controls {
    display: grid;
    grid-template-columns: repeat(5, minmax(42px, 64px));
    grid-template-rows: repeat(3, minmax(42px, 64px));
    grid-template-areas:
      ". . w . ."
      ". a s d ."
      "enter enter space esc esc";
    justify-content: center;
    gap: 6px;
    width: min(calc(100vw - 16px), 640px);
    max-height: 154px;
    flex: 1 1 auto;
    padding: 0;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
  }

  .mobile-key {
    min-width: 0;
    min-height: 42px;
    border: 3px solid #a5a5ff;
    border-radius: 0;
    padding: 0.3rem;
    background: #352879;
    color: #ffffff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(14px, 4vw, 22px);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 2px #4242e7;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-key.is-pressed,
  .mobile-key:active {
    background: #813338;
    transform: translateY(1px);
  }

  .key-w { grid-area: w; }
  .key-a { grid-area: a; }
  .key-s { grid-area: s; }
  .key-d { grid-area: d; }
  .key-enter { grid-area: enter; }
  .key-space { grid-area: space; }
  .key-escape { grid-area: esc; }
}
