/* Lostin.games — ink, paper, gold, jade, stone */
:root {
  --ink: #000000;
  --surface: #121413;
  --surface-2: #1b1e1c;
  --line: #2c302e;
  --stone: #8b8f8c;
  --paper: #f3f4f1;
  --gold: #c9a86a;
  --gold-deep: #9c7f47;
  --jade: #4f9a86;
  --jade-deep: #16362f;

  --display: "Shippori Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --body: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.75rem, 6.5vw, 5.25rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --radius: 2px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: var(--paper); text-decoration-color: var(--gold-deep); text-underline-offset: 0.2em; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: 0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
.lede { font-size: var(--step-1); color: #c9ccc8; max-width: 38ch; line-height: 1.5; }
.hint { color: var(--stone); font-size: var(--step--1); font-weight: 400; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* header */
.site-header {
  max-width: var(--max); margin: 0 auto; padding: 22px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 30px; color: var(--paper); flex: none; }
.brand-mark svg { width: 100%; height: auto; }
.brand-name { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.2rem; font-weight: 500; letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 32px; }
.site-nav a { text-decoration: none; color: #c9ccc8; padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--paper); border-bottom-color: var(--gold); }
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .nav-toggle { display: block; background: none; border: 1px solid var(--line); color: var(--paper); font: inherit; padding: 6px 14px; border-radius: var(--radius); }
  .site-header { flex-wrap: wrap; }
  .site-nav { display: none; width: 100%; flex-direction: column; gap: 0; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 var(--step-0)/1 var(--body); padding: 14px 22px; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #dcbf86; color: var(--ink); }
.btn-line { border-color: var(--gold-deep); color: var(--paper); background: transparent; }
.btn-line:hover { border-color: var(--gold); color: var(--gold); }
.btn-quiet { background: transparent; color: #c9ccc8; padding-inline: 4px; border: 0; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.3em; }
.btn-quiet:hover { color: var(--paper); text-decoration-color: var(--gold); }
.btn[disabled] { opacity: .6; cursor: progress; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 28px; }

.status { color: var(--jade); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.02em; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.status::before { content: ""; width: 18px; height: 1px; background: var(--jade); }

/* hero */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(48px, 10vh, 120px) var(--gutter) clamp(64px, 12vh, 140px);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center;
}
.hero h1 { font-weight: 500; }
.hero-play { justify-self: end; width: 100%; max-width: 540px; }
.hero-visual { position: relative; width: 100%; aspect-ratio: 1; }
.hero-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.hero-hint { text-align: center; color: var(--stone); font-size: var(--step--1); min-height: 1.6em; margin: 8px 0 0; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-play { justify-self: center; max-width: 420px; }
}

/* our games */
.our-games { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(64px, 10vh, 120px); }
.our-games > h2 { font-size: var(--step-3); padding-top: 40px; border-top: 1px solid var(--line); margin-bottom: 48px; }
.game-entry { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(36px, 5vw, 72px); align-items: center; }
.game-entry + .game-entry { margin-top: 96px; }
.entry-art { position: relative; display: block; }
.entry-cover { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--line); }
.entry-shot {
  position: absolute; left: 7.5%; top: 11%; width: 42%; aspect-ratio: 16/9; object-fit: cover;
  border: 1px solid var(--gold-deep); box-shadow: 0 20px 50px rgba(0,0,0,.7); background: var(--surface);
}
.entry-shot-empty { display: grid; place-items: center; color: var(--stone); font-size: var(--step--1); border-style: dashed; }
.entry-art:hover .entry-cover { border-color: var(--gold-deep); }
.entry-text h3 { font-size: var(--step-3); }
.entry-text p { color: #c9ccc8; max-width: 40ch; }
@media (max-width: 820px) { .game-entry { grid-template-columns: 1fr; } }

/* split + contact */
.split {
  max-width: var(--max); margin: 0 auto; padding: clamp(48px, 8vh, 96px) var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); border-top: 1px solid var(--line);
}
.split p { color: #c9ccc8; max-width: 52ch; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }
.text-link { color: var(--gold); }
.contact-strip { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 8vh, 96px) var(--gutter); border-top: 1px solid var(--line); }
.contact-strip p { color: #c9ccc8; font-size: var(--step-1); max-width: 50ch; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list a { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.post-list .post-title { font-family: var(--display); font-size: var(--step-1); }
.post-list time, .post-list .post-sum { color: var(--stone); font-size: var(--step--1); }
.post-list-lg .post-sum { font-size: var(--step-0); color: #c9ccc8; }
.post-list a:hover .post-title { color: var(--gold); }

/* page scaffolding */
.page-head { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 8vh, 96px) var(--gutter) 40px; }
.narrow { max-width: calc(68ch + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 96px; }
.prose { line-height: 1.7; }
.prose h2 { margin-top: 1.6em; font-size: var(--step-2); }
.prose p, .prose li { color: #d6d8d4; max-width: 68ch; }
.prose li { margin-bottom: .4em; }
.post h1 { font-size: var(--step-3); }
.post-meta { color: var(--stone); font-size: var(--step--1); margin-top: 40px; }
.draft-note { border-left: 2px solid var(--gold); padding: 8px 14px; color: var(--gold) !important; }
.facts-plain div { display: grid; grid-template-columns: 12rem 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts-plain dt { color: var(--stone); }
.facts-plain dd { margin: 0; }
@media (max-width: 560px) { .facts-plain div { grid-template-columns: 1fr; gap: 2px; } }

/* games grid */
.game-grid { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 96px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 48px 32px; }
.game-card-art img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--line); }
.game-card-body { padding-top: 18px; }
.game-card h2 a { text-decoration: none; }
.game-card p { color: #c9ccc8; }

/* game page */
.game-head { max-width: var(--max); margin: 0 auto; padding: clamp(32px, 6vh, 72px) var(--gutter) 36px; }
.game-head .lede { max-width: 52ch; }
.game-head .cta-row { margin-top: 20px; }
.game-stage { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr; gap: 32px; }
.game-stage:has(.ad-rail) { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 1100px) { .game-stage:has(.ad-rail) { grid-template-columns: 1fr; } }
.player { position: relative; aspect-ratio: var(--aspect, 16/9); background: var(--surface); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.player-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.player-static .player-cover { opacity: 1; }
.player-start { position: relative; font-size: var(--step-1); padding: 18px 30px; }
.player-hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #c9ccc8; font-size: var(--step--1); margin: 0; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; color: var(--stone); font-size: var(--step--1); }
.player-bar p { margin: 0; }
.trailer { margin-top: 32px; aspect-ratio: 16/9; }
.trailer iframe { width: 100%; height: 100%; border: 0; }

.game-body { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 6vw, 96px); }
@media (max-width: 900px) { .game-body { grid-template-columns: 1fr; } }
.game-body .prose h2:first-child { margin-top: 0; }
.facts dl { margin: 0; border-top: 1px solid var(--line); }
.facts dl div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--stone); font-size: var(--step--1); }
.facts dd { margin: 2px 0 0; }
.steam-widget { width: 100%; height: 190px; border: 0; margin-top: 24px; }
.controls { display: grid; gap: 8px; }
.controls div { display: grid; grid-template-columns: 9rem 1fr; gap: 12px; align-items: baseline; }
.controls dd { margin: 0; color: #d6d8d4; }
kbd { font: 500 var(--step--1)/1 var(--body); border: 1px solid var(--line); border-bottom-width: 2px; padding: 4px 8px; border-radius: 3px; background: var(--surface); }

.shots { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 48px; }
.shot-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.shot-row img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--line); }

/* reviews */
.reviews { max-width: var(--max); margin: 0 auto; padding: 56px var(--gutter); border-top: 1px solid var(--line); display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
@media (max-width: 900px) { .reviews { grid-template-columns: 1fr; } }
.seal {
  width: 132px; height: 132px; border: 2px solid var(--gold); outline: 1px solid var(--gold-deep); outline-offset: 4px;
  display: grid; place-content: center; text-align: center; margin: 12px 0 24px; transform: rotate(-2deg);
}
.seal-score { font-family: var(--display); font-size: 2.75rem; line-height: 1; color: var(--gold); }
.seal-count { font-size: var(--step--1); color: var(--stone); margin-top: 6px; padding: 0 8px; }
.dist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: var(--step--1); color: var(--stone); }
.dist li { display: grid; grid-template-columns: 1.5rem 1fr 2rem; gap: 10px; align-items: center; }
.dist .bar { height: 4px; background: var(--surface-2); position: relative; }
.dist .bar i { position: absolute; inset: 0 auto 0 0; background: var(--jade); }

form label { display: grid; gap: 6px; margin-bottom: 18px; font-weight: 500; font-size: var(--step--1); color: #d6d8d4; }
input, textarea, select {
  font: 400 var(--step-0)/1.4 var(--body); color: var(--paper); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold-deep); outline: none; box-shadow: 0 0 0 1px var(--gold-deep); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-msg { margin: 0; font-size: var(--step--1); color: var(--jade); }
.form-msg.error { color: #e08f7a; }
.fine { color: var(--stone); font-size: var(--step--1); margin-top: 14px; }
.turnstile:empty { display: none; }
.turnstile { margin-bottom: 16px; }
.review-form { background: var(--surface); border: 1px solid var(--line); padding: clamp(20px, 3vw, 32px); margin-bottom: 40px; }
.review-form input, .review-form textarea { background: var(--ink); }

.stars { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.star-row { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars legend { font-size: var(--step--1); font-weight: 500; color: #d6d8d4; margin-bottom: 8px; padding: 0; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { width: 34px; height: 34px; margin: 0; cursor: pointer; color: var(--line); display: block; }
.stars label::before { content: ""; display: block; width: 100%; height: 100%; background: currentColor;
  clip-path: polygon(50% 4%, 61% 37%, 96% 37%, 68% 58%, 79% 92%, 50% 71%, 21% 92%, 32% 58%, 4% 37%, 39% 37%); }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--gold); }
.stars input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }

.review-list { list-style: none; padding: 0; margin: 0; }
.review { padding: 22px 0; border-bottom: 1px solid var(--line); }
.review-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.review-name { font-weight: 600; }
.review-stars { color: var(--gold); letter-spacing: 2px; }
.review time { color: var(--stone); font-size: var(--step--1); }
.review p { color: #d6d8d4; white-space: pre-line; margin: 0; max-width: 68ch; }
.review-empty { color: var(--stone); }

.feedback { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 96px; }
.feedback details { border: 1px solid var(--line); }
.feedback summary { cursor: pointer; padding: 22px 24px; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.feedback summary::-webkit-details-marker { display: none; }
.feedback summary > span { display: grid; gap: 4px; }
.feedback summary strong { font-family: var(--display); font-weight: 500; font-size: var(--step-1); }
.feedback summary::after { content: "+"; font-size: 1.6rem; color: var(--gold); line-height: 1; }
.feedback details[open] summary::after { content: "–"; }
.feedback-form { padding: 0 24px 24px; max-width: 760px; }

.play-prompt {
  position: fixed; right: var(--gutter); bottom: 24px; z-index: 20; max-width: 360px;
  background: var(--surface); border: 1px solid var(--gold-deep); padding: 20px 22px; box-shadow: 0 18px 48px rgba(0,0,0,.6);
  animation: rise .35s ease;
}
.play-prompt p { margin: 0; }
.play-prompt .cta-row { margin-top: 14px; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@media (max-width: 560px) { .play-prompt { left: 16px; right: 16px; } }

/* ads */
.ad { min-height: 120px; }
.ad-label { display: block; color: var(--stone); font-size: 0.75rem; margin-bottom: 6px; }
.ad-rail { position: sticky; top: 24px; align-self: start; min-height: 600px; }
.ad-inline { max-width: var(--max); margin: 0 auto 64px; padding: 0 var(--gutter); }
.game-stage .ad-rail { padding: 0; }

/* contact */
.contact-form { max-width: 760px; }

/* admin */
.admin { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 96px; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; color: var(--stone); font: 500 var(--step-0) var(--body); padding: 12px 4px; margin-right: 20px; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--paper); border-bottom-color: var(--gold); }
.admin-item { border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 12px; }
.admin-item.hidden-item { opacity: .5; }
.admin-meta { color: var(--stone); font-size: var(--step--1); display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-item dl { margin: 8px 0 0; display: grid; gap: 8px; }
.admin-item dt { color: var(--stone); font-size: var(--step--1); }
.admin-item dd { margin: 0; white-space: pre-line; }
.admin-actions { display: flex; gap: 12px; margin-top: 12px; }
.admin-actions button { font: 500 var(--step--1) var(--body); background: none; border: 1px solid var(--line); color: var(--paper); padding: 6px 12px; cursor: pointer; border-radius: var(--radius); }
.admin-actions button:hover { border-color: var(--gold); }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 32px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter); display: grid; grid-template-columns: 1fr 2fr; gap: 24px 48px; }
.footer-brand { display: flex; gap: 14px; align-items: center; color: var(--stone); }
.footer-brand p { margin: 0; font-family: var(--display); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: flex-end; }
.footer-nav a { color: #c9ccc8; text-decoration: none; font-size: var(--step--1); }
.footer-nav a:hover { color: var(--gold); }
.footer-copy { grid-column: 1 / -1; color: var(--stone); font-size: var(--step--1); margin: 0; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } .footer-nav { justify-content: flex-start; } }
@media (max-width: 560px) { .player-hint { display: none; } .player-start { font-size: var(--step-0); padding: 14px 22px; } }
