:root{
  --bg:#080807;
  --bg-soft:#100d0b;
  --panel:#17120f;
  --panel-2:#211914;
  --panel-3:#2a2018;
  --line:#40301f;
  --line-strong:#765018;
  --txt:#fff8e8;
  --muted:#b8a99b;
  --yellow:#ffd21a;
  --orange:#ff8a1f;
  --red:#ff3f2e;
  --cyan:#39d9ff;
  --green:#52e17a;
  --shadow:0 18px 42px rgba(0,0,0,.48);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{min-height:100%;overflow-x:hidden}
body{
  font-family:"Segoe UI",Roboto,Arial,sans-serif;
  background:
    linear-gradient(180deg,rgba(8,8,7,.82),var(--bg) 420px),
    url("/assets/img/toy-battles-snow.png") center top/cover fixed no-repeat;
  color:var(--txt);
  line-height:1.5;
  display:flex;
  flex-direction:column;
  min-height:100vh;
}
body::selection{background:var(--yellow);color:#17120f}
a{color:var(--cyan);text-decoration:none}
a:hover{color:#8cecfa}
img{max-width:100%;display:block}
b,strong{color:var(--txt)}
.container{width:100%;max-width:1160px;margin:0 auto;padding:0 20px}
.page{flex:1}
.page-narrow{flex:1;padding-top:30px}
.section{padding:46px 20px}
.section-tight{padding-top:32px}
.eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  color:var(--yellow);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

/* Header */
header.nav{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(8,8,7,.9);
  backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(255,210,26,.18);
}
.nav-inner{
  min-height:66px;
  display:flex;
  align-items:center;
  gap:18px;
}
.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:#fff;
  font-size:20px;
  font-weight:900;
  white-space:nowrap;
}
.brand .logo{
  width:38px;
  height:38px;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--yellow),var(--red));
  color:#15110b;
  font-size:13px;
  box-shadow:0 0 0 2px rgba(255,255,255,.08) inset;
}
.brand b{color:var(--yellow)}
.top-live{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:0 12px;
  border:1px solid rgba(255,210,26,.26);
  border-radius:8px;
  background:rgba(23,18,15,.72);
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.live-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 4px rgba(82,225,122,.14);
}
[data-live-state="unknown"] .live-dot{background:var(--orange);box-shadow:0 0 0 4px rgba(255,138,31,.13)}
.nav-links{
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:4px;
}
.nav-links a{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  padding:0 12px;
  border-radius:8px;
  font-weight:800;
}
.nav-links a:hover{color:var(--txt);background:rgba(255,255,255,.06)}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  gap:8px;
  padding:0 18px;
  border:0;
  border-radius:8px;
  color:#17120f;
  cursor:pointer;
  font-size:15px;
  font-weight:900;
  transition:transform .14s ease,filter .14s ease,border-color .14s ease;
}
.btn:hover{transform:translateY(-1px);filter:brightness(1.06)}
.btn-primary{background:linear-gradient(135deg,var(--cyan),#1a8dff);color:#081017}
.btn-yellow{background:linear-gradient(135deg,var(--yellow),var(--orange));color:#17120f}
.btn-ghost{background:rgba(23,18,15,.82);color:var(--txt);border:1px solid rgba(255,210,26,.24)}
.btn-danger{background:linear-gradient(135deg,var(--red),#bf1d16);color:#fff}
.btn-block{width:100%}
.btn-sm{min-height:36px;padding:0 12px;font-size:13px}

/* Hero */
.hero-game{
  min-height:590px;
  display:flex;
  align-items:center;
  background:
    linear-gradient(90deg,rgba(8,8,7,.92),rgba(8,8,7,.58) 52%,rgba(8,8,7,.86)),
    linear-gradient(180deg,rgba(8,8,7,.08),rgba(8,8,7,.92)),
    url("/assets/img/toy-battles-hero.png") center/cover no-repeat;
  border-bottom:1px solid rgba(255,210,26,.18);
}
.hero-content{padding-top:46px;padding-bottom:52px}
.hero-content h1{
  max-width:720px;
  margin-top:10px;
  font-size:64px;
  line-height:1.02;
  font-weight:950;
}
.hero-content p{
  max-width:620px;
  margin-top:18px;
  color:#e8d8c8;
  font-size:18px;
}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:26px}
.hero-live{max-width:760px;margin-top:34px}
.live-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.live-card{
  min-height:92px;
  padding:16px;
  border:1px solid rgba(255,210,26,.24);
  border-radius:8px;
  background:rgba(23,18,15,.78);
  box-shadow:var(--shadow);
}
.live-card span{display:block;color:var(--muted);font-size:13px;font-weight:800}
.live-card strong{display:block;margin-top:4px;color:var(--yellow);font-size:30px;line-height:1;font-weight:950}

/* Mini heroes */
.mini-hero{
  min-height:330px;
  display:flex;
  align-items:center;
  border-bottom:1px solid rgba(255,210,26,.16);
  background:
    linear-gradient(90deg,rgba(8,8,7,.9),rgba(8,8,7,.64)),
    url("/assets/img/toy-battles-hero.png") center/cover no-repeat;
}
.download-hero{
  background:
    linear-gradient(90deg,rgba(8,8,7,.9),rgba(8,8,7,.62)),
    url("/assets/img/toy-battles-snow.png") center/cover no-repeat;
}
.mini-hero-inner{padding-top:46px;padding-bottom:38px}
.mini-hero h1{font-size:46px;line-height:1.05;margin-top:8px}
.mini-hero p{max-width:600px;margin:12px 0 22px;color:#e8d8c8;font-size:17px}

/* Cards and panels */
.card,.feature,.rank-tile,.stat{
  background:linear-gradient(180deg,rgba(33,25,20,.96),rgba(20,15,12,.96));
  border:1px solid rgba(255,210,26,.18);
  border-radius:8px;
  box-shadow:var(--shadow);
}
.card{padding:24px}
.card h2{font-size:20px;margin-bottom:4px}
.card .sub{color:var(--muted);font-size:14px;margin-bottom:18px}
.grid{display:grid;gap:18px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}

/* Home sections */
.rank-preview-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
}
.rank-preview-head h2,.media-copy h2,.section h2{font-size:30px;line-height:1.15}
.rank-strip{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.rank-tile{
  min-height:112px;
  padding:16px;
  display:grid;
  grid-template-columns:auto 42px minmax(0,1fr);
  align-items:center;
  gap:10px;
  color:var(--txt);
}
.rank-tile:hover{border-color:rgba(255,210,26,.46);color:var(--txt)}
.rank-tile-main{min-width:0}
.rank-tile-main b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-tile-main small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.empty-state{padding:18px;border:1px dashed rgba(255,210,26,.26);border-radius:8px;color:var(--muted)}
.media-band{
  padding:44px 0;
  background:linear-gradient(90deg,rgba(255,210,26,.08),rgba(57,217,255,.06),rgba(255,63,46,.07));
  border-top:1px solid rgba(255,210,26,.14);
  border-bottom:1px solid rgba(255,210,26,.14);
}
.media-band-inner{display:grid;grid-template-columns:1fr 420px;align-items:center;gap:34px}
.media-copy p{margin:12px 0 22px;color:var(--muted);max-width:560px}
.media-band img{
  width:100%;
  border-radius:8px;
  border:1px solid rgba(255,210,26,.26);
  box-shadow:var(--shadow);
}
.feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.feature{padding:20px;min-height:172px}
.feature-kicker{display:block;color:var(--cyan);font-size:12px;text-transform:uppercase;font-weight:900;margin-bottom:8px}
.feature h3{font-size:18px;margin-bottom:8px}
.feature p{color:var(--muted);font-size:14px}

/* Forms */
.auth-wrap{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:54px 20px;
  background:
    linear-gradient(180deg,rgba(8,8,7,.52),rgba(8,8,7,.9)),
    url("/assets/img/toy-battles-splash.png") center/cover no-repeat;
}
.auth-card{width:100%;max-width:430px}
.field{margin-bottom:16px}
.field label{display:block;font-size:13px;font-weight:800;color:var(--muted);margin-bottom:6px}
.field input{
  width:100%;
  min-height:44px;
  background:#0d0b0a;
  border:1px solid rgba(255,210,26,.18);
  border-radius:8px;
  color:var(--txt);
  padding:0 13px;
  font-size:15px;
  outline:none;
  transition:border-color .14s ease,box-shadow .14s ease;
}
.field input:focus{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(57,217,255,.13)}
.field .hint{font-size:12px;color:var(--muted);margin-top:5px}
.alert{padding:12px 14px;border-radius:8px;font-size:14px;margin-bottom:18px;font-weight:800}
.alert-err{background:rgba(255,63,46,.12);border:1px solid rgba(255,63,46,.38);color:#ffaaa2}
.alert-ok{background:rgba(82,225,122,.12);border:1px solid rgba(82,225,122,.34);color:#9bf0b8}
.alert-compact{max-width:560px;margin:0}
.auth-foot{text-align:center;margin-top:18px;color:var(--muted);font-size:14px}

/* Dashboard */
.dash-head{display:flex;align-items:center;gap:16px;margin:0 0 24px;flex-wrap:wrap}
.avatar,.mini-avatar{
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--yellow),var(--red));
  color:#17120f;
  font-weight:950;
  border-radius:8px;
  box-shadow:0 0 0 2px rgba(255,255,255,.08) inset;
}
.avatar{width:64px;height:64px;font-size:28px}
.mini-avatar{width:42px;height:42px;font-size:18px;flex:0 0 42px}
.dash-head h1{font-size:28px;line-height:1.15}
.dash-head .nick{color:var(--muted);font-size:14px;margin-top:2px}
.dash-actions{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}
.badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  vertical-align:middle;
}
.badge-g1{background:#332719;color:#dfc5aa}
.badge-g2{background:#0f5a72;color:#c9f6ff}
.badge-g3{background:#6d241b;color:#ffd4cf}
.badge-g4{background:#1b6e3b;color:#ccffd9}
.badge-g7{background:var(--yellow);color:#17120f}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:24px}
.stat{min-height:96px;padding:16px}
.stat .v{font-size:25px;font-weight:950;color:var(--txt);line-height:1.1;overflow-wrap:anywhere}
.stat .l{color:var(--muted);font-size:13px;margin-top:6px;font-weight:800}
.stat .v.y{color:var(--yellow)}
.stat .v.b{color:var(--cyan)}
.live-stat .v{color:var(--green)}
.connect-card{margin-top:18px}
.steps{color:var(--muted);font-size:14px;padding-left:18px;line-height:1.9}
.steps b{color:var(--txt)}

/* Admin */
.admin-page{flex:1;padding-top:30px}
.admin-head{margin-bottom:14px}
.spaced-card{margin-bottom:18px}
.search-form{display:flex;gap:10px}
.search-input{
  flex:1;
  min-width:0;
  min-height:44px;
  background:#0d0b0a;
  border:1px solid rgba(255,210,26,.18);
  border-radius:8px;
  color:var(--txt);
  padding:0 13px;
  font-size:15px;
  outline:none;
}
.search-input:focus{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(57,217,255,.13)}
.admin-actions{gap:14px}
.text-red{color:var(--red)}
.text-green{color:var(--green)}

/* Ranking */
.rank-hero .live-grid{max-width:760px;margin-top:18px}
.rank-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:18px;
  margin-bottom:16px;
}
.rank-toolbar h2{font-size:30px;line-height:1.15}
.rank-toolbar p{color:var(--muted);font-weight:800}
.rank-tabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.rank-tabs a{
  min-height:36px;
  display:inline-flex;
  align-items:center;
  border:1px solid rgba(255,210,26,.22);
  border-radius:8px;
  padding:0 12px;
  color:var(--muted);
  font-size:13px;
  font-weight:900;
  background:rgba(23,18,15,.72);
}
.rank-tabs a.active,.rank-tabs a:hover{color:#17120f;background:var(--yellow);border-color:var(--yellow)}
.rank-table-wrap{
  overflow:auto;
  border:1px solid rgba(255,210,26,.18);
  border-radius:8px;
  background:rgba(15,12,10,.92);
  box-shadow:var(--shadow);
}
table.tbl{width:100%;border-collapse:collapse;font-size:14px}
table.tbl th,table.tbl td{text-align:left;padding:13px 14px;border-bottom:1px solid rgba(255,210,26,.12)}
table.tbl th{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  font-weight:900;
  background:rgba(255,210,26,.06);
}
table.tbl tr:hover td{background:rgba(255,210,26,.045)}
.rank-table td{white-space:nowrap}
.rank-player{display:flex;align-items:center;gap:10px;min-width:220px}
.rank-player b{margin-right:6px}
.rank-pos{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#2a2018;
  color:var(--muted);
  font-weight:950;
}
.rank-pos-1{background:var(--yellow);color:#17120f}
.rank-pos-2{background:#e7eef2;color:#17120f}
.rank-pos-3{background:#c77a2c;color:#17120f}

/* Download */
.download-layout{display:grid;grid-template-columns:1fr 390px;gap:20px;align-items:start}
.download-shot img{
  width:100%;
  border-radius:8px;
  border:1px solid rgba(255,210,26,.24);
  box-shadow:var(--shadow);
}

/* Footer */
footer.ft{
  margin-top:auto;
  border-top:1px solid rgba(255,210,26,.18);
  padding:24px 0;
  color:var(--muted);
  font-size:14px;
  background:rgba(8,8,7,.86);
}
.ft-inner{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}

@media(max-width:980px){
  .hero-content h1{font-size:48px}
  .media-band-inner,.download-layout{grid-template-columns:1fr}
  .rank-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .feature-grid,.grid-3{grid-template-columns:1fr}
  .stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .top-live{display:none}
}
@media(max-width:760px){
  body{background-attachment:scroll}
  .nav-inner{padding:10px 20px;align-items:stretch;flex-direction:column;gap:10px}
  .nav-links{
    width:100%;
    margin-left:0;
    justify-content:flex-start;
    flex-wrap:wrap;
    overflow-x:visible;
    padding-bottom:4px;
    row-gap:6px;
  }
  .nav-links a{min-height:34px;padding:0 10px;font-size:14px}
  .nav-links .btn-primary{display:none}
  .hero-game{min-height:560px}
  .hero-content h1{font-size:36px;max-width:340px}
  .hero-content p,.mini-hero p{font-size:16px;max-width:340px}
  .mini-hero h1{font-size:34px;max-width:340px}
  .live-grid,.grid-2{grid-template-columns:1fr}
  .rank-preview-head{align-items:flex-start;flex-direction:column}
  .rank-strip{grid-template-columns:1fr}
  .rank-toolbar{align-items:flex-start;flex-direction:column}
  .rank-tabs{justify-content:flex-start}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dash-actions{width:100%;margin-left:0}
  .dash-actions .btn{flex:1}
}
@media(max-width:460px){
  .container{padding-left:14px;padding-right:14px}
  .section{padding-left:14px;padding-right:14px}
  .brand{font-size:18px}
  .hero-content h1{font-size:34px}
  .stats{grid-template-columns:1fr}
  .rank-tile{grid-template-columns:auto 40px minmax(0,1fr)}
  .hero-actions .btn{flex:1 1 150px}
  .search-form{flex-direction:column}
  .nav-links .btn{width:auto}
}
