:root{
  --bg1:#b5ffd9;
  --bg2:#a5d8ff;
  --bg3:#fbd1ff;

  --card: rgba(255,255,255,.72);
  --stroke: rgba(0,0,0,.08);

  --text:#0f172a;
  --muted:#64748b;

  --you:#0ea5e9;
  --pc:#ef4444;

  --p:#14b8a6;
  --p2:#0ea5e9;

  --shadow: 0 22px 55px rgba(15,23,42,.18);
  --shadow2: 0 12px 28px rgba(15,23,42,.12);

  --radius: 26px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Poppins",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 15% 10%, var(--bg3), transparent 38%),
    radial-gradient(circle at 85% 20%, var(--bg2), transparent 35%),
    radial-gradient(circle at 55% 95%, var(--bg1), transparent 40%),
    linear-gradient(135deg,#f8fafc,#eef2ff);
  overflow-x:hidden;
}

/* ====== Arcade Glass Navigation ====== */

.arcade-nav{
  position:absolute;
  top:18px;
  left:22px;
  z-index:50;
}

.arcade-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 20px;
  border-radius:40px;
  font-weight:600;
  font-size:14px;
  text-decoration:none;
  color:#0f172a;

  background:rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border:1px solid rgba(255,255,255,0.5);
  box-shadow:0 15px 35px rgba(0,0,0,.15);
  transition:.3s ease;
}

.arcade-btn:hover{
  transform:translateY(-4px);
  box-shadow:0 25px 55px rgba(0,0,0,.25);
}

.arcade-btn .icon{
  font-size:18px;
}


#fxLayer{
  position:fixed;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:9999;
}

.fx-fire{
  position:absolute;
  width:8px;
  height:8px;
  border-radius:50%;
  animation:firework 1.1s ease-out forwards;
}

@keyframes firework{
  to{
    transform:translate(var(--dx), var(--dy));
    opacity:0;
  }
}

.fx-emoji{
  position:absolute;
  font-size:34px;
  animation:fall 2s linear forwards;
}

@keyframes fall{
  from{ transform:translateY(-40px); opacity:1; }
  to{ transform:translateY(110vh); opacity:0; }
}


#fxLayer{
  position:fixed;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:9999;
}

/* FIREWORK PARTICLES */
.fx-fire{
  position:absolute;
  width:8px;
  height:8px;
  border-radius:50%;
  animation:firework 900ms ease-out forwards;
}

@keyframes firework{
  to{
    transform:translate(var(--dx), var(--dy));
    opacity:0;
  }
}

/* TEASE EMOJIS */
.fx-emoji{
  position:absolute;
  font-size:28px;
  animation:fall 1.6s linear forwards;
}

@keyframes fall{
  from{ transform:translateY(-40px); opacity:1; }
  to{ transform:translateY(110vh); opacity:0; }
}


/* Ambient orbs */
.bg-orb{
  position:fixed;
  width:420px; height:420px;
  border-radius:50%;
  filter: blur(30px);
  opacity:.18;
  pointer-events:none;
}
.o1{ left:-140px; top:-160px; background:#ff7ad9; }
.o2{ right:-180px; top:70px; background:#27b8ff; }
.o3{ left:35%; bottom:-220px; background:#00f5b7; }

.page{
  max-width:980px;
  margin:0 auto;
  padding:18px 14px 40px;
}

.top{
  text-align:center;
  padding:10px 6px 6px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.7);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow2);
  font-weight:900;
  font-size:13px;
}
.top h1{
  margin:10px 0 4px;
  font-size:clamp(28px, 4vw, 44px);
  letter-spacing:-.02em;
}
.top p{
  margin:0;
  color:var(--muted);
}

.card{
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding:16px;
  margin:14px auto;
}

.hidden{ display:none !important; }

.start-grid{
  display:grid;
  grid-template-columns: 1fr 1fr auto;
  gap:12px;
  align-items:end;
}
.field label{
  display:block;
  font-weight:900;
  font-size:12px;
  margin:0 0 6px;
  color:rgba(15,23,42,.85);
}
.field input,.field select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.85);
  outline:none;
  font-family:inherit;
  font-size:14px;
}
.field input:focus,.field select:focus{
  border-color:rgba(14,165,233,.45);
  box-shadow:0 0 0 4px rgba(14,165,233,.15);
}

