:root {
  --bg: #0b0f17;
  --card: #121a2a;
  --text: #e9eefc;
  --muted: #a9b4d0;
  --accent: #6aa6ff;
  --danger: #ff6a6a;
  --border: rgba(255,255,255,.10);
}

* { box-sizing: border-box; }
body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  margin: 0;
  background: #0b0f17;
  color: #fff;
}

.container{
  width: 100%;
  max-width: 1320px;   /* was likely ~800-900 */
  margin: 0 auto;
  padding: 22px;
}

@media (min-width: 1200px){
  .container{ padding: 30px; }
}


.grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
@media (max-width: 900px){ .grid{ grid-template-columns: 1fr; } }

.card {
  background: rgba(18,26,42,.88);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.row { display:flex; gap: 10px; align-items:center; }
.row > * { flex: 1; }

label { display:block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11,15,23,.65);
  color: var(--text);
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }

button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--accent);
  color: #081225;
  font-weight: 700;
}
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button.danger {
  background: transparent;
  border: 1px solid rgba(255,106,106,.5);
  color: var(--danger);
}

.list { display:flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.game {
  display:flex; gap: 12px; align-items:flex-start; justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(11,15,23,.55);
}
.game h3 { margin: 0; font-size: 15px; }
.game p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.badge {
  font-size: 12px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap;
}

.top-actions { display:flex; gap: 10px; align-items:center; justify-content:flex-end; flex-wrap: wrap; }
small.help { color: var(--muted); display:block; margin-top: 10px; line-height: 1.35; }

.play-wrap { display:flex; flex-direction: column; gap: 12px; }
.play-header { display:flex; gap: 10px; align-items:center; justify-content: space-between; flex-wrap: wrap; }

/* Default (non-fullscreen) iframe sizing */
iframe {
  width: 100%;
  height: min(80vh, 900px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #000;
}

/* Player shell wrapper */
#playerShell {
  width: 100%;
}

/* ✅ Fullscreen: force true full-screen sizing */
#playerShell:fullscreen {
  position: fixed;
  inset: 0;            /* top/right/bottom/left = 0 */
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #000;
  border-radius: 0;
  z-index: 9999;
  display: block;
}

/* Make iframe fill fullscreen shell */
#playerShell:fullscreen #gameFrame {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  display: block;
}

/* Some browsers fullscreen the iframe instead */
#gameFrame:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  display: block;
}
/* ---------- Cereal polish ---------- */

.hero {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.brand { display:flex; gap:12px; align-items:center; }
.logo {
  font-size: 26px;
  width: 46px; height: 46px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
}

.sectionHead {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sectionHead h2 { margin:0; font-size: 18px; }

.searchWrap {
  display:flex;
  gap: 10px;
  align-items:center;
}
#searchInput {
  min-width: 260px;
}
@media (max-width: 520px){
  #searchInput { min-width: 180px; width: 100%; }
  .searchWrap { width: 100%; }
}

/* Categories */
.categoryBar {
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content:flex-end;
}
.chip {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(11,15,23,.45);
  color: var(--text);
  font-weight: 650;
  font-size: 13px;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip.active {
  background: rgba(106,166,255,.18);
  border-color: rgba(106,166,255,.45);
}

/* Grid cards */
.gameGrid {
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px){ .gameGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px){ .gameGrid{ grid-template-columns: 1fr; } }

.gameCard {
  position: relative;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(11,15,23,.55);
  display:flex;
  gap: 12px;
  align-items:flex-start;
  justify-content: space-between;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  will-change: transform;
}
.gameCard:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.18);
}
.gameCard:active {
  transform: translateY(0px) scale(.99);
}

