:root {
  --bg: #0f1724;
  --card: #0b1220;
  --accent: #60a5fa;
  --muted: #94a3b8;
  --success: #10b981;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Roboto, 'Helvetica Neue', Arial;
}

body {
  background: linear-gradient(180deg, var(--bg), #071027);
  color: #e6eef8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app {
  width: 100%;
  max-width: 950px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.7);
}

header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 18px;
  margin: 0;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

input[type=text],
select,
button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: inherit;
}

select {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.2);
}

select option {
  background: #0b1220;
  color: #e6eef8;
}

main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-top: 14px;
}

.board-wrap {
  background: rgba(255,255,255,0.02);
  padding: 14px;
  border-radius: 10px;
  min-height: 360px;
}

.status {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.grid {
  display: inline-grid;
  border-radius: 6px;
  user-select: none;
}

.cell {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.03);
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.15));
  font-weight: 700;
}

.cell.hidden {
  background: linear-gradient(180deg, #0b2238, #031027);
  cursor: pointer;
}

.cell.flag {
  background: linear-gradient(180deg, #3b2f6b, #261a4a);
}

.cell.mine {
  background: linear-gradient(180deg, #8b1e1e, #4a0f0f);
}

.cell.revealed {
  background: linear-gradient(180deg, #0b1220, #05223a);
  cursor: default;
}

.sidebar {
  background: rgba(255,255,255,0.02);
  padding: 12px;
  border-radius: 10px;
  min-height: 360px;
}

.leaderboard {
  margin-top: 10px;
}

.leaderboard ol {
  padding-left: 18px;
  margin: 8px 0;
}

footer {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
}
