:root {
  --bg: #e9f0fb;
  --panel: #ffffff;
  --ink: #12204a;
  --muted: #5b6785;
  --line: #d7e0f0;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --radius: 16px;
  --shadow: 0 4px 14px rgba(18, 32, 74, .10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; background: var(--panel); box-shadow: var(--shadow); }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 1.3rem; }
.topnav { display: flex; gap: 6px; }
.topnav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--muted); }
.topnav a:hover { background: var(--bg); color: var(--ink); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 20px 48px; }

/* Cards */
.grid { display: grid; gap: 14px; }
.grid-home { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-flow: dense; }
.card { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card:hover, .card:focus-visible { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 24px rgba(18, 32, 74, .18); }
.card .cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-name { display: block; padding: 8px 12px 10px; font-weight: 800; font-size: .95rem; line-height: 1.3; }
.card-big { grid-column: span 2; grid-row: span 2; }
.card-big .cover { aspect-ratio: 16 / 9.2; }
.card-big .card-name { font-size: 1.25rem; padding-bottom: 2px; }
.card-hook { display: block; padding: 0 12px 12px; color: var(--muted); font-size: .9rem; line-height: 1.4; }
@media (max-width: 560px) { .grid-home { grid-template-columns: repeat(2, 1fr); } }

/* Text covers (for games whose official art we do not use) */
.cover-text { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; background: var(--bg, #ffb703); background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,.35) 0 18%, transparent 19%), radial-gradient(circle at 85% 75%, rgba(0,0,0,.08) 0 22%, transparent 23%); color: var(--fg); padding: 12px; text-align: center; }
.cover-text span { font-weight: 900; font-size: clamp(1.1rem, 3.2vw, 2rem); line-height: 1.05; letter-spacing: -.02em; text-transform: uppercase; }
.card .cover-text span { font-size: 1.15rem; }
.card-big .cover-text span { font-size: clamp(1.6rem, 4vw, 2.6rem); }

/* Game page */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.player { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.frame { position: relative; width: 100%; max-height: calc(100svh - 160px); margin: 0 auto; background: #111; display: grid; place-items: center; overflow: hidden; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame .frame-cover { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; filter: brightness(.75); }
.play-btn { position: relative; z-index: 1; font: inherit; font-weight: 900; font-size: 1.2rem; padding: 14px 34px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.play-btn:hover { filter: brightness(1.05); transform: scale(1.04); }
.frame:fullscreen { max-height: none; }
.gamebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.gamebar-title { display: flex; flex-direction: column; line-height: 1.3; }
.gamebar-title span { color: var(--muted); font-size: .85rem; }
.tools { display: flex; align-items: center; gap: 8px; }
.tools .icon { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); cursor: pointer; }
.tools .icon:hover { background: var(--line); }
.tools .icon[hidden] { display: none; }
.tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toolmsg { font-size: .85rem; color: var(--muted); }
.side h2 { font-size: 1rem; margin: 4px 0 12px; }
.grid-side { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .game-layout { grid-template-columns: 1fr; } .grid-side { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

/* Text */
.prose { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; margin-top: 20px; }
.prose.narrow { max-width: 820px; margin: 20px auto; }
.prose h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; }
.prose h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.hook { font-size: 1.1rem; margin: 0 0 6px; }
.meta, .small { color: var(--muted); font-size: .88rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 16px 0; }
.facts div { background: var(--bg); border-radius: 12px; padding: 8px 12px; }
.facts dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.facts dd { margin: 0; font-weight: 700; }
.prose table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #fff; font: 700 .8rem system-ui, sans-serif; text-align: center; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { font-weight: 800; cursor: pointer; }
details p { margin: 8px 0 0; }
.sources { padding-left: 1.2em; }
.home-intro { max-width: 820px; }
.lead { color: var(--muted); }
.newlist { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.newlist li { display: flex; flex-direction: column; gap: 6px; }

.foot { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: .85rem; }
.foot a { color: var(--muted); }
.grid { align-items: start; }
.card .cover { height: auto; }
.frame .frame-cover.cover-text { place-items: start center; padding-top: 18%; }
.frame .frame-cover.cover-text span { font-size: clamp(1.8rem, 4.5vw, 3.2rem); }
.frame .play-btn { margin-top: 18%; }
.topnav a { white-space: nowrap; }
@media (max-width: 480px) { .top { padding: 10px 14px; } .logo { font-size: 1.15rem; } .topnav { gap: 0; } .topnav a { padding: 6px 8px; font-size: .9rem; } .topnav a:first-child { display: none; } }
