/* =============================================
   RTP.Casino Design System v2 — Intelligence Platform

   A total UI rewrite. Dashboard-first, data-dense,
   terminal-inspired. Built for trust and clarity.
   ============================================= */

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

:root {
  /* ── Background layers ────────────────────── */
  --bg-base: #08090d;
  --bg-raised: #0e1017;
  --bg-surface: #141620;
  --bg-card: #181b28;
  --bg-card-hover: #1e2235;
  --bg-input: #12141e;

  /* ── Accent palette ───────────────────────── */
  --accent: #00d26a;
  --accent-hover: #00f07a;
  --accent-muted: rgba(0, 210, 106, 0.12);
  --accent-glow: rgba(0, 210, 106, 0.25);
  --amber: #f5a623;
  --amber-muted: rgba(245, 166, 35, 0.12);
  --blue: #3b82f6;
  --blue-muted: rgba(59, 130, 246, 0.12);
  --red: #ef4444;
  --red-muted: rgba(239, 68, 68, 0.10);

  /* ── Text ─────────────────────────────────── */
  --text-1: #eef0f6;
  --text-2: #8b90a0;
  --text-3: #4e5364;
  --text-link: var(--accent);

  /* ── Borders ──────────────────────────────── */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(0, 210, 106, 0.3);

  /* ── Typography ───────────────────────────── */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-size: 15px;
  --line-height: 1.6;

  /* ── Spacing scale ────────────────────────── */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  /* ── Radius ───────────────────────────────── */
  --r1: 6px;
  --r2: 10px;
  --r3: 14px;
  --r4: 20px;

  /* ── Shadows ──────────────────────────────── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.6);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* ── Transitions ──────────────────────────── */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 400ms;

  /* ── Layout ───────────────────────────────── */
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --content-max: 1280px;
}

html {
  font-size: var(--font-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text-1);
  background: var(--bg-base);
  line-height: var(--line-height);
  min-height: 100vh;
}

a { color: var(--text-link); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ── Typography ─────────────────────────────── */
h1, h2, h3, h4, h5 {
  color: var(--text-1);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

.mono { font-family: var(--font-mono); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-amber { color: var(--amber); }

/* ── App Shell: Sidebar + Topbar + Content ──── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
}

/* ── Sidebar ────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  padding: var(--s5) 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
@media (max-width: 1024px) { .sidebar { display: none; } }

.sidebar-logo {
  padding: 0 var(--s5);
  margin-bottom: var(--s6);
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.sidebar-logo img { height: 28px; }
.sidebar-logo span {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-section {
  margin-bottom: var(--s4);
}
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: var(--s2) var(--s5) var(--s2);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s5);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all var(--t-fast) var(--ease);
}
.sidebar-link:hover {
  color: var(--text-1);
  background: var(--accent-muted);
  border-left-color: var(--accent);
}
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-muted);
  border-left-color: var(--accent);
}
.sidebar-link i { width: 18px; text-align: center; font-size: 14px; }

.sidebar-footer {
  margin-top: auto;
  padding: var(--s4) var(--s5);
  border-top: 1px solid var(--border);
}

/* ── Topbar ─────────────────────────────────── */
.topbar {
  grid-area: topbar;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s5);
  gap: var(--s4);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px) saturate(120%);
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: var(--s2) var(--s4) var(--s2) 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast);
}
.topbar-search input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.topbar-search input::placeholder { color: var(--text-3); }
.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 14px;
}
.topbar-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-left: auto;
}
.topbar-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 14px;
}
.topbar-btn:hover { color: var(--text-1); border-color: var(--border-hover); background: var(--bg-surface); }

/* ── Mobile topbar ──────────────────────────── */
.mobile-menu-btn { display: none; }
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex; }
  .topbar-logo-mobile {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-weight: 800;
    color: var(--text-1);
  }
  .topbar-logo-mobile img { height: 24px; }
}
@media (min-width: 1025px) {
  .topbar-logo-mobile { display: none; }
}

/* ── Main content ───────────────────────────── */
.main {
  grid-area: main;
  padding: var(--s6);
  max-width: var(--content-max);
  width: 100%;
}
@media (max-width: 768px) { .main { padding: var(--s4); } }

/* ── Bento Grid (homepage) ──────────────────── */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s4);
}
.bento-2 { grid-column: span 2; }
.bento-3 { grid-column: span 3; }
.bento-4 { grid-column: span 4; }
.bento-tall { grid-row: span 2; }
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-3 { grid-column: span 2; }
  .bento-4 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento-2, .bento-3, .bento-4 { grid-column: span 1; }
}

