/* EOL Arcade: shared styles for /arcade/ and /arcade/play/ */
:root {
	--bg: #0a1124;
	--surface: #131c36;
	--surface-2: #1b2648;
	--band: #0f1a38;
	--ad-bg: #0d1530;
	--line: #22305a;
	--line-2: #2a3866;
	--text: #f3f5fb;
	--soft: #c3cbe0;
	--muted: #a9b3ce;
	--faint: #8e99b8;
	--orange: #ff9a3c;
	--orange-ink: #1a1206;
	--link: #ffb46b;
	--cyan: #48d7f0;
	--cyan-ink: #04202a;
	--display: "Bricolage Grotesque", system-ui, sans-serif;
	--body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
	--gutter: max(16px, 3%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--link); }
a:hover { color: #ffd2a3; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--orange); color: var(--orange-ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { max-width: 1360px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); }
.top-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding-top: 16px; padding-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-text { font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: -.01em; }
.logo-text b { color: var(--orange); font-weight: 800; }
.search { flex: 1 1 320px; min-width: 0; max-width: 580px; position: relative; }
.search svg { position: absolute; left: 17px; top: 14px; color: var(--faint); pointer-events: none; }
.search input { width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 0 18px 0 46px; font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--cyan); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav a { color: #e1e6f3; text-decoration: none; font-weight: 600; font-size: 15px; padding: 12px 14px; border-radius: 10px; }
.nav a:hover { background: var(--surface); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; }
.chip { flex: none; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: #e1e6f3; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--orange); }
.chip .n { opacity: .7; font-weight: 600; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--orange-ink); }
@media (max-width: 720px) {
	.nav { display: none; }
	.chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
	.chips::-webkit-scrollbar { display: none; }
}

/* ---------- intro + grid ---------- */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; padding-top: 30px; padding-bottom: 18px; }
.intro h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 38px); line-height: 1.08; letter-spacing: -.02em; max-width: 760px; }
.intro p { margin: 0; color: var(--muted); font-size: 15px; }
.result { margin: 0 0 14px; color: var(--muted); font-size: 14px; min-height: 21px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, calc(50% - 8px)), 1fr)); grid-auto-flow: dense; gap: 16px; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--text); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.tile:hover { color: var(--text); transform: perspective(900px) rotateX(5deg) translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); border-color: var(--orange); }
.tile-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.tile-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.badges { display: flex; gap: 6px; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 8px; border-radius: 999px; background: var(--cyan); color: var(--cyan-ink); line-height: 1.2; }
.tile-cat .badge { font-size: 10px; padding: 2px 7px; margin-right: 6px; vertical-align: 1px; }
.badge--new { background: var(--orange); color: var(--orange-ink); }
.badge--daily { background: var(--text); color: var(--bg); }
.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.tile-title { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-blurb { display: none; }
.tile-cat { color: var(--muted); font-size: 12.5px; }
.tile--big { grid-column: span 2; grid-row: span 2; }
.tile--big .tile-media { aspect-ratio: auto; flex: 1 1 auto; min-height: 240px; }
.tile--big .tile-title { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; -webkit-line-clamp: 3; }
.tile--big .tile-blurb { display: block; color: var(--soft); font-size: 14px; line-height: 1.45; }
.grid.is-filtered .tile--big { grid-column: auto; grid-row: auto; }
.grid.is-filtered .tile--big .tile-media { aspect-ratio: 4 / 3; flex: none; min-height: 0; }
.grid.is-filtered .tile--big .tile-title { font-family: var(--body); font-weight: 700; font-size: 15px; -webkit-line-clamp: 2; }
.grid.is-filtered .tile-blurb { display: none; }
.empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: 18px; color: var(--muted); font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .tile, .tile:hover { transition: none; transform: none; } }

