/* =====================================================================
   HLstatsX modern overlay (Phase G + G.1).
   Loaded AFTER tailwind.output.css + windmill.css so these rules win
   without rewriting any PHP templates. Per-section accents flow from
   <body data-hlx-mode="..."> + a small <style> block in header.php
   that pipes admin-configured colors as CSS variables.

   Drop at:  /var/www/hlstatsx/src/web/assets/css/hlx_modern.css
   ===================================================================== */

:root {
  /* Defaults; overridden by the inline <style id="hlx-modern-vars">
     block written by header.php from cw_config. */
  --hlx-accent:        #4f8fff;
  --hlx-accent-2:      #a855f7;
  --hlx-mode-c:        var(--hlx-accent);

  --hlx-good:          #34d399;
  --hlx-warn:          #fbbf24;
  --hlx-bad:           #f87171;

  --hlx-bg:            #0a0c13;
  --hlx-bg-2:          #11151f;
  --hlx-bg-3:          #181d2b;
  --hlx-bg-4:          #232a3d;
  --hlx-border:        #262e44;
  --hlx-border-2:      #313a55;
  --hlx-fg:            #e6eaf3;
  --hlx-fg-2:          #99a2b8;
  --hlx-fg-dim:        #5a647d;
}

/* Mode-specific colour fallbacks. header.php may set --hlx-mode-c
   from cw_config; if not, these defaults kick in. */
