/* main.css */
:root{
  --bg0:#070a12;
  --bg1:#0b1020;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.12);
  --text:#eaf0ff;
  --muted: rgba(234,240,255,.70);

  --p1:#7c3aed;
  --p2:#22c55e;
  --p3:#06b6d4;
  --warn:#f59e0b;
  --danger:#ef4444;

  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: radial-gradient(1200px 900px at 30% 20%, rgba(124,58,237,.22), transparent 55%),
              radial-gradient(1200px 900px at 80% 30%, rgba(6,182,212,.20), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* Background decor */
.bg{ position:fixed; inset:0; pointer-events:none; z-index:-2; }
.bg-grid{
  position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity:.18;
  mask-image: radial-gradient(closest-side, rgba(0,0,0,1), rgba(0,0,0,0));
  -webkit-mask-image: radial-gradient(closest-side, rgba(0,0,0,1), rgba(0,0,0,0));
}
.bg-glow{
  position:absolute; inset:-20%;
  background: radial-gradient(circle at 20% 20%, rgba(34,197,94,.12), transparent 40%),
              radial-gradient(circle at 70% 25%, rgba(124,58,237,.18), transparent 45%),
              radial-gradient(circle at 40% 80%, rgba(6,182,212,.14), transparent 45%);
  filter: blur(30px);
  opacity:.95;
}

/* Layout */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 18px 18px;
  max-width: 1100px;
  margin: 0 auto;
}
.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:42px; height:42px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(124,58,237,.55), rgba(6,182,212,.35));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
}
.brand-title{ font-weight:800; letter-spacing:.3px; }
.brand-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.topbar-actions{ display:flex; gap:10px; }

.app{
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 18px 70px;
}

.view{ animation: fadeIn .25s ease-out; }
@keyframes fadeIn{ from{opacity:0; transform: translateY(6px);} to{opacity:1; transform:none;} }
.hidden{ display:none !important; }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.05));
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.btn{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  cursor:pointer;
  transition: transform .05s ease, background .2s ease, border-color .2s ease;
  font-weight:700;
}
.btn:hover{ background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); }
.btn:active{ transform: translateY(1px); }
.btn.full{ width:100%; }
.btn.primary{
  border-color: rgba(124,58,237,.55);
  background: linear-gradient(135deg, rgba(124,58,237,.85), rgba(6,182,212,.55));
}
.btn.primary:hover{ filter: brightness(1.05); }
.btn.success{
  border-color: rgba(34,197,94,.45);
  background: linear-gradient(135deg, rgba(34,197,94,.75), rgba(6,182,212,.35));
}
.btn.danger{
  border-color: rgba(239,68,68,.55);
  background: linear-gradient(135deg, rgba(239,68,68,.75), rgba(124,58,237,.35));
}
.btn.ghost{ background: rgba(255,255,255,.04); }

/* Toast */
.toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.16);
  box-shadow: var(--shadow);
  z-index: 50;
}
.toast b{ color:#fff; }
.toast.good{ border-color: rgba(34,197,94,.35); }
.toast.bad{ border-color: rgba(239,68,68,.40); }
.toast.warn{ border-color: rgba(245,158,11,.40); }

/* AUTH */
.auth-shell{
  display:grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 8px;
}
.auth-hero{ display:flex; }
.hero-card{
  width:100%;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.12);
  background: radial-gradient(900px 550px at 30% 25%, rgba(124,58,237,.22), transparent 55%),
              radial-gradient(900px 550px at 80% 30%, rgba(34,197,94,.16), transparent 55%),
              rgba(255,255,255,.04);
  box-shadow: var(--shadow);
}
.hero-badge{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--muted);
  font-weight:800;
  font-size:12px;
}
.hero-card h1{
  margin: 12px 0 8px;
  font-size: 44px;
  letter-spacing: -.8px;
}
.hero-card p{
  margin:0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}
.hero-stats{ display:flex; gap: 10px; flex-wrap:wrap; margin-top: 16px; }
.pill{
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(234,240,255,.88);
  font-weight:800;
  font-size: 12px;
}