/* ── Glass Card ─────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s5);
  transition: all var(--t-base) var(--ease);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}
.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-muted), transparent 60%);
  z-index: 0;
  opacity: 0;
  transition: opacity var(--t-base);
}
.card-glow:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s4);
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}
.badge-green { background: var(--accent-muted); color: var(--accent); }
.badge-amber { background: var(--amber-muted); color: var(--amber); }
.badge-blue { background: var(--blue-muted); color: var(--blue); }
.badge-red { background: var(--red-muted); color: var(--red); }

.card-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin-bottom: var(--s2);
}
.card-value.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: var(--s3);
}
.card-link:hover { gap: 10px; }

/* ── Stat row ───────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s4);
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: var(--s4) var(--s5);
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s1);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-1);
}

/* ── Data Table (terminal style) ────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.data-table thead {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
}
.data-table th {
  background: var(--bg-surface);
  padding: var(--s3) var(--s4);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}
.data-table tr:hover td { background: var(--bg-card); }
.data-table .mono { font-family: var(--font-mono); font-size: 13px; }

/* ── Tag / Chip ─────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg-surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r2);
  border: none;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-base);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); color: var(--bg-base); }
.btn-outline {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--text-1); border-color: var(--border-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { color: var(--text-1); background: var(--bg-surface); }
.btn-sm { font-size: 13px; padding: 7px 14px; }

/* ── Page header ────────────────────────────── */
.page-header {
  margin-bottom: var(--s7);
}
.page-header h1 {
  margin-bottom: var(--s3);
}
.page-header .subtitle {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 640px;
  line-height: 1.6;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: var(--s4);
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { font-size: 10px; }

/* ── Content article ────────────────────────── */
.article {
  max-width: 720px;
}
.article h2 { margin: var(--s7) 0 var(--s4); }
.article h3 { margin: var(--s6) 0 var(--s3); }
.article p { margin-bottom: var(--s4); color: var(--text-2); }
.article ul, .article ol { margin-bottom: var(--s4); padding-left: var(--s5); color: var(--text-2); }
.article li { margin-bottom: var(--s2); }
.article img { border-radius: var(--r3); margin: var(--s5) 0; }
.article blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--s4) var(--s5);
  margin: var(--s5) 0;
  background: var(--accent-muted);
  border-radius: 0 var(--r2) var(--r2) 0;
  color: var(--text-2);
}
.article code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
}
.article pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: var(--s4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  margin: var(--s5) 0;
}

/* ── Tool panel (calculator/verifier) ───────── */
.tool-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s6);
  margin-bottom: var(--s6);
}
@media (max-width: 720px) { .tool-panel { grid-template-columns: 1fr; } }

.tool-inputs { display: flex; flex-direction: column; gap: var(--s4); }
.tool-field { display: flex; flex-direction: column; gap: 6px; }
.tool-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
}
.tool-field input,
.tool-field select {
  padding: var(--s3) var(--s4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color var(--t-fast);
}
.tool-field input:focus,
.tool-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.tool-outputs {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  justify-content: center;
  padding-left: var(--s5);
  border-left: 1px solid var(--border);
}
@media (max-width: 720px) {
  .tool-outputs { border-left: 0; padding-left: 0; padding-top: var(--s4); border-top: 1px solid var(--border); }
}
.tool-output-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tool-output-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-1);
}
.tool-output-value.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Footer ─────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--s6) var(--s5);
  margin-top: var(--s9);
  text-align: center;
}
.footer-rg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  margin-bottom: var(--s4);
  font-size: 13px;
  color: var(--text-3);
}
.footer-rg .rg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.footer-copy { font-size: 13px; color: var(--text-3); }

/* ── Disclaimer bar ─────────────────────────── */
.disclaimer {
  text-align: center;
  padding: var(--s3) var(--s5);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: var(--r2);
  margin-top: var(--s6);
}

/* ── List items ─────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s4);
  border-radius: var(--r2);
  transition: background var(--t-fast);
  text-decoration: none;
  color: var(--text-1);
}
.list-item:hover { background: var(--bg-card); color: var(--text-1); }
.list-item-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  font-size: 16px;
  flex-shrink: 0;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 14px; }
.list-item-desc { font-size: 13px; color: var(--text-3); }

/* ── Utility ────────────────────────────────── */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--s5); }
.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.flex { display: flex; }
.flex-center { align-items: center; }
.gap-sm { gap: var(--s2); }
.gap-md { gap: var(--s4); }
.gap-lg { gap: var(--s6); }
.mt-sm { margin-top: var(--s3); }
.mt-md { margin-top: var(--s5); }
.mt-lg { margin-top: var(--s7); }
.mb-sm { margin-bottom: var(--s3); }
.mb-md { margin-bottom: var(--s5); }
.mb-lg { margin-bottom: var(--s7); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
