/* Shared layout for the hub and the simple game pages.
   A game page restyles it by overriding the tokens below in its own theme.css. */
:root {
  --bg: #101018;
  --surface: #1a1a28;
  --border: #5455ed;          /* MSX dark blue */
  --text: #e8e8f0;
  --dim: #9a9ab0;
  --accent: #7d76fc;          /* MSX light blue */
  --font-display: "VT323", ui-monospace, monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --display-size: 1.25;       /* display fonts differ a lot in size */
  --radius: 4px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
code { font-size: .85em; word-break: break-all; }

.bar { border-bottom: 1px solid var(--border); padding: 10px 16px; }
.bar a { font-family: var(--font-display); font-size: calc(1rem * var(--display-size)); text-decoration: none; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }

h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: calc(2rem * var(--display-size)); }
h2 { font-size: calc(1.4rem * var(--display-size)); color: var(--accent); margin-top: 2em; }

.meta { color: var(--dim); margin: 0; font-size: .9rem; letter-spacing: .05em; text-transform: uppercase; }
.jp { color: var(--dim); margin: 0 0 .75em; }

.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: #2f8f4e;
  color: #fff;
}
.status.wip { background: #b8860b; }

/* Hub */
.intro { color: var(--dim); max-width: 60ch; }
.grid {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 2px solid var(--frame, var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s;
}
.card a:hover, .card a:focus-visible { transform: translateY(-3px); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #000; }
.card div { padding: 12px 14px 16px; }
.card h2 { font-size: 1.6rem; margin: 4px 0; color: var(--frame, var(--text)); }
.card .jp { margin-bottom: 8px; font-size: .9rem; }

/* Game page */
.hero { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.hero img { width: 100%; border: 2px solid var(--border); border-radius: var(--radius); }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } }

.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 1em 0; }
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--accent); color: var(--bg); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--dim); font-weight: 600; }

.shots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shots figure { margin: 0; }
.shots img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); }
.shots figcaption { color: var(--dim); font-size: .85rem; margin-top: 4px; }

.status.adult, .note.adult { background: #b3261e; color: #fff; }
/* Before/after: original Japanese screen next to the translated one */
.compare { display: grid; gap: 28px; }
.compare figure { margin: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair span { display: block; color: var(--dim); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.pair img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); }
.compare figcaption { margin-top: 6px; }
@media (max-width: 520px) { .pair { grid-template-columns: 1fr; } }

blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--accent); }
.note { padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface); }
.note.adult { border: 0; border-radius: var(--radius); font-weight: 600; }

/* Manual: scan of each page next to its translation */
.page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.page figure { margin: 0; }
.page img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); }
.page figcaption { color: var(--dim); font-size: .85rem; margin-top: 4px; }
.page h3 { font-family: var(--font-display); font-weight: 400; color: var(--accent); margin-top: 0; }
.page dt { font-weight: 600; }
.page dd { margin: 0 0 8px 16px; }
@media (max-width: 640px) { .page { grid-template-columns: 1fr; } .page figure { max-width: 220px; } }

footer { color: var(--dim); font-size: .85rem; border-top: 1px solid var(--border); margin-top: 48px; padding-top: 16px; }

/* Hub masthead: logo next to the site name */
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.brand img { image-rendering: pixelated; flex: none; }
.brand h1 { margin: 0; }
.tagline { margin: 0; color: var(--dim); }
.status.test { background: #2a6fdb; }
/* Hub: status section headings above each grid */
h2 + .grid { margin-top: 16px; }

/* IPS patcher */
.patcher { display: grid; gap: 16px; max-width: 60ch; margin: 24px 0; }
.patcher label { display: grid; gap: 4px; font-weight: 600; }
.patcher input[type=file] { font: inherit; font-weight: 400; color: var(--dim); }
button.btn { background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; justify-self: start; }
.note.error { border-left-color: #b3261e; }
td.ok { color: #5fd38d; }
td.bad { color: #ff6b6b; }
.hero .gmsx { margin: 12px 0 0; font-size: .9rem; }
.faq { max-width: 70ch; }
.faq h3 { font-family: var(--font-display); font-weight: 400; font-size: calc(1.1rem * var(--display-size)); color: var(--text); margin: 1.5em 0 .25em; }
