* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(24px, 8vh, 80px) 16px;
  background: #e3e6eb;
  color: #222;
  font: 14px/1.75 Tahoma, Verdana, sans-serif;
}
a { color: #0000a0; text-underline-offset: 3px; }
a:visited { color: #551a8b; }
a:hover { color: #003e8d; }
a:focus-visible { outline: 2px dotted #000080; outline-offset: 4px; }
.window {
  max-width: 660px;
  margin: auto;
  padding: 3px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  box-shadow: 3px 3px 0 #00000012;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  background: linear-gradient(90deg, #000080, #346baf);
  color: #fff;
  font: bold 12px/1.5 Tahoma, sans-serif;
}
.page-icon { width: 12px; height: 14px; border: 1px solid #222; background: #fff; box-shadow: inset 0 0 0 2px #c9d7e7; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 5px 9px; font-size: 12px; }
.toolbar a { color: #222; text-decoration: none; }
.toolbar a:hover { text-decoration: underline; }
.address { margin: 0 4px 6px; padding: 2px 7px; border: 1px solid; border-color: #808080 #fff #fff #808080; background: #f7f7f7; color: #555; font: 11px/1.7 "Courier New", monospace; overflow-wrap: anywhere; }
main { padding: clamp(24px, 6vw, 42px); background: #fff; border: 1px solid; border-color: #808080 #fff #fff #808080; }
.eyebrow { margin: 0 0 12px; color: #666; font: 11px/1.6 "Courier New", monospace; }
h1 { margin: 0 0 20px; font: bold clamp(30px, 6vw, 38px)/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
p { margin: 0 0 16px; }
.now { margin-top: 27px; padding-top: 20px; border-top: 1px dotted #b7b7b7; }
h2 { margin: 0 0 9px; font: bold 12px/1.5 "Courier New", monospace; text-transform: uppercase; letter-spacing: .04em; }
.now p { margin-bottom: 14px; }
.now p:last-child { margin-bottom: 0; }
.wip { white-space: nowrap; color: #555; font-size: 12px; }
.links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 26px; font-size: 13px; }
.statusbar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding: 2px 7px; border: 1px solid; border-color: #808080 #fff #fff #808080; font: 10px/1.7 Tahoma, sans-serif; }
.statusbar a { color: #333; }
[hidden] { display: none !important; }
.toolbar a { padding: 0 4px; }
.toolbar a[aria-current="location"] { background: #000080; color: #fff; }
.window[data-panel] main { min-height: 340px; }
.window[data-panel] .now { margin-top: 0; padding-top: 0; border-top: 0; }
.window[data-panel] .links { margin-top: 14px; }
@media (max-width: 420px) { body { padding: 20px 12px; } .toolbar { gap: 6px 10px; } }

.empty-state { padding: 16px 0; border-top: 1px dotted #b7b7b7; color: #666; font: 12px/1.7 "Courier New", monospace; }
.book-list { margin: 20px 0 0; padding-left: 25px; }
.book-list li { padding: 12px 0 12px 4px; border-top: 1px dotted #b7b7b7; }
.book-author { display: block; margin-top: 3px; color: #666; font-size: 12px; }
.review-meta { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px dotted #b7b7b7; color: #555; font: 11px/1.7 "Courier New", monospace; }
.review-body { overflow-wrap: anywhere; }
.titlebar, h1, .book-list { overflow-wrap: anywhere; }
.review-body p:last-child { margin-bottom: 0; }
.review-back { margin-top: 28px; padding-top: 16px; border-top: 1px dotted #b7b7b7; font-size: 12px; }

.book-overview { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: start; }
.book-cover { margin: 0; }
.book-cover img { display: block; width: 150px; max-width: 100%; height: auto; border: 1px solid #b7b7b7; }
.book-cover figcaption { margin-top: 8px; font: 10px/1.7 "Courier New", monospace; }
.review-pending { color: #666; font: 12px/1.7 "Courier New", monospace; }
@media (max-width: 420px) { .book-overview { grid-template-columns: 1fr; gap: 20px; } }

/* Classic Windows-style sunken track and uniformly spaced blue blocks. */
.reading-progress { max-width: 260px; margin: 10px 0 4px; }
.reading-progress[data-stage="started"] { --fill-width: calc(100% / 3); }
.reading-progress[data-stage="mostly-finished"] { --fill-width: calc(200% / 3); }
.reading-progress[data-stage="finished"] { --fill-width: 100%; }
.progress-track {
  height: 22px;
  padding: 3px;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
.progress-fill {
  display: block;
  width: var(--fill-width);
  height: 100%;
  background: repeating-linear-gradient(90deg, #000080 0 9px, transparent 9px 11px);
}
.review-body .reading-progress { margin-top: 0; margin-bottom: 24px; }

.graphics-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 5;
  background: #030511;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  cursor: grab;
  touch-action: none;
}
.graphics-canvas:active { cursor: grabbing; }
.graphics-canvas:focus-visible, .graphics-controls button:focus-visible {
  outline: 2px dotted #000080;
  outline-offset: 4px;
}
.graphics-help, .graphics-status { margin: 12px 0; color: #555; font-size: 12px; }
.graphics-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.graphics-controls button {
  min-width: 72px;
  min-height: 36px;
  padding: 4px 12px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  border-radius: 0;
  background: #c0c0c0;
  color: #222;
  font: 12px Tahoma, Verdana, sans-serif;
  cursor: pointer;
}
.graphics-controls button:active { border-color: #777 #fff #fff #777; }
.graphics-controls button:disabled { color: #666; cursor: default; }

.game-player { background: #000; border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; }
#game-screen { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; image-rendering: pixelated; background: #000; }
#game-screen:focus-visible { outline: 2px dotted #fff; outline-offset: -4px; }
.game-controls { margin-top: 16px; }
.game-touch { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: #c0c0c0; }
.game-touch button {
  min-width: 44px; min-height: 44px; padding: 4px 9px;
  border: 2px solid; border-color: #fff #777 #777 #fff; border-radius: 0;
  background: #c0c0c0; color: #222; font: 12px Tahoma, Verdana, sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.game-touch button:active, .game-touch button[data-held] { border-color: #777 #fff #fff #777; background: #aaa; }
.game-touch button:focus-visible { outline: 2px dotted #000080; outline-offset: 2px; }
.game-player:fullscreen { display: flex; flex-direction: column; justify-content: center; border: 0; }
.game-player:fullscreen #game-screen { width: 100%; max-height: calc(100dvh - 130px); object-fit: contain; flex: 1; min-height: 0; }
.game-player:fullscreen .game-touch { flex-shrink: 0; justify-content: center; }
.toolbar a[aria-current="page"] { background: #000080; color: #fff; }
