/* Play Parking — style.css : tokens, base, layout, components */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eceff3;
  --text: #141821;
  --muted: #535d6c;
  --border: #d9dee6;
  --brand: #0b5cd0;
  --brand-strong: #0847a3;
  --brand-ink: #ffffff;
  --accent: #ffc21a;
  --accent-strong: #f0ad00;
  --accent-ink: #17181b;
  --success: #17804a;
  --danger: #b8232f;
  --asphalt: #262b33;
  --focus: #0b5cd0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .07);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1200px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Arial Narrow", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1217;
  --surface: #161b22;
  --surface-2: #1e252e;
  --text: #e8ecf1;
  --muted: #a4aebb;
  --border: #2a323d;
  --brand: #5b9dff;
  --brand-strong: #86b6ff;
  --brand-ink: #0b1220;
  --success: #3ccf7e;
  --danger: #ff6b76;
  --focus: #86b6ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1217;
    --surface: #161b22;
    --surface-2: #1e252e;
    --text: #e8ecf1;
    --muted: #a4aebb;
    --border: #2a323d;
    --brand: #5b9dff;
    --brand-strong: #86b6ff;
    --brand-ink: #0b1220;
    --success: #3ccf7e;
    --danger: #ff6b76;
    --focus: #86b6ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); font-weight: 850; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 750; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
