/* SM Games - sunny "arcade cabinet" theme matching One More Bag's palette. */
:root {
  --paper: #fff9e9;
  --paper-2: #fff3d1;
  --card: #fffdf6;
  --ink: #173f35;
  --ink-2: #2f5a4e;
  --muted: #5f7a70;
  --line: #d9cfb3;
  --yellow: #ffd65a;
  --yellow-2: #ffe389;
  --coral: #f07455;
  --coral-2: #d95b3d;
  --green: #8fbf6b;
  --green-2: #cfe6b4;
  --sky: #cfe9ea;
  --radius: 18px;
  --wrap: 1120px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --shadow: 0 10px 0 -4px rgba(23, 63, 53, .12), 0 18px 40px rgba(23, 63, 53, .12);
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  line-height: 1.55; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; width: 100%; }
a { color: var(--coral-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 800; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.accent { color: var(--coral); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 10; }

/* Header */
.site-header { background: var(--paper); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.25rem; }
.brand:hover { text-decoration: none; }
.logo-mark { flex: none; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav a { color: var(--ink); font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: var(--paper-2); text-decoration: none; }
.nav .btn { padding: 8px 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 14px;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary { background: var(--yellow); }
.btn-primary:hover { background: var(--yellow-2); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-lg { padding: 16px 32px; font-size: 1.2rem; border-radius: 18px; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { box-shadow: none; background: var(--paper-2); }
.btn[aria-pressed="true"] { background: var(--green-2); }

/* Cabinet frame: the game's own look, reused for screenshots and the player */
.cabinet { display: block; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cabinet img { width: 100%; }

/* Hero */
.hero { position: relative; display: grid; gap: 36px; align-items: center; padding: 48px 0 32px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .hero { grid-template-columns: 1fr 1.15fr; padding: 72px 0 48px; } }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: var(--coral-2); margin-bottom: 12px; }
.hero h1 { margin-bottom: 14px; }
.hero h1 .accent { display: block; }
.lede { font-size: 1.25rem; color: var(--ink-2); }
.cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 24px 0 10px; }
.cta-row .fine { color: var(--muted); font-size: .95rem; }
.hero-media { position: relative; }
.hero-media .cabinet { transform: rotate(-1.2deg); }
.hero-phone { position: absolute; right: -6px; bottom: -28px; width: 24%; min-width: 96px; transform: rotate(4deg); display: none; }
@media (min-width: 880px) { .hero-phone { display: block; } }
.hero-empty { text-align: center; display: block; padding: 96px 0; }

/* Sun + hills band */
.band { position: relative; margin-top: 24px; }
.band svg { display: block; width: 100%; height: auto; }

/* Sections */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head p { color: var(--muted); margin: 0; }
.section-alt { background: var(--paper-2); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.section-green { background: var(--green-2); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }

/* Feature cards */
.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px 20px 16px; box-shadow: 0 5px 0 var(--ink); }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--yellow); border: 2px solid var(--ink); margin-bottom: 12px; }
.feature .icon svg { width: 26px; height: 26px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--ink-2); }

/* Gallery */
.gallery { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .gallery { grid-template-columns: 2fr 2fr 1fr; align-items: start; } .gallery .tall { grid-row: span 1; } }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: .9rem; color: var(--muted); margin-top: 8px; }
.gallery .cabinet { background: var(--sky); }
.gallery .tall .cabinet { border-radius: 24px; }

/* Steps */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { position: relative; padding: 18px 18px 14px 18px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: inline-block; font-weight: 800; color: var(--coral-2); margin-bottom: 6px; letter-spacing: .08em; }
.step h3 { margin-bottom: 4px; }
.step p { margin: 0; color: var(--ink-2); }

/* Studio strip */
.studio { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 820px) { .studio { grid-template-columns: 1.2fr 1fr; } }
.studio-card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 24px; box-shadow: 0 5px 0 var(--ink); }
.studio-card h3 { margin-top: 0; }
.studio-card ul { padding-left: 1.1em; margin: 0 0 12px; }
.studio-card li { margin-bottom: 6px; }

