/* DOOMSCROLL.EXE on nikstil.com: a dark, DOS-era frame around the 320×200 game screen. */
:root {
  --blood: #d3261e;
  --ink: #e8e2d8;
  --muted: #9b928a;
  --panel: #1b1210;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  display: grid;
  place-items: center;
  padding: 16px;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 30%, #3a0c08, #120404 60%, #070202);
}
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.frame { width: min(100%, 960px); display: grid; gap: 10px; }
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid #4a1a14;
  border-radius: 6px;
  background: linear-gradient(#2a0f0c, #1a0907);
  font: bold 13px "Courier New", monospace;
}
.bar-name { color: var(--blood); letter-spacing: .08em; }
.bar-sub { flex: 1; color: var(--muted); font-weight: normal; }
.bar-btn {
  padding: 3px 9px;
  border: 1px solid #5a2a22;
  border-radius: 4px;
  color: var(--ink);
  background: #2e1310;
  text-decoration: none;
  font: 12px "Segoe UI", system-ui, sans-serif;
}
.bar-btn:hover { border-color: var(--blood); }

.view {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 2px solid #4a1a14;
  border-radius: 4px;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.screen { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: rgba(8, 2, 2, .82);
}
.overlay.dead { background: rgba(60, 0, 0, .78); }
.logo {
  font: 900 clamp(34px, 8vw, 72px)/1 Impact, "Arial Black", sans-serif;
  letter-spacing: .04em;
  color: var(--blood);
  text-shadow: 0 3px 0 #5a0a06, 0 0 24px rgba(211, 38, 30, .5);
  transform: perspective(300px) rotateX(12deg);
}
.big { font: 900 clamp(26px, 6vw, 48px)/1 Impact, "Arial Black", sans-serif; letter-spacing: .05em; color: var(--blood); text-shadow: 0 2px 0 #5a0a06; }
.tag, .copy { max-width: 56ch; color: var(--ink); }
.warn { color: #ffd24a; }
.kicker { font: bold 12px "Courier New", monospace; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font: 14px "Courier New", monospace; color: var(--muted); }
.stats b { color: var(--ink); }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.btn {
  padding: 8px 16px;
  border: 1px solid #6a2a22;
  border-radius: 4px;
  color: var(--ink);
  background: linear-gradient(#3a1612, #241009);
  font-weight: 600;
}
.btn:hover, .btn:focus-visible { border-color: #ff5a4a; outline: none; }
.btn.blood { color: #fff; border-color: #ff5a4a; background: linear-gradient(#e0392c, #9c140d); box-shadow: 0 0 16px rgba(211, 38, 30, .35); }

.episodes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(100%, 900px); }
.ep-final { border-color: #8a6d1c; background: linear-gradient(rgba(60, 40, 6, .9), rgba(30, 10, 8, .9)); }
.ep-final .ep-num { color: #ffd24a; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.coop-toggle { display: inline-flex; gap: 6px; align-items: center; margin-left: 12px; color: var(--ink); cursor: pointer; }
.coop-toggle input { accent-color: var(--blood); }
.view.coop { aspect-ratio: 32 / 10; min-height: min(480px, 80vh); }
.frame:has(.view.coop) { width: min(100%, 1400px); }
.ep {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px;
  border: 1px solid #4a1a14;
  border-radius: 6px;
  text-align: left;
  background: rgba(30, 10, 8, .85);
}
.ep-num { font: bold 11px "Courier New", monospace; letter-spacing: .12em; color: var(--muted); }
.ep-name { font: 800 16px/1.2 Impact, "Arial Black", sans-serif; letter-spacing: .03em; color: var(--ink); }
.ep-meta { font-size: 12px; color: var(--muted); }
.ep-done { color: #6ef0a0; font-weight: 700; }
.ep .row { justify-content: flex-start; margin-top: 4px; }
.ep .btn { padding: 6px 10px; font-size: 13px; }

.diff-now { max-width: 70ch; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.diff-now b { color: var(--ink); }
.btn.small { padding: 3px 9px; font-size: 12px; }
.overlay.diff { justify-content: flex-start; overflow-y: auto; }
.diff-list { display: grid; gap: 6px; width: min(100%, 640px); padding: 0; list-style: none; counter-reset: diff; }
.diff-list button {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #4a1a14;
  border-radius: 5px;
  color: var(--ink);
  background: rgba(30, 10, 8, .9);
  text-align: left;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.diff-list button::before { counter-increment: diff; content: counter(diff) "."; min-width: 2.2ch; color: var(--muted); font-family: "Courier New", monospace; }
.diff-list button:hover, .diff-list button:focus-visible { border-color: #ff5a4a; outline: none; }
.diff-list button[aria-pressed="true"] { border-color: var(--blood); background: #4a120d; }
.diff-list li:last-child button { font-weight: 400; font-size: 12.5px; line-height: 1.5; }
.help { color: var(--muted); font-size: 12.5px; text-align: center; }
.help b { color: var(--ink); font-weight: 600; }

/* touch controls, under the screen */
.pad { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 2px; }
.dpad { display: grid; grid-template-areas: ". up ." "left . right" ". down ."; gap: 4px; }
.pad-right { display: grid; grid-template-columns: auto auto; gap: 8px; align-items: center; }
.key {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  color: #fff;
  background: #2a1210;
  font-weight: 700;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.big-key { width: 70px; height: 70px; border-radius: 50%; }
.fire { background: #a3160f; }
.ban { background: #4b525a; }
.coarse .help { display: none; }

/* inside a BloatOS window */
.embed body { padding: 0; background: #000; place-items: stretch; }
.embed .frame { width: 100%; height: 100%; gap: 0; grid-template-rows: auto 1fr; }
.embed .bar, .embed .help { display: none; }
.embed .frame { grid-template-rows: 1fr auto; }
.embed .pad { padding: 6px; background: #120404; }
.embed .overlay { gap: 8px; padding: 12px; }
.embed .logo { font-size: 40px; }
.embed .view { aspect-ratio: auto; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.embed .screen { object-fit: contain; }

@media (max-width: 860px) {
  .episodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .bar-sub { display: none; }
  /* menus need more room than the game screen's 16:10 */
  .view:has(> .overlay:not([hidden])) { aspect-ratio: auto; height: min(80vh, 680px); }
  body { padding: 8px; place-items: start center; }
  .episodes { grid-template-columns: 1fr; max-height: 100%; overflow-y: auto; }
  .overlay { justify-content: flex-start; overflow-y: auto; }
  .logo { margin-top: 6px; }
}
