/* ================================================================ Light theme (html[data-theme="light"])
   Chosen in the header (theme.js), dark by default. The palette of the Arène variables, then the tokens the
   stylesheets use in place of their literal colors (var(--hgl-…, dark color)): undefined in dark mode, so the dark
   look keeps its exact colors. Same Néo Arène look: square boxes, a color per data type, darker for a white page. */
html[data-theme="light"] {
  color-scheme: light;
  --ar-bg: #f3f4f8;
  --ar-bg-2: #eceef4;
  --ar-panel: #ffffff;
  --ar-panel-2: #f4f5f9;
  --ar-line: #e1e3ea;
  --ar-fg: #14151e;
  --ar-muted: #5d6170;
  --ar-dim: #868a98;
  --ar-accent-hi: #4f59d6;
  --ar-accent-soft: rgba(113, 124, 248, 0.12);
  --ar-gold: #b8860b;
  --ar-silver: #7b8494;
  --ar-bronze: #b0672c;

  --ar-text: #14151e;
  --fg: #22242e;
  /* a color per data type, darker for a white page */
  --c-voice: #5b66e8; --c-msg: #0e9f72; --c-member: #8b5cf6; --c-server: #e5483a; --c-rank: #a87b06; --c-streak: #e46a14; --c-xp: #b7790a;

  --hgl-ink: 20, 21, 30;
  --hgl-surface: 255, 255, 255;
  --hgl-strong: #14151e;
  /* text grays */
  --hgl-a3a6b0: #5d6170; --hgl-9a9da7: #61656f; --hgl-9a9daa: #61656f; --hgl-b0b3bc: #555968; --hgl-8b8e98: #6b6f7c;
  --hgl-72767d: #7d8190; --hgl-686c78: #7d8190; --hgl-8e9297: #6b6f7c; --hgl-b9bbbe: #4a4d58; --hgl-dcddde: #2a2c36;
  --hgl-d0d2d8: #2e313c; --hgl-c9ccd3: #353845; --hgl-e3e5e8: #22242e; --hgl-f2f3f5: #14151e; --hgl-f7f8f9: #14151e;
  /* surfaces and lines */
  --hgl-0b0b13: #f3f4f8; --hgl-0e0f16: #eceef4;
  --hgl-14151e: #ffffff; --hgl-14161e: #ffffff; --hgl-161720: #ffffff; --hgl-13141b: #ffffff;
  --hgl-191a24: #f4f5f9; --hgl-1d1e28: #f4f5f9; --hgl-24252f: #eceef4; --hgl-242631: #e1e3ea;
  --hgl-1e1f22: #f2f3f5; --hgl-2b2d31: #ffffff; --hgl-313338: #ffffff;
  /* accent and data colors as text, darker on white */
  --hgl-717cf8: #5b66e8; --hgl-a5acff: #5560dc; --hgl-c5c9ff: #4c55c9; --hgl-b9beff: #4c55c9; --hgl-818cf8: #4f46e5;
  --hgl-3fd1a0: #0e9f72; --hgl-34d399: #059669; --hgl-10b981: #059669; --hgl-4ade80: #15a34a;
  --hgl-fbbf24: #b7790a; --hgl-f5c542: #a87b06; --hgl-facc15: #a16207; --hgl-f5b03b: #b7790a; --hgl-f59e0b: #b45309; --hgl-fb923c: #ea580c;
  --hgl-f87171: #dc2626; --hgl-fca5a5: #dc2626; --hgl-ff6b8a: #e11d48; --hgl-ff8aa3: #e11d48;
  --hgl-c084fc: #9333ea; --hgl-b07cff: #8b5cf6; --hgl-a78bfa: #7c3aed;
}
html[data-theme="light"] body { background: var(--ar-bg); color: var(--ar-fg); }

/* Theme menu of the header: the icon of the theme shown */
/* Language and theme side by side: the theme button just right of the language one */
html body .hdr-prefs { display: inline-flex; align-items: center; gap: 6px; }
html body .theme-menu-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  background: var(--ar-panel); border: 1px solid var(--ar-line); border-radius: 0; color: var(--ar-text, #f2f3f5); clip-path: var(--cut-s); cursor: pointer; }
html body .theme-menu-btn:hover, html body .theme-menu.open .theme-menu-btn { background: var(--ar-panel-2); }
html body .theme-ico { display: none; }
html[data-theme="dark"] body .theme-ico-dark, html[data-theme="light"] body .theme-ico-light { display: grid; }
html body .theme-menu-list { right: 0; left: auto; min-width: 160px; }
html body .theme-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }

