
:root{
  --bg1:#0b0f1a;
  --bg2:#070a12;
  --card:#0f1628cc;
  --stroke:#24304a;
  --text:#e9eefc;
  --muted:#aeb9d7;
  --accent:#7c5cff;
  --accent2:#2ee59d;
  --danger:#ff4d6d;
  --ok:#42d392;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --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, sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 800px at 70% 20%, #1b2a55 0%, var(--bg1) 40%, var(--bg2) 100%);
  overflow-x:hidden;
}

#app{
  position:relative;
  min-height:100%;
  display:grid;
  place-items:center;
  padding:28px;
}

.bg-chars{
  position:fixed;
  inset:-40px;
  z-index:0;
  color:rgba(233,238,252,.06);
  font-weight:700;
  letter-spacing:2px;
  line-height:2.3;
  font-size:18px;
  transform: rotate(-10deg);
  user-select:none;
  filter: blur(.2px);
  animation: floaty 12s ease-in-out infinite;
  pointer-events:none;
  white-space:pre-wrap;
}

@keyframes floaty{
  0%{ transform: rotate(-10deg) translateY(0px); }
  50%{ transform: rotate(-10deg) translateY(-20px); }
  100%{ transform: rotate(-10deg) translateY(0px); }
}

.view{
  width:min(940px, 100%);
  z-index:1;
  display:none;
}
.view.active{display:block;}

.card{
  background: var(--card);
  border:1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding:26px;
}

.hero{
  padding:32px;
  text-align:left;
}

.brand{
  display:flex;
  gap:14px;
  align-items:flex-start;
}
.logo-dot{
  width:16px;height:16px;border-radius:50%;
  background: linear-gradient(135deg, var(--accent), #3aa0ff);
  margin-top:10px;
  box-shadow: 0 0 18px rgba(124,92,255,.6);
}
h1{
  margin:0;
  font-size:44px;
  letter-spacing:-.8px;
  line-height:1;
}
h1 span{ color: rgba(233,238,252,.85); font-weight:800; }
h2{ margin:0 0 8px 0; font-size:28px; }

.sub{
  margin:10px 0 18px 0;
  color:var(--muted);
}

.btn-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:14px;
}
.btn-row.right{ justify-content:flex-end; }

.btn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:12px 16px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:700;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); }
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: linear-gradient(135deg, var(--accent), #3aa0ff);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 10px 30px rgba(124,92,255,.28);
}
.btn.primary:hover{ filter: brightness(1.04); }

.tiny{ margin-top:16px; color: rgba(233,238,252,.75); font-size:13px; }

