/* rollercoastergames.net — site styles */
:root {
  --ink: #1b2233;
  --ink-2: #4b5568;
  --ink-3: #6b7489;
  --bg: #eef0f7;
  --surface: #fff;
  --line: #dde1ec;
  --sky: #c3c7dc;
  --nav: #111318;
  --orange: #ff7a00;
  --orange-ink: #b45000;
  --blue: #1565c0;
  --blue-2: #1f7ae0;
  --green: #2fa84a;
  --green-2: #23903c;
  --star: #ffb400;
  --star-off: #cdd2de;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 28, 50, .06), 0 4px 14px rgba(20, 28, 50, .07);
  --shadow-lg: 0 6px 24px rgba(20, 28, 50, .16);
  --maxw: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--orange-ink); }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); margin: 0 0 .4em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); margin: 1.8em 0 .6em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.masthead {
  background: var(--sky) url("https://static.rollercoastergames.net/header.jpg") no-repeat right bottom / auto 100%;
}
.masthead .container { display: flex; align-items: center; min-height: 128px; }
.logo { display: inline-block; }
.logo img { width: 380px; max-width: 72vw; height: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.site-nav { background: var(--nav); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a {
  display: block; padding: 12px 14px; color: #e9ecf3; text-decoration: none; white-space: nowrap;
  font-weight: 600; font-size: .95rem; border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: #ffffff55; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--orange); }

/* ---------- Page bits ---------- */
main { padding-bottom: 48px; }
.page-head { padding: 28px 0 8px; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 760px; }
.breadcrumb { font-size: .88rem; color: var(--ink-3); margin: 18px 0 0; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px 0 2px; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px clamp(18px, 3vw, 36px); }
.prose { max-width: 820px; }
.panel.prose { max-width: none; }
.panel.prose > * { max-width: 860px; }
.prose > :first-child { margin-top: 0; }
.prose li { margin-bottom: .35em; }
.prose ul, .prose ol { padding-left: 1.3em; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 18px; }
.chip {
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--nav); color: #fff; border-color: var(--nav); }
.chip .count { font-weight: 500; opacity: .7; }

/* ---------- Game grid ---------- */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.card:hover, .card:focus-within { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card[hidden] { display: none; }
.card a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card-media { position: relative; aspect-ratio: 6 / 5; background: #d9deea; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9);
  background: var(--green); color: #fff; font-weight: 700; font-size: .95rem;
  padding: 8px 18px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.3);
  opacity: 0; transition: opacity .18s, transform .18s;
}
.card:hover .card-play, .card a:focus-visible .card-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 1.05rem; margin: 0; }
.card-desc { margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.45; }
.card-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--ink-3); }
.grid.compact .card-desc { display: none; }
.grid.compact .card-title { font-size: .95rem; }

