/* ============================================================
   v6 OS module: DR-DOS (1992–1995) — text mode, F-keys, snake
   ============================================================ */
#os-dos { position: absolute; inset: 0; display: none; background: var(--crt-bg, #020803); }
#os-dos.on { display: flex; flex-direction: column; }
#os-dos .crt {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: clamp(14px, 3.5vw, 40px);
  font-family: var(--mono);
  color: var(--phos, #c8ffc8);
  text-shadow: 0 0 calc(8px * var(--crt)) color-mix(in srgb, var(--phos, #c8ffc8) 55%, transparent);
}
#os-dos .crt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0, calc(.15 * var(--crt))) 0 1px, transparent 1px 3px);
}
#os-dos .crt-on { animation: crt-on .5s ease-out; }
@keyframes crt-on { 0% { transform: scaleY(.004); filter: brightness(6); } 60% { transform: scaleY(1.02); } 100% { transform: scaleY(1); } }

#os-dos .dos-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--phos-dim); margin-bottom: 14px;
  letter-spacing: .08em;
}
.tline { min-height: 1.2em; line-height: 1.7; font-size: clamp(13.5px, 1.9vw, 16.5px); white-space: pre-wrap; word-break: break-word; }
.tline.hl { color: color-mix(in srgb, var(--phos) 55%, #fff); font-weight: 700; }
.tline.err { background: var(--phos); color: #0b0e0b; text-shadow: none; font-weight: 700; padding: 0 6px; width: max-content; max-width: 100%; }
.tline.dim, .b-dim { color: var(--phos-dim); }
.tline.cur-beat { background: color-mix(in srgb, var(--phos) 14%, transparent); outline: 1px solid var(--phos-dim); }
.b-title { font-weight: 700; letter-spacing: .1em; }
.tline .yr { color: var(--phos-dim); margin-right: 10px; user-select: none; }
.cursor { display: inline-block; width: .6em; height: 1.05em; background: var(--phos); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.dosline { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; font-size: clamp(13.5px, 1.9vw, 16.5px); }
.dosline .ps1 { color: var(--phos); white-space: nowrap; }
.dosline input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--phos); font: inherit; font-family: var(--mono);
  caret-color: var(--phos); text-transform: uppercase; min-width: 30px;
}
.dos-link { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dos-link:hover { background: var(--phos); color: #041207; text-shadow: none; }

/* F-key bar */
#dos-fbar {
  display: flex; gap: 2px; padding: 6px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--phos) 9%, #000);
  border-top: 1px solid var(--phos-dim);
  font-family: var(--mono);
}
#dos-fbar button {
  flex: 1; min-width: 76px; min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--phos); font-size: 12.5px;
  border: 1px solid transparent;
}
#dos-fbar button .fk {
  background: var(--phos); color: #041207; padding: 1px 6px; font-weight: 700; font-size: 11px;
}
#dos-fbar button:hover { border-color: var(--phos-dim); background: color-mix(in srgb, var(--phos) 12%, transparent); }
#dos-fbar .fbar-hint { flex: 100%; text-align: center; color: var(--phos-dim); font-size: 10px; letter-spacing: .1em; padding: 2px 0 1px; text-transform: uppercase; }
@media (min-width: 720px) { #dos-fbar .fbar-hint { flex: none; margin-left: auto; align-self: center; padding: 0 8px; } }

/* in-CRT game */
.crt-game { margin: 14px 0; }
.crt-game canvas { border: 1.5px solid var(--phos-dim); background: rgba(0,0,0,.4); image-rendering: pixelated; touch-action: none; max-width: 100%; }
.crt-game .g-status { font-size: 13px; margin: 8px 0; color: var(--phos); font-family: var(--mono); }
.g-pad { display: none; gap: 8px; margin-top: 10px; }
.g-pad button { width: 52px; height: 52px; border: 1px solid var(--phos-dim); color: var(--phos); font-size: 20px; }
@media (pointer: coarse) { .g-pad { display: flex; } }
.g-quit { font-family: var(--mono); color: var(--phos); border: 1px solid var(--phos-dim); padding: 8px 14px; margin-top: 8px; min-height: 44px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  #os-dos .crt-on, .cursor { animation: none; }
}