body[data-hlx-mode="players"]    { --hlx-mode-c: #4f8fff; }
body[data-hlx-mode="clans"]      { --hlx-mode-c: #a855f7; }
body[data-hlx-mode="weapons"]    { --hlx-mode-c: #f97316; }
body[data-hlx-mode="maps"]       { --hlx-mode-c: #34d399; }
body[data-hlx-mode="awards"]     { --hlx-mode-c: #fbbf24; }
body[data-hlx-mode="servers"]    { --hlx-mode-c: #38bdf8; }
body[data-hlx-mode="actions"]    { --hlx-mode-c: #ec4899; }
body[data-hlx-mode="chat"]       { --hlx-mode-c: #14b8a6; }
body[data-hlx-mode="playerinfo"] { --hlx-mode-c: var(--hlx-accent); }

/* ===== Body + radial glow ============================================
   The whole-page background gets a subtle radial wash in the mode's
   accent colour so each section reads visually different. */
html.dark body {
  background:
    radial-gradient(1000px 700px at -200px -200px,
      color-mix(in srgb, var(--hlx-mode-c) 14%, transparent), transparent 60%),
    radial-gradient(900px 600px at 110% -100px,
      color-mix(in srgb, var(--hlx-accent-2) 10%, transparent), transparent 60%),
    var(--hlx-bg) !important;
  color: var(--hlx-fg);
}
html.dark .bg-gray-50, html.dark .dark\:bg-gray-900 {
  background: transparent !important;
}

/* ===== Sidebar =======================================================
   Refined gradient + active-state indicator with brand glow. */
html.dark aside.bg-white,
html.dark aside.dark\:bg-gray-800 {
  background: linear-gradient(180deg, #0d1119 0%, #11151f 60%, #0d1119 100%) !important;
  border-right: 1px solid var(--hlx-border) !important;
  box-shadow: 1px 0 0 rgba(255,255,255,0.02);
}
html.dark aside a.text-lg.font-bold {
  font-weight: 900 !important;
  font-size: 17px !important;
  letter-spacing: -0.3px !important;
  background: linear-gradient(135deg, var(--hlx-accent), var(--hlx-accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--hlx-accent) 35%, transparent));
}

/* Sidebar nav rows -- bigger hit target, hover lift, active accent */
html.dark aside ul li a {
  position: relative;
  border-radius: 8px;
  margin: 1px 6px !important;
  padding: 8px 12px !important;
  font-weight: 600 !important;
  transition: background 0.12s, color 0.12s, transform 0.08s;
}
html.dark aside ul li a:hover {
  background: var(--hlx-bg-3) !important;
  color: var(--hlx-fg) !important;
  transform: translateX(2px);
}
html.dark aside ul li a.text-gray-800,
html.dark aside ul li a.dark\:text-gray-100 {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--hlx-accent) 22%, transparent),
    color-mix(in srgb, var(--hlx-accent) 4%, transparent) 85%) !important;
  color: var(--hlx-fg) !important;
}
html.dark aside ul li a.text-gray-800::before,
html.dark aside ul li a.dark\:text-gray-100::before {
  content: '';
  position: absolute;
  left: -6px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: linear-gradient(180deg, var(--hlx-accent), var(--hlx-accent-2));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px color-mix(in srgb, var(--hlx-accent) 60%, transparent);
}

/* Sidebar icon tinting */
html.dark aside ul li a svg,
html.dark aside ul li a i.fas,
html.dark aside ul li a i.fa {
  color: var(--hlx-fg-2);
  transition: color 0.12s;
}
html.dark aside ul li a:hover svg,
html.dark aside ul li a:hover i.fas,
html.dark aside ul li a:hover i.fa {
  color: var(--hlx-mode-c);
}

/* ===== Topbar (header strip) ========================================
   Frosted-glass effect over the brand-tinted background. */
html.dark header.bg-white,
html.dark header.dark\:bg-gray-800,
html.dark .py-4.bg-white.dark\:bg-gray-800 {
  background: rgba(10,12,19,0.78) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hlx-border) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35) !important;
}

/* ===== Cards / panels ================================================ */
html.dark .bg-white,
html.dark .dark\:bg-gray-800 {
  background-color: var(--hlx-bg-2) !important;
  border: 1px solid var(--hlx-border) !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25) !important;
  position: relative;
}
html.dark .rounded-lg.shadow-xs,
html.dark .rounded-lg.shadow-md,
html.dark .rounded-lg.shadow-lg { border-radius: 12px !important; }

/* Decorative gradient ribbon on top of every card -- mode-coloured */
html.dark .min-w-0.p-4.bg-white,
html.dark .min-w-0.p-4.dark\:bg-gray-800 {
  background-image: linear-gradient(180deg,
    color-mix(in srgb, var(--hlx-mode-c) 6%, transparent),
    transparent 90%) !important;
  background-color: var(--hlx-bg-2) !important;
}
html.dark .min-w-0.p-4.bg-white::before,
html.dark .min-w-0.p-4.dark\:bg-gray-800::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--hlx-mode-c) 80%, transparent),
    color-mix(in srgb, var(--hlx-mode-c) 30%, transparent) 50%,
    transparent);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}
html.dark h4.mb-4.font-semibold {
  color: var(--hlx-mode-c) !important;
  letter-spacing: 0.3px !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  font-weight: 800 !important;
}

/* ===== Tables -- this is where HLstatsX shows its age =============== */
html.dark table.data-table,
html.dark table {
  border-collapse: collapse !important;
  width: 100%;
}
html.dark table.data-table thead th,
html.dark table thead th {
  background: var(--hlx-bg-3) !important;
  color: var(--hlx-fg-2) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 1.4px !important;
  text-transform: uppercase !important;
  border-bottom: 2px solid var(--hlx-mode-c) !important;
  padding: 10px 12px !important;
  position: sticky;
  top: 0;
  z-index: 5;
}
html.dark table.data-table tbody td,
html.dark table tbody td {
  padding: 9px 12px !important;
  border-bottom: 1px solid var(--hlx-border) !important;
  vertical-align: middle !important;
}
html.dark table.data-table tbody tr:hover,
html.dark table tbody tr:hover {
  background: color-mix(in srgb, var(--hlx-mode-c) 8%, transparent) !important;
}
html.dark table tbody tr:last-child td { border-bottom: 0 !important; }
html.dark img[src*="flagcdn"] { border-radius: 2px; vertical-align: middle; }

