/* ============================================================
   GTA: VALEN COUNTY - MODERN MINIMALIST UCP & ACCOUNT THEME
   Distinct Clean SaaS Dashboard Style (Separate from /forum)
   ============================================================ */
:root {
  --bg-grad: linear-gradient(155deg, #eef4ff 0%, #f8fbff 42%, #e6f0ff 100%);
  --orb-1: rgba(37, 99, 235, 0.14);
  --orb-2: rgba(56, 189, 248, 0.13);

  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-soft: rgba(244, 247, 253, 0.9);
  --surface-hover: rgba(226, 238, 255, 0.52);

  --topbar-bg: rgba(255, 255, 255, 0.74);
  --footer-grad: linear-gradient(180deg, rgba(230, 240, 255, 0) 0%, rgba(196, 219, 255, 0.42) 100%);

  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.15);

  --text-heading: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-border: rgba(37, 99, 235, 0.28);

  --green: #15803d;
  --green-soft: rgba(22, 163, 74, 0.1);
  --green-border: rgba(22, 163, 74, 0.28);

  --gold: #b45309;
  --gold-soft: rgba(245, 158, 11, 0.12);
  --gold-border: rgba(245, 158, 11, 0.32);

  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.09);
  --red-border: rgba(220, 38, 38, 0.28);

  --discord: #5865f2;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 10px 35px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 16px 42px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] {
  --bg-grad: linear-gradient(155deg, #070c17 0%, #0b1326 48%, #0d1b36 100%);
  --orb-1: rgba(37, 99, 235, 0.22);
  --orb-2: rgba(14, 165, 233, 0.14);

  --surface: rgba(17, 25, 42, 0.72);
  --surface-solid: #11192a;
  --surface-soft: rgba(24, 35, 58, 0.72);
  --surface-hover: rgba(37, 99, 235, 0.14);

  --topbar-bg: rgba(11, 18, 34, 0.72);
  --footer-grad: linear-gradient(180deg, rgba(13, 27, 54, 0) 0%, rgba(20, 52, 110, 0.34) 100%);

  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.24);

  --text-heading: #f8fafc;
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-border: rgba(96, 165, 250, 0.34);

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --green-border: rgba(52, 211, 153, 0.32);

  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.14);
  --gold-border: rgba(251, 191, 36, 0.32);

  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --red-border: rgba(248, 113, 113, 0.32);

  --shadow-card: 0 12px 38px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 18px 46px rgba(37, 99, 235, 0.18);
}

@keyframes bgFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-grad);
  background-size: 180% 180%;
  animation: bgFlow 20s ease infinite;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(95px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 460px;
  height: 460px;
  top: -120px;
  right: -100px;
  background: radial-gradient(circle, var(--orb-1), transparent 70%);
}

body::after {
  width: 420px;
  height: 420px;
  bottom: -140px;
  left: -100px;
  background: radial-gradient(circle, var(--orb-2), transparent 70%);
}

header, main, footer {
  position: relative;
  z-index: 1;
}

h1, h2, h3, .p-brand-name {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.16s ease;
}
a:hover { color: var(--accent-hover); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-heading);
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); }

.p-wrap {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── MINIMALIST STICKY GLASS TOPBAR ── */
.p-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.p-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  flex-wrap: wrap;
}

.p-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text-heading);
  text-decoration: none !important;
}

.p-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16);
}

.p-brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-heading);
  display: block;
  line-height: 1.15;
}

.p-brand-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.p-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 999px;
}

.p-nav-link {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.p-nav-link:hover {
  color: var(--text-heading);
}

.p-nav-link.active {
  background: var(--surface-solid);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

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

/* Shared auth chip classes used by common.js */
.ips-signin-link {
  color: var(--text-secondary) !important;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background 0.16s ease, color 0.16s ease;
}
.ips-signin-link:hover {
  background: var(--surface-soft);
  color: var(--text-heading) !important;
}

.ips-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px 3px 4px;
  color: var(--text-heading) !important;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.ips-user-chip:hover {
  border-color: var(--accent-border);
  background: var(--surface-solid);
}
.ips-user-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── MAIN WORKSPACE ── */
.p-main {
  flex: 1;
  padding: 34px 0 46px;
}

.p-hero {
  margin-bottom: 24px;
  animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.p-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.p-hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.p-hero p {
  font-size: 14px;
  color: var(--text-muted);
}

.p-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: start;
}

/* ── MINIMALIST CARDS ── */
.p-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.p-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.p-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.p-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.2px;
}

.p-card-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Clean step list for /ucp */
.p-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.p-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-muted);
}

