:root {
  --bg: #060b1a;
  --bg-soft: #0f1831;
  --text: #e9efff;
  --muted: #b8c6ef;
  --primary: #5cc8ff;
  --primary-dark: #2ca7e6;
  --card: #121c38;
  --card-soft: #101936;
  --border: #24315e;
  --danger: #f44336;
  --success: #51cf66;
  --warning: #ffb347;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 20% 10%, #1b2d63, var(--bg) 45%);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-dark);
}

.container {
  background: rgba(18, 28, 56, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.header,
.user-header {
  border-bottom-color: var(--border) !important;
}

.section-title {
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
}

.btn,
.refresh-btn,
.button {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn:hover,
.refresh-btn:hover,
.button:hover {
  transform: translateY(-1px);
}

.btn-primary,
.refresh-btn,
.button {
  background: var(--primary) !important;
  color: #00101b !important;
}

.btn-primary:hover,
.refresh-btn:hover,
.button:hover {
  background: var(--primary-dark) !important;
}

.btn-secondary,
.button-secondary {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.btn-secondary:hover,
.button-secondary:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.btn-danger,
.logout-btn {
  background: #ad2c2c !important;
  color: #fff !important;
  border: 1px solid #c53b3b !important;
}

.btn-danger:hover,
.logout-btn:hover {
  background: #912525 !important;
}

.auth-input,
input,
select,
textarea {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}

::placeholder {
  color: var(--muted);
}

.auth-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
}

.auth-form,
.status,
.user-info,
.game-card,
.form-section,
.toxic-messages-section,
.stat,
.stat-card,
.highlight,
.contact,
.access-denied,
.plan-banner,
.highly-toxic-section {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
}

.stat-card,
.messages-table thead {
  background: linear-gradient(145deg, #162754, #0f1b3d) !important;
}

.messages-table {
  background: var(--card);
  border: 1px solid var(--border);
}

.messages-table td,
.messages-table th {
  border-bottom-color: var(--border) !important;
}

.messages-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

.empty-state,
.loading,
.table-time,
.user-info,
.footer,
p,
small,
li {
  color: var(--muted);
}

.game-badge,
.badge {
  background: var(--danger);
  color: #fff;
}

.auth-error {
  color: #ff8f8f !important;
}

.auth-success {
  color: #8cffb0 !important;
}

/* override common inline legacy colors */
[style*="color: #666"],
[style*="color:#666"],
[style*="color: #555"],
[style*="color:#555"],
[style*="color: #888"],
[style*="color:#888"] {
  color: var(--muted) !important;
}

[style*="color: #667eea"],
[style*="color:#667eea"],
[style*="color: #3949ab"],
[style*="color:#3949ab"],
[style*="border-bottom: 2px solid #667eea"] {
  color: var(--primary) !important;
  border-color: var(--border) !important;
}

[style*="background: white"],
[style*="background:white"],
[style*="background: #fff"] {
  background: var(--card) !important;
}