.gameMeta { display:flex; gap: 12px; align-items:center; }
.gameIcon {
  width: 56px; height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.10);
  background:#000;
}
.gameTitle { margin: 0; font-size: 15px; }
.gameDesc { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.gameTag {
  display:inline-block;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ---------- Mouse click animations (ripple) ---------- */
button, .chip, .gameCard { position: relative; overflow: hidden; }

.ripple {
  position:absolute;
  border-radius:999px;
  transform: scale(0);
  animation: ripple .55s ease-out;
  background: rgba(255,255,255,.25);
  pointer-events:none;
}
@keyframes ripple {
  to { transform: scale(3.2); opacity: 0; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce){
  .chip, .gameCard, button { transition:none !important; }
  .ripple { display:none !important; }
}

/* ---------- Animated background polish ---------- */
body::before {
  content:"";
  position: fixed;
  inset: -40%;
  z-index: -2;
  background:
    radial-gradient(800px 500px at 10% 10%, rgba(106,166,255,.22), transparent 60%),
    radial-gradient(700px 480px at 80% 20%, rgba(255,106,180,.14), transparent 60%),
    radial-gradient(900px 600px at 50% 90%, rgba(106,255,200,.10), transparent 60%),
    linear-gradient(120deg, rgba(19,32,66,.65), rgba(11,15,23,.95));
  filter: blur(0px);
  transform: translate3d(0,0,0);
  animation: cerealGlow 14s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes cerealGlow {
  0%   { transform: translate(-2%, -1%) scale(1.02); filter: hue-rotate(0deg); }
  50%  { transform: translate(2%, 1%) scale(1.04); filter: hue-rotate(10deg); }
  100% { transform: translate(-1%, 2%) scale(1.03); filter: hue-rotate(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
}

/* ---------- Modal ---------- */
.modalBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 10000;
}

.modalBackdrop.hidden {
  display: none;
}

.modal {
  width: min(720px, 94vw);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(18,26,42,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  padding: 16px;
  position: relative;
}

.modalClose {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(11,15,23,.50);
  color: var(--text);
  font-weight: 800;
}

.modalTop {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.modalIcon {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: #000;
  object-fit: cover;
  flex: 0 0 auto;
}

.modalTitle {
  margin: 0;
  font-size: 18px;
}

.modalMeta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modalPill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(11,15,23,.45);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.modalDesc {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.modalActions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Make entire game card feel clickable */
.gameCard {
  cursor: pointer;
}

/* ---------- Spacious layout + polish ---------- */

/* Make cards feel roomier */
.card{
  padding: 18px;
  border-radius: 18px;
}
@media (min-width: 900px){
  .card{ padding: 22px; }
}

/* Hero spacing */
.hero{
  margin-bottom: 18px;
}

/* Bigger search input */
#searchInput{
  padding: 12px 14px;
  border-radius: 14px;
}

/* Grid: 4 columns on big screens */
.gameGrid{
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1200px){ .gameGrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px){ .gameGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px){ .gameGrid{ grid-template-columns: 1fr; } }

/* Card polish */
.gameCard{
  padding: 14px;
  border-radius: 18px;
  background: rgba(11,15,23,.62);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.gameCard:hover{
  background: rgba(11,15,23,.72);
  border-color: rgba(255,255,255,.18);
}

.gameIcon{
  width: 62px;
  height: 62px;
  border-radius: 16px;
}

.gameTitle{
  font-size: 16px;
}

.gameDesc{
  font-size: 13px;
  line-height: 1.35;
}

/* Make the Play button look more “premium” when pressed */
button{
  border-radius: 14px;
  padding: 10px 14px;
}
button:active{
  transform: translateY(1px) scale(.99);
}

/* ===== CEREAL FULL-WIDTH OVERRIDES (paste at very bottom) ===== */

/* Stop any flex-centering that can trap the layout */
html, body {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body {
  display: block !important;
}

/* Make your main container actually wide */
.container {
  width: 100% !important;
  max-width: 1600px !important;   /* make it big */
  margin: 0 auto !important;
  padding: 28px !important;
}

/* Make cards stretch full width */
.card {
  width: 100% !important;
  max-width: none !important;
}

/* Make header/hero full width too */
.hero {
  width: 100% !important;
  max-width: none !important;
}

/* Make grid use available width */
.gameGrid {
  width: 100% !important;
  max-width: none !important;
}

/* Optional: more columns on huge screens */
@media (min-width: 1400px) {
  .gameGrid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}

/* ---------- Bigger Cereal Title ---------- */

h1{
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0;
  background: linear-gradient(90deg, #6aa6ff, #ff6ab4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub{
  font-size: 16px;
  color: #9aa3b2;
  margin-top: 6px;
}

<div class="searchWrap">
  <input id="searchInput" type="search" placeholder="Search games…" autocomplete="off" />
  <button id="themeToggle" class="secondary" type="button" aria-label="Toggle theme">🌙</button>
  <button id="refreshBtn" class="secondary" type="button">Refresh</button>
</div>

/* ===== THEME (Dark/Light) ===== */
:root{
  --bg: #0b0f17;
  --panel: rgba(11,15,23,.62);
  --panel2: rgba(18,26,42,.92);
  --text: #ffffff;
  --muted: #a3adbd;
  --border: rgba(255,255,255,.12);
  --chipBg: rgba(11,15,23,.45);
}

html, body{
  background: var(--bg);
  color: var(--text);
}

/* apply variables to your UI */
.card, .gameCard, .modal{
  border-color: var(--border);
}
.gameCard{ background: var(--panel); }
.modal{ background: var(--panel2); }
.gameDesc, .sub, .help, .modalDesc, .modalPill{ color: var(--muted); }
.chip{ background: var(--chipBg); border-color: var(--border); }

/* ===== LIGHT THEME OVERRIDES ===== */
html[data-theme="light"]{
  --bg: #f6f7fb;
  --panel: rgba(255,255,255,.86);
  --panel2: rgba(255,255,255,.94);
  --text: #0b1220;
  --muted: #4b5568;
  --border: rgba(15,23,42,.12);
  --chipBg: rgba(255,255,255,.76);
}

/* make "secondary" buttons readable in light mode */
html[data-theme="light"] .secondary{
  background: rgba(15,23,42,.06);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ===== Favorites / Recent UI ===== */
.rightTools{
  display:flex;
  gap:10px;
  align-items:center;
}

.starBtn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  display:grid;
  place-items:center;
  font-size: 18px;
}

.starBtn.active{
  border-color: rgba(255,215,0,.45);
  box-shadow: 0 0 20px rgba(255,215,0,.18);
}

.emptyState{
  grid-column: 1 / -1;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--muted);
}

/* ===== Play page loading overlay ===== */
.playerWrap{
  position: relative;
  width: 100%;
  height: calc(100vh - 140px);
  min-height: 520px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.35);
}
.playerFrame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.overlay{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,.55);
  z-index: 20;
}
.overlay.hidden{ display:none; }
.overlayCard{
  width: min(460px, 92vw);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(18,26,42,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  padding: 18px;
}
.overlayRow{
  display:flex;
  gap: 12px;
  align-items:center;
}
.spinner{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.9);
  animation: spin .85s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.overlaySub{ color: var(--muted); }

/* ===== CEREAL VISUAL UPGRADE PACK ===== */

body{
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

.container{
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px;
}

/* Glass panels */
.glass{
  background: rgba(20, 28, 45, .38);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glassStrong{
  background: rgba(20, 28, 45, .72);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 70px rgba(0,0,0,.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.title{
  font-size: clamp(46px, 4vw, 64px);
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0;
  background: linear-gradient(90deg, rgba(106,166,255,.95), rgba(255,106,180,.92));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width: 52px; height: 52px;
  border-radius: 18px;
  display:grid; place-items:center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 28px;
  transform-origin: 50% 70%;
  animation: cerealBob 2.6s ease-in-out infinite;
}
@keyframes cerealBob{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }

.controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}
#searchInput{
  min-width: 320px;
  padding: 12px 14px;
  border-radius: 14px;
}
@media (max-width: 700px){
  #searchInput{ min-width: 220px; width: 100%; }
}

/* Panels */
.panel{
  padding: 18px;
  border-radius: 22px;
}

/* HERO */
.heroBanner{
  position: relative;
  overflow:hidden;
  border-radius: 24px;
  min-height: 260px;
  margin-bottom: 18px;
}
.heroBg{
  position:absolute;
  inset:-20%;
  background:
    radial-gradient(900px 520px at 12% 25%, rgba(106,166,255,.32), transparent 60%),
    radial-gradient(760px 520px at 85% 25%, rgba(255,106,180,.22), transparent 60%),
    radial-gradient(900px 600px at 60% 90%, rgba(106,255,200,.12), transparent 60%),
    linear-gradient(120deg, rgba(11,15,23,.65), rgba(11,15,23,.95));
  filter: saturate(1.1);
  animation: heroDrift 14s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes heroDrift{
  0%{ transform: translate(-1%, -1%) scale(1.03); }
  100%{ transform: translate(1%, 1%) scale(1.05); }
}
.heroContent{
  position: relative;
  z-index: 1;
  padding: 18px;
  max-width: 820px;
}
.pill{
  display:inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.88);
  font-weight: 700;
  font-size: 13px;
}
.heroTitle{
  margin: 12px 0 0;
  font-size: clamp(28px, 2.6vw, 40px);
  letter-spacing: -0.5px;
}
.heroDesc{
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}
.heroActions{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Netflix-style tabs */
.tabs{
  display:flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.tab{
  position: relative;
  padding: 8px 2px;
  font-weight: 750;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color .15s ease, transform .15s ease;
}
.tab:hover{ color: var(--text); transform: translateY(-1px); }
.tab.active{ color: var(--text); }
.tab.active::after{
  content:"";
  position:absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(106,166,255,.95), rgba(255,106,180,.92));
}

/* BIG game preview cards */
.gameGrid{
  display:grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1200px){ .gameGrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px){ .gameGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px){ .gameGrid{ grid-template-columns: 1fr; } }

.gameCard{
  position: relative;
  overflow:hidden;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(11,15,23,.55);
  min-height: 180px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, border-color .18s ease;
}
.gameCard:hover{
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.18);
  box-shadow:
    0 18px 70px rgba(0,0,0,.22),
    0 0 28px rgba(106,166,255,.20),
    0 0 55px rgba(255,106,180,.14);
}
.gameThumb{
  position:absolute;
  inset:0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
  transform: scale(1.02);
}
.gameShade{
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.65)),
    radial-gradient(700px 220px at 15% 25%, rgba(106,166,255,.18), transparent 55%);
}
.gameInfo{
  position:absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 10px;
}
.gameText{
  max-width: 72%;
}
.gameName{
  margin:0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.gameBlurb{
  margin: 6px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 13px;
  line-height: 1.3;
}
.badgeRow{
  margin-top: 8px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge{
  display:inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.85);
}

.cardActions{
  display:flex;
  gap: 10px;
  align-items:center;
}

.starBtn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.9);
  display:grid;
  place-items:center;
  font-size: 18px;
}
.starBtn.active{
  border-color: rgba(255,215,0,.45);
  box-shadow: 0 0 20px rgba(255,215,0,.18);
}

.emptyState{
  grid-column: 1 / -1;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
  color: var(--muted);
}

/* ===== Animations: Fade-in + Shine Sweep ===== */

/* Smooth fade-in for cards when they appear */
@keyframes cerealIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gameCard{
  animation: cerealIn .22s ease both;
}

/* Stagger effect using CSS variable */
.gameCard{
  animation-delay: calc(var(--i, 0) * 18ms);
}

/* Shine sweep overlay */
.gameCard::before{
  content:"";
  position:absolute;
  top:-40%;
  left:-60%;
  width: 55%;
  height: 180%;
  transform: rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.10),
    rgba(255,255,255,.22),
    rgba(255,255,255,.10),
    transparent
  );
  opacity: 0;
  filter: blur(.2px);
  pointer-events:none;
}

.gameCard:hover::before{
  opacity: 1;
  animation: cerealShine .75s ease;
}

@keyframes cerealShine{
  from { left: -70%; }
  to   { left: 120%; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce){
  .gameCard{ animation: none !important; }
  .gameCard::before{ display:none !important; }
}

/* ===== Animated Gradient + Glow Background (Cereal) ===== */

/* Base background */
html, body {
  background: #0b0f17;
}

/* Big animated gradient layer */
body::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -3;
  pointer-events: none;

  /* Smooth “moving lights” + gradient */
  background:
    radial-gradient(900px 600px at 15% 25%, rgba(106,166,255,.28), transparent 60%),
    radial-gradient(900px 650px at 85% 20%, rgba(255,106,180,.20), transparent 60%),
    radial-gradient(1100px 700px at 55% 92%, rgba(106,255,200,.12), transparent 60%),
    linear-gradient(120deg, rgba(16,22,35,1), rgba(11,15,23,1));

  filter: saturate(1.1);
  transform: translate3d(0,0,0);
  animation: cerealBgDrift 14s ease-in-out infinite alternate;
}

/* Soft “glow haze” layer */
body::after {
  content: "";
  position: fixed;
  inset: -40%;
  z-index: -2;
  pointer-events: none;

  background:
    radial-gradient(700px 450px at 20% 60%, rgba(106,166,255,.16), transparent 60%),
    radial-gradient(700px 450px at 80% 55%, rgba(255,106,180,.12), transparent 60%),
    radial-gradient(900px 520px at 50% 15%, rgba(255,255,255,.06), transparent 70%);

  filter: blur(22px);
  opacity: .9;
  animation: cerealGlowFloat 10s ease-in-out infinite alternate;
}

@keyframes cerealBgDrift {
  0%   { transform: translate(-2%, -1%) scale(1.03); filter: hue-rotate(0deg) saturate(1.05); }
  50%  { transform: translate(2%, 1%)  scale(1.05); filter: hue-rotate(10deg) saturate(1.12); }
  100% { transform: translate(-1%, 2%) scale(1.04); filter: hue-rotate(-8deg) saturate(1.08); }
}

@keyframes cerealGlowFloat {
  0%   { transform: translate(-1%, 0%) scale(1.02); opacity: .80; }
  100% { transform: translate(1%, 1%)  scale(1.05); opacity: .95; }
}

/* Optional: subtle grain/noise for a premium look */
.bgNoise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none !important; }
}

/* ===== THEME BACKGROUND FIX (paste at bottom) ===== */
:root{
  --pageBg: #0b0f17;
  --pageBg2: #0b0f17;
  --text: #ffffff;
  --muted: #a3adbd;
  --panel: rgba(20, 28, 45, .38);
  --border: rgba(255,255,255,.12);
}

html, body{
  background: var(--pageBg) !important;
  color: var(--text) !important;
}

/* Force background to actually change in light mode */
html[data-theme="light"]{
  --pageBg: #f6f7fb;
  --pageBg2: #ffffff;
  --text: #0b1220;
  --muted: #4b5568;
  --panel: rgba(255,255,255,.82);
  --border: rgba(15,23,42,.12);
}

/* Make sure panels use theme colors */
.glass, .panel, .topbar, .modal, .glassStrong{
  background: var(--panel) !important;
  border-color: var(--border) !important;
}

/* If you have any animated background layers, make them theme-aware */
body::before, body::after{
  background-color: transparent !important;
}

/* Optional: in light mode, reduce heavy dark overlays */
html[data-theme="light"] .gameShade{
  background:
    linear-gradient(180deg, rgba(255,255,255,.00), rgba(0,0,0,.10)),
    radial-gradient(700px 220px at 15% 25%, rgba(106,166,255,.12), transparent 55%) !important;
}

/* ===== Auto Badges: NEW + HOT ===== */
.badge.new{
  border-color: rgba(106,166,255,.35);
  box-shadow: 0 0 18px rgba(106,166,255,.14);
}

.badge.hot{
  border-color: rgba(255,106,180,.35);
  box-shadow: 0 0 18px rgba(255,106,180,.14);
}

/* ===== Continue Playing ===== */
.continueCard{
  display:flex;
  gap: 14px;
  align-items: center;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(11,15,23,.45);
  padding: 14px;
  overflow:hidden;
}

.hidden{ display:none !important; }

.continueThumb{
  width: 180px;
  height: 100px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
  position: relative;
}
.continueThumb::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(0,0,0,.05));
}

.continueInfo{
  flex: 1 1 auto;
  min-width: 200px;
}
.continueTitle{
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.3px;
}
.continueMeta{
  margin: 8px 0 0;
  color: var(--muted);
}

.continueActions{
  flex: 0 0 auto;
  display:flex;
  gap: 10px;
}

@media (max-width: 700px){
  .continueCard{ flex-direction: column; align-items: stretch; }
  .continueThumb{ width: 100%; height: 160px; }
  .continueActions{ justify-content: flex-end; }
}

/* ===== Settings UI ===== */
.settingsGrid{
  margin-top: 14px;
  display:flex;
  flex-direction: column;
  gap: 14px;
}

.settingRow{
  display:flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}

.settingLabel{
  font-weight: 800;
}
.settingHint{
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.settingSelect{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.12);
  color: var(--text);
}
html[data-theme="light"] .settingSelect{
  background: rgba(255,255,255,.8);
  color: var(--text);
}

.settingButtons{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Toggle Switch */
.switch{
  position: relative;
  width: 52px;
  height: 30px;
  display:inline-block;
}
.switch input{ display:none; }
.slider{
  position:absolute;
  inset:0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  transition: .18s ease;
}
.slider::after{
  content:"";
  position:absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  transition: .18s ease;
}
.switch input:checked + .slider{
  background: rgba(106,166,255,.22);
}
.switch input:checked + .slider::after{
  transform: translateX(22px);
}