/* Link color across pages -- mode-aware */
html.dark .min-w-0 a:not(.cw-prem):not(.hlx-cw-chip):not(.hlx-search-row):not(.cw-btn) {
  color: color-mix(in srgb, var(--hlx-mode-c) 75%, #ffffff);
  transition: color 0.12s;
}
html.dark .min-w-0 a:not(.cw-prem):not(.hlx-cw-chip):not(.hlx-search-row):not(.cw-btn):hover {
  color: var(--hlx-mode-c);
  text-shadow: 0 0 12px color-mix(in srgb, var(--hlx-mode-c) 35%, transparent);
}

/* ===== Buttons / accents ============================================ */
html.dark .bg-purple-600,
html.dark a.bg-purple-600,
html.dark button.bg-purple-600 {
  background: linear-gradient(135deg, var(--hlx-accent), var(--hlx-accent-2)) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--hlx-accent) 30%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.20) !important;
  transition: transform 0.10s, filter 0.15s !important;
}
html.dark .bg-purple-600:hover {
  filter: brightness(1.10);
  transform: translateY(-1px);
}

/* Tailwind text colour classes -- nudge them brand-ward */
html.dark .text-purple-400,
html.dark .text-purple-500,
html.dark .text-purple-600 {
  color: var(--hlx-accent-2) !important;
}

/* ===== Player-info CW Rank chip respects layout ===================== */
html.dark .cw-prem { margin: 0; }

/* ===== Global search box ============================================ */
.hlx-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 16px;
}
.hlx-search-input {
  width: 100%;
  background: var(--hlx-bg-2);
  border: 1px solid var(--hlx-border);
  color: var(--hlx-fg);
  border-radius: 999px;
  padding: 8px 16px 8px 36px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2399a2b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat;
  background-position: 12px 50%;
  background-size: 16px 16px;
}
.hlx-search-input:focus {
  outline: none;
  border-color: var(--hlx-mode-c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hlx-mode-c) 25%, transparent);
}
.hlx-search-dropdown {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--hlx-bg-2);
  border: 1px solid var(--hlx-border);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.55);
  max-height: 460px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}
.hlx-search-dropdown.open { display: block; }
.hlx-search-section { padding: 6px 0; border-bottom: 1px solid var(--hlx-border); }
.hlx-search-section:last-child { border-bottom: 0; }
.hlx-search-section-h {
  font-size: 10px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--hlx-fg-dim);
  padding: 4px 14px 6px;
}
.hlx-search-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--hlx-fg) !important;
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: background 0.08s, border-color 0.08s;
}
.hlx-search-row:hover {
  background: var(--hlx-bg-3);
  border-left-color: var(--hlx-mode-c);
}
.hlx-search-row .hlx-search-row-sub {
  font-size: 11px; color: var(--hlx-fg-dim);
  margin-left: auto;
}
.hlx-search-empty {
  padding: 16px;
  text-align: center;
  color: var(--hlx-fg-dim);
  font-size: 13px;
  font-style: italic;
}

/* ===== Page-mode hero accent ========================================
   Big gradient bar under the topbar so each section feels different. */
html.dark main > div:first-of-type::before {
  content: '';
  display: block;
  width: 100%; height: 2px;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--hlx-mode-c) 70%, transparent),
    transparent);
  margin-bottom: -2px;
}

/* ===== LE Bans badge integration ==================================== */
.lebans-badge {
  border-radius: 12px !important;
  border: 1px solid color-mix(in srgb, var(--hlx-bad) 50%, transparent) !important;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--hlx-bad) 12%, var(--hlx-bg-2)),
    var(--hlx-bg-2)) !important;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--hlx-bad) 18%, transparent) !important;
}