.label{ font-weight:800; margin-top:8px; margin-bottom:6px; color: rgba(233,238,252,.9); }
.input{
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color:var(--text);
  padding:12px 14px;
  border-radius: 14px;
  outline:none;
}
.input:focus{ border-color: rgba(124,92,255,.55); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.spacer{ height:10px; }

.avatar-picker{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.avatar-btn{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color:var(--text);
  padding:12px 14px;
  border-radius: 16px;
  cursor:pointer;
  min-width: 160px;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.avatar-btn:hover{ background: rgba(255,255,255,.08); }
.avatar-btn:active{ transform: translateY(1px); }
.avatar-btn.selected{
  border-color: rgba(46,229,157,.5);
  box-shadow: 0 0 0 3px rgba(46,229,157,.14);
}
.avatar{
  width:42px;
  height:42px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-weight:900;
}
.avatar-blank{
  background: rgba(255,255,255,.06);
  border:2px solid rgba(255,255,255,.18);
}
.avatar-smile{
  background: rgba(46,229,157,.12);
  border:2px solid rgba(46,229,157,.4);
  position: relative;
}

/* eyes */
.avatar-smile::before{
  content:"";
  position:absolute;
  width:6px;height:6px;
  border-radius:50%;
  background: rgba(233,238,252,.90);
  top:36%;
  left:34%;
  box-shadow: 18px 0 0 rgba(233,238,252,.90);
}

/* mouth */
.avatar-smile::after{
  content:"";
  position:absolute;
  width:24px;height:14px;
  border:3px solid rgba(233,238,252,.90);
  border-top:0;
  border-left:0;
  border-right:0;
  border-radius: 0 0 999px 999px;
  bottom:26%;
}

.avatar-name{ font-weight:900; color: rgba(233,238,252,.9); }

.diff-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
  margin-top:14px;
}
@media(max-width:860px){
  .diff-grid{ grid-template-columns: 1fr; }
  h1{ font-size:38px; }
}

.diff-btn{
  text-align:left;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  padding:16px;
  border-radius: 16px;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.diff-btn:hover{ background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.diff-btn:active{ transform: translateY(1px); }
.diff-title{ font-weight:950; font-size:18px; margin-bottom:6px; }
.diff-desc{ color: var(--muted); font-weight:700; line-height:1.35; }

.game-card{ padding:18px; }
.hud{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.player-panel{
  display:flex;
  gap:12px;
  align-items:center;
  min-width: 280px;
}
.avatarBox{
  width:54px;height:54px;border-radius:50%;
  display:grid;place-items:center;
  border:2px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  font-weight:950;
}
.pmeta{ display:flex; flex-direction:column; gap:6px; }
.pname{ font-weight:950; font-size:16px; }
.hpbar{
  width:210px;
  height:12px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
}
.hpfill{
  height:100%;
  width:100%;
  background: linear-gradient(90deg, var(--ok), #3aa0ff);
}
.hptext{ font-size:12px; color: rgba(233,238,252,.8); font-weight:800; }

.vs{
  font-weight:950;
  letter-spacing:2px;
  opacity:.85;
}

.round-top{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin:16px 0 10px 0;
  flex-wrap:wrap;
}
.pill{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  font-weight:900;
  color: rgba(233,238,252,.9);
}
.timer{
  margin-left:auto;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  font-weight:950;
  font-variant-numeric: tabular-nums;
}

.stage{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  border-radius: 16px;
  padding:18px;
  min-height: 300px;
}
.stage-title{
  font-weight:950;
  font-size:18px;
  margin-bottom:8px;
}
.stage-body{
  display:grid;
  place-items:center;
  min-height: 170px;
  border-radius: 14px;
  border:1px dashed rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.big{
  font-size:46px;
  font-weight:950;
  letter-spacing:1px;
  text-align:center;
  padding:12px;
}

.input-row{
  display:flex;
  gap:10px;
  margin-top:14px;
  align-items:center;
}
.big-input{
  font-size:16px;
  padding:14px 16px;
}
.hint{
  margin-top:10px;
  color: rgba(233,238,252,.65);
  font-size:13px;
  font-weight:800;
}

.result-row{
  margin-top:12px;
  border-top:1px solid rgba(255,255,255,.10);
  padding-top:14px;
}
.result-text{
  font-weight:950;
  font-size:16px;
  margin-bottom:10px;
}

.hidden{ display:none !important; }

.toast{
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 900;
  max-width: 92vw;
  text-align:center;
}
/* =========================
   Chat + Emotes
   ========================= */

.chatWrap{
  margin-top: 14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  padding: 12px;
}

.chatLog{
  height: 110px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding-right: 6px;
}

.chatMsg{
  display:flex;
  gap:8px;
  align-items:flex-start;
  font-size:13px;
  line-height:1.25;
  color: rgba(233,238,252,.85);
}

.chatTag{
  font-weight:950;
  color: rgba(233,238,252,.65);
}

.chatTag.player{ color: rgba(46,229,157,.90); }
.chatTag.cpu{ color: rgba(124,92,255,.95); }

.emoteBar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top: 10px;
}

.emoteBtn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(233,238,252,.80);
  font-weight:900;
  font-size:12px;
  padding:8px 10px;
  border-radius: 999px;
  cursor:pointer;
}
.emoteBtn:hover{
  background: rgba(255,255,255,.08);
}
