/*  =========================
    Design Tokens
    ========================= */

:root {
  /* --- Brand & accent colours --- */
  --color-accent:           #d42a2a;
  --color-accent-dark:      #aa1a1a;

  /* --- Background layers (darkest → lightest) --- */
  --color-background-dark:  #070022;   /* navbar / footer */
  --color-background:       #0e0430;   /* page body */
  --color-surface:          #09041a;   /* card / panel background */

  /* --- Text --- */
  --color-text:             #f0f0f0;
  --color-text-muted:       #b8b8c8;
  --color-text-subtle:      rgba(240, 240, 240, 0.75);

  /* --- Semantic colours --- */
  --color-warning:          #f59e0b;
  --color-danger:           #ef4444;
  --color-success-bright:   #20e672;   /* craft-owned banner / success highlights */
  --color-gold:             #c49a00;   /* golden spot / team reward */
  --color-favorite:         #ffd966;   /* favourite star */

  /* --- Disabled state --- */
  --color-disabled-bg:      #525252;
  --color-disabled-text:    #d4d4d4;

  /* --- Action colours (shared across rider card, team selection, mobile card) --- */
  --color-craft-green:      #187e30;
  --color-craft-green-dark: #105820;
  --color-remove-red:       #a11f1f;
  --color-remove-red-dark:  #7a1212;

  /* --- Borders --- */
  --color-border:           rgba(255, 255, 255, 0.13);

  /* --- Rarity colours --- */
  --rarity-common:          #8c8c8c;
  --rarity-rare:            #007bff;
  --rarity-epic:            #8e44ad;
  --rarity-legendary:       #f39c12;
  --rarity-all-star:        #05cfcf;

  /* --- Division accent colours --- */
  --division-olympics-wc-cc: #775b0c;
  --division-1uwt:           #056f8f;
  --division-2uwt:           #043e50;
  --division-1pro:           #046104;
  --division-2pro:           #04440d;
  --division-11:             #520707;
  --division-21:             #440404;
  --division-giro:           #ac129f;
  --division-tour:           #8b7f0c;
  --division-vuelta:         #750a0a;

  /* --- Generic palette aliases (used by button system) --- */
  --blue:         #0b5ed7;
  --blue-dark:    #043b8d;
  --gray:         #6c757d;
  --gray-dark:    #5c636a;
  --green:        #198754;
  --green-dark:   #13653f;
  --yellow:       #d39e00;
  --yellow-dark:  #a77d00;

  /* --- Border radius scale --- */
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-pill:  999px;
  --border-radius: 10px;   /* legacy alias — prefer named scale above */

  /* --- Spacing scale (absolute, component-level) --- */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  48px;

  /* --- Fluid spacing unit (used for calc-based layouts) --- */
  --spacing-unit: clamp(6px, calc(5.6px + 0.125vw), 8px);

  /* --- Font-size scale --- */
  --font-sm:   0.75rem;
  --font-base: 1rem;
  --font-md:   1.15rem;
  --font-lg:   1.5rem;
  --font-xl:   2rem;

  /* --- Shadows --- */
  --shadow-card:   0 2px 10px rgba(0, 0, 0, 0.40);
  --shadow-raised: 0 8px 32px  rgba(0, 0, 0, 0.55);
  /* Fluid shadow — used by legacy var(--shadow-lg) references */
  --shadow-lg-y:    clamp(4px, calc(3.2px + 0.25vw), 8px);
  --shadow-lg-blur: clamp(12px, calc(10.4px + 0.5vw), 20px);
  --shadow-lg:      0 var(--shadow-lg-y) var(--shadow-lg-blur) rgba(0, 0, 0, 0.35);

  /* --- Notification dot --- */
  --notification-dot-size: clamp(6px, calc(5.6px + 0.125vw), 8px);

  /* --- Global transition --- */
  --transition: 0.2s ease;
}


/*  =========================
    Base
    ========================= */

html {
  font-size: clamp(16px, calc(15.2px + 0.25vw), 20px);
}

body {
  background: var(--color-background);
  color: var(--color-text);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 200;
  padding-top: 4rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--color-accent-dark);
}

.indented {
  margin-left: 2rem;
}

/* Rarity modifier — sets --rarity-color for child components */
.rarity-common   { --rarity-color: var(--rarity-common); }
.rarity-rare     { --rarity-color: var(--rarity-rare); }
.rarity-epic     { --rarity-color: var(--rarity-epic); }
.rarity-legendary{ --rarity-color: var(--rarity-legendary); }
.rarity-all-star { --rarity-color: var(--rarity-all-star); }


/*  =========================
    Navbar, Dropdown & Footer
    ========================= */

.dropdown-menu,
.footer,
.navbar,
.navbar-collapse {
  background: var(--color-background-dark);
}

.navbar.fixed-top {
  padding-top: env(safe-area-inset-top, 0px);
}

.dropdown-item:hover {
  background-color: var(--color-background);
}

.logo {
  height: clamp(32px, calc(var(--spacing-unit) * 6), 48px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.coin-note {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: normal;
}

@media (max-width: 500px) {
  .coin-note {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.1rem;
  }
}

.notification-dot {
  background-color: var(--color-accent);
  border-radius: 50%;
  position: absolute;
  top: 0;
  right: 0;
  height: var(--notification-dot-size);
  width: var(--notification-dot-size);
}

.nav-notif-label {
  position: relative;
  padding-right: 10px;
}

.navbar-toggler-dot {
  position: absolute;
  top: 4px;
  right: 4px;
}


/* =========================
   Card Base
   ========================= */

.card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  height: 100%;
  overflow: hidden;
  padding: calc(var(--spacing-unit) * 4);
  position: relative;
}


/* =========================
   Utilities
   ========================= */

.chart-canvas-wrapper {
  position: relative;
  height: 300px;
}