.p-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.p-steps strong {
  display: block;
  color: var(--text-heading);
  font-size: 13.5px;
  margin-bottom: 1px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.16s ease, box-shadow 0.18s ease, background 0.16s ease, border-color 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover { box-shadow: 0 8px 20px rgba(37, 99, 235, 0.38); }

.btn-discord {
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.28);
}

.btn-secondary {
  background: var(--surface-solid);
  color: var(--text-primary) !important;
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent) !important; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted) !important;
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-soft); color: var(--text-heading) !important; }

.btn-danger {
  background: var(--red-soft);
  color: var(--red) !important;
  border-color: var(--red-border);
}
.btn-danger:hover { background: rgba(220, 38, 38, 0.18); }

/* ── ALERTS (shared class name with common.js) ── */
.ips-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  animation: fadeUp 0.3s ease both;
}
.ips-alert.warn { border-color: var(--gold-border); background: var(--gold-soft); color: var(--gold); }
.ips-alert.error { border-color: var(--red-border); background: var(--red-soft); color: var(--red); }
.ips-alert.success { border-color: var(--green-border); background: var(--green-soft); color: var(--green); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* ── PILLS & METRICS ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pill-open { background: var(--green-soft); border-color: var(--green-border); color: var(--green); }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.kv-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.kv-card:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.kv-card span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.45px;
  margin-bottom: 5px;
}
.kv-card strong {
  font-size: 15px;
  color: var(--text-heading);
  word-break: break-all;
}

/* ── CHARACTER GALLERY CARDS ── */
.char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.char-card {
  display: flex;
  gap: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.char-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-hover);
}
.char-skin {
  width: 72px;
  height: 112px;
  object-fit: contain;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}
.char-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  font-size: 12.5px;
  margin-top: 10px;
}
.char-stats span { color: var(--text-muted); }
.money { color: var(--green); }
.char-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ── LIVE SERVER STATUS & RULES ── */
.server-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.45px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.server-status-badge.status-online { background: var(--green-soft); border-color: var(--green-border); color: var(--green); }
.server-status-badge.status-online .live-dot { background: var(--green); animation: pulseDot 1.8s ease-in-out infinite; }
.server-status-badge.status-maint { background: var(--gold-soft); border-color: var(--gold-border); color: var(--gold); }
.server-status-badge.status-maint .live-dot { background: var(--gold); }
.server-status-badge.status-offline { background: var(--red-soft); border-color: var(--red-border); color: var(--red); }
.server-status-badge.status-offline .live-dot { background: var(--red); }

.online-ic-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 12px;
}
.online-ic-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 7px;
}
.online-ic-head strong { font-size: 14px; color: var(--accent); }
.players-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.players-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
  transition: width 0.5s ease;
}

.rules-list { margin-top: 6px; }
.rules-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.rules-row:last-child { border-bottom: none; }
.rules-key { font-weight: 600; color: var(--text-primary); }
.rules-val {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: 6px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── MODALS (compatible with common.js & account.js) ── */
.ips-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ips-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 32, 0.55);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.2s ease both;
}
.ips-box.ips-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 470px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
  animation: modalPop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ips-modal-card .ips-box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.ips-modal-card .ips-box-body { padding: 20px; }

/* ── SEAMLESS BLENDED GRADIENT MINIMALIST FOOTER ── */
.p-footer {
  background: var(--footer-grad);
  padding: 36px 0 26px;
  margin-top: auto;
  font-size: 12.5px;
  color: var(--text-muted);
}

.p-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.p-footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.p-footer-links a {
  color: var(--text-muted);
  font-weight: 500;
}
.p-footer-links a:hover { color: var(--accent); }

.p-theme-toggle {
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.p-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── MOBILE RESPONSIVENESS ── */
@media (max-width: 860px) {
  .p-split { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .p-wrap { padding: 0 14px; }
  .p-topbar-inner { padding: 10px 0; gap: 10px; }
  .p-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .p-nav::-webkit-scrollbar { display: none; }
  .p-main { padding: 22px 0 32px; }
  .p-hero h1 { font-size: 22px; }
  .p-card { padding: 18px; border-radius: 14px; }
  .form-group input,
  .form-group textarea,
  .form-group select { font-size: 16px; }
  .p-footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 520px) {
  .char-card { flex-direction: column; align-items: center; }
  .char-card > div { width: 100%; }
  .char-skin { width: 82px; height: 118px; }
  .char-card-foot { flex-direction: column; align-items: stretch; }
  .char-card-foot .btn { width: 100%; }
  .kv-grid { grid-template-columns: 1fr; }
}