kbd {
  font: 600 .85em/1 var(--font);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .15em .45em;
  white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-tight { padding: 28px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.logo svg { width: 38px; height: 38px; }
.logo-text { font-family: var(--font-display); font-weight: 900; font-size: 1.28rem; letter-spacing: .04em; line-height: 1; }
.logo-text span { color: var(--brand); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 650; font-size: .98rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-2); color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-icon-dark { display: none; }
[aria-pressed="true"] .theme-icon-dark { display: block; }
[aria-pressed="true"] .theme-icon-light { display: none; }
.nav-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 2px solid transparent;
  font: 750 1rem/1.1 var(--font); text-decoration: none; cursor: pointer; transition: background .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-secondary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: .92rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    linear-gradient(90deg, rgba(255,255,255,.08) 2px, transparent 2px) 0 0 / 64px 100%,
    linear-gradient(180deg, #1c2129 0%, #262c35 100%);
  border-bottom: 6px solid var(--accent);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 4px;
  background: repeating-linear-gradient(90deg, #ffc21a 0 34px, transparent 34px 60px); opacity: .7;
}
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 56px 16px 64px; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero .tagline { color: var(--accent); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; font-size: .95rem; margin-bottom: .6em; }
.hero p.hero-text { color: #d7dde6; font-size: 1.15rem; max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.hero-art { justify-self: center; width: 100%; max-width: 440px; }
.hero-art img { width: 100%; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }

/* ---------- search ---------- */
.search-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.search-row { display: flex; gap: 8px; position: relative; }
.search-row input[type="search"] {
  flex: 1; min-width: 0; min-height: 52px; padding: 12px 16px 12px 46px; font: 500 1.08rem var(--font);
  border: 2px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text);
}
.search-row input[type="search"]:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.search-row .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-results { margin-top: 14px; }
.search-count { font-size: .9rem; color: var(--muted); margin: 0 0 8px; }
.search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.search-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.search-thumb img { border-radius: 6px; width: 64px; height: 40px; object-fit: cover; }
.search-thumb-ph { display: grid; place-items: center; width: 64px; height: 40px; border-radius: 6px; background: var(--surface-2); }
.search-type { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.search-title { font-weight: 750; text-decoration: none; }
.search-title:hover { text-decoration: underline; }
.search-desc { margin: 2px 0 0; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.search-empty { padding: 12px; border: 1px dashed var(--border); border-radius: 10px; }
.search-empty p { margin: 0 0 4px; }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.game-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.game-card:hover { transform: translateY(-2px); }
.game-card-thumb { display: block; aspect-ratio: 16 / 10; background: var(--asphalt); }
.game-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.game-card-title { font-size: 1.12rem; margin: 0; }
.game-card-title a { color: var(--text); text-decoration: none; }
.game-card-title a:hover { color: var(--brand); text-decoration: underline; }
.game-card-desc { font-size: .95rem; color: var(--muted); margin: 0; line-height: 1.5; }
.game-card-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.game-card-meta li, .tag {
  font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.diff-easy { color: var(--success) !important; }
.diff-medium { color: #9a6700 !important; }
.diff-hard { color: var(--danger) !important; }
:root[data-theme="dark"] .diff-medium { color: #e3b341 !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diff-medium { color: #e3b341 !important; } }
.game-card-actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 40px; min-height: 38px; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--danger); border-radius: 10px;
  cursor: pointer; font-size: 1.15rem; padding: 4px 10px;
}
.fav-btn:hover { background: var(--surface-2); }
.fav-btn .fav-label { font-size: .92rem; font-weight: 700; color: var(--text); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cat-card {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.cat-card:hover { border-color: var(--brand); color: var(--text); }
.cat-card img { width: 56px; height: 56px; flex-shrink: 0; }
.cat-card strong { display: block; font-size: 1.05rem; }
.cat-card span { display: block; font-size: .88rem; color: var(--muted); line-height: 1.4; }

.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.guide-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--brand);
}
.guide-card h3 { font-size: 1.05rem; margin: 0; }
.guide-card h3 a { color: var(--text); text-decoration: none; }
.guide-card h3 a:hover { color: var(--brand); text-decoration: underline; }
.guide-card p { margin: 0; font-size: .93rem; color: var(--muted); line-height: 1.5; }
.guide-card .meta { font-size: .8rem; color: var(--muted); font-weight: 650; }

/* ---------- editorial blocks ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature h3 { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; }
.feature h3 .ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 1rem; flex-shrink: 0; }
.feature p { margin: 0; color: var(--muted); font-size: .96rem; }
.tips-list { counter-reset: tip; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tips-list li { counter-increment: tip; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tips-list li::before {
  content: counter(tip); position: absolute; left: 14px; top: 13px; width: 30px; height: 30px; border-radius: 7px;
  background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.tips-list strong { display: block; }
.callout { padding: 16px 18px; border-left: 5px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.callout p:last-child { margin: 0; }

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: .9rem; padding: 14px 0 0; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; color: var(--muted); padding: 0 2px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 650; }

.page-head { padding: 16px 0 12px; }
.page-head h1 { margin-bottom: .25em; }
.page-head .lead { margin: 0; }
.byline { font-size: .9rem; color: var(--muted); margin-top: 10px; }

/* ---------- prose ---------- */
.layout-article { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0 1.4em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose thead th { background: var(--surface-2); }
.prose aside.note, .note {
  margin: 1.4em 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2);
  border-left: 5px solid var(--brand); font-size: .98rem;
}
.sidebar { position: sticky; top: 84px; display: grid; gap: 18px; }
.side-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.side-box h2 { font-size: 1.02rem; margin-bottom: 10px; }
.side-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.side-box li a { font-weight: 650; text-decoration: none; }
.side-box li a:hover { text-decoration: underline; }
.toc ol { margin: 0; padding-left: 1.2em; font-size: .93rem; }
.toc li { margin-bottom: 4px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; font-weight: 750; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 16px 14px; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

/* ---------- filters ---------- */
.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end;
  padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px;
}
.filters label { display: grid; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.filters select, .filters input {
  min-height: 44px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text); font: 500 .95rem var(--font); width: 100%;
}
.filters .filter-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; grid-column: 1 / -1; flex-wrap: wrap; }
.filter-count { font-size: .9rem; color: var(--muted); margin: 0; }
.empty-state { padding: 26px; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); }

/* ---------- ads ---------- */
.ad-container {
  margin: 28px auto; min-height: 120px; max-width: 970px; display: grid; place-items: center;
  border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); position: relative;
}
.ad-container::before {
  content: "Advertisement"; position: absolute; top: 6px; left: 10px; font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.ad-container:empty::after { content: ""; }

/* ---------- footer ---------- */
.site-footer { margin-top: 56px; background: var(--asphalt); color: #cfd6df; border-top: 6px solid var(--accent); }
.site-footer a { color: #e8edf3; text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; padding: 44px 16px 28px; }
.footer-grid h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: .95rem; }
.footer-brand p { font-size: .93rem; color: #aeb8c4; margin-top: 12px; }
.footer-brand .logo { color: #fff; }
.footer-brand .logo-text span { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px; font-size: .85rem; color: #aeb8c4; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }

/* ---------- misc ---------- */
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pill-links a { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-weight: 650; font-size: .93rem; }
.pill-links a:hover { border-color: var(--brand); }
.notfound { text-align: center; padding: 40px 0 10px; }
.notfound svg { margin: 0 auto 18px; width: 220px; }
.sitemap-list { columns: 2 260px; }
.sitemap-list li { break-inside: avoid; }
.contact-box { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stack > * + * { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .game-card:hover { transform: none; }
}

/* consent bar (only shown when analytics is configured and consent is required) */
.consent-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80; max-width: 720px; margin: 0 auto;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.consent-bar p { margin: 0; font-size: .95rem; }
.consent-actions { display: flex; gap: 8px; }