/* Arcade buttons: the light buttons sink into a grey edge instead of a black one */
html[data-theme="light"] body :is(.btn-hero-secondary, .btn-versus-action, .btn-export-card, .btn-copy-snippet, .btn-customize-profile, .dashboard-section-link, .podium-card-more, .an-more, .btn-clear-server-filter) {
  --face: #e9ebf2;
  --face-hover: #dfe2eb;
  --edge: #c3c7d3;
}
html[data-theme="light"] body :is(.btn-hero-discord, .top-button, .versus-submit-btn, .btn-discord, .btn-download-svg, .btn-customize-save, .btn-discord-login) { --edge: #3a43a8; }
/* Profile colors: the member's color darkened rather than lightened for the highlights */
html[data-theme="light"] body .profile-themed { --ar-accent-hi: color-mix(in srgb, var(--accent) 78%, #000); --ar-accent-soft: rgba(var(--accent-rgb), 0.12); }

/* Tabs of a profile or server page: a light tint of the color, so the active title is dark */
html[data-theme="light"] body .profile-hero-tabs .graphs-tab-btn.active { color: var(--ar-fg); }

/* Profile page: the background color chosen by the member, as a light tint of it */
html[data-theme="light"] body .profile-backdrop { background: color-mix(in srgb, var(--backdrop-color) 12%, #f3f4f8); }
/* Header: always on a light band (a member's background can be dark or bright) */
html[data-theme="light"] body .app-header::before { background: rgba(255, 255, 255, 0.92); border-bottom-color: var(--ar-line); }

/* More surfaces written by hand: dark panels and bars become white or light grey */
html[data-theme="light"] {
  --hgl-0a0b11: #f3f4f8; --hgl-0c0d14: #ffffff; --hgl-08090f: #ffffff; --hgl-080910: #ffffff; --hgl-090a10: #ffffff;
  --hgl-0f0f17: #ffffff; --hgl-101118: #ffffff; --hgl-101018: #ffffff; --hgl-101017: #ffffff; --hgl-16171f: #ffffff; --hgl-171822: #ffffff;
  --hgl-1d1f28: #f4f5f9; --hgl-1d1f2c: #f4f5f9; --hgl-22252f: #eceef4; --hgl-22232d: #eceef4; --hgl-262831: #e6e8ef; --hgl-252833: #eceef4;
}

/* Phone menu: the three themes side by side, without the header button */
@media (max-width: 1024px) {
  html body .hdr-prefs { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
  html body .theme-menu-btn { display: none; }
  html body .theme-menu .theme-menu-list { position: static; display: flex; flex-direction: row; gap: 4px; min-width: 0; margin: 0; padding: 0; background: none; box-shadow: none; border: 0; opacity: 1; visibility: visible; transform: none; }
  html body .theme-menu { width: 100%; }
  html body .theme-menu .theme-menu-item { flex: 1 1 0; min-width: 0; justify-content: center; gap: 6px; padding: 10px 4px; font-size: 0.82rem; }
}

/* Badge rarities: the same colors, darker so they read on white */
html[data-theme="light"] body .rarity-bronze { --rarity: 168, 98, 40; }
html[data-theme="light"] body .rarity-silver { --rarity: 110, 118, 132; }
html[data-theme="light"] body .rarity-gold { --rarity: 168, 123, 6; }
html[data-theme="light"] body .rarity-platinum { --rarity: 13, 148, 128; }
html[data-theme="light"] body .rarity-diamond { --rarity: 37, 115, 214; }
html[data-theme="light"] body .rarity-legend { --rarity: 124, 58, 237; }
html[data-theme="light"] body .rarity-mythic { --rarity: 214, 51, 160; }
html[data-theme="light"] body .rarity-locked { --rarity: 134, 138, 152; }
/* Small separator dots */
html[data-theme="light"] body :is(.footer-sep, .profile-hero-sep) { color: rgba(20, 21, 30, 0.35); }

/* Light text colors written by hand: the same hue, darker (generated) */
html[data-theme="light"] {
  --hgl-2dd4bf: #2fa798;
  --hgl-7ee0a0: #33a35a;
  --hgl-9aa1ff: #1e29b8;
  --hgl-a5b4fc: #1e39b8;
  --hgl-b1a8f5: #3423b3;
  --hgl-c3c6ce: #4b4f58;
  --hgl-c3c8ff: #1e2bb8;
  --hgl-c9a3ff: #5e1eb8;
  --hgl-c9a6ff: #5b1eb8;
  --hgl-c9cbd3: #4b4e58;
  --hgl-c9cdfb: #1e2ab8;
  --hgl-c9ced6: #4b5058;
  --hgl-cdd2ff: #1e2db8;
  --hgl-dbdee1: #4b5258;
  --hgl-dfe2ff: #1e2cb8;
  --hgl-e0dbff: #331eb8;
  --hgl-e6e8ff: #1e2ab8;
  --hgl-f3d58a: #b58b21;
  --hgl-f79a9c: #b81e21;
  --hgl-fbbf3c: #b8881e;
  --hgl-ff8fa3: #b81e3a;
  --hgl-ffb3c3: #b81e3e;
  --hgl-ffc2cd: #b81e3a;
}

/* Colors given per element (help page tones and tiers, event kinds in server management): darker on white */
html[data-theme="light"] body .is-cyan { --c: #0284c7; }
html[data-theme="light"] body .is-blurple { --c: #5b66e8; }
html[data-theme="light"] body .is-pink { --c: #db2777; }
html[data-theme="light"] body .is-gold { --c: #a87b06; }
html[data-theme="light"] body .is-purple { --c: #7c3aed; }
html[data-theme="light"] body .is-green { --c: #0e9f72; }
html[data-theme="light"] body .help-title { --group: #5d6170; }
html[data-theme="light"] body .help-title.group-adept { --group: #2563eb; }
html[data-theme="light"] body .help-title.group-master { --group: #7c3aed; }
html[data-theme="light"] body .help-title.group-legend { --group: #b45309; }
html[data-theme="light"] body :is(.help-tier-name, .help-badge-tier em) { color: color-mix(in srgb, var(--tier) 62%, #000); }
html[data-theme="light"] body :is(.sm-ev, .sm-ev-type)[data-kind="voice"] { --ev: #2f6fe0; }
html[data-theme="light"] body :is(.sm-ev, .sm-ev-type)[data-kind="messages"] { --ev: #0e9f72; }
html[data-theme="light"] body :is(.sm-ev, .sm-ev-type)[data-kind="level"] { --ev: #a87b06; }
html[data-theme="light"] body :is(.sm-ev, .sm-ev-type)[data-kind="join"] { --ev: #7c3aed; }
html[data-theme="light"] body :is(.sm-ev, .sm-ev-type)[data-kind="mixed"] { --ev: #db2777; }
html[data-theme="light"] body .hg-rhythm.is-msg { --rc: #0e9f72; }
