/* Quiciplay — mobile-first dark theme, zero dependencies */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#030712;--surface:#0f172a;--surface-2:#1e293b;--border:#334155;
  --text:#f1f5f9;--muted:#94a3b8;--accent:#7c3aed;--accent-2:#06b6d4;
  --radius:12px;--header:56px;--ad-h:90px;--safe:env(safe-area-inset-bottom,0px);
  color-scheme:dark
}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  background:var(--bg);color:var(--text);line-height:1.5;min-height:100dvh
}
img:not(.game-card__thumb){display:block;max-width:100%;height:auto}
a{color:inherit;text-decoration:none}
button,input{font:inherit;color:inherit;border:none;background:none;cursor:pointer}
:focus-visible{outline:2px solid var(--accent-2);outline-offset:2px}

/* Layout */
.site-header{
  position:sticky;top:0;z-index:100;height:var(--header);
  display:flex;align-items:center;gap:.75rem;padding:0 1rem;
  background:rgba(3,7,18,.92);backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border)
}
.logo{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:1.1rem}
.logo img{width:32px;height:32px}
.header-search{flex:1;max-width:420px;margin-left:auto}
.header-search input{
  width:100%;padding:.55rem .85rem;border-radius:999px;
  background:var(--surface);border:1px solid var(--border)
}
.header-search input::placeholder{color:var(--muted)}

.container{width:min(1200px,100% - 2rem);margin-inline:auto}

/* Ad slots — reserved height prevents CLS */
.ad-slot{
  display:flex;align-items:center;justify-content:center;
  min-height:var(--ad-h);background:var(--surface);
  border:1px dashed var(--border);border-radius:var(--radius);
  overflow:hidden;color:var(--muted);font-size:.75rem
}
.ad-slot--leader{--ad-h:90px;min-height:50px}
.ad-slot--rect{--ad-h:250px;width:300px;max-width:100%}
.ad-slot--mobile{--ad-h:50px;display:none}
.ad-slot.is-filled{border-style:solid;background:transparent}

@media(max-width:768px){
  .ad-slot--desktop{display:none}
  .ad-slot--mobile{display:flex}
  .ad-slot--leader{min-height:50px}
}

/* Hero */
.hero{padding:1.25rem 0 .5rem;text-align:center}
.hero h1{font-size:clamp(1.35rem,4vw,2rem);font-weight:800;letter-spacing:-.02em}
.hero p{color:var(--muted);margin-top:.35rem;font-size:.95rem}

/* Categories */
.category-bar{
  display:flex;gap:.5rem;padding:1rem 0;overflow-x:auto;
  scrollbar-width:none;-webkit-overflow-scrolling:touch
}
.category-bar::-webkit-scrollbar{display:none}
.chip{
  flex:0 0 auto;padding:.45rem .9rem;border-radius:999px;
  background:var(--surface);border:1px solid var(--border);
  font-size:.85rem;white-space:nowrap;transition:background .15s,border-color .15s
}
.chip.is-active,.chip:hover{background:var(--surface-2);border-color:var(--accent)}

/* Game grid */
.games-meta{color:var(--muted);font-size:.85rem;margin-bottom:.75rem}
.games-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:.75rem;padding-bottom:2rem
}
@media(min-width:640px){
  .games-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:1rem}
}

.game-card{
  display:flex;flex-direction:column;border-radius:var(--radius);
  background:var(--surface);border:1px solid var(--border);
  overflow:hidden;transition:transform .15s,border-color .15s
}
.game-card:hover{transform:translateY(-2px);border-color:var(--accent)}
.game-card__media{
  position:relative;width:100%;aspect-ratio:16/10;overflow:hidden;
  background:var(--surface-2);border-radius:var(--radius) var(--radius) 0 0
}
.game-card__thumb{
  display:block;width:100%;height:100%;min-height:160px;
  object-fit:cover;background:var(--surface-2)
}
.game-card__thumb--placeholder{min-height:160px;animation:pulse 1.2s ease infinite}
.game-card__body{padding:.6rem .65rem .75rem}
.game-card__title{
  font-size:.85rem;font-weight:600;line-height:1.25;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden
}
.game-card__cat{font-size:.7rem;color:var(--accent-2);margin-top:.2rem;text-transform:capitalize}

.empty-state{
  grid-column:1/-1;text-align:center;padding:3rem 1rem;color:var(--muted)
}

/* Play page */
.play-layout{display:flex;flex-direction:column;min-height:100dvh}
.play-main{flex:1;display:flex;flex-direction:column;padding:0 1rem 1rem}
.play-toolbar{
  display:flex;align-items:center;gap:.75rem;padding:.75rem 0;
  flex-wrap:wrap
}
.back-btn{
  display:inline-flex;align-items:center;gap:.35rem;padding:.45rem .75rem;
  border-radius:var(--radius);background:var(--surface);border:1px solid var(--border);
  font-size:.85rem
}
.back-btn:hover{border-color:var(--accent)}
.play-title{font-weight:700;font-size:1rem;flex:1;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.play-ads-top{margin-bottom:.75rem}
.play-body{
  display:grid;grid-template-columns:1fr;gap:.75rem;flex:1;min-height:0
}
@media(min-width:1024px){
  .play-body{grid-template-columns:1fr 320px}
}

.game-frame-wrap{
  position:relative;flex:1;min-height:min(70dvh,640px);
  background:#000;border-radius:var(--radius);overflow:hidden;
  border:1px solid var(--border)
}
.game-frame-wrap iframe{
  position:absolute;inset:0;width:100%;height:100%;border:0
}
.play-sidebar{display:flex;flex-direction:column;gap:.75rem}
.play-ads-bottom{margin-top:.75rem}

.frame-loader{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  background:var(--surface);color:var(--muted);font-size:.9rem
}
.frame-loader.is-hidden{display:none}

/* Footer */
.site-footer{
  padding:1.5rem 1rem calc(1.5rem + var(--safe));
  border-top:1px solid var(--border);text-align:center;
  color:var(--muted);font-size:.8rem
}
.site-footer a{color:var(--accent-2)}

/* Skeleton */
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.45}}
.skeleton{border-radius:var(--radius);background:var(--surface-2);animation:pulse 1.2s ease infinite}
.skeleton--card{aspect-ratio:16/10}