.auth-card{ padding: 16px; }
.tabs{
  display:flex;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  overflow:hidden;
}
.tab{
  flex:1;
  border:0;
  background: transparent;
  color: var(--muted);
  padding: 12px;
  cursor:pointer;
  font-weight:900;
}
.tab.active{
  background: linear-gradient(135deg, rgba(124,58,237,.55), rgba(6,182,212,.28));
  color: var(--text);
}
.form{ margin-top: 14px; display:flex; flex-direction:column; gap: 12px; }
.field label{
  font-size: 12px;
  color: var(--muted);
  font-weight:800;
  display:block;
  margin-bottom: 6px;
}
.field input{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,14,28,.55);
  color: var(--text);
  outline:none;
}
.field input:focus{
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 0 0 3px rgba(124,58,237,.18);
}
.hint{ color: var(--muted); font-size: 12px; margin-top: 4px; }

/* APP DASHBOARD */
.grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  margin-top: 10px;
}
.profile{ padding: 16px; }
.profile-top{ display:flex; gap: 12px; align-items:center; }
.avatar{
  width: 54px; height: 54px;
  border-radius: 18px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(34,197,94,.35), rgba(124,58,237,.35));
  border:1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 24px;
}
.nick{ font-weight: 900; font-size: 18px; }
.sub{ color: var(--muted); font-size: 12px; margin-top:2px; display:flex; align-items:center; gap: 8px;}
.rank{
  padding: 4px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(234,240,255,.92);
  font-weight:900;
}
.dot{ opacity:.5; }
.small{ opacity:.9; }

