:root {
  --bg: #0b1020;
  --card: #151c2f;
  --border: #27324a;
  --primary: #5b8def;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #f8fafc;
  --muted: #94a3b8;
  --water: #10182a;
  --ship: #7c8aa5;
  --miss: #cbd5e1;
  --hit: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top, rgba(91, 141, 239, 0.18), transparent 28%),
    linear-gradient(180deg, #0b1020 0%, #0d1428 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: rgba(11, 16, 32, 0.7);
  color: var(--text);
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 1.75rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.headline {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}

.subtle {
  color: var(--muted);
}

.card {
  background: rgba(21, 28, 47, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.card-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, #5b8def, #436fd0);
  color: var(--text);
}

.btn-secondary {
  background: rgba(39, 50, 74, 0.8);
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.btn-success {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(11, 16, 32, 0.65);
}

.status-success {
  color: #bbf7d0;
}

.status-warning {
  color: #fde68a;
}

.status-danger {
  color: #fecaca;
}

.message-box {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.55);
}

.hidden {
  display: none !important;
}

/* ── Theme toggle button ─────────────────────────────────────────────────── */
.theme-toggle {
  font-size: 14px;
  line-height: 1;
  padding: 5px 8px !important;
  border-radius: 6px !important;
  min-width: 0;
}

.theme-toggle:hover:not(:disabled) {
  transform: none !important;
}

/* Floating variant for auth pages (no nav bar) */
.theme-toggle-float {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 100;
  font-size: 16px;
  background: rgba(255,255,255,0.85);
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
  backdrop-filter: blur(4px);
  transition: background 0.15s, border-color 0.15s;
}

.theme-toggle-float:hover {
  background: #f6f8fa;
  transform: none !important;
}

html[data-theme="dark"] .theme-toggle-float {
  background: rgba(22,27,34,0.9);
  border-color: #30363d;
  color: #e6edf3;
}

html[data-theme="dark"] .theme-toggle-float:hover {
  background: #21262d;
}

.empty-state {
  padding: 0.95rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

@media (max-width: 900px) {
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