/* ===== Mobile sweep ================================================= */
@media (max-width: 720px) {
  html.dark table.data-table,
  html.dark .min-w-0 table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  html.dark table.data-table thead th { white-space: nowrap !important; }
  html.dark .p-4   { padding: 0.875rem !important; }
  html.dark .mb-8  { margin-bottom: 1rem !important; }
  html.dark .gap-6 { gap: 0.875rem !important; }
  html.dark .grid.gap-6.md\:grid-cols-2 { grid-template-columns: 1fr !important; }
  .hlx-search-wrap { margin: 0 8px; }
  .hlx-search-input { font-size: 12px; padding: 6px 14px 6px 32px; }
}

/* ===== Light theme parity =========================================== */
html:not(.dark) body {
  background:
    radial-gradient(900px 500px at 0 0, color-mix(in srgb, var(--hlx-mode-c) 8%, transparent), transparent 60%),
    #f5f6fa;
}
html:not(.dark) .hlx-search-input {
  background-color: #ffffff;
  border-color: #d3d6de;
  color: #11151f;
}
html:not(.dark) .hlx-search-dropdown {
  background: #ffffff;
  border-color: #d3d6de;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}
html:not(.dark) .hlx-search-row { color: #11151f !important; }
html:not(.dark) .hlx-search-row:hover { background: #f0f1f7; }

/* =====================================================================
   Phase H -- global polish (gameme).
   Fills gaps the overlay above doesn't cover: form controls, buttons,
   the front-page icon stat-cards, scrollbars, meters/bargraphs,
   typography. CSS-only; appended last so it wins. Revert by deleting
   from this banner down (or restore the .bak alongside this file).
   ===================================================================== */

/* ----- Base typography & rendering ----- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--hlx-accent) 42%, transparent); color: #fff; }

/* ----- Custom scrollbars ----- */
html.dark * { scrollbar-width: thin; scrollbar-color: var(--hlx-border-2) transparent; }
html.dark ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark ::-webkit-scrollbar-track { background: transparent; }
html.dark ::-webkit-scrollbar-thumb {
  background: var(--hlx-border-2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--hlx-mode-c) 55%, var(--hlx-border-2));
  background-clip: padding-box;
}

/* ----- Front-page icon stat-cards (flex items-center p-4) ----- */
html.dark .flex.items-center.p-4.bg-white,
html.dark .flex.items-center.p-4.dark\:bg-gray-800 {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
html.dark .flex.items-center.p-4.bg-white:hover,
html.dark .flex.items-center.p-4.dark\:bg-gray-800:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--hlx-mode-c) 45%, var(--hlx-border)) !important;
  box-shadow: 0 14px 28px -10px rgba(0,0,0,.55) !important;
}
/* icon badge -> rounded-square with soft depth */
html.dark .flex.items-center.p-4 .rounded-full {
  border-radius: 12px !important;
  box-shadow: 0 6px 16px -4px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.18);
}
/* value line bigger/brighter, label as uppercase caption */
html.dark .flex.items-center.p-4 > div:last-child > p:last-child {
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  color: var(--hlx-fg) !important;
  line-height: 1.1;
}
html.dark .flex.items-center.p-4 > div:last-child > p:first-child {
  text-transform: uppercase; letter-spacing: .6px; font-size: 11px !important;
}

/* ----- Form controls (admin pages, settings, etc.) ----- */
html.dark .windmill-text,
html.dark .windmill-dropdown,
html.dark .windmill-textarea,
html.dark input[type="text"]:not(.hlx-search-input),
html.dark input[type="number"],
html.dark input[type="password"],
html.dark input[type="search"]:not(.hlx-search-input),
html.dark select,
html.dark textarea {
  background-color: var(--hlx-bg-3) !important;
  border: 1px solid var(--hlx-border-2) !important;
  color: var(--hlx-fg) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
html.dark .windmill-text:focus,
html.dark .windmill-dropdown:focus,
html.dark .windmill-textarea:focus,
html.dark input[type="text"]:not(.hlx-search-input):focus,
html.dark input[type="number"]:focus,
html.dark input[type="password"]:focus,
html.dark input[type="search"]:not(.hlx-search-input):focus,
html.dark select:focus,
html.dark textarea:focus {
  outline: none !important;
  border-color: var(--hlx-mode-c) !important;
  background-color: var(--hlx-bg-2) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hlx-mode-c) 22%, transparent) !important;
}
html.dark select option { background: var(--hlx-bg-2); color: var(--hlx-fg); }

