/* Minesweeper — scoped game UI */
.ms-shell{
  max-width: 640px;
  margin: 0 auto 28px;
}

.ms-hud{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}
.ms-stat{
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  text-align:center;
}
.ms-stat .label{
  display:block;
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:700;
  margin-bottom:4px;
}
.ms-stat .value{
  font-size:20px;
  font-weight:800;
  font-variant-numeric: tabular-nums;
}

.ms-modes{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}
.ms-mode-btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--muted);
  font-weight:800;
  font-size:13px;
  padding:9px 14px;
  border-radius:999px;
  cursor:pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.ms-mode-btn:hover{
  color:var(--text);
  border-color: rgba(255,255,255,.24);
}
.ms-mode-btn.is-active{
  color:#081018;
  background: linear-gradient(135deg, #A78BFA, #34D399);
  border-color: transparent;
}

.ms-board-wrap{
  position:relative;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.14);
  border-radius:22px;
  padding:14px;
  box-shadow: var(--shadow);
  overflow:auto;
  user-select:none;
}
.ms-board{
  display:grid;
  gap:3px;
  margin:0 auto;
  width:max-content;
}
.ms-cell{
  width:var(--ms-size, 32px);
  height:var(--ms-size, 32px);
  border:0;
  border-radius:6px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
  font-weight:800;
  font-size:calc(var(--ms-size, 32px) * .42);
  line-height:1;
  cursor:pointer;
  padding:0;
  color:var(--text);
  position:relative;
}
.ms-cell:focus-visible{
  outline:2px solid rgba(167,139,250,.9);
  outline-offset:1px;
}
.ms-cell.is-hidden:hover{
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.1));
}
.ms-cell.is-revealed{
  background: rgba(7,10,18,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  cursor:default;
}
.ms-cell.is-flagged{
  background: linear-gradient(180deg, rgba(244,63,94,.35), rgba(244,63,94,.18));
}
.ms-cell.is-mine.is-revealed,
.ms-cell.is-mine.is-exploded{
  background: #EF4444;
}
.ms-cell.is-exploded{
  box-shadow: 0 0 0 2px #FDE047;
}
.ms-cell.is-wrong-flag{
  background: rgba(239,68,68,.45);
}
.ms-cell.n1{ color:#60A5FA; }
.ms-cell.n2{ color:#4ADE80; }
.ms-cell.n3{ color:#F87171; }
.ms-cell.n4{ color:#A78BFA; }
.ms-cell.n5{ color:#FB923C; }
.ms-cell.n6{ color:#2DD4BF; }
.ms-cell.n7{ color:#F472B6; }
.ms-cell.n8{ color:#E2E8F0; }

.ms-flag, .ms-bomb{
  font-size:calc(var(--ms-size, 32px) * .5);
  line-height:1;
}

.ms-overlay{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background: rgba(7,10,18,.62);
  border-radius:22px;
  padding:20px;
  z-index:2;
}
.ms-overlay[hidden]{ display:none !important; }
.ms-overlay-card{
  width:min(100%, 320px);
  text-align:center;
  background: rgba(12,18,40,.95);
  border:1px solid rgba(255,255,255,.16);
  border-radius:18px;
  padding:22px 18px;
  box-shadow: var(--shadow);
}
.ms-overlay-card h2{
  margin:0 0 8px;
  font-size:22px;
}
.ms-overlay-card p{
  margin:0 0 16px;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
}

.ms-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
  justify-content:center;
}

.ms-hint{
  text-align:center;
  font-size:13px;
  color:var(--muted);
  margin-top:10px;
}

.ms-shell.is-busy .ms-cell{ pointer-events:none; }

@media (max-width: 420px){
  .ms-board-wrap{ padding:10px; border-radius:18px; }
  .ms-hud{ grid-template-columns: 1fr 1fr; }
  .ms-stat:last-child{ grid-column: 1 / -1; }
}