/* ---------- ads: labelled, spaced from games, hidden when Google has nothing to show ---------- */
/* The frame and label appear only once Google fills the slot; an empty or blocked slot takes almost no space. */
.ad { border-radius: 16px; border: 1px solid transparent; padding: 0; }
.ad-label { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; visibility: hidden; height: 0; margin: 0; }
.ad ins { display: block; }
.ad:has(ins[data-ad-status="filled"]) { border-color: var(--line); background: var(--ad-bg); padding: 12px 14px 14px; }
.ad:has(ins[data-ad-status="filled"]) .ad-label { visibility: visible; height: auto; margin-bottom: 8px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.grid .ad { grid-column: 1 / -1; }
.grid .ad:has(ins[data-ad-status="filled"]) { margin: 18px 0; }
.ad-row { margin-top: 48px; }
body[data-page="play"] .ad-row { margin-top: 72px; } /* keeps the ad well clear of the game window */

/* ---------- 3D & VR band ---------- */
.band { margin-top: 56px; }
.band-inner { background: var(--band); border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.band-copy { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { color: var(--cyan); font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.band h2, .sec h2, .guides h2 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; }
.band h2 { font-size: clamp(30px, 4vw, 42px); }
.band p { margin: 0; color: var(--soft); font-size: 16px; line-height: 1.6; max-width: 520px; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.mode { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.mode svg { color: var(--cyan); }
.mode strong { font-size: 16px; }
.mode span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.band-media { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.vr-card { position: relative; display: block; border-radius: 20px; overflow: hidden; aspect-ratio: 1200 / 630; border: 1px solid var(--line); transition: transform .25s ease, border-color .25s ease; }
.vr-card:hover { transform: translateY(-3px); border-color: var(--cyan); }
.vr-card img { width: 100%; height: 100%; object-fit: cover; }
.vr-cta { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; background: var(--cyan); color: var(--cyan-ink); font-weight: 800; font-size: 15px; padding: 12px 18px; border-radius: 999px; }
.band-note { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- sections ---------- */
.sec { margin-top: 56px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.sec h2 { font-size: 28px; }
.sec-head span { color: var(--muted); font-size: 14px; }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mini { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; text-decoration: none; color: var(--text); transition: border-color .2s ease; }
.mini:hover { border-color: var(--orange); color: var(--text); }
.mini img { width: 88px; height: 66px; object-fit: cover; border-radius: 10px; flex: none; }
.mini strong { display: block; font-size: 15px; line-height: 1.3; }
.mini small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.guides { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 40px; }
.guides-copy { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.guides h2 { font-size: 28px; }
.guides-copy p { margin: 0; color: var(--soft); font-size: 15px; line-height: 1.6; }
.guide-list { flex: 2 1 560px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.guide { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-decoration: none; color: var(--text); }
.guide:hover { border-color: var(--orange); color: var(--text); }
.guide strong { font-size: 16px; }
.guide span { color: var(--muted); font-size: 14px; }
.guide em { font-style: normal; color: var(--link); font-weight: 700; font-size: 14px; }

/* ---------- footer ---------- */
.foot { margin-top: 56px; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 28px; color: var(--muted); font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot a { color: var(--soft); text-decoration: none; padding: 10px 0; }
.foot a:hover { color: var(--text); }

/* ---------- play page ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; min-width: 0; }
.crumbs a { color: var(--soft); text-decoration: none; padding: 10px 0; }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); }
.btn-ghost { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); color: #e1e6f3; text-decoration: none; font-weight: 700; font-size: 14px; }
.btn-ghost:hover { border-color: var(--orange); color: var(--text); }
.play-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 24px; }
.play-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.stage { background: #fff; color: #1a2332; border-radius: 22px; border: 1px solid var(--line); overflow: hidden; }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px 12px 20px; background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line); }
.stage-bar h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.15; }
.stage-bar .badges { position: static; margin-top: 6px; }
.stage-tools { display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: #e1e6f3; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--cyan); }
#game { padding: 22px 18px 28px; min-height: 420px; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.stage:fullscreen { border-radius: 0; overflow: auto; }
.stage:fullscreen #game { min-height: calc(100vh - 70px); }
.howto { margin: 0; color: var(--soft); font-size: 15px; line-height: 1.55; background: var(--band); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.howto b { color: var(--text); }
.side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card h2, .side h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 20px; }
.card p { margin: 0; color: var(--soft); font-size: 14px; line-height: 1.55; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.next-list { display: flex; flex-direction: column; gap: 10px; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tips .card strong { font-size: 16px; }
.notfound { padding: 40px 12px; text-align: center; }
.notfound a { font-weight: 700; color: #1d5fc4; }

/* engine classes from the Classroom Games hub, scoped to the stage */
#game .gtitle { font-size: 22px; font-weight: 800; color: #14213d; margin: 0 0 6px; text-align: center; }
#game .gscore { font-size: 15px; font-weight: 700; color: #1a73e8; text-align: center; margin: 6px 0; }
#game .gmsg { font-size: 15px; color: #5b6b7f; text-align: center; margin: 8px 0; }
#game .gbtn { display: inline-block; padding: 12px 26px; min-height: 48px; font-size: 16px; font-weight: 700; border: 2px solid #dfe5ee; background: #fff; color: #1a73e8; border-radius: 12px; cursor: pointer; margin: 6px 4px; }
#game .gbtn:hover { border-color: #1a73e8; }
#game .gbtn-primary { background: #1a73e8; border-color: #1a73e8; color: #fff; }
#game .gbtn-primary:hover { background: #1765cc; }
#game .gcenter { text-align: center; }
#game a { color: #1d5fc4; }
@media (max-width: 520px) { #game { padding: 18px 12px 24px; } }