/* ----- Buttons (windmill + legacy admin .submit) ----- */
html.dark .windmill-button,
html.dark input[type="submit"],
html.dark input.submit,
html.dark .submit {
  background: linear-gradient(135deg, var(--hlx-accent), var(--hlx-accent-2)) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 8px !important;
  padding: 8px 18px !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--hlx-accent) 28%, transparent),
              inset 0 1px 0 rgba(255,255,255,.18) !important;
  transition: transform .1s, filter .15s !important;
}
html.dark .windmill-button:hover,
html.dark input[type="submit"]:hover,
html.dark input.submit:hover,
html.dark .submit:hover {
  filter: brightness(1.10);
  transform: translateY(-1px);
}

/* ----- Meters / activity bars (statsme, playerinfo, rankings) ----- */
html.dark meter {
  width: 92px; height: 8px; border: 0; border-radius: 999px;
  background: var(--hlx-bg-4);
}
html.dark meter::-webkit-meter-bar {
  background: var(--hlx-bg-4); border: 0; border-radius: 999px;
}
html.dark meter::-webkit-meter-optimum-value,
html.dark meter::-webkit-meter-suboptimum-value,
html.dark meter::-webkit-meter-even-less-good-value {
  background: linear-gradient(90deg, var(--hlx-mode-c), var(--hlx-accent-2));
  border-radius: 999px;
}
html.dark meter::-moz-meter-bar {
  background: linear-gradient(90deg, var(--hlx-mode-c), var(--hlx-accent-2));
  border-radius: 999px;
}

/* ----- Code / kbd ----- */
html.dark code, html.dark kbd, html.dark tt {
  background: var(--hlx-bg-3); color: var(--hlx-accent);
  border: 1px solid var(--hlx-border);
  border-radius: 6px; padding: 1px 6px; font-size: 12px;
}

/* ----- Keyboard focus accessibility ----- */
html.dark a:focus-visible,
html.dark button:focus-visible,
html.dark input:focus-visible,
html.dark select:focus-visible {
  outline: 2px solid var(--hlx-mode-c);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- Light-theme parity for the new form controls ----- */
html:not(.dark) .windmill-text,
html:not(.dark) .windmill-dropdown,
html:not(.dark) .windmill-textarea,
html:not(.dark) input[type="text"]:not(.hlx-search-input),
html:not(.dark) input[type="number"],
html:not(.dark) input[type="password"],
html:not(.dark) select,
html:not(.dark) textarea {
  border-radius: 8px !important;
}
html:not(.dark) .windmill-text:focus,
html:not(.dark) .windmill-dropdown:focus,
html:not(.dark) input[type="text"]:not(.hlx-search-input):focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
  border-color: var(--hlx-mode-c) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hlx-mode-c) 20%, transparent) !important;
  outline: none !important;
}

/* =====================================================================
   Phase H.1 -- table / avatar rendering fixes + visible card accent.
   The overlay adds border-bottom to every <td>; on the player-profile
   layout table that drew divider lines across the Steam avatar. Lift
   the avatar above the lines and strip borders from its cell.
   ===================================================================== */

/* Player-profile Steam avatar: opaque, above any collapsed row borders,
   and its own cell carries no divider line. */
html.dark #player_avatar,
html.dark td#player_avatar {
  border: 0 !important;
  background: transparent !important;
}
html.dark #player_avatar img {
  position: relative;
  z-index: 2;
  border-radius: 10px;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.6);
}

