/* To The Max — shared styles. Dark pit-lane look, red + kerb-yellow accents. */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,800;1,800&family=Inter:wght@400;600&display=swap");

:root {
  --bg: #0b0b0f;
  --panel: #15151c;
  --panel-2: #1d1d27;
  --line: #2a2a36;
  --text: #f2f2f5;
  --muted: #9a9aab;
  --red: #ff2a2a;
  --red-dark: #b3121a;
  --yellow: #ffc400;
  --green: #22d36b;
  --radius: 10px;
  --max: 1200px;
  --head: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, .head { font-family: var(--head); font-weight: 800; line-height: 1.02; letter-spacing: .01em; margin: 0 0 .4em; text-transform: uppercase; }
h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.kicker { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; color: var(--red); }

/* chequered + kerb stripes */
.kerb { height: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 28px, #fff 28px 56px); }
.cheq { height: 14px; background: conic-gradient(#fff 25%, #000 0 50%, #fff 0 75%, #000 0) 0 0 / 14px 14px; opacity: .9; }

/* header */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(11, 11, 15, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 62px; flex-wrap: wrap; }
.logo { font-family: var(--head); font-weight: 800; font-style: italic; font-size: 1.9rem; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.logo b { color: var(--red); }
.logo span { display: inline-block; transform: skewX(-12deg); background: var(--red); color: #fff; padding: 0 .2em; margin: 0 .08em; }
.logo i { font-style: italic; color: var(--yellow); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { text-decoration: none; font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-radius: 6px; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.nav a.cta { background: var(--red); color: #fff; }
.nav a.cta:hover { background: var(--red-dark); }

/* ticker */
.ticker { background: var(--red); color: #fff; overflow: hidden; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.ticker .track { display: inline-block; padding: 7px 0; animation: tick 90s linear infinite; }
.ticker a { text-decoration: none; margin-right: 48px; }
.ticker a::before { content: "▶ "; opacity: .7; }
.ticker:hover .track { animation-play-state: paused; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* buttons, cards, grid */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; padding: 12px 22px; border-radius: 8px; border: 0; background: var(--red); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--red-dark); }
.btn.ghost { background: transparent; border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--text); }
.btn.yellow { background: var(--yellow); color: #111; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--red); transform: translateY(-2px); }
.card .src { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--yellow); font-weight: 600; }
.card h3 { font-size: 1.2rem; text-transform: none; font-family: var(--body); font-weight: 600; line-height: 1.3; margin: 0; }
.card p { color: var(--muted); font-size: .92rem; margin: 0; }
.card time { font-size: .8rem; color: var(--muted); margin-top: auto; }

section { padding-block: 44px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-head h2 { margin: 0; }

/* ad + sponsor slots: clearly labelled so readers never mistake them for editorial */
.ad { border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); display: grid; place-items: center; text-align: center; font-size: .85rem; min-height: 100px; background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(255, 255, 255, .02) 12px 24px); }
.ad::before { content: "Advertisement"; display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .15em; margin-bottom: 4px; }

/* forms */
input, select, button { font: inherit; }
.field { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: 8px; min-width: 0; }
.field:focus { outline: 2px solid var(--red); outline-offset: 1px; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 36px; color: var(--muted); font-size: .88rem; margin-top: 40px; }
.site-foot .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.site-foot a { color: var(--muted); text-decoration: none; display: block; padding: 2px 0; }
.site-foot a:hover { color: var(--text); }
.legal { margin-top: 24px; font-size: .78rem; line-height: 1.5; }

/* game shell */
.game-wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px; }
.game-stage { position: relative; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.game-stage canvas { display: block; width: 100%; height: auto; touch-action: none; }
.hud { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.hud .stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-width: 110px; }
.hud .stat b { display: block; font-family: var(--head); font-size: 1.6rem; line-height: 1; }
.hud .stat small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* ---- Ad layout (gptoday-style): top banner, side rails, in-feed tiles ----
   Every slot is a .ad box with its IAB size in data-size; swap the inner HTML for the ad tag later.
   Policy: every ad stays labelled ("Advertisement" / "Sponsored") — AdSense and consumer law require it. */
.top-banner { background: #07070a; border-bottom: 1px solid var(--line); padding-block: 10px; }
.top-banner .ad { margin: 0 auto; max-width: 970px; min-height: 90px; }
@media (max-width: 760px) { .top-banner .ad { max-width: 320px; min-height: 100px; } }

.page-grid { max-width: 1440px; margin: 0 auto; padding-inline: 16px; display: grid; gap: 24px;
  grid-template-columns: minmax(0, 1fr); align-items: start; }
.rail { display: none; }
.rail .ad { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); }
.rail .ad + .ad { margin-top: 16px; }
@media (min-width: 1024px) { .page-grid { grid-template-columns: minmax(0, 1fr) 300px; } .rail-right { display: block; padding-top: 36px; } }
@media (min-width: 1400px) { .page-grid { grid-template-columns: 160px minmax(0, 1fr) 300px; } .rail-left { display: block; padding-top: 36px; } }
.ad[data-size="300x250"] { min-height: 250px; }
.ad[data-size="300x600"] { min-height: 600px; }
.ad[data-size="160x600"] { min-height: 600px; }
/* the in-article box only shows where the rails are hidden (phones/tablets) */
.ad.inline { min-height: 250px; max-width: 336px; margin: 24px auto; }
@media (min-width: 1024px) { .ad.inline { display: none; } }

/* native in-feed tile: same shape as a news card, clearly marked */
.card.ad-tile { border-style: dashed; background: linear-gradient(160deg, #1b1b10, var(--panel)); }
.card.ad-tile .src { color: var(--muted); }
.card.ad-tile .src b { color: var(--yellow); font-weight: 600; }

/* ---- Hero stats widget (js/stats.js): tabs over the original podium rows; each list scrolls inside the panel ---- */
[data-stats] .st-tabs { display: flex; gap: 4px; margin: 4px 0 6px; background: var(--bg); border-radius: 8px; padding: 4px; }
[data-stats] .st-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; padding: 7px 4px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
[data-stats] .st-tabs button[aria-selected="true"] { background: var(--red); color: #fff; }
[data-stats] .st-tabs button:focus-visible, [data-stats] .st-panel:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; }
[data-stats] .st-panel { max-height: 330px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
[data-stats] .gap { text-align: right; }
[data-stats] .gap small { font-size: .74rem; }
[data-stats] .st-foot { font-size: .74rem; color: var(--muted); margin: 8px 0 0; }

/* ---- Game thumbnail cards (home + /play/) ---- */
.games-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .games-grid { grid-template-columns: minmax(0, 1fr); } }
.game-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: border-color .15s, transform .15s; }
a.game-card:hover { border-color: var(--red); transform: translateY(-2px); }
a.game-card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.game-card img, .game-card .gc-art { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #1c1d22; }
.game-card .gc-art { position: relative; overflow: hidden; background: radial-gradient(circle at 50% 50%, #2b2f38, #15161b); }
/* nose-up car art turned sideways: out of flow so the turned box cannot stretch the 16:9 frame */
.game-card .gc-art img { position: absolute; left: 50%; top: 50%; width: auto; height: 150%; aspect-ratio: auto; transform: translate(-50%, -50%) rotate(90deg); background: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.gc-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.gc-body b { font-family: var(--head); font-weight: 800; text-transform: uppercase; font-size: 1.45rem; line-height: 1; }
.gc-body span { color: var(--muted); font-size: .92rem; }
.gc-body em { margin-top: auto; padding-top: 8px; font-style: normal; color: var(--red); font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.gc-body em::after { content: " →"; }
.game-card.soon { border-style: dashed; }
.game-card.soon em { color: var(--yellow); }
.game-card.soon em::after { content: ""; }
