:root{
  color-scheme: dark;
  --bg:#0b0f14;
  --panel:#121823;
  --panel2:#0f1520;
  --line:rgba(255,255,255,.10);
  --text:#d7dde6;
  --muted:#9aa4b2;
  --accent:#ff8c1a;
  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --radius:16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(255,140,26,.12), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(120,180,255,.10), transparent 55%),
              var(--bg);
  color: var(--text);
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15,21,32,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.4px;
}
.brand-icon{
  width: 34px; height: 34px;
  display:grid; place-items:center;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
}
.badge{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,140,26,.14);
  border: 1px solid rgba(255,140,26,.30);
  color: var(--text);
}

.nav{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-link{
  text-decoration:none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.nav-link:hover{
  background: rgba(255,255,255,.05);
  border-color: var(--line);
}

.main{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}
.panel{
  background: rgba(18,24,35,.65);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.page h1{ margin: 6px 0 12px; font-size: 26px; }
.muted{ color: var(--muted); }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.card{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.card h2{ margin: 0 0 8px; font-size: 16px; }

.btn{
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.btn:hover{ background: rgba(255,255,255,.09); }

.pre{
  margin-top: 10px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  overflow:auto;
  min-height: 72px;
}

.list{ margin: 10px 0 0; padding-left: 18px; }
.list li{ margin: 6px 0; }

.footer{
  border-top: 1px solid var(--line);
  margin-top: 18px;
  background: rgba(15,21,32,.35);
}
.footer-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

code{
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 8px;
}

@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

.form{ display:flex; flex-direction:column; gap: 12px; }
.label{ display:flex; flex-direction:column; gap: 6px; color: var(--text); }
.input{
  background: rgba(0,0,0,.20);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}
.input:focus{ border-color: rgba(255,140,26,.45); }

.error{
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,80,120,.35);
  background: rgba(255,80,120,.12);
}

.tabs{
  display:flex;
  gap:10px;
  margin-bottom: 12px;
}
.tab{
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
}
.tab.active{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,140,26,.35);
}

.chip{
  margin-left: 8px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,140,26,.35);
  background: rgba(255,140,26,.12);
}

.refbox{
  margin: 10px 0 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,140,26,.25);
  background: rgba(255,140,26,.08);
}
.sponsor{
  font-weight: 700;
  margin-top: 2px;
}

.btn-ghost{
  margin-top: 10px;
  background: transparent;
}

/* Modes layout */
.app-shell[data-mode="guest"] .hud { display: none; }
.app-shell[data-mode="guest"] .panel { max-width: 720px; margin: 0 auto; }

.app-shell[data-mode="game"] .panel { max-width: 1100px; }
.app-shell[data-mode="game"] .hud { display: flex; }

/* HUD */
.hud{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hud-item{
  display:flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}
.hud-btn{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
}
.hud-btn:hover{ background: rgba(255,255,255,.09); }