.wallet{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wallet-item{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.wallet-item .label{ font-size: 12px; color: var(--muted); font-weight:900; }
.wallet-item .value{ font-size: 18px; font-weight: 950; margin-top: 4px; }

.actions{ margin-top: 12px; display:flex; gap: 10px; }

.mini{
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.mini-title{ font-weight: 900; font-size: 12px; color: var(--muted); }
.mini-body{ margin-top: 8px; display:flex; gap: 8px; flex-wrap:wrap; }
.chip{
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  font-weight: 900;
  font-size: 12px;
}

/* XP */
.xp{
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.xp-top{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.xp-label{ font-weight: 1000; font-size: 12px; color: rgba(234,240,255,.90); }
.xp-num{ font-weight: 950; font-size: 12px; color: var(--muted); }
.xp-bar{
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
}
.xp-fill{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34,197,94,.85), rgba(6,182,212,.75), rgba(124,58,237,.85));
  width: 0%;
  transition: width .25s ease;
}

/* Games */
.games{ padding: 16px; }
.card-head h2{ margin:0; font-size: 18px; font-weight: 950; }
.muted{ color: var(--muted); font-size: 12px; margin-top: 4px; }
.game-list{ margin-top: 14px; display:flex; flex-direction:column; gap: 10px; }
.game-item{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.game-item.featured{
  background: radial-gradient(650px 180px at 30% 50%, rgba(124,58,237,.26), transparent 62%),
              rgba(255,255,255,.05);
  border-color: rgba(124,58,237,.22);
}
.game-icon{
  width: 54px; height: 54px;
  border-radius: 18px;
  display:grid; place-items:center;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  font-size: 26px;
}
.game-info{ flex:1; }
.game-title{ font-weight: 950; }
.game-sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }
.game-item.disabled{ opacity:.60; }
.tag{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  font-weight: 950;
  font-size: 12px;
}
.card-foot{ margin-top: 14px; }

/* ARENA */
.arena{ margin-top: 10px; }
.arena-head{ display:flex; align-items: stretch; justify-content: space-between; gap: 14px; }
.arena-title{
  flex:1;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.10);
  background: radial-gradient(900px 260px at 20% 50%, rgba(34,197,94,.18), transparent 55%),
              radial-gradient(900px 260px at 80% 50%, rgba(124,58,237,.20), transparent 55%),
              rgba(255,255,255,.04);
  box-shadow: var(--shadow);
}
.arena-badge{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  font-weight: 950;
  font-size: 12px;
  color: rgba(234,240,255,.9);
}
.arena-title h2{ margin: 10px 0 6px; font-size: 26px; font-weight: 1000; }
.arena-sub{ color: var(--muted); font-size: 13px; }

.arena-panel{
  width: 320px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
}
.row{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255,255,255,.10);
}
.row:last-child{ border-bottom:0; }
.k{ color: var(--muted); font-weight: 900; font-size: 12px; }
.v{ font-weight: 950; }

.arena-body{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
}
.arena-stage{ padding: 16px; }
.stage-top{ display:flex; justify-content: space-between; align-items:flex-end; gap: 10px; }
.stage-title{ font-weight: 1000; font-size: 16px; }
.stage-hint{ color: var(--muted); font-size: 12px; }

.choices{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.choice{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  padding: 14px 10px;
  cursor:pointer;
  color: var(--text);
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 8px;
  font-weight: 950;
  transition: transform .08s ease, border-color .2s ease, background .2s ease;
}
.choice:hover{
  transform: translateY(-2px);
  border-color: rgba(124,58,237,.35);
  background: rgba(255,255,255,.08);
}
.choice:active{ transform: translateY(0px); }
.choice .emoji{ font-size: 34px; }
.choice .txt{ font-size: 13px; color: rgba(234,240,255,.9); }
.choice.disabled{ opacity: .45; cursor: not-allowed; transform:none !important; }

.result{
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
}
.result-title{ font-size: 20px; font-weight: 1000; }
.result-sub{ margin-top: 6px; color: var(--muted); font-weight: 800; }
.result-actions{ margin-top: 12px; display:flex; gap: 10px; flex-wrap:wrap; }

.arena-side{ display:flex; flex-direction: column; gap: 12px; }
.side-card{ padding: 14px; }
.side-card h3{ margin:0; font-size: 14px; font-weight: 1000; }
.rules{ margin: 10px 0 0 18px; color: var(--muted); font-weight: 800; font-size: 12px; line-height: 1.55; }

.side-stats{ margin-top: 10px; display:grid; gap: 10px; }
.ss{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.ss .label{ font-size: 12px; color: var(--muted); font-weight: 900; }
.ss .value{ margin-top: 6px; font-size: 16px; font-weight: 1000; }

.taunt{
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color: rgba(234,240,255,.88);
  font-weight: 900;
  font-size: 12px;
}

/* Chat */
.chat-card{ display:flex; flex-direction:column; }
.chat-box{
  margin-top: 10px;
  height: 210px;
  overflow:auto;
  padding: 10px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
}
.chat-msg{
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  margin-bottom: 8px;
}
.chat-msg.me{ border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.08); }
.chat-meta{ font-size: 11px; color: var(--muted); font-weight: 900; display:flex; justify-content:space-between; gap:10px; }
.chat-text{ margin-top: 4px; font-weight: 850; font-size: 12px; color: rgba(234,240,255,.92); line-height: 1.35; }
.chat-send{ display:flex; gap: 10px; margin-top: 10px; }
.chat-send input{
  flex:1;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,14,28,.55);
  color: var(--text);
  outline:none;
}
.chat-send input:focus{
  border-color: rgba(6,182,212,.55);
  box-shadow: 0 0 0 3px rgba(6,182,212,.16);
}

/* Modal */
.modal{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display:grid; place-items:center;
  z-index: 80;
  padding: 18px;
}
.modal-card{
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(12,16,32,.92);
  box-shadow: var(--shadow);
}
.modal-head{
  display:flex; justify-content: space-between; align-items:center;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.modal-title{ font-weight: 1000; }
.modal-body{ padding: 14px; color: rgba(234,240,255,.90); }
.modal-body .row2{ display:flex; gap: 10px; align-items:center; }
.modal-body input{
  flex:1;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,14,28,.55);
  color: var(--text);
  outline:none;
}

/* Responsive */
@media (max-width: 980px){
  .auth-shell{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
  .arena-head{ flex-direction: column; }
  .arena-panel{ width: 100%; }
  .arena-body{ grid-template-columns: 1fr; }
}