/* Any image inside a table cell renders above the row dividers. */
html.dark table td img { position: relative; z-index: 1; }

/* Flag icons sit centered on the row instead of clipping the divider. */
html.dark table td img.tableicon { vertical-align: middle; border-radius: 2px; }

/* Always-visible top accent stripe on the front-page icon stat-cards
   (same treatment the overlay already gives the .min-w-0 panels). */
html.dark .flex.items-center.p-4.bg-white,
html.dark .flex.items-center.p-4.dark\:bg-gray-800 { position: relative; overflow: hidden; }
html.dark .flex.items-center.p-4.bg-white::before,
html.dark .flex.items-center.p-4.dark\:bg-gray-800::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--hlx-mode-c) 85%, transparent),
    color-mix(in srgb, var(--hlx-mode-c) 30%, transparent) 55%,
    transparent);
}

/* =====================================================================
   Phase H.2 -- player-profile avatar (Steam + Non-Steam).
   ===================================================================== */
.gm-avatar {
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--hlx-border-2);
  box-shadow: 0 10px 26px -8px rgba(0,0,0,.65);
}
html.dark .gm-avatar { box-shadow: 0 10px 26px -8px rgba(0,0,0,.65), 0 0 0 4px color-mix(in srgb, var(--hlx-mode-c) 14%, transparent); }
.gm-avatar--nonsteam {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(120% 120% at 30% 0%, color-mix(in srgb, var(--hlx-accent) 24%, transparent), transparent 55%),
    linear-gradient(135deg, var(--hlx-bg-3), var(--hlx-bg));
  border: 2px dashed color-mix(in srgb, var(--hlx-accent) 45%, var(--hlx-border-2)) !important;
}
.gm-avatar--nonsteam i {
  font-size: 46px;
  color: var(--hlx-accent);
  filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--hlx-accent) 45%, transparent));
}
.gm-avatar--nonsteam span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--hlx-fg);
}

/* =====================================================================
   Phase H.3 -- player-profile value polish.
   ===================================================================== */
