:root {
  --bg: #090b16;
  --surface: #13172a;
  --surface-2: #1c2240;
  --text: #f6f7ff;
  --muted: #aeb5d4;
  --primary: #7c5cff;
  --primary-2: #24d6c5;
  --danger: #ff5d73;
  --success: #44d492;
  --border: rgba(255,255,255,.11);
  --shadow: 0 18px 50px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin:0; color:var(--text); background:radial-gradient(circle at top right,#1a1742 0,transparent 34%),var(--bg); font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; min-height:100vh; }
a { color:inherit; text-decoration:none; }
img { max-width:100%; display:block; }
button,input,select,textarea { font:inherit; }
.container { width:min(1140px,calc(100% - 32px)); margin-inline:auto; }
.site-header { position:sticky; top:0; z-index:30; background:rgba(9,11,22,.86); backdrop-filter:blur(16px); border-bottom:1px solid var(--border); }
.nav-wrap { min-height:72px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.brand { display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px; }
.brand-icon { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:linear-gradient(135deg,var(--primary),var(--primary-2)); box-shadow:0 8px 28px rgba(124,92,255,.35); }
.nav-menu { display:flex; align-items:center; gap:8px; }
.nav-menu a { padding:10px 13px; border-radius:10px; color:var(--muted); }
.nav-menu a:hover,.nav-menu a.active { color:#fff; background:var(--surface-2); }
.nav-menu .nav-danger { color:#ff8c9b; }
.nav-toggle { display:none; border:1px solid var(--border); color:#fff; background:var(--surface); border-radius:10px; padding:8px 12px; }
.hero { padding:80px 0 62px; }
.hero-grid { display:grid; grid-template-columns:1.25fr .75fr; gap:38px; align-items:center; }
.eyebrow { display:inline-flex; align-items:center; gap:8px; padding:7px 11px; border-radius:999px; background:rgba(124,92,255,.14); border:1px solid rgba(124,92,255,.34); color:#c8bcff; font-weight:700; font-size:.85rem; }
h1,h2,h3 { line-height:1.15; margin:0 0 14px; }
h1 { font-size:clamp(2.5rem,6vw,5.3rem); letter-spacing:-.05em; }
h2 { font-size:clamp(1.8rem,4vw,2.8rem); }
.gradient-text { background:linear-gradient(90deg,#fff,#b9acff,#55f0df); -webkit-background-clip:text; background-clip:text; color:transparent; }
.lead { color:var(--muted); max-width:720px; font-size:1.1rem; }
.actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:28px; }
.btn { display:inline-flex; justify-content:center; align-items:center; gap:8px; min-height:44px; padding:10px 16px; border:1px solid transparent; border-radius:12px; cursor:pointer; font-weight:750; transition:.2s ease; }
.btn:hover { transform:translateY(-1px); }
.btn-primary { background:linear-gradient(135deg,var(--primary),#5a40e8); color:#fff; box-shadow:0 12px 30px rgba(124,92,255,.28); }
.btn-secondary { background:var(--surface-2); border-color:var(--border); color:#fff; }
.btn-danger { background:rgba(255,93,115,.14); border-color:rgba(255,93,115,.35); color:#ff9cab; }
.btn-sm { min-height:35px; padding:6px 10px; border-radius:9px; font-size:.9rem; }
.hero-card { padding:24px; border-radius:26px; background:linear-gradient(150deg,rgba(124,92,255,.3),rgba(36,214,197,.08)),var(--surface); border:1px solid var(--border); box-shadow:var(--shadow); transform:rotate(2deg); }
.controller { aspect-ratio:1.35; border-radius:28px; background:linear-gradient(145deg,#302a5d,#171a30); position:relative; display:grid; place-items:center; font-size:6rem; border:1px solid rgba(255,255,255,.16); }
.stat-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:16px; }
.stat { background:rgba(5,7,18,.45); border:1px solid var(--border); border-radius:14px; padding:12px; text-align:center; }
.stat strong { display:block; font-size:1.35rem; }
.stat span { color:var(--muted); font-size:.82rem; }
.section { padding:54px 0; }
.section-head { display:flex; justify-content:space-between; align-items:end; gap:20px; margin-bottom:24px; }
.section-head p { color:var(--muted); margin:0; }
.game-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px; }
.game-card { overflow:hidden; border-radius:20px; background:linear-gradient(180deg,rgba(255,255,255,.03),transparent),var(--surface); border:1px solid var(--border); box-shadow:0 14px 32px rgba(0,0,0,.18); transition:.2s ease; }
.game-card:hover { transform:translateY(-5px); border-color:rgba(124,92,255,.48); }
.game-thumb { aspect-ratio:16/10; width:100%; object-fit:cover; background:#202544; }
.game-card-body { padding:18px; }
.game-card h3 { font-size:1.22rem; }
.game-card p { color:var(--muted); margin:0 0 14px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; color:var(--muted); font-size:.86rem; }
.badge { display:inline-flex; padding:5px 9px; border-radius:999px; background:rgba(36,214,197,.12); border:1px solid rgba(36,214,197,.25); color:#8ff8ed; font-size:.78rem; font-weight:700; }
.card-actions { display:flex; gap:9px; margin-top:16px; }
.search-panel { background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:18px; margin-bottom:26px; }
.search-form { display:grid; grid-template-columns:1fr 220px auto; gap:12px; }
.input,.select,.textarea { width:100%; color:#fff; background:#0d1020; border:1px solid var(--border); border-radius:11px; padding:11px 13px; outline:none; }
.input:focus,.select:focus,.textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(124,92,255,.15); }
.textarea { min-height:130px; resize:vertical; }
.select option { background:#11152a; }
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-weight:700; margin-bottom:7px; }
.form-help { color:var(--muted); font-size:.85rem; margin-top:6px; }
.panel { background:var(--surface); border:1px solid var(--border); border-radius:19px; padding:22px; box-shadow:0 12px 30px rgba(0,0,0,.14); }
.auth-wrap { width:min(460px,calc(100% - 32px)); margin:64px auto; }
.game-detail { display:grid; grid-template-columns:1fr 1fr; gap:30px; align-items:start; }
.game-detail-image { border-radius:22px; border:1px solid var(--border); width:100%; aspect-ratio:16/10; object-fit:cover; }
.play-shell { width:min(1180px,calc(100% - 20px)); margin:22px auto 50px; }
.play-top { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:14px; }
.game-frame { width:100%; min-height:680px; border:1px solid var(--border); border-radius:18px; background:#000; }
.pagination { display:flex; justify-content:center; gap:8px; margin-top:30px; }
.pagination a,.pagination span { min-width:40px; height:40px; display:grid; place-items:center; border-radius:10px; background:var(--surface); border:1px solid var(--border); }
.pagination .active { background:var(--primary); }
.empty { text-align:center; padding:52px 24px; color:var(--muted); }
.alert { margin-top:18px; border-radius:12px; padding:13px 15px; border:1px solid; }
.alert.success { color:#a2ffd1; background:rgba(68,212,146,.1); border-color:rgba(68,212,146,.3); }
.alert.error { color:#ffb4bf; background:rgba(255,93,115,.1); border-color:rgba(255,93,115,.3); }
.site-footer { margin-top:60px; padding:34px 0; border-top:1px solid var(--border); color:var(--muted); }
.footer-grid { display:flex; justify-content:space-between; gap:20px; }
.footer-grid p { margin:6px 0 0; }
.footer-right { text-align:right; }
/* Admin */
.admin-layout { display:grid; grid-template-columns:240px minmax(0,1fr); min-height:calc(100vh - 72px); }
.sidebar { padding:24px 16px; border-right:1px solid var(--border); background:#0c0f1e; }
.sidebar h3 { padding:0 10px; }
.sidebar a { display:block; color:var(--muted); padding:10px 12px; border-radius:10px; margin:4px 0; }
.sidebar a:hover,.sidebar a.active { color:#fff; background:var(--surface-2); }
.admin-main { padding:28px; min-width:0; }
.admin-head { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:22px; }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.stat-card { padding:20px; border-radius:16px; background:var(--surface); border:1px solid var(--border); }
.stat-card strong { display:block; font-size:2rem; }
.stat-card span { color:var(--muted); }
.table-wrap { overflow:auto; border-radius:16px; border:1px solid var(--border); }
table { width:100%; border-collapse:collapse; background:var(--surface); min-width:760px; }
th,td { padding:13px 14px; text-align:left; border-bottom:1px solid var(--border); vertical-align:middle; }
th { color:#cbd0e8; background:#171b32; font-size:.86rem; text-transform:uppercase; letter-spacing:.05em; }
td { color:#e9ebf7; }
.table-thumb { width:72px; height:45px; border-radius:8px; object-fit:cover; }
.status { display:inline-flex; padding:4px 8px; border-radius:999px; font-size:.8rem; font-weight:700; }
.status.active { color:#a3ffd4; background:rgba(68,212,146,.12); }
.status.inactive { color:#ffb4bf; background:rgba(255,93,115,.12); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.preview { width:220px; max-width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:14px; border:1px solid var(--border); background:#202544; }
@media (max-width: 900px) {
  .hero-grid,.game-detail { grid-template-columns:1fr; }
  .game-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .search-form { grid-template-columns:1fr 1fr; }
  .search-form .btn { grid-column:1/-1; }
  .admin-layout { grid-template-columns:1fr; }
  .sidebar { border-right:0; border-bottom:1px solid var(--border); display:flex; overflow:auto; gap:4px; }
  .sidebar h3 { display:none; }
  .sidebar a { white-space:nowrap; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 640px) {
  .nav-toggle { display:block; }
  .nav-menu { display:none; position:absolute; left:16px; right:16px; top:64px; flex-direction:column; align-items:stretch; background:#111427; border:1px solid var(--border); border-radius:14px; padding:10px; box-shadow:var(--shadow); }
  .nav-menu.open { display:flex; }
  .hero { padding-top:48px; }
  .game-grid,.search-form,.form-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:1fr; }
  .section-head,.footer-grid,.play-top,.admin-head { align-items:flex-start; flex-direction:column; }
  .footer-right { text-align:left; }
  .admin-main { padding:20px 16px; }
  .game-frame { min-height:560px; }
}
