:root{
  --sb-bg:#0b1220;
  --sb-card:#0f1a2b;
  --sb-card2:#0c1524;
  --sb-border:rgba(148,163,184,0.18);
  --sb-text:#e5e7eb;
  --sb-muted:#94a3b8;
  --sb-accent:#38bdf8;
  --sb-accent2:#a78bfa;
  --sb-good:#22c55e;
  --sb-warn:#f59e0b;
  --sb-bad:#ef4444;
  --sb-cell:#0b1220;
  --sb-cell2:#0f1a2b;
  --sb-gridline:rgba(148,163,184,0.22);
  --sb-ship:rgba(148,163,184,0.45);
}

.sb-root{
  color:var(--sb-text);
}

.sb-pvp{
  --sb-accent:#e5e7eb;
  --sb-accent2:#94a3b8;
}

.sb-card{
  background:linear-gradient(180deg, rgba(56,189,248,0.06), rgba(167,139,250,0.04)), var(--sb-card);
  border:1px solid var(--sb-border);
  border-radius:16px;
  padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,0.35);
}

.sb-pvp .sb-card{
  background:#0b0b0f;
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:none;
}

.sb-pvp-header{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  margin-bottom:10px;
}

.sb-pvp-timer{
  font-size:18px;
  font-weight:800;
  color:#f3f4f6;
  letter-spacing:0.08em;
}

.sb-rotate{
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.2);
  background:rgba(255,255,255,0.08);
  color:#e5e7eb;
  padding:8px 14px;
  font-weight:700;
  cursor:pointer;
}

.sb-section{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}

.sb-section-title{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.24em;
  color:#94a3b8;
  font-weight:700;
}

.sb-section-title.center{
  text-align:center;
}

.sb-hidden{
  display:none;
}

.sb-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.sb-title h3{
  margin:0;
  font-size:16px;
  font-weight:800;
  letter-spacing:0.2px;
}

.sb-badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.sb-badge{
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  color:var(--sb-muted);
}

.sb-controls{
  display:flex;
  align-items:center;
  gap:10px;
  margin:10px 0 10px 0;
}

.sb-controls input{
  width:110px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(56,189,248,0.35);
  background:rgba(0,0,0,0.25);
  color:var(--sb-text);
  padding:0 12px;
  outline:none;
}

.sb-controls input:focus{
  border-color:rgba(56,189,248,0.65);
  box-shadow:0 0 0 3px rgba(56,189,248,0.14);
}

.sb-btn{
  flex:1;
  height:40px;
  border-radius:12px;
  border:none;
  background:linear-gradient(135deg, rgba(56,189,248,1), rgba(167,139,250,1));
  color:#07101a;
  font-weight:900;
  cursor:pointer;
}

.sb-btn:active{ opacity:0.9; }
.sb-btn[disabled]{ opacity:0.5; cursor:not-allowed; }

.sb-status{
  margin:8px 0 12px 0;
  font-size:12px;
  color:var(--sb-accent);
  min-height:16px;
  font-weight:700;
}

.sb-pvp .sb-status{
  text-align:center;
  color:#e5e7eb;
}

.sb-layout{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.sb-board{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.sb-board-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
  color:var(--sb-muted);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.08em;
}

.sb-board-title strong{
  color:var(--sb-text);
  letter-spacing:0.02em;
}

.sb-fleet{
  width:52px;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding-top:22px;
}

.sb-pvp .sb-fleet{
  width:auto;
  padding-top:0;
  flex-direction:row;
  flex-wrap:wrap;
  gap:8px;
}

.sb-shipline{
  display:flex;
  gap:3px;
}

.sb-dot{
  width:9px;
  height:9px;
  border-radius:3px;
  background:rgba(148,163,184,0.45);
  border:1px solid rgba(148,163,184,0.2);
}

.sb-dot.sb-damaged{ background:rgba(245,158,11,0.95); border-color:rgba(245,158,11,0.35); }
.sb-dot.sb-destroyed{ background:rgba(239,68,68,0.65); border-color:rgba(239,68,68,0.35); opacity:0.35; }

.sb-grid{
  display:grid;
  grid-template-columns:repeat(8, 1fr);
  grid-template-rows:repeat(8, 1fr);
  gap:2px;
  background:rgba(148,163,184,0.10);
  border:1px solid rgba(148,163,184,0.22);
  border-radius:14px;
  padding:6px;
  width:100%;
  max-width:320px;
  aspect-ratio:1;
}

.sb-cell{
  background:linear-gradient(180deg, rgba(15,26,43,0.9), rgba(11,18,32,0.9));
  border:1px solid rgba(148,163,184,0.14);
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  user-select:none;
  aspect-ratio:1;
}

.sb-cell.sb-ship{ background:linear-gradient(180deg, rgba(148,163,184,0.55), rgba(148,163,184,0.35)); border-color:rgba(148,163,184,0.25); }
.sb-cell.sb-hit{ background:linear-gradient(180deg, rgba(245,158,11,0.95), rgba(245,158,11,0.65)); border-color:rgba(245,158,11,0.35); }
.sb-cell.sb-dead{ background:linear-gradient(180deg, rgba(239,68,68,0.95), rgba(239,68,68,0.55)); border-color:rgba(239,68,68,0.35); }
.sb-cell.sb-miss{ background:rgba(255,255,255,0.04); }
.sb-cell.sb-miss::after{ content:"•"; color:rgba(148,163,184,0.85); font-size:14px; line-height:1; transform:translateY(-1px); }

.sb-modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.72);
  z-index:3000;
  align-items:center;
  justify-content:center;
  padding:16px;
}

.sb-modal{
  width:100%;
  max-width:420px;
  background:linear-gradient(180deg, rgba(56,189,248,0.06), rgba(167,139,250,0.04)), #0b1220;
  border:1px solid rgba(56,189,248,0.25);
  border-radius:18px;
  padding:16px;
  box-shadow:0 20px 60px rgba(0,0,0,0.55);
}

.sb-modal h2{
  margin:0;
  font-size:18px;
  font-weight:900;
}

.sb-modal p{
  margin:8px 0 0 0;
  color:var(--sb-muted);
  font-size:13px;
  line-height:1.35;
}

.sb-modal-actions{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.sb-modal-actions button{
  height:42px;
  border-radius:12px;
  border:none;
  font-weight:900;
  cursor:pointer;
}

.sb-modal-actions .sb-primary{
  background:linear-gradient(135deg, rgba(56,189,248,1), rgba(167,139,250,1));
  color:#07101a;
}

.sb-modal-actions .sb-secondary{
  background:rgba(255,255,255,0.10);
  color:var(--sb-text);
}

@media (min-width: 560px){
  .sb-layout{ gap:16px; }
  .sb-board{ gap:12px; }
}
