:root{
  --bg0:#1b1c20;
  --bg1:#1b1c20;
  --panel:#23242a;
  --panel2:#26282f;
  --border:rgba(255,255,255,.08);
  --text:#f2f2f2;
  --muted:#9ea3b3;
  --accent:#6c63ff;

  --radius:18px;
  --shadow:0 8px 30px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: #1b1c20; /* solid dark grey */
}

.hidden{ display:none !important; }

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(0,0,0,.25);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
}

/* =========================
   HOME (image 1 vibe)
========================= */
.home{
  height:100vh;
  display:grid;
  place-items:center;
  position:relative;
  overflow:hidden;
}


.homeCenter{
  position:relative;
  text-align:center;
  padding: 28px 22px;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  box-shadow: var(--shadow);
  min-width: min(720px, 92vw);
}

.homeTitle{
  font-weight: 1000;
  letter-spacing: .8px;
  font-size: clamp(44px, 7vw, 88px);
}

.homeSub{
  margin-top: 8px;
  color: var(--muted);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 12px;
}

.homeBtns{
  margin-top: 22px;
  display:flex;
  gap: 12px;
  justify-content:center;
  flex-wrap:wrap;
}

.homeBtn{
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  font-weight: 700;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.homeBtn:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}
.homeBtn.primary{
  background: rgba(124,92,255,.20);
  border-color: rgba(124,92,255,.40);
}
.homeBtn.primary:hover{
  background: rgba(124,92,255,.26);
}

.homeHint{
  margin-top: 16px;
  color: rgba(234,240,255,.65);
  font-size: 13px;
}

/* =========================
   SHELL
========================= */
.shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topbar{
  height: 62px;
  display:grid;
  grid-template-columns: 60px 1fr 380px;
  align-items:center;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.14);
  backdrop-filter: blur(10px);
  position: sticky;
  top:0;
  z-index: 20;
}

.iconBtn{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size: 18px;
}
.iconBtn:hover{ background: rgba(255,255,255,.08); }

.topTitle{
  justify-self:center;
  font-weight: 1000;
  letter-spacing: .5px;
  font-size: 28px;
  cursor:pointer;
  user-select:none;
}

.topRight{
  justify-self:end;
  display:flex;
  align-items:center;
  gap: 10px;
}

.searchWrap{
  position: relative;
  width: min(360px, 40vw);
}
.search{
  width:100%;
  padding: 11px 14px 11px 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline:none;
}
.search::placeholder{ color: rgba(234,240,255,.55); }
.searchIcon{
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .7;
  pointer-events:none;
}

/* Drawer */
.drawer{
  position: fixed;
  top: 62px;
  left: 12px;
  width: 270px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 12px;
  transform: translateX(-110%);
  transition: transform .18s ease;
  z-index: 30;
}
.drawer.open{ transform: translateX(0); }

.drawerHeader{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}
.drawerLogo{
  width: 42px; height: 42px;
  border-radius: 14px;
  display:grid; place-items:center;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
}
.drawerTitle{ font-weight: 900; }
.drawerSub{ font-size: 12px; color: var(--muted); margin-top:2px; }

.drawerBtns{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.drawerBtn{
  width:100%;
  text-align:left;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  font-weight: 700;
}
.drawerBtn:hover{ background: rgba(255,255,255,.08); }
.drawerBtn.active{
  background: rgba(124,92,255,.18);
  border-color: rgba(124,92,255,.40);
}
.drawerBtn.ghost{
  background: transparent;
}

.backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 25;
}

/* Main */
.main{
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 14px 26px;
}

.page{ display:none; }
.page.active{ display:block; }

/* =========================
   GAMES GRID (image 2 vibe)
========================= */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.tile{
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  overflow:hidden;
  cursor:pointer;
  position:relative;
  aspect-ratio: 1 / 1;
  transform: translateZ(0);
}
.tile:hover{ border-color: rgba(255,255,255,.18); }

.tileImg{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  filter: saturate(1.08) contrast(1.02);
  transform: scale(1.01);
}

.tileOverlay{
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55));
  opacity: 0;
  transition: opacity .15s ease;
}
.tile:hover .tileOverlay{ opacity: 1; }

.tileTitle{
  position:absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.40);
  backdrop-filter: blur(10px);
  font-weight: 900;
  letter-spacing: .2px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease;
}
.tile:hover .tileTitle{
  opacity: 1;
  transform: translateY(0);
}

.tileChip{
  position:absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  color: rgba(234,240,255,.85);
}

/* PLAYER */
.playerArea{
  margin-top: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow:hidden;
  background: rgba(0,0,0,.16);
  box-shadow: var(--shadow);

  /* key change: player can grow without looking squished */
  display:flex;
  flex-direction:column;
}

/* normal mode sizing */
.playerArea:not(.theater){
  height: min(72vh, 760px);   /* big but not insane */
}



/* full screen class (backup styling) */
.playerArea.isFullscreen{
  border-radius: 0;
  border: 0;
  height: 100vh;
}

.playerBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.14);
  flex: 0 0 auto;
}

/* IMPORTANT: iframe fills whatever height playerArea has */
.player{
  width:100%;
  height: 100%;
  flex: 1 1 auto;
  border:0;
  background:#000;

  /* prevents weird shrinking on some browsers */
  display:block;
}

/* Fit/Fill modes (works for games that use responsive canvas) */
.playerArea.fit .player {  /* default */
  /* nothing special, game gets full iframe */
}

/* =========================
   WIP PAGES
========================= */
.wipCard{
  margin: 18px auto 0;
  max-width: 760px;
  padding: 22px;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.20);
  box-shadow: var(--shadow);
  text-align:center;
}
.wipTitle{
  font-size: 40px;
  font-weight: 1000;
  letter-spacing:.4px;
}
.wipSub{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
/* GAME PAGE LAYOUT */
.gamePage{
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* make the game feel like its own page */
#page-game .playerArea{
  margin-top: 0;
  height: calc(100vh - 90px); /* fills screen under top bar */
}

/* description card below (scroll down) */
.gameInfoCard{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  padding: 16px;
}

.divider{
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 14px 0;
}
.backdrop.hidden{
  pointer-events: none;
}