.badge { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: #eef1f8; color: var(--ink-2); }
.badge-builder { background: #fff1e3; color: #a84a00; }
.badge-simulator { background: #e6f0ff; color: #1553a8; }
.badge-cablecar { background: #e7f7ec; color: #1d7a36; }
.badge-park { background: #f6e9fb; color: #7d2c9c; }

/* Stars: a 5-star glyph run filled by rating via --r (0-5) */
.stars { --r: 0; display: inline-block; font-size: 15px; line-height: 1; letter-spacing: 1px; white-space: nowrap;
  background: linear-gradient(90deg, var(--star) calc(var(--r) / 5 * 100%), var(--star-off) 0);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars::before { content: "★★★★★"; }
.rating { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Category cards ---------- */
.cats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 8px 0 0; padding: 0; list-style: none; }
.cat-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; text-decoration: none; color: inherit; height: 100%; transition: box-shadow .18s, transform .18s; }
.cat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: inherit; }
.cat-icon { font-size: 1.8rem; line-height: 1; }
.cat-card strong { display: block; font-size: 1.05rem; color: var(--ink); }
.cat-card span { font-size: .9rem; color: var(--ink-2); }

/* ---------- Game page ---------- */
.game-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; padding: 14px 0 16px; }
.game-head h1 { margin: 0 0 4px; }
.game-sub { margin: 0; color: var(--ink-2); }
.game-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.game-tags a.badge { text-decoration: none; }
.game-tags a.badge:hover { filter: brightness(.95); }

.rate { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: .9rem; color: var(--ink-2); }
.rate-avg strong { color: var(--ink); }
.rate-yours { display: flex; align-items: center; gap: 2px; }
.rate-yours > span:first-child { margin-right: 6px; }
.rate-yours button { font: inherit; font-size: 22px; line-height: 1; background: none; border: 0; padding: 2px; cursor: pointer; color: var(--star-off); transition: color .1s, transform .1s; }
.rate-yours button.on { color: var(--star); }
.rate-yours button:hover { transform: scale(1.15); }
.rate-msg { min-height: 1.2em; font-size: .82rem; }

.player-wrap { background: #0f1220; border-radius: var(--radius); padding: clamp(8px, 1.5vw, 16px); box-shadow: var(--shadow-lg); }
.player {
  --w: 4; --h: 3;
  position: relative; margin: 0 auto; background: #000; border-radius: 10px; overflow: hidden;
  aspect-ratio: var(--w) / var(--h);
  width: min(100%, calc(76vh * var(--w) / var(--h)));
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.player:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.player:-webkit-full-screen { width: 100%; height: 100%; }
.poster { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; color: #fff; cursor: pointer; }
.poster-bg { position: absolute; inset: -20px; max-width: none; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(16px) brightness(.55) saturate(1.2); }
.poster-bg.sharp { inset: 0; width: 100%; height: 100%; filter: brightness(.7); }
.poster-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px; text-align: center; }
.poster-thumb { width: min(240px, 42vw); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); border: 3px solid rgba(255,255,255,.85); }
.play-btn {
  display: inline-flex; align-items: center; gap: 10px; background: var(--green); color: #fff;
  font-weight: 800; font-size: clamp(1rem, .9rem + .6vw, 1.3rem); letter-spacing: .02em;
  padding: 12px 30px; border-radius: 999px; border: 2px solid #ffffff40;
  box-shadow: 0 6px 18px rgba(0,0,0,.4), inset 0 -3px 0 rgba(0,0,0,.15);
  transition: transform .12s, background .12s;
}
.poster:hover .play-btn, .poster:focus-visible .play-btn { background: var(--green-2); transform: scale(1.05); }
.play-btn svg { width: 1em; height: 1em; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: #cfd5e6; font-size: .95rem; }

.player-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 4px 2px; color: #b9c0d4; font-size: .88rem; }
.btn {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  background: #ffffff14; color: #fff; border: 1px solid #ffffff2e; border-radius: 8px; padding: 6px 12px; text-decoration: none;
}
.btn:hover { background: #ffffff26; color: #fff; }
.player-bar kbd, .controls kbd { font-family: inherit; }

.game-layout { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 300px; margin-top: 28px; align-items: start; }
.sidebar { position: sticky; top: 64px; }
.sidebar h2 { font-size: 1.1rem; margin: 0 0 12px; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.side-list a { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.side-list a:hover { box-shadow: var(--shadow-lg); transform: translateX(2px); }
.side-list img { width: 84px; height: 70px; object-fit: cover; border-radius: 8px; flex: none; }
.side-list strong { display: block; font-size: .95rem; line-height: 1.3; }
.side-list span { font-size: .8rem; color: var(--ink-3); }

.controls { width: 100%; border-collapse: collapse; margin: .4em 0 1.2em; font-size: .97rem; }
.controls th, .controls td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls th { width: 38%; font-weight: 700; white-space: normal; }
.controls tr:last-child th, .controls tr:last-child td { border-bottom: 0; }
.controls-wrap { background: #f6f7fb; border: 1px solid var(--line); border-radius: 12px; padding: 4px 6px; margin-bottom: 1.2em; }
.tips li::marker { color: var(--orange); }

.faq { margin-top: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 16px; font-weight: 700; 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; font-weight: 400; color: var(--ink-3); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 16px 14px; color: var(--ink-2); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Comments archive */
.comments { margin-top: 28px; }
.comments > details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comments > details > summary::-webkit-details-marker { display: none; }
.comments > details > summary h2 { margin: 0; font-size: 1.25rem; }
.comments > details > summary .toggle { font-size: .9rem; font-weight: 600; color: var(--blue); }
.comments > details[open] > summary .toggle .show { display: none; }
.comments > details:not([open]) > summary .toggle .hide { display: none; }
.comment-list, .comment-list ol { list-style: none; margin: 0; padding: 0; }
.comment-list { margin-top: 18px; }
.comment-list > li { padding: 14px 0; border-top: 1px solid var(--line); }
.comment-list ol { margin: 12px 0 0 22px; padding-left: 16px; border-left: 3px solid var(--line); }
.comment-list ol li { padding: 6px 0; }
.comment { display: flex; gap: 12px; }
.c-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .95rem; }
.c-body { min-width: 0; flex: 1; }
.c-meta { margin: 0 0 2px; font-size: .88rem; color: var(--ink-3); }
.c-meta strong { color: var(--ink); }
.c-text { margin: 0; overflow-wrap: anywhere; }
.comments-note { font-size: .85rem; color: var(--ink-3); margin: 14px 0 0; }

/* Forms (contact) */
.form { display: grid; gap: 14px; max-width: 620px; }
.form label { font-weight: 600; display: block; margin-bottom: 4px; }
.form input[type=text], .form input[type=email], .form textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #c8cedb; border-radius: 10px; background: #fff; }
.form input:focus, .form textarea:focus { outline: 3px solid #1f7ae055; border-color: var(--blue-2); }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.form .hp { position: absolute; left: -9999px; }
.btn-primary { font: inherit; font-weight: 700; cursor: pointer; background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 11px 22px; justify-self: start; }
.btn-primary:hover { background: var(--green-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--nav); color: #b8bfd0; font-size: .92rem; margin-top: 24px; }
.site-footer .container { padding-top: 32px; padding-bottom: 28px; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 2fr 1fr 1fr; }
.site-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: #e2e6f0; text-decoration: none; }
.site-footer a:hover { color: var(--orange); text-decoration: underline; }
.footer-bottom { border-top: 1px solid #ffffff1a; margin-top: 24px; padding-top: 16px; font-size: .85rem; color: #8d95a8; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .game-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .side-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .masthead .container { min-height: 92px; }
  .masthead { background-size: auto 92px; background-position: right -60px bottom; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .rate { align-items: flex-start; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card-desc { display: none; }
  .card-body { padding: 10px 10px 12px; }
  .card-title { font-size: .95rem; }
  .card-meta .badge { display: none; }
  .panel { padding: 18px 16px; }
}
@media (max-width: 560px) {
  .play-name { display: none; }
  .poster-thumb { width: min(160px, 38vw); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
