:root{
  --bg:#05070c;
  --panel:#0b1220;
  --panel2:#0a0f1a;
  --line:rgba(255,255,255,.08);
  --text:rgba(255,255,255,.9);
  --muted:rgba(255,255,255,.65);
  --muted2:rgba(255,255,255,.45);

  --primary:#3b82f6;
  --danger:#ef4444;

  --r:16px;
  --shadow: 0 20px 80px rgba(0,0,0,.55);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 500px at 30% 0%, rgba(59,130,246,.18), transparent 60%),
              radial-gradient(1000px 500px at 70% 10%, rgba(147,51,234,.16), transparent 55%),
              var(--bg);
  color:var(--text);
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(5,7,12,.7);
  backdrop-filter: blur(10px);
}
.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:40px; height:40px;
  display:grid; place-items:center;
  border-radius:12px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
}
.title{ font-weight:800; letter-spacing:.2px; font-size:18px; }
.subtitle{ font-size:12px; color:var(--muted); margin-top:2px; }
.right{ display:flex; gap:10px; align-items:center; }
.badge{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  font-size:12px;
  color:var(--muted);
}
.hidden{ display:none; }

/* Layout */
.layout{
  padding:18px;
  display:grid;
  gap:16px;
  grid-template-columns: 360px 420px 1fr 1fr;
  align-items:start;
}
.panel{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding:14px;
}
.panel h2{ margin:0 0 10px 0; font-size:16px; }
.subhead{ margin:0 0 10px 0; font-size:13px; color:var(--muted); font-weight:700; }
.span2{ grid-column: span 2; }

.divider{
  height:1px;
  background: var(--line);
  margin:12px 0;
}

/* Fields & buttons */
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.field span{ font-size:12px; color:var(--muted); }
.field input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
.field input:focus{ border-color: rgba(59,130,246,.6); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.field.mini{ width:110px; margin:0; }
.row{ display:flex; gap:10px; align-items:flex-end; }
.grow{ flex:1; }

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{ background: rgba(255,255,255,.10); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn.primary{ background: rgba(59,130,246,.25); border-color: rgba(59,130,246,.45); }
.btn.primary:hover{ background: rgba(59,130,246,.34); }
.btn.danger{ background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.38); }
.btn.danger:hover{ background: rgba(239,68,68,.26); }

.hint{ font-size:12px; color:var(--muted); margin:6px 0 0 0; }
.tip{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed rgba(255,255,255,.12);
  color:var(--muted);
  background: rgba(0,0,0,.18);
  font-size:12px;
}

/* Players */
.players{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.playerTag{
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.22);
  font-size:12px;
  color:var(--muted);
}

/* Draw */
.drawCard{
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  padding:14px;
}
.drawLabel{ font-size:12px; color:var(--muted); }
.drawNumber{
  font-size:74px;
  font-weight:900;
  letter-spacing:1px;
  margin:6px 0 10px 0;
  line-height:1;
}
.drawActions{ display:flex; gap:10px; }
.drawMeta{ margin-top:8px; font-size:12px; color:var(--muted); }

.drawnList{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  max-height:120px;
  overflow:auto;
  padding-right:6px;
}
.pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  color:var(--muted);
  font-size:12px;
}
.pill.last{
  border-color: rgba(59,130,246,.55);
  background: rgba(59,130,246,.18);
  color: rgba(255,255,255,.92);
}

/* Board 1-90 */
.board90{
  display:grid;
  grid-template-columns: repeat(10, minmax(0,1fr));
  gap:8px;
}
.b90{
  padding:10px 0;
  text-align:center;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.20);
  color: var(--muted);
  font-weight:800;
  font-size:12px;
}
.b90.drawn{
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
}
.b90.last{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.16);
}

/* Tickets */
.ticketsHeader{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-start;
}
.ticketsTools{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.colorPick{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color: var(--muted);
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px 10px;
  background: rgba(0,0,0,.18);
}
.colorPick input{ width:28px; height:22px; border:0; background:transparent; padding:0; }

.tickets{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:14px;
}

.ticketCard{
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  padding:12px;
  transition: transform .08s ease, border-color .08s ease;
}
.ticketCard:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.14);
}
.ticketCard.mine{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.ticketTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  gap:10px;
}
.ticketId{ font-weight:900; font-size:13px; }
.taken{ font-size:12px; color:var(--muted); }
.lockedText{ color: rgba(255,255,255,.8); }

.ticketGrid{
  display:grid;
  grid-template-columns: repeat(9, 1fr);
  gap:6px;
}
.cell{
  height:24px;
  border-radius:7px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:12px;
  color: rgba(255,255,255,.9);
  user-select:none;
}
.cell.empty{
  background: rgba(0,0,0,.20);
  border-color: rgba(255,255,255,.06);
  color: transparent;
}
.cell.hit{
  outline: 2px solid rgba(255,255,255,.18);
}
.cell.marked{
  outline: 2px solid rgba(255,255,255,.28);
}

/* Responsive */
@media (max-width: 1200px){
  .layout{ grid-template-columns: 360px 1fr 1fr; }
  .span2{ grid-column: span 2; }
}
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .span2{ grid-column: span 1; }
  .tickets{ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .drawNumber{ font-size:62px; }
}
