/* Platform additions. The app runs under a strict CSP (no inline styles),
   so spacing and layout helpers live here as classes. */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.m-0 { margin: 0; }
.center { text-align: center; }
.full { width: 100%; }
.nowrap { white-space: nowrap; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; align-content: start; }
.stack-sm { display: grid; gap: 8px; align-content: start; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.h-lg { font-size: clamp(2rem, 4vw, 3rem); }
.h-md { font-size: 1.6rem; }
.h-sm { font-size: 1.2rem; }
.lead { font-size: 1.05rem; color: var(--mist); max-width: 680px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; overflow-wrap: anywhere; }
.break { overflow-wrap: anywhere; }
.cart-wrap { position: relative; }
.cart-side { max-width: 300px; margin: 0 auto; width: 100%; }
.red-text { color: #ff6b70; }
.ok-text { color: var(--ok); }

.brand-logo img { width: 240px; height: auto; }
.footer-logo { width: 240px; height: auto; }
.footer-blurb { max-width: 320px; margin-top: 18px; }
.menu > summary.btn { padding: 0 12px 0 6px; }

/* Forms */
.check-row { display: flex; gap: 10px; align-items: center; font-size: 0.92rem; color: var(--mist); margin-bottom: 12px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--action-red); flex-shrink: 0; }
.form-error { color: #ff6b70; font-size: 0.9rem; margin: 0 0 12px; }
.form-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.inline-form .input { flex: 1; min-width: 180px; }
input[type="file"].input { padding: 10px; }
input[type="color"].input { padding: 4px; height: 46px; }

/* Catalog with filter sidebar */
.catalog-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; margin-top: 28px; }
@media (max-width: 960px) { .catalog-layout { grid-template-columns: 1fr; } }
.filter-panel { position: sticky; top: 100px; align-self: start; }
@media (max-width: 960px) { .filter-panel { position: static; } }
.filter-panel .field { margin-bottom: 12px; }
.filter-panel details summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; margin: 6px 0 12px; color: var(--mist); }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
@media (max-width: 400px) { .columns { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
@media (max-width: 1080px) { .split { grid-template-columns: 1fr; } }

/* Studio / admin sub navigation */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0 28px; }
.subnav a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--graphite); font-weight: 600; font-size: 0.88rem; color: var(--mist); }
.subnav a:hover { color: var(--white); border-color: var(--mist); }
.subnav a[aria-current="page"] { background: var(--action-red); border-color: var(--action-red); color: var(--white); }

.list-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.list-row p { margin: 4px 0 0; }

.stars { color: var(--signal-orange); letter-spacing: 2px; white-space: nowrap; }
.stars .off { color: #3a414a; }

/* Ad slots: page sections only, never over the game viewport */
.ad-slot:empty { display: none; }
.ad { margin: 28px 0; padding: 18px 20px; border-radius: var(--radius); border: 1px dashed #3a414a; background: #0e1216; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ad small { font-size: 0.7rem; letter-spacing: 0.16em; color: var(--mist); text-transform: uppercase; }
.ad h3 { margin: 4px 0; font-size: 1.2rem; }
.ad p { margin: 0; color: var(--mist); font-size: 0.9rem; }

/* Game player */
.player { aspect-ratio: 16 / 9; }
.launch-panel { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; }
@media (max-width: 720px) { .launch-panel { grid-template-columns: 1fr; } .launch-panel .cart-side { max-width: 200px; } }
.consent { padding: 16px 18px; border-radius: var(--radius); background: rgba(0, 174, 239, 0.07); border: 1px solid rgba(0, 174, 239, 0.35); font-size: 0.92rem; color: #d9dce1; }
.status-line { font-size: 0.88rem; color: var(--mist); }

/* Multiplayer arena */
.arena-wrap { position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 800 / 480; }
.arena-wrap canvas { width: 100%; height: 100%; display: block; outline: none; }
.arena-wrap:fullscreen { border-radius: 0; border: 0; }
.room-code { font: 800 italic clamp(2.6rem, 8vw, 4.4rem)/1 var(--font-display); letter-spacing: 0.08em; color: var(--cream); margin: 8px 0 18px; }
.team-a { color: #b6c95a; font-weight: 600; }
.team-b { color: #ff6b70; font-weight: 600; }
.touch-controls { display: none; gap: 10px; justify-content: center; margin-top: 14px; }
.touch-controls .btn { min-width: 64px; min-height: 56px; font-size: 1.2rem; touch-action: none; user-select: none; }
@media (pointer: coarse) { .touch-controls { display: flex; } }
.match-status { font: 700 1.4rem var(--font-display); text-transform: uppercase; margin: 14px 0; }

/* Auth art */
.auth-art .inner { text-align: center; }
.auth-art .crest { margin: 0 auto; }
.auth-art h2 { margin-top: 32px; font-size: 2.6rem; }
.auth-art ul { text-align: left; display: inline-grid; }
.auth-form .lead-auth { color: var(--mist); margin: 0 0 28px; }

/* Code */
pre.code { background: var(--carbon); border: 1px solid var(--line); border-radius: 8px; padding: 16px; overflow-x: auto; font-size: 0.85rem; color: var(--cream); white-space: pre; }
pre.json { background: var(--carbon); border: 1px solid var(--line); border-radius: 8px; padding: 16px; overflow: auto; font-size: 0.8rem; max-height: 520px; }

.avatar-img { width: 112px; height: 112px; object-fit: cover; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }

.message { padding: 12px 14px; border-radius: 10px; background: var(--carbon); border: 1px solid var(--line); margin-top: 10px; }
.message.mine { border-color: rgba(249, 1, 11, 0.35); }
.message p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.loading { padding: 80px 0; text-align: center; color: var(--mist); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.gallery img, .gallery video { width: 100%; border-radius: 10px; border: 1px solid var(--line); aspect-ratio: 16 / 10; object-fit: cover; background: #000; }

.badge-state { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--line); color: var(--mist); text-transform: capitalize; }
.badge-state.published, .badge-state.approved, .badge-state.resolved, .badge-state.reviewed, .badge-state.released, .badge-state.verified, .badge-state.paid, .badge-state.active { color: var(--ok); border-color: rgba(43, 213, 118, 0.45); }
.badge-state.pending, .badge-state.open, .badge-state.scheduled, .badge-state.queued, .badge-state.processing, .badge-state.scanning, .badge-state.uploading, .badge-state.draft, .badge-state.requested { color: var(--signal-orange); border-color: rgba(255, 138, 0, 0.45); }
.badge-state.rejected, .badge-state.suspended, .badge-state.refunded, .badge-state.failed, .badge-state.disputed { color: #ff6b70; border-color: rgba(249, 1, 11, 0.45); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.hero-art .tag { background: rgba(8, 11, 13, 0.85); }

.crest-sm { width: 120px; height: auto; margin: 0 auto; }

/* Header fit: six nav items + search + account on laptop widths */
.header-search { min-width: 170px; }
@media (max-width: 1380px) { .main-nav a { padding: 8px 10px; font-size: 0.9rem; } .site-header .wrap { gap: 16px; } }
@media (max-width: 1240px) and (min-width: 1025px) { .site-header .header-search:not(.mobile-search) { display: none; } }
.main-nav a { white-space: nowrap; }
.touch-controls { flex-wrap: wrap; }
.touch-controls .btn { min-width: 56px; padding: 0 12px; }
@media (max-width: 1080px) { .split { grid-template-columns: minmax(0, 1fr); } }
