/* CCRL Challenger — complete dark theme.
   This file only changes colours, borders and shadows; it does not change layout. */

html.ccrl-dark {
  color-scheme: dark;
}

body.ccrl-dark {
  --navy: #08111f;
  --navy-2: #10213a;
  --blue: #4d9be6;
  --blue-dark: #67a9ee;
  --blue-soft: #172d49;
  --ink: #e7edf7;
  --muted: #a8b4c6;
  --line: #334155;
  --surface: #111827;
  --page: #0b1220;
  --green: #4ade80;
  --shadow: 0 12px 30px rgba(0, 0, 0, .32);

  color: var(--ink) !important;
  background: radial-gradient(circle at 50% -10%, #17263b 0, #0b1220 42%, #070d17 100%) !important;
}

/* Header */
body.ccrl-dark .ccrl-header {
  background: linear-gradient(135deg, #070e19 0%, #0e2039 58%, #173b60 100%) !important;
  border-bottom-color: #3f8fd4 !important;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .38) !important;
}
body.ccrl-dark .ccrl-subtitle { color: #bfdbfe !important; }

/* Main surfaces */
body.ccrl-dark .ccrl-card {
  background: rgba(17, 24, 39, .97) !important;
  border-color: #334155 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .30) !important;
}
body.ccrl-dark .ccrl-hero h1,
body.ccrl-dark .ccrl-form-title,
body.ccrl-dark .ccrl-game-head h1 {
  color: #edf2f7 !important;
}
body.ccrl-dark .ccrl-hero p,
body.ccrl-dark .ccrl-form-subtitle,
body.ccrl-dark .ccrl-help,
body.ccrl-dark .ccrl-engine-details,
body.ccrl-dark .ccrl-info-card,
body.ccrl-dark .ccrl-engine-record {
  color: #aeb9ca !important;
}

/* Links */
body.ccrl-dark a { color: #9ecbff !important; }
body.ccrl-dark a:visited { color: #c4b5fd !important; }
body.ccrl-dark a:hover { color: #c7e2ff !important; }
body.ccrl-dark .ccrl-brand,
body.ccrl-dark .ccrl-brand:visited { color: inherit !important; }

/* Kicker / pills / stats */
body.ccrl-dark .ccrl-kicker {
  background: #173454 !important;
  color: #9fcbff !important;
}
body.ccrl-dark .ccrl-stat {
  background: #151f30 !important;
  border-color: #34445a !important;
  color: #c1ccda !important;
}
body.ccrl-dark .ccrl-stat strong { color: #f3f6fb !important; }
body.ccrl-dark .ccrl-engine-pill {
  background: #182f4b !important;
  color: #9fcbff !important;
}

/* Buttons */
body.ccrl-dark .ccrl-button.secondary,
body.ccrl-dark input[type="submit"].secondary,
body.ccrl-dark button.secondary {
  background: #172335 !important;
  color: #a9d1ff !important;
  border-color: #3a4d65 !important;
  box-shadow: none !important;
}
body.ccrl-dark .ccrl-button.secondary:hover,
body.ccrl-dark input[type="submit"].secondary:hover,
body.ccrl-dark button.secondary:hover {
  background: #20324a !important;
}
body.ccrl-dark .ccrl-button,
body.ccrl-dark input[type="submit"],
body.ccrl-dark button:not(#ccrl-dark-mode-toggle):not(.ccrl-donation-close) {
  background: #2868aa !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28) !important;
}
body.ccrl-dark .ccrl-button:hover,
body.ccrl-dark input[type="submit"]:hover,
body.ccrl-dark button:not(#ccrl-dark-mode-toggle):not(.ccrl-donation-close):hover {
  background: #347dbf !important;
}

/* Engine table — make every row/surface dark, not just alternating rows. */
body.ccrl-dark .ccrl-table-wrap {
  border-color: #34445a !important;
  background: #111827 !important;
}
body.ccrl-dark .ccrl-table {
  background: #111827 !important;
  color: #e7edf7 !important;
}
body.ccrl-dark .ccrl-table thead th {
  background: #1d2939 !important;
  color: #e8eef7 !important;
  border-color: #334155 !important;
}
body.ccrl-dark .ccrl-table tbody tr,
body.ccrl-dark .ccrl-table tbody tr:nth-child(odd),
body.ccrl-dark .ccrl-table tbody tr:nth-child(even) {
  background: #111827 !important;
}
body.ccrl-dark .ccrl-table tbody tr:nth-child(even) td {
  background: #151f2e !important;
}
body.ccrl-dark .ccrl-table tbody tr:nth-child(odd) td {
  background: #111827 !important;
}
body.ccrl-dark .ccrl-table tbody td {
  color: #dbe4f0 !important;
  border-top-color: #2c394c !important;
}
body.ccrl-dark .ccrl-table tbody tr:hover td {
  background: #1a2a3f !important;
}
body.ccrl-dark .ccrl-table td:first-child,
body.ccrl-dark .ccrl-engine-record {
  color: #a8b4c6 !important;
}
body.ccrl-dark .ccrl-engine-record strong { color: #dbe4f0 !important; }

/* Forms */
body.ccrl-dark .ccrl-opponent {
  background: #152a43 !important;
  border-color: #2f5276 !important;
  color: #dce8f6 !important;
}
body.ccrl-dark .ccrl-opponent strong { color: #a9d1ff !important; }
body.ccrl-dark .ccrl-choice label {
  background: #131d2c !important;
  border-color: #34445a !important;
  color: #e2e8f0 !important;
}
body.ccrl-dark .ccrl-input,
body.ccrl-dark input,
body.ccrl-dark select,
body.ccrl-dark textarea {
  background: #0f1725 !important;
  color: #edf2f7 !important;
  border-color: #46576e !important;
}
body.ccrl-dark .ccrl-input::placeholder,
body.ccrl-dark input::placeholder,
body.ccrl-dark textarea::placeholder {
  color: #78879b !important;
}
body.ccrl-dark .ccrl-input:disabled {
  background: #1b2534 !important;
  color: #78879b !important;
}
body.ccrl-dark input[type="checkbox"],
body.ccrl-dark input[type="radio"] { accent-color: #4d9be6; }

/* Game page */
body.ccrl-dark .ccrl-board-card {
  background: #0f1725 !important;
  border-color: #334155 !important;
}
body.ccrl-dark .ccrl-info-card {
  background: #131d2c !important;
  border-color: #334155 !important;
  color: #b8c4d4 !important;
}
body.ccrl-dark .ccrl-pgn-card,
body.ccrl-dark .pgn_info {
  background: #0f1725 !important;
  border-color: #334155 !important;
  color: #dce5f0 !important;
}
body.ccrl-dark .ccrl-engine-details {
  border-top-color: #334155 !important;
}
body.ccrl-dark .ccrl-engine-details strong { color: #eef2f7 !important; }

/* Affiliate cards */
body.ccrl-dark .affiliate-card {
  background: #131d2c !important;
  border-color: #34445a !important;
  color: #e5ebf3 !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .25) !important;
}
body.ccrl-dark .affiliate-card:hover { background: #18263a !important; }
body.ccrl-dark .affiliate-card-placeholder {
  background: #202d40 !important;
  color: #9aa9bb !important;
}
body.ccrl-dark .affiliate-card-brand,
body.ccrl-dark .affiliate-card-meta,
body.ccrl-dark .affiliate-disclosure { color: #9eabbc !important; }
body.ccrl-dark .affiliate-card-title,
body.ccrl-dark .affiliate-heading { color: #e7edf6 !important; }

/* Donation UI */
body.ccrl-dark .ccrl-donation-banner {
  background: #172231 !important;
  color: #e7edf5 !important;
  border-color: #3a4b61 !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .42) !important;
}
body.ccrl-dark .ccrl-donation-button {
  background: #1f3046 !important;
  color: #dcecff !important;
  border-color: #50647d !important;
}
body.ccrl-dark .ccrl-donation-button:hover { background: #29415d !important; }
body.ccrl-dark .ccrl-donation-close { background: transparent !important; color: #9eabbc !important; }
body.ccrl-dark .ccrl-donation-close:hover { background: transparent !important; color: #fff !important; }

/* Crypto donation page and any remaining common surfaces. */
body.ccrl-dark hr { border-color: #334155 !important; }
body.ccrl-dark .card,
body.ccrl-dark .panel,
body.ccrl-dark .box,
body.ccrl-dark .modal-content {
  background: #131d2c !important;
  color: #e5ebf3 !important;
  border-color: #334155 !important;
}
body.ccrl-dark code,
body.ccrl-dark pre { background: #0c1421 !important; color: #dce8f6 !important; }

/* Existing inline styles that are intentionally colour-only. */
body.ccrl-dark [style*="color:#64748b"],
body.ccrl-dark [style*="color: #64748b"] { color: #a8b4c6 !important; }
body.ccrl-dark [style*="color:#334155"],
body.ccrl-dark [style*="color: #334155"] { color: #dbe4f0 !important; }
body.ccrl-dark [style*="background: white"],
body.ccrl-dark [style*="background:white"] { background: #131d2c !important; color: #e5ebf3 !important; }

/* Theme toggle: fixed overlay, so it cannot move or resize the existing layout. */
#ccrl-dark-mode-toggle {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 99999;
  border: 1px solid rgba(255,255,255,.28) !important;
  border-radius: 999px !important;
  padding: 7px 11px !important;
  min-height: 34px;
  background: rgba(15, 23, 42, .82) !important;
  color: #f8fafc !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0,0,0,.24) !important;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
#ccrl-dark-mode-toggle:hover { background: rgba(30, 41, 59, .94) !important; }
body.ccrl-dark #ccrl-dark-mode-toggle {
  background: rgba(30, 41, 59, .92) !important;
  color: #f8fafc !important;
  border-color: rgba(255,255,255,.22) !important;
}

@media (max-width: 600px) {
  #ccrl-dark-mode-toggle { top: 8px; right: 8px; padding: 6px 9px !important; }
}

/* Active games / spectator page */
body.ccrl-dark .board-container,
body.ccrl-dark .boards-container {
  color: #e7edf7 !important;
}
body.ccrl-dark .board-wrapper,
body.ccrl-dark .board-title,
body.ccrl-dark .match-title {
  color: #e7edf7 !important;
}
body.ccrl-dark .active-age {
  color: #a8b4c6 !important;
}
body.ccrl-dark .ccrl-card h1,
body.ccrl-dark .ccrl-card h2,
body.ccrl-dark .ccrl-card h3,
body.ccrl-dark .ccrl-card p,
body.ccrl-dark .ccrl-card label,
body.ccrl-dark .ccrl-card span,
body.ccrl-dark .ccrl-card div {
  color: inherit;
}
body.ccrl-dark .ccrl-card .board-wrapper,
body.ccrl-dark .ccrl-card .match-title,
body.ccrl-dark .ccrl-card .board-title {
  color: #e7edf7 !important;
}


/* Affiliate recommendations — higher-contrast disclosure and external-link CTA */
body.ccrl-dark .affiliate-disclosure {
  color: #c1ccda !important;
  opacity: 1 !important;
}
body.ccrl-dark .affiliate-card-thumb {
  background: #202d40 !important;
}
body.ccrl-dark .affiliate-card-cta {
  background: #2f9e8f !important;
  color: #ffffff !important;
}
body.ccrl-dark .affiliate-card:hover .affiliate-card-cta {
  background: #3aa99f !important;
}
