/* Shared layout. Game-specific art lives in art/; themes only set presentation tokens. */
:root {
  color-scheme: dark;
  --page: #141613;
  --ink: #f1f0e8;
  --muted: #afb3a7;
  --line: #34392f;
  --highlight: #d5e8a2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: #d5e8a230; }
a:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--highlight); outline-offset: 6px; }
::selection { background: var(--highlight); color: var(--page); }
.shell { width: min(1440px, 100%); margin-inline: auto; padding: 0 48px; }
.skip-link { position: absolute; top: 12px; left: 12px; z-index: 10; padding: 14px 20px; background: var(--highlight); color: var(--page); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 750; letter-spacing: -.5px; }
.brand-label { margin-left: 8px; font-size: 13px; font-weight: 400; letter-spacing: 1px; color: var(--muted); }
.brand-mark { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; transform: rotate(-8deg); }
.brand-mark i { width: 9px; height: 9px; border-radius: 2px; background: var(--highlight); }
.brand-mark i:nth-child(2) { background: #eeaa77; }
.brand-mark i:nth-child(3) { background: #a79cd6; }
.brand-mark i:nth-child(4) { background: #7cbeac; }
.browse-link { display: flex; align-items: center; gap: 24px; min-height: 44px; padding: 8px 0 8px 12px; text-decoration: none; font-size: 13px; }
.browse-link span { font-size: 22px; color: var(--highlight); }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; padding: 54px 0 52px; }
.eyebrow { margin: 0 0 20px; color: var(--muted); font: 10px/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 2px; }
h1 { margin: 0; font-size: clamp(40px, 4.8vw, 66px); line-height: 1.25; font-weight: 750; letter-spacing: -2px; }
h1 em { font-style: normal; color: var(--highlight); }
.intro-note { padding-bottom: 5px; }
.intro-note p { margin: 20px 0 18px; font-size: 14px; line-height: 1.9; color: #c4c7bb; }
.worlds { display: flex; padding-left: 4px; }
.worlds span { display: grid; place-items: center; width: 48px; height: 48px; margin-left: -4px; border: 3px solid var(--page); border-radius: 50%; font: 30px/1 Georgia, serif; color: #272c23; background: #d5e8a2; transform: rotate(-12deg); }
.worlds span:nth-child(2) { background: #e8ad85; transform: rotate(12deg); }
.worlds span:nth-child(3) { background: #afa0d7; transform: rotate(-25deg); }
.instant { font-size: 11px; color: var(--muted); }
.instant span { margin-right: 6px; color: var(--highlight); font-size: 8px; }
.collection { scroll-margin-top: 24px; }
.collection-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 23px 0; border-top: 1px solid var(--line); }
.collection-header h2 { margin: 0; font-size: 16px; font-weight: 600; }
.collection-header h2 span { margin-left: 10px; color: var(--highlight); }
.collection-header p { margin: 0; font-size: 12px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }

/* A whole card is one link: no nested buttons or hover-only information. */
.game {
  --accent: #d5e8a2;
  --surface: #20251e;
  --cover-ink: #f1f0e8;
  --cover-ground: #303e31;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid #ffffff16;
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.game:focus-visible { outline-color: var(--accent); border-color: var(--accent); }
.cover { position: relative; isolation: isolate; container-type: inline-size; aspect-ratio: 8 / 5; overflow: hidden; border-radius: 11px 11px 0 0; background: var(--cover-ground); color: var(--cover-ink); }
.cover-art { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
/* Tint the title corner with the theme ground so cover text never competes with the artwork. */
.cover::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(18deg, var(--cover-ground) 12%, transparent 60%); opacity: .85; }
.badge { position: absolute; left: 18px; top: 16px; max-width: calc(100% - 66px); border: 1px solid currentColor; padding: 4px 8px; border-radius: 5px; font-size: 11px; line-height: 1.4; letter-spacing: 1px; }
.cover-title { position: absolute; left: 19px; bottom: 20px; right: 16px; font-family: "Arial Black", "Segoe UI", sans-serif; font-size: clamp(25px, 10cqw, 36px); font-weight: 900; line-height: .95; letter-spacing: -1px; overflow-wrap: anywhere; }
.cover-title span { display: block; }
.game-body { flex: 1; display: flex; flex-direction: column; padding: 21px 19px 0; }
.game h3 { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 650; letter-spacing: .3px; color: var(--ink); overflow-wrap: anywhere; }
.desc { margin: 10px 0 19px; font-size: 14px; line-height: 1.85; color: #c1c5bd; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-bottom: 20px; }
.tags span { border-radius: 4px; padding: 4px 7px; color: #d0d3ca; background: #ffffff09; font-size: 11px; line-height: 1.4; }
.card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; min-height: 58px; padding: 14px 0; border-top: 1px solid #ffffff16; }
.play-hint { font-size: 12px; line-height: 1.5; color: #b3b9ad; }
.play-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--accent); }
.play-link span { font-size: 17px; line-height: 1; }

/* Themes describe reusable visual styles, not a second list of games. */
.game.clock { --accent: #f3b77b; --surface: #262019; --cover-ink: #462913; --cover-ground: #efb778; }
.clock .cover-title { font-style: italic; }
.game.sky { --accent: #b7dfc1; --surface: #1d2822; --cover-ink: #213e38; --cover-ground: #c5e8ce; }
.sky .cover-title { font-family: "Trebuchet MS", "Arial Rounded MT Bold", sans-serif; letter-spacing: -1.5px; }
.game.circuit { --accent: #f2d17e; --surface: #1b2927; --cover-ink: #f4daa0; --cover-ground: #173f3b; }
.circuit .cover-title { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: 1px; }
.game.cosmos { --accent: #cdbcf5; --surface: #252132; --cover-ink: #f1e8ff; --cover-ground: #39315b; }
.cosmos .cover-title { font-size: clamp(24px, 9cqw, 32px); font-weight: 350; letter-spacing: 1px; }
.game.survivor { --accent: #c2f777; --surface: #20291b; --cover-ink: #d0fb85; --cover-ground: #1b2d21; }
.survivor .cover-title { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(23px, 9cqw, 32px); letter-spacing: -1.5px; }
.game.forge { --accent: #ffb37b; --surface: #2c201d; --cover-ink: #ffe0a6; --cover-ground: #652d24; }
.forge .cover-title { font-family: Georgia, "Times New Roman", serif; font-weight: 900; }
.game.velocity { --accent: #b3c3ff; --surface: #202437; --cover-ink: #e5ebff; --cover-ground: #222e5d; }
.velocity .cover-title { font-style: italic; letter-spacing: -1.5px; }
.game.wuxia { --accent: #c9d7ad; --surface: #242a23; --cover-ink: #284939; --cover-ground: #d9dfc8; }
.wuxia .cover-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(24px, 9.5cqw, 35px); font-weight: 400; letter-spacing: 2px; }
.wuxia h3 { font-family: "Songti SC", SimSun, serif; letter-spacing: 3px; }

.catalog-status { padding: 38px 20px; margin: 0; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.8; }
.site-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 44px; padding: 30px 0 38px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.site-footer p { margin: 0; line-height: 1.8; }
.site-footer .footer-brand { margin-bottom: 7px; font-size: 13px; color: #d0d3c9; }
.draft-links { display: flex; flex-wrap: wrap; gap: 8px; }
.draft-links a { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; text-decoration: none; }
.draft-links a span { font-size: 10px; color: #d6c09a; }

@media (hover: hover) and (pointer: fine) {
  .game:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 28px #0003; }
  .game:hover .cover-art { transform: scale(1.025); }
  .browse-link:hover, .draft-links a:hover { color: var(--highlight); }
}
@media (max-width: 1199px) {
  .shell { padding-inline: 32px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 959px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { gap: 28px; }
}
@media (max-width: 639px) {
  .shell { padding-inline: 20px; }
  .site-header { min-height: 76px; gap: 12px; }
  .brand { font-size: 16px; gap: 9px; }
  .brand-label { display: none; }
  .browse-link { font-size: 12px; gap: 10px; }
  .intro { display: block; padding: 36px 0 30px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.3px; margin-bottom: 16px; }
  h1 { font-size: clamp(39px, 10vw, 56px); letter-spacing: -1px; }
  .intro-note { padding: 0; }
  .intro-note p { margin: 18px 0 12px; font-size: 13px; }
  .worlds { display: none; }
  .collection-header { padding-block: 21px; gap: 8px; }
  .collection-header h2 { font-size: 15px; }
  .collection-header p { font-size: 11px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .game-body { padding: 22px 22px 0; }
  .card-footer { min-height: 62px; }
  .site-footer { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .game, .cover-art { transition: none; }
  .game:hover, .game:hover .cover-art { transform: none; }
}
@media (forced-colors: active) {
  .game, .badge, .tags span, .draft-links a { border: 1px solid CanvasText; }
  .cover-art { opacity: .2; }
}