/* Bold values in profile/stat cards read in bright foreground, not grey */
html.dark .min-w-0 table td b,
html.dark .min-w-0 table td strong {
  color: var(--hlx-fg) !important;
  font-weight: 800;
}
/* Framed chip for the "Favorite Weapon" thumbnail on the profile */
.gm-fav-weapon {
  background: var(--hlx-bg-3);
  border: 1px solid var(--hlx-border-2);
  border-radius: 8px;
  padding: 5px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

/* =====================================================================
   Phase H.4 -- title bar brand gradient (active style renders it flat).
   ===================================================================== */
.windmill-title-bar {
  background: linear-gradient(120deg, #7c3aed 0%, #ec4899 65%, #06b6d4 125%) !important;
  box-shadow: 0 10px 30px -12px rgba(124,58,237,.55) !important;
  border: 0 !important;
}

/* =====================================================================
   Phase H.5 -- colorful sidebar icons + topbar "Links" pill.
   ===================================================================== */

/* Sidebar icons: vivid per-position palette (overrides the grey default) */
html.dark aside ul li a i.fas,
html.dark aside ul li a i.fa {
  font-size: 15px; width: 20px; text-align: center;
  transition: transform .12s ease, color .12s ease;
}
html.dark aside ul li:nth-child(1)  a i { color: #f97316 !important; } /* orange  */
html.dark aside ul li:nth-child(2)  a i { color: #38bdf8 !important; } /* sky     */
html.dark aside ul li:nth-child(3)  a i { color: #14b8a6 !important; } /* teal    */
html.dark aside ul li:nth-child(4)  a i { color: #4f8fff !important; } /* blue    */
html.dark aside ul li:nth-child(5)  a i { color: #a855f7 !important; } /* purple  */
html.dark aside ul li:nth-child(6)  a i { color: #22d3ee !important; } /* cyan    */
html.dark aside ul li:nth-child(7)  a i { color: #fbbf24 !important; } /* gold    */
html.dark aside ul li:nth-child(8)  a i { color: #ec4899 !important; } /* pink    */
html.dark aside ul li:nth-child(9)  a i { color: #f43f5e !important; } /* rose    */
html.dark aside ul li:nth-child(10) a i { color: #34d399 !important; } /* green   */
html.dark aside ul li:nth-child(11) a i { color: #ef4444 !important; } /* red     */
html.dark aside ul li:nth-child(12) a i { color: #8b5cf6 !important; } /* violet  */
html.dark aside ul li:nth-child(13) a i { color: #06b6d4 !important; } /* cyan2   */
html.dark aside ul li:nth-child(14) a i { color: #84cc16 !important; } /* lime    */
html.dark aside ul li:nth-child(15) a i { color: #fb7185 !important; } /* coral   */
html.dark aside ul li a:hover i { transform: scale(1.18); }
/* keep the sidebar brand crisp */
html.dark aside a.text-lg.font-bold { font-size: 19px !important; }

/* Topbar "Links" -> gradient pill with a chevron */
html.dark header button[aria-label="Notifications"] {
  padding: 6px 18px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #7c3aed, #ec4899) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  box-shadow: 0 6px 18px -6px rgba(124,58,237,.5) !important;
  transition: filter .15s ease, transform .1s ease !important;
}
html.dark header button[aria-label="Notifications"]:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
html.dark header button[aria-label="Notifications"]::after { content: " \25BE"; opacity: .85; }

/* "Viewing: <game>" centre label -> readable, subtle chip */
html.dark header a[href*="hlstats.php?game="] {
  color: var(--hlx-fg) !important;
  font-weight: 600;
}

/* --- FIX: Font Awesome renders as <svg>, not <i>. Color the svg. --- */
html.dark aside ul li a svg { transition: transform .12s ease, color .12s ease; }
html.dark aside ul li:nth-child(1)  a svg { color: #f97316 !important; }
html.dark aside ul li:nth-child(2)  a svg { color: #38bdf8 !important; }
html.dark aside ul li:nth-child(3)  a svg { color: #14b8a6 !important; }
html.dark aside ul li:nth-child(4)  a svg { color: #4f8fff !important; }
html.dark aside ul li:nth-child(5)  a svg { color: #a855f7 !important; }
html.dark aside ul li:nth-child(6)  a svg { color: #22d3ee !important; }
html.dark aside ul li:nth-child(7)  a svg { color: #fbbf24 !important; }
html.dark aside ul li:nth-child(8)  a svg { color: #ec4899 !important; }
html.dark aside ul li:nth-child(9)  a svg { color: #f43f5e !important; }
html.dark aside ul li:nth-child(10) a svg { color: #34d399 !important; }
html.dark aside ul li:nth-child(11) a svg { color: #ef4444 !important; }
html.dark aside ul li:nth-child(12) a svg { color: #8b5cf6 !important; }
html.dark aside ul li:nth-child(13) a svg { color: #06b6d4 !important; }
html.dark aside ul li:nth-child(14) a svg { color: #84cc16 !important; }
html.dark aside ul li:nth-child(15) a svg { color: #fb7185 !important; }
html.dark aside ul li a:hover svg { transform: scale(1.18); filter: brightness(1.2); }

/* =====================================================================
   Phase H.6 -- FIX dropdowns dropping the page down.
   The card rule (html.dark .bg-white { position: relative }) also matches
   the header dropdown <ul> (it carries bg-white), beating Tailwind's
   .absolute -> the menu lands in normal flow and pushes the page down.
   Force explicitly-absolute elements to stay absolute, and give the
   header menus a stacking context so they overlay cleanly.
   ===================================================================== */
html.dark .absolute { position: absolute !important; }
html.dark header ul[aria-label="submenu"] { z-index: 50; }