/* Grid / cards (multi-game) */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { display: block; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; color: var(--ink); box-shadow: 0 5px 0 var(--ink); transition: transform .12s; }
.card:hover { transform: translateY(-3px); text-decoration: none; }
.card-thumb { aspect-ratio: 16/9; object-fit: cover; width: 100%; border-bottom: 2px solid var(--ink); }
.card-body { display: block; padding: 12px 14px 14px; }
.card-title { display: block; font-weight: 800; font-size: 1.1rem; }
.card-tagline { display: block; color: var(--muted); font-size: .92rem; margin-top: 2px; }
.tags { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.tags li { font-size: .78rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--card); color: var(--ink-2); border: 2px solid var(--ink); }

/* Game page */
.crumbs { color: var(--muted); font-size: .9rem; margin: 20px 0 8px; }
.crumbs a { color: var(--muted); }
.game-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.player { margin: 20px 0 36px; }
.player-stage { position: relative; width: 100%; aspect-ratio: var(--aw, 16) / var(--ah, 9); background: var(--paper-2); border-radius: var(--radius); overflow: hidden; border: 2px solid var(--ink); box-shadow: var(--shadow); max-height: 80vh; }
@media (max-width: 700px) {
  .player-stage { aspect-ratio: auto; height: min(78vh, 720px); }
}
.player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--paper-2); }
.player-cover { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: var(--paper-2); }
.player-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-cover::after { content: ""; position: absolute; inset: 0; background: rgba(23, 63, 53, .18); }
.player-cover .btn { position: relative; z-index: 1; min-width: 200px; }
.player.is-playing .player-cover { display: none; }
.player-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.player-bar .spacer { flex: 1; }
.player-stage:fullscreen { border-radius: 0; border: 0; max-height: none; aspect-ratio: auto; box-shadow: none; }
.player-stage:fullscreen iframe { width: 100%; height: 100%; }
.game-info { display: grid; gap: 36px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 820px) { .game-info { grid-template-columns: 1.1fr 1fr; } }
.controls { border-collapse: collapse; width: 100%; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.controls th, .controls td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.controls tr:last-child th, .controls tr:last-child td { border-bottom: 0; }
.controls th { width: 45%; font-weight: 500; }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--paper-2); border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 8px; padding: 2px 8px; white-space: nowrap; font-weight: 700; }
.note { color: var(--muted); font-size: .92rem; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 700; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tips li { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 12px 14px; }
.tips li strong { color: var(--coral-2); }
.faq details { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 0 14px; margin-bottom: 10px; }
.faq summary { font-weight: 800; padding: 12px 0; cursor: pointer; }
.faq p { padding-bottom: 12px; margin: 0; color: var(--ink-2); }
.share { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Prose pages */
.prose { max-width: 720px; padding: 40px 0 56px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose .lede { margin-bottom: 1.4em; }

/* Footer */
.site-footer { border-top: 2px solid var(--ink); background: var(--ink); color: #d9e7e0; padding: 32px 0 36px; margin-top: 56px; font-size: .95rem; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-brand { display: flex; flex-direction: column; }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: #fff; font-weight: 700; }
.footer-note { margin: 18px auto 0; font-size: .85rem; color: #a9c2b7; }

/* Small screens: keep the header on one line */
.brand-name, .nav a { white-space: nowrap; }
@media (max-width: 520px) {
  .nav { gap: 2px; }
  .nav .btn { display: none; }
  .brand { font-size: 1.1rem; }
}

/* News */
.news .news-post { border-top: 2px solid var(--line); padding-top: 28px; margin-top: 28px; }
.news .news-post h2 { margin-top: 0; }
.news .news-post h2 a { color: var(--ink); }
.news-game { margin-top: 14px; }

/* Ad slots: only rendered when AdSense is configured; kept clear of game controls */
.ad-slot { margin: 32px auto; max-width: 970px; text-align: center; }
.ad-label { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