.btn{
  border:1px solid var(--stroke);
  background:#fff;
  border-radius:16px;
  padding:12px 14px;
  font-weight:900;
  cursor:pointer;
  box-shadow:var(--shadow2);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  user-select:none;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 16px 34px rgba(15,23,42,.14); }
.btn:active{ transform: translateY(0px) scale(.99); }
.btn.primary{
  background: linear-gradient(135deg, var(--p), var(--p2));
  color:#fff;
  border-color:rgba(255,255,255,.25);
}
.btn.ghost{
  background:rgba(255,255,255,.55);
}

.rules{
  margin-top:12px;
  display:grid;
  gap:8px;
}
.rule{
  display:flex;
  gap:10px;
  align-items:flex-start;
  font-size:13px;
  color:var(--muted);
  background:rgba(255,255,255,.55);
  border:1px solid rgba(0,0,0,.06);
  padding:10px 12px;
  border-radius:16px;
}
.rule span{ font-size:16px; }

.hud{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.hud-left{ display:flex; gap:10px; flex-wrap:wrap; }
.pill{
  padding:10px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.8);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow2);
  font-size:13px;
}
.you{ color:var(--you); font-weight:900; }
.pc{ color:var(--pc); font-weight:900; }
.sep{ color:rgba(15,23,42,.25); padding:0 6px; }

.game-card{ padding:14px; }

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
  max-width:560px;
  margin:0 auto;
}
.cell{
  position:relative;
  border-radius:22px;
  min-height:92px;
  background:rgba(255,255,255,.9);
  border:1px solid rgba(0,0,0,.06);
  box-shadow: 0 18px 40px rgba(15,23,42,.12);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:38px;
  font-weight:900;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, filter .12s ease;
}
.cell:hover{ transform: translateY(-2px); box-shadow: 0 24px 50px rgba(15,23,42,.16); }
.cell.taken{ cursor:not-allowed; opacity:.75; filter:saturate(.8); }
.cell.bounce{ animation: bounce .25s ease; }
@keyframes bounce{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.05); }
  100%{ transform: scale(1); }
}

.tag{
  position:absolute;
  top:10px; left:12px;
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.85);
}
.tag.you{ color:var(--you); }
.tag.pc{ color:var(--pc); }

.hint{
  max-width:560px;
  margin:12px auto 0;
  padding:12px 12px;
  border-radius:18px;
  border:1px dashed rgba(0,0,0,.12);
  color:var(--muted);
  font-size:13px;
  text-align:center;
  background:rgba(255,255,255,.55);
}

/* Overlay */
.overlay{
  position:fixed;
  inset:0;
  background: rgba(2,6,23,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:50;
}
.overlay-card{
  width:min(520px, 100%);
  background:rgba(255,255,255,.9);
  border:1px solid rgba(255,255,255,.25);
  border-radius:26px;
  box-shadow:0 30px 90px rgba(0,0,0,.35);
  padding:18px;
  text-align:center;
  position:relative;
  overflow:hidden;
}
.result-emoji{ font-size:44px; }
.overlay-card h2{ margin:8px 0 4px; }
.overlay-card p{ margin:0 0 10px; color:var(--muted); }

.combo{
  margin:10px auto 0;
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.combo .pillNum{
  padding:10px 12px;
  border-radius:999px;
  font-weight:900;
  background:rgba(255,255,255,.85);
  border:1px solid rgba(0,0,0,.08);
  box-shadow:var(--shadow2);
}
.overlay-actions{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:14px;
}

/* Confetti */
.confetti{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}
.confetti i{
  position:absolute;
  width:10px; height:14px;
  border-radius:3px;
  opacity:.85;
  animation: fall 1.2s linear forwards;
}
@keyframes fall{
  from{ transform: translateY(-40px) rotate(0deg); opacity:.9; }
  to{ transform: translateY(540px) rotate(240deg); opacity:0; }
}

.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:18px;
  background: rgba(15,23,42,.92);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  font-size:13px;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  z-index:60;
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(-6px);
}

.foot{
  text-align:center;
  color:rgba(15,23,42,.5);
  font-size:12px;
  padding-top:6px;
}

@media (max-width: 860px){
  .start-grid{ grid-template-columns: 1fr; }
  .btn.primary{ width:100%; }
  .cell{ min-height:84px; font-size:34px; }
}
