:root{
  --bg:#16161c; --fg:#f7f7f8; --card:#1e1e26; --primary:#7c5cff; --primary-fg:#fcfcfd;
  --muted:#26262e; --muted-fg:#b0b0b8; --border:rgba(255,255,255,.09); --input:rgba(255,255,255,.12);
  --success:#34d399; --warning:#eab308; --destructive:#f87171;
  --glow:0 10px 40px -10px rgba(124,92,255,.55);
  --radius:0.875rem;
}
*{margin:0;padding:0;box-sizing:border-box;border-color:var(--border)}
html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--fg);font-family:'Manrope',sans-serif;-webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:'Unbounded',sans-serif}
a{text-decoration:none;color:inherit}
img{display:block}
.page{position:relative;min-height:100vh;overflow-x:hidden}
.bg-grid{pointer-events:none;position:absolute;left:0;right:0;top:0;height:720px;
  background-image:linear-gradient(to right,rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(to bottom,rgba(255,255,255,.04) 1px,transparent 1px);
  background-size:48px 48px;
  -webkit-mask-image:radial-gradient(ellipse at top,black 30%,transparent 75%);
  mask-image:radial-gradient(ellipse at top,black 30%,transparent 75%)}
.glow-top{pointer-events:none;position:absolute;left:50%;top:-200px;height:500px;width:900px;transform:translateX(-50%);border-radius:9999px;background:rgba(124,92,255,.25);filter:blur(140px)}
.text-gradient{background:linear-gradient(120deg,#a78bfa,#7c5cff 50%,#e879c9);-webkit-background-clip:text;background-clip:text;color:transparent}

/* header */
.header{position:sticky;top:0;z-index:30;border-bottom:1px solid var(--border);background:rgba(22,22,28,.7);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
.header-inner{max-width:80rem;margin:0 auto;height:4rem;display:flex;align-items:center;justify-content:space-between;padding:0 1rem}
@media(min-width:640px){.header-inner{padding:0 1.5rem}}
.logo{display:inline-flex;align-items:center;gap:.625rem}
.logo span{font-family:'Unbounded',sans-serif;font-weight:800;letter-spacing:-.025em;font-size:1.25rem}
.logo.sm span{font-size:1rem}
.btn-primary{border-radius:9999px;background:var(--primary);color:var(--primary-fg);padding:.5rem .875rem;font-size:.75rem;font-weight:700;transition:box-shadow .2s}
.btn-primary:hover{box-shadow:var(--glow)}
@media(min-width:640px){.btn-primary{padding:.5rem 1rem;font-size:.875rem}}

/* hero */
.main{position:relative;max-width:80rem;margin:0 auto;padding:0 1rem}
@media(min-width:640px){.main{padding:0 1.5rem}}
.hero{display:grid;align-items:center;gap:2.5rem;padding:2.5rem 0}
@media(min-width:640px){.hero{padding:4rem 0}}
@media(min-width:1024px){.hero{grid-template-columns:1.1fr 1fr;padding:6rem 0}}
.hero-text{text-align:center}
@media(min-width:1024px){.hero-text{text-align:left}}
.pill{display:inline-flex;align-items:center;gap:.5rem;border-radius:9999px;border:1px solid rgba(124,92,255,.4);background:rgba(124,92,255,.1);padding:.25rem .75rem;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--primary)}
.pill .dot{height:.375rem;width:.375rem;border-radius:9999px;background:var(--success);animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.hero h1{margin-top:1.5rem;font-size:2.4rem;font-weight:900;line-height:1.05;letter-spacing:-.025em}
@media(min-width:400px){.hero h1{font-size:3rem}}
@media(min-width:640px){.hero h1{font-size:3.75rem}}
@media(min-width:1280px){.hero h1{font-size:4.5rem}}
.hero-sub{margin:1.25rem auto 0;max-width:32rem;font-size:1rem;color:var(--muted-fg)}
@media(min-width:640px){.hero-sub{font-size:1.125rem}}
@media(min-width:1024px){.hero-sub{margin-left:0}}
.search-wrap{position:relative;margin:2rem auto 0;max-width:28rem}
@media(min-width:1024px){.search-wrap{margin-left:0}}
.search-icon{position:absolute;z-index:10;left:1.25rem;top:50%;transform:translateY(-50%);height:1.25rem;width:1.25rem;color:var(--muted-fg);pointer-events:none}
#search{height:3.5rem;width:100%;border-radius:1rem;border:1px solid var(--input);background:rgba(30,30,38,.8);padding:0 1rem 0 3.25rem;font-size:1rem;color:var(--fg);outline:none;backdrop-filter:blur(8px);transition:border-color .2s,box-shadow .2s;font-family:inherit}
#search:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(124,92,255,.2)}

/* showcase (fanned posters) */
.showcase{position:relative;margin:0 auto;height:440px;width:100%;max-width:28rem;display:none}
@media(min-width:1024px){.showcase{display:block}}
.showcase-glow{position:absolute;inset:2.5rem;border-radius:9999px;background:rgba(124,92,255,.3);filter:blur(48px)}
.showcase-card{position:absolute;left:50%;top:50%;height:360px;width:250px;overflow:hidden;border-radius:1.5rem;border:1px solid var(--border);box-shadow:0 25px 50px -12px rgba(0,0,0,.6);transition:all .5s}
.showcase-card:hover{z-index:20!important;transform:translate(-50%,-50%) scale(1.05) rotate(0deg)!important;box-shadow:var(--glow)}
.showcase-card img{height:100%;width:100%;object-fit:cover}
.showcase-fade{position:absolute;inset:0;background:linear-gradient(to top,rgba(22,22,28,.9),transparent 50%)}
.showcase-name{position:absolute;bottom:1rem;left:1rem;font-family:'Unbounded',sans-serif;font-size:1.125rem;font-weight:700}

/* features */
.features{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;padding-bottom:3rem}
@media(min-width:640px){.features{gap:.75rem}}
.feature{display:flex;flex-direction:column;align-items:center;gap:.5rem;border-radius:1rem;border:1px solid var(--border);background:rgba(30,30,38,.6);padding:.75rem;text-align:center;backdrop-filter:blur(8px)}
@media(min-width:640px){.feature{flex-direction:row;gap:1rem;padding:1rem;text-align:left}}
.feature-icon{display:flex;height:2.5rem;width:2.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:.75rem;background:rgba(124,92,255,.15);color:var(--primary)}
.feature-icon svg{height:1.25rem;width:1.25rem}
@media(min-width:640px){.feature-icon{height:2.75rem;width:2.75rem}}
.feature-t{font-size:.75rem;font-weight:700;line-height:1.25}
@media(min-width:640px){.feature-t{font-size:1rem}}
.feature-d{display:none;font-size:.875rem;color:var(--muted-fg)}
@media(min-width:640px){.feature-d{display:block}}

/* games grid */
.games{scroll-margin-top:5rem;padding-bottom:6rem}
.games-head{margin-bottom:1.5rem;display:flex;flex-direction:column;gap:1rem}
@media(min-width:640px){.games-head{flex-direction:row;align-items:flex-end;justify-content:space-between}}
.games-head h2{font-size:1.5rem;font-weight:700}
@media(min-width:640px){.games-head h2{font-size:2.25rem}}
.cats{display:flex;gap:.5rem;overflow-x:auto;padding-bottom:.25rem}
.cat-btn{flex-shrink:0;border-radius:9999px;border:1px solid var(--border);background:var(--card);color:var(--muted-fg);padding:.5rem 1rem;font-size:.875rem;font-weight:600;cursor:pointer;transition:all .2s;font-family:inherit}
.cat-btn:hover{color:var(--fg)}
.cat-btn.active{border-color:var(--primary);background:var(--primary);color:var(--primary-fg)}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem}
@media(max-width:340px){.grid{grid-template-columns:1fr}}
@media(min-width:640px){.grid{gap:1.25rem}}
@media(min-width:1024px){.grid{grid-template-columns:repeat(3,1fr)}}
@media(min-width:1280px){.grid{grid-template-columns:repeat(4,1fr)}}
.empty{padding:4rem 0;text-align:center;color:var(--muted-fg)}

/* card */
.card{position:relative;display:block;aspect-ratio:3/4;overflow:hidden;border-radius:1rem;border:1px solid var(--border);background:var(--card);transition:all .5s}
@media(min-width:640px){.card{border-radius:1.5rem}}
.card:hover{transform:translateY(-6px);border-color:rgba(124,92,255,.6);box-shadow:var(--glow)}
.card img{position:absolute;inset:0;height:100%;width:100%;object-fit:cover;transition:transform .7s}
.card:hover img{transform:scale(1.1)}
.card-noimg{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--muted-fg)}
.card-noimg svg{height:3rem;width:3rem}
.card-fade{position:absolute;inset:0;background:linear-gradient(to top,var(--bg),rgba(22,22,28,.6) 55%,transparent)}
.card-top{position:absolute;top:0;left:0;right:0;display:flex;align-items:flex-start;justify-content:space-between;gap:.25rem;padding:.625rem}
@media(min-width:640px){.card-top{padding:1rem}}
.card-cat{display:none;border-radius:9999px;border:1px solid var(--border);background:rgba(22,22,28,.6);padding:.25rem .75rem;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;backdrop-filter:blur(8px)}
@media(min-width:480px){.card-cat{display:inline-block}}
.card-status{display:flex;align-items:center;gap:.375rem;margin-left:auto;border-radius:9999px;border:1px solid;padding:.125rem .5rem;font-size:10px;font-weight:700;backdrop-filter:blur(8px)}
@media(min-width:640px){.card-status{padding:.25rem .75rem;font-size:11px}}
.sdot{height:.375rem;width:.375rem;border-radius:9999px;background:currentColor}
.st-green{background:rgba(52,211,153,.15);color:var(--success);border-color:rgba(52,211,153,.3)}
.st-violet{background:rgba(124,92,255,.2);color:var(--primary);border-color:rgba(124,92,255,.4)}
.st-yellow{background:rgba(234,179,8,.15);color:var(--warning);border-color:rgba(234,179,8,.3)}
.st-red{background:rgba(248,113,113,.15);color:var(--destructive);border-color:rgba(248,113,113,.3)}
.card-bottom{position:absolute;bottom:0;left:0;right:0;padding:.75rem}
@media(min-width:640px){.card-bottom{padding:1.25rem}}
.card-cat-sm{display:block;margin-bottom:.25rem;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--primary)}
@media(min-width:480px){.card-cat-sm{display:none}}
.card-bottom h3{font-size:1rem;font-weight:700;line-height:1.25}
@media(min-width:640px){.card-bottom h3{font-size:1.5rem}}
.card-desc{display:none;margin-top:.375rem;font-size:.875rem;color:var(--muted-fg);overflow:hidden;display:none;-webkit-line-clamp:2;-webkit-box-orient:vertical}
@media(min-width:640px){.card-desc{display:-webkit-box}}
.card-link{margin-top:.625rem;display:flex;align-items:center;justify-content:space-between;gap:.5rem;border-radius:.75rem;border:1px solid var(--border);background:rgba(22,22,28,.5);padding:.25rem .25rem .25rem .625rem;backdrop-filter:blur(8px);transition:border-color .3s}
@media(min-width:640px){.card-link{margin-top:1rem;border-radius:1rem;padding:.375rem .375rem .375rem 1rem}}
.card:hover .card-link{border-color:rgba(124,92,255,.5)}
.card-host{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:600}
@media(min-width:640px){.card-host{font-size:.875rem}}
.card-arrow{display:flex;height:1.75rem;width:1.75rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:.5rem;background:var(--primary);color:var(--primary-fg);transition:transform .3s}
@media(min-width:640px){.card-arrow{height:2.25rem;width:2.25rem;border-radius:.75rem}}
.card-arrow svg{height:1rem;width:1rem}
.card:hover .card-arrow{transform:rotate(45deg)}

/* footer */
.footer{border-top:1px solid var(--border)}
.footer-inner{max-width:80rem;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.75rem;padding:2rem 1rem}
@media(min-width:640px){.footer-inner{flex-direction:row;padding:2rem 1.5rem}}
.footer-inner p{font-size:.875rem;color:var(--muted-fg)}

/* ===== admin ===== */
.admin-wrap{max-width:56rem;margin:0 auto;padding:2rem 1rem 4rem}
.admin-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:2rem;flex-wrap:wrap}
.admin-head h1{font-size:1.5rem;font-weight:800}
.admin-actions{display:flex;gap:.5rem}
.btn{border-radius:.75rem;border:1px solid var(--border);background:var(--card);color:var(--fg);padding:.5rem 1rem;font-size:.875rem;font-weight:600;cursor:pointer;font-family:inherit;transition:all .2s;display:inline-flex;align-items:center;gap:.4rem}
.btn:hover{border-color:rgba(124,92,255,.5)}
.btn.violet{background:var(--primary);border-color:var(--primary);color:var(--primary-fg)}
.btn.violet:hover{box-shadow:var(--glow)}
.btn.danger{color:var(--destructive)}
.btn.danger:hover{border-color:rgba(248,113,113,.5)}
.login-box{max-width:24rem;margin:6rem auto;background:var(--card);border:1px solid var(--border);border-radius:1.5rem;padding:2rem}
.login-box h1{font-size:1.25rem;font-weight:800;margin:.75rem 0 .25rem}
.login-box p.sub{font-size:.875rem;color:var(--muted-fg);margin-bottom:1.5rem}
.field{margin-bottom:1rem}
.field label{display:block;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-fg);margin-bottom:.375rem}
.field input,.field select,.field textarea{width:100%;border-radius:.75rem;border:1px solid var(--input);background:rgba(22,22,28,.6);padding:.625rem .875rem;font-size:.875rem;color:var(--fg);outline:none;font-family:inherit;transition:border-color .2s,box-shadow .2s}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(124,92,255,.2)}
.field textarea{resize:vertical;min-height:4.5rem}
.alert{border-radius:.75rem;padding:.625rem .875rem;font-size:.875rem;margin-bottom:1rem}
.alert.err{background:rgba(248,113,113,.12);border:1px solid rgba(248,113,113,.3);color:var(--destructive)}
.alert.ok{background:rgba(52,211,153,.12);border:1px solid rgba(52,211,153,.3);color:var(--success)}
.game-row{display:flex;align-items:center;gap:1rem;background:var(--card);border:1px solid var(--border);border-radius:1rem;padding:.75rem;margin-bottom:.625rem;flex-wrap:wrap}
.game-row img{height:3.5rem;width:2.75rem;object-fit:cover;border-radius:.5rem;flex-shrink:0}
.game-row .info{flex:1;min-width:10rem}
.game-row .info b{font-size:.9375rem}
.game-row .info small{display:block;color:var(--muted-fg);font-size:.75rem;margin-top:.15rem}
.game-row .row-actions{display:flex;gap:.4rem}
.modal-bg{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.7);backdrop-filter:blur(4px);display:none;align-items:center;justify-content:center;padding:1rem}
.modal-bg.open{display:flex}
.modal{background:var(--card);border:1px solid var(--border);border-radius:1.5rem;padding:1.5rem;width:100%;max-width:28rem;max-height:90vh;overflow-y:auto}
.modal h2{font-size:1.125rem;font-weight:800;margin-bottom:1.25rem}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
@media(max-width:480px){.form-row{grid-template-columns:1fr}}
.hint{font-size:.75rem;color:var(--muted-fg);margin-top:.25rem}
