:root{
  --bg:#0b0f14;
  --card:#111826;
  --card2:#0f1623;
  --text:#e6edf3;
  --muted:#95a4b6;
  --accent:#4cc2ff;
  --good:#4ade80;
  --bad:#fb7185;
  --border:rgba(255,255,255,.08);
  --shadow: 0 12px 30px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 600px at 20% 0%, #12243a, var(--bg));
  color:var(--text);
}

.app{ min-height:100vh; }
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}
.brand{ font-weight:800; letter-spacing:.5px; }
.status{ color:var(--muted); font-size:14px; }

.layout{
  display:grid;
  grid-template-columns: 340px 1fr;
  grid-template-rows: auto auto;
  gap:16px;
  padding:16px;
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow: var(--shadow);
  padding:14px;
}
.lobby{ grid-row: 1 / span 2; }
.board{ }
.hand{ }

h2{ margin:0 0 10px 0; font-size:18px; }
h3{ margin:14px 0 8px; font-size:14px; color:var(--muted); }
.muted{ color:var(--muted); font-size:13px; }

.row{ display:flex; gap:10px; margin:10px 0; }
.row.two{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap:10px; }
input{
  width:100%;
  background: rgba(0,0,0,.25);
  border:1px solid var(--border);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}
button{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
button:hover{ border-color: rgba(255,255,255,.2); }
button:disabled{ opacity:.5; cursor:not-allowed; }
button.primary{
  background: rgba(76,194,255,.18);
  border-color: rgba(76,194,255,.35);
}

ul{ padding-left:18px; margin:0; list-style-type: none;}
li{ margin:6px 0; color:var(--muted); list-style-type: none;}

.boardHeader{ display:flex; justify-content:space-between; align-items:baseline; }
.zones{ display:flex; flex-direction:column; gap:14px; margin-top:10px; }
.zoneTitle{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.12em;
  text-transform:uppercase;
  margin-bottom:6px;
}
.zoneRow{
  min-height:92px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  padding:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
@keyframes popIn {
  from { opacity:0; transform: translateY(8px) scale(.98); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.cardSlot{
  width:120px;
  height:72px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, filter .14s ease;
  animation: popIn .18s ease-out;
}
.cardSlot.faceDown{
  background: radial-gradient(300px 140px at 20% 20%, rgba(76,194,255,.22), rgba(255,255,255,.04));
}
.cardName{
  font-size:12px;
  text-align:center;
  line-height:1.2;
}
.cardSlot.clickable{
  cursor:pointer;
  border-color: rgba(76,194,255,.55);
  box-shadow: 0 0 0 1px rgba(76,194,255,.18), 0 10px 26px rgba(0,0,0,.35);
}
.cardSlot.clickable:hover{
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(76,194,255,.28),
    0 0 22px rgba(76,194,255,.18),
    0 16px 34px rgba(0,0,0,.45);
}
@keyframes softPulse {
  0%   { box-shadow: 0 0 0 1px rgba(76,194,255,.16), 0 10px 26px rgba(0,0,0,.35); }
  50%  { box-shadow: 0 0 0 1px rgba(76,194,255,.30), 0 0 24px rgba(76,194,255,.18), 0 10px 26px rgba(0,0,0,.35); }
  100% { box-shadow: 0 0 0 1px rgba(76,194,255,.16), 0 10px 26px rgba(0,0,0,.35); }
}
.cardSlot.turnPulse{
  animation: softPulse 1.4s ease-in-out infinite;
}
.ownerTag{
  position:absolute;
  bottom:6px;
  left:8px;
  font-size:10px;
  color: rgba(255,255,255,.55);
}

.limboPill{
  width:52px; height:52px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
}

.handRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  padding-top:10px;
}

.handCard{
  width:160px;
  height:96px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.2));
  padding:12px;
  cursor:pointer;
  position:relative;
  transition: transform .12s ease, opacity .2s ease;
}
.handCard:hover{ transform: translateY(-3px); border-color: rgba(76,194,255,.35); }
.handCard.disabled{ opacity:.35; cursor:not-allowed; }
.handCard .title{ font-weight:700; font-size:13px; }
.handCard .sub{ color:var(--muted); font-size:11px; margin-top:6px; }

.fadeOut{ opacity:0; transform: translateY(6px) scale(.98); }

.turnBanner{
  text-align:center;
  font-weight:800;
  letter-spacing:.08em;
  padding:10px 14px;
  border-bottom:1px solid var(--border);
  transform: translateY(-8px);
  opacity:0;
  transition: transform .18s ease, opacity .18s ease;
}

.turnBanner.myTurn{
  background: rgba(74,222,128,.18);
  color: var(--good);
}

.turnBanner.nextTurn{
  background: rgba(250,204,21,.18);
  color: #fde047;
}

.turnBanner.hidden{
  display:none;
}
.turnBanner:not(.hidden){
  transform: translateY(0);
  opacity:1;
}
.factionCardContent{
  display:flex;
  align-items:center;
  gap:10px;
}

.factionIcon{
  width:34px;
  max-width:55px;
  height:auto;
  flex-shrink:0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}

/* Players list UX */
.playerItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 8px;
  border-radius:10px;
}

.playerItem.active{
  background: rgba(74,222,128,.10);
  border: 1px solid rgba(74,222,128,.22);
}

.playerItem.next{
  background: rgba(250,204,21,.08);
  border: 1px solid rgba(250,204,21,.18);
}

.badges{
  display:flex;
  gap:6px;
  flex-shrink:0;
}

.badge{
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--muted);
}

.badge.active{
  background: rgba(74,222,128,.16);
  border-color: rgba(74,222,128,.30);
  color: var(--good);
}

.badge.next{
  background: rgba(250,204,21,.16);
  border-color: rgba(250,204,21,.30);
  color: #fde047;
}

.phaseBar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 6px;
}

.phaseStep{
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--muted);
}

.phaseStep.active{
  background: rgba(76,194,255,.16);
  border-color: rgba(76,194,255,.30);
  color: var(--text);
}

.phaseStep.done{
  opacity:.7;
}

.phaseHelp{
  color: var(--muted);
  font-size:13px;
  margin-bottom:10px;
}
.zone.activeZone .zoneRow{
  border-color: rgba(76,194,255,.38);
  box-shadow:
    0 0 0 1px rgba(76,194,255,.10),
    0 0 26px rgba(76,194,255,.12) inset;
}

.card.hand.activeHand{
  border-color: rgba(76,194,255,.28);
  box-shadow: 0 0 0 1px rgba(76,194,255,.10), var(--shadow);
}
