/*
 * AntiGames site shell (med-study-rpg.com/antigames/).
 * Tokens copied verbatim from the sister sites (LocalLLMRPG src/styles/global.css:20-55,
 * see ~/.claude/imports/med_study_rpg_design.md §1). Do not change colours here alone:
 * tokens are shared across the med-study-rpg sites and change together.
 * Light scheme only, hard pixel shadows, radius 0, no gradients (dither instead).
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Noto+Serif+TC:wght@400;600&family=VT323&family=Press+Start+2P&display=swap');

@font-face {
  font-family: 'Cubic 11';
  /* relative to this CSS file (design §3: no root-absolute font urls) */
  src: url('fonts/Cubic_11.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: light;

  --bg-cream: #f4ecd8;
  --bg-cream-deep: #eadfc4;
  --bg-dark: #2d1f1a;
  --ink: #1a1410;
  --ink-muted: #5a4a3c;
  --accent-leaf: #6a8c3f;
  --accent-rose: #c44d4d;
  --accent-gold: #d4a04d;
  --accent-sky: #6a9bc4;
  --frame-wood-light: #8c6d4a;
  --frame-wood-dark: #5a3f29;
  --rarity-sr: #a06ac4;
  --paper: #fbf6ea;
  --on-dark: #f4ecd8;
  --footer-bg: #2d1f1a;
  /* secondary text on #2d1f1a (ink-muted would be 1.9:1 there) */
  --on-dark-muted: #d9caa6;

  --font-pixel-cjk: 'Cubic 11', 'Noto Sans TC', 'PingFang TC', sans-serif;
  --font-pixel-num: 'VT323', 'Cubic 11', 'Courier New', monospace;
  --font-pixel-en: 'Press Start 2P', 'Cubic 11', 'Courier New', monospace;
  --font-legible: 'Noto Serif TC', 'Source Han Serif TC', 'PingFang TC', 'Microsoft JhengHei', Georgia, serif;
  --font-ui: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', -apple-system, system-ui, sans-serif;
  --font-code: 'SFMono-Regular', Menlo, Consolas, 'Courier New', monospace;

  --shadow-px: 2px 2px 0 var(--bg-dark);
  --shadow-px-lg: 4px 4px 0 var(--bg-dark);
  --reading-width: 680px;
  --page-width: 1088px;

  --dither: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23d9caa6'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23d9caa6'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

body {
  background: var(--bg-cream);
  background-image: var(--dither);
  color: var(--ink);
  font-family: var(--font-pixel-cjk);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cubic 11 has no bold: never synthesise one, emphasise with a 1px text-shadow. */
h1,
h2,
h3,
h4,
.site-title {
  font-weight: normal;
  text-shadow: 1px 0 0 currentColor;
}

img,
svg {
  max-width: 100%;
}

img.pixel {
  image-rendering: pixelated;
}

a {
  color: var(--frame-wood-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
/* site_shell_audit S6: #a83c3c on the dither dots was 3.84:1; ink is 11.25:1 there (15.49 on cream). */
a:hover {
  color: var(--ink);
  text-decoration-thickness: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent-sky);
  outline-offset: 2px;
}

.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link:focus {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink);
}

/* ── Header ─────────────────────────────────────────────────────── */

.site-header {
  background: var(--bg-dark);
  color: var(--on-dark);
  border-bottom: 4px solid var(--frame-wood-dark);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}
.site-title {
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.site-title:hover {
  color: var(--on-dark);
}
.site-title svg {
  flex: none;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
}
.site-nav a {
  color: var(--on-dark);
  text-decoration: none;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}
.site-nav a[aria-current='page'],
.site-nav a:hover {
  color: var(--accent-gold);
}
.site-nav a[aria-current='page']::before {
  content: '▶';
  font-size: 12px;
  margin-right: 4px;
}
@media (max-width: 420px) {
  .site-nav {
    gap: 0 4px;
  }
  .site-nav a {
    font-size: 15px;
    padding: 0 2px;
  }
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── Footer ─────────────────────────────────────────────────────── */

.site-footer {
  background: var(--footer-bg);
  color: var(--on-dark);
  border-top: 4px solid var(--frame-wood-dark);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
.site-footer__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}
.site-footer p {
  margin: 0;
}
.site-footer a {
  color: var(--accent-gold);
}
.site-footer a:hover {
  color: var(--on-dark);
}

/* ── Components ─────────────────────────────────────────────────── */

.frame {
  background: var(--paper);
  border: 4px solid var(--frame-wood-light);
  outline: 2px solid var(--frame-wood-dark);
  outline-offset: -2px;
  box-shadow: var(--shadow-px-lg);
  padding: 16px;
}

.dialogue {
  background: var(--bg-dark);
  color: var(--on-dark);
  border: 4px solid var(--frame-wood-light);
  box-shadow: var(--shadow-px-lg);
  padding: 16px 16px 24px;
  position: relative;
  line-height: 1.8;
}
.dialogue p {
  margin: 0 0 4px;
}
.dialogue__muted {
  color: var(--on-dark-muted);
  font-family: var(--font-ui);
  font-size: 14px;
}
.dialogue::after {
  content: '▼';
  position: absolute;
  right: 12px;
  bottom: 4px;
  font-size: 12px;
  color: var(--accent-gold);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
  to {
    visibility: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dialogue::after {
    animation: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--font-pixel-cjk);
  font-size: 16px;
  line-height: 1.2;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--bg-dark);
  box-shadow: var(--shadow-px);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  background: var(--bg-cream-deep);
  color: var(--ink);
}
.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--bg-dark);
}
/* #4f6b2e instead of --accent-leaf: cream text on #6a8c3f is only 3.3:1 */
.btn--primary {
  background: #4f6b2e;
  color: var(--on-dark);
}
.btn--primary:hover {
  background: #3f5724;
  color: var(--on-dark);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.6;
  border: 2px solid var(--bg-dark);
  background: var(--accent-gold);
  color: var(--ink);
}
.badge--rose {
  background: #a83c3c;
  color: var(--on-dark);
}
.badge--sky {
  background: var(--accent-sky);
  color: var(--ink);
}
.badge--plain {
  background: var(--bg-cream-deep);
}

.lv {
  font-family: var(--font-pixel-en);
  font-size: 12px;
  letter-spacing: 0;
}
.num {
  font-family: var(--font-pixel-num);
  font-size: 20px;
  line-height: 1;
}

.page-title {
  font-size: 24px;
  line-height: 1.4;
  margin: 0 0 8px;
}
@media (min-width: 768px) {
  .page-title {
    font-size: 32px;
  }
}
.page-lead {
  font-family: var(--font-legible);
  color: var(--ink-muted);
  margin: 0 0 24px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.breadcrumb {
  font-family: var(--font-ui);
  font-size: 14px;
  margin: 0 0 12px;
  -webkit-font-smoothing: antialiased;
}

/* ── Long-form prose (about, credits, references) ───────────────── */

.prose {
  font-family: var(--font-legible);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  max-width: var(--reading-width);
  overflow-wrap: anywhere;
}
@media (min-width: 768px) {
  .prose {
    font-size: 18px;
  }
}
.prose h2,
.prose h3 {
  font-family: var(--font-pixel-cjk);
  line-height: 1.4;
  -webkit-font-smoothing: none;
  scroll-margin-top: 120px;
}
.prose h2 {
  font-size: 24px;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 4px solid var(--frame-wood-light);
}
.prose h2::before {
  content: '◆ ';
  color: var(--accent-gold);
}
.prose h3 {
  font-size: 20px;
  margin: 32px 0 8px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}
.prose li {
  margin-bottom: 4px;
}
.prose strong {
  font-weight: 600;
}
.prose blockquote {
  margin: 24px 0;
  padding: 12px 16px;
  background: var(--paper);
  border-left: 8px solid var(--accent-gold);
  box-shadow: var(--shadow-px);
}
.prose code {
  font-family: var(--font-code);
  font-size: 0.85em;
  background: var(--bg-cream-deep);
  padding: 1px 4px;
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 16px 0 24px;
}
.prose table {
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  min-width: 100%;
}
.prose th,
.prose td {
  border: 2px solid var(--frame-wood-dark);
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--bg-cream-deep);
  font-weight: 500;
}

/* references list */
.ref-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.7;
}
.ref-list li {
  padding: 8px 0;
  border-bottom: 2px dashed var(--bg-cream-deep);
}
.ref-list .ref-id {
  font-family: var(--font-code);
  font-size: 13px;
  color: var(--ink-muted);
  display: block;
}

/* ── Home ───────────────────────────────────────────────────────── */

.hero {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
  max-width: 760px;
}
.hero__wild {
  margin: 0 0 8px;
  font-size: 20px;
}
.hero__boss {
  color: var(--accent-gold);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.hero__sub {
  margin: 0;
  font-family: var(--font-legible);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
.disclaimer-strip {
  margin: 0;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--paper);
  border: 2px solid var(--bg-dark);
  border-left: 8px solid #a83c3c;
  -webkit-font-smoothing: antialiased;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}
.map-title {
  font-size: 24px;
  margin: 0 0 16px;
}
.world-map {
  list-style: none;
  margin: 0 0 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background-color: #c9d9a0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Crect x='3' y='4' width='1' height='2' fill='%23a3bd74'/%3E%3Crect x='11' y='11' width='1' height='2' fill='%23a3bd74'/%3E%3Crect x='12' y='12' width='1' height='1' fill='%23a3bd74'/%3E%3C/svg%3E");
  border: 4px solid var(--frame-wood-light);
  outline: 2px solid var(--frame-wood-dark);
  outline-offset: -2px;
  box-shadow: var(--shadow-px-lg);
}
@media (min-width: 768px) {
  .world-map {
    grid-template-columns: repeat(3, 1fr);
  }
}
.stage__card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 4px 12px;
  height: 100%;
  padding: 12px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--bg-dark);
  border-top: 8px solid var(--accent, var(--accent-gold));
  box-shadow: var(--shadow-px-lg);
}
.stage__sprite {
  grid-row: span 2;
  width: 56px;
  height: 56px;
  background: var(--bg-dark);
  border: 2px solid var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage__sprite img {
  width: 48px;
  height: 48px;
}
.stage__lv {
  margin: 0;
}
.stage__name {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}
.stage__boss {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}
.stage__boss-sub {
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-muted);
  -webkit-font-smoothing: antialiased;
}
.stage__meta {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.map-note {
  font-family: var(--font-ui);
  font-size: 14px;
  margin: 0 0 32px;
  -webkit-font-smoothing: antialiased;
}

/* ── Play page ──────────────────────────────────────────────────── */

.play-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.play-head .page-title {
  margin: 0;
}
.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.game-frame {
  padding: 8px;
}
.game-stage {
  position: relative;
  width: 100%;
  /* keep 16:9 but never taller than the viewport minus chrome */
  max-width: calc((100vh - 220px) * 16 / 9);
  min-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #14161c;
}
@media (min-width: 768px) {
  .game-stage {
    min-width: 0;
    max-width: min(100%, calc((100vh - 220px) * 16 / 9));
  }
}
.game-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #14161c;
}
.play-notes {
  margin: 16px 0 0;
  padding-left: 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  max-width: var(--reading-width);
}
.rotate-hint {
  display: none;
  margin: 0 0 12px;
}
@media (max-width: 767px) and (orientation: portrait) {
  .rotate-hint {
    display: block;
  }
}

/* ── 404 ────────────────────────────────────────────────────────── */

.lost {
  max-width: 560px;
  margin-bottom: 24px;
}
.lost-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ── About #feedback (DECISIONS 2026-10-11 B7) ─────────────────── */
.feedback-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--paper);
  border: 2px solid var(--bg-dark);
  box-shadow: var(--shadow-px);
  font-family: var(--font-ui);
}
.feedback-form label {
  font-family: var(--font-pixel-cjk);
  -webkit-font-smoothing: none;
}
.feedback-form select {
  min-height: 44px;
  padding: 4px 8px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-cream);
  border: 2px solid var(--bg-dark);
  border-radius: 0;
}
.feedback-form__alt,
.feedback-form__status {
  flex-basis: 100%;
  margin: 0;
  font-size: 15px;
  color: var(--ink-muted);
}
.feedback-form__copy {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 14px;
}
