/* ==========================================================================
   cg-header — header desktop template 12
   Livelli di token:
     1. BRAND       -> l'unico blocco che cambia da cliente a cliente
     2. SEMANTICI   -> chiaro / scuro (body.dark-mode)
     3. COMPONENTE  -> --cg-header-*, usati dalle regole qui sotto
   Regola: le regole BEM usano solo token di componente, mai colori diretti.
   ========================================================================== */

/* 1. BRAND (default Domusbet) ------------------------------------------------ */
/* I file dei font non si caricano qui: li importa l'adeguamento del cliente. */
:root {
  --cg-brand: #c8102e;
  --cg-on-brand: #ffffff;
  --cg-font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cg-font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --cg-radius: 10px;
  /* logo per il tema scuro, opzionale: url(...) del file del cliente.
     Senza questo token in dark resta il logo normale. */
  /* --cg-header-logo-dark: url("/percorso/logo-chiaro.png"); */
}

/* 2. SEMANTICI ---------------------------------------------------------------
   Dichiarati su body (non su :root) così i derivati con color-mix() vengono
   ricalcolati quando body.dark-mode cambia i valori di base. */
body {
  --cg-bg: #ffffff;
  --cg-bg-deep: #17171b;
  --cg-on-deep: #f4f4f5;
  --cg-on-deep-muted: #a9a9b3;
  --cg-surface: #f3f3f6;
  --cg-surface-hover: #e7e7ec;
  --cg-border: #e4e4e9;
  --cg-text: #1d1d22;
  --cg-muted: #63636b;
  --cg-brand-text: var(--cg-brand);
  --cg-danger-text: #b3261e;
  --cg-shadow: 0 14px 36px rgb(0 0 0 / 0.14);
}

body.dark-mode {
  --cg-bg: #15171b;
  --cg-bg-deep: #0d0e11;
  --cg-on-deep: #f4f4f5;
  --cg-on-deep-muted: #9a9da6;
  --cg-surface: #1e2026;
  --cg-surface-hover: #2a2d34;
  --cg-border: #2a2d34;
  --cg-text: #f4f4f5;
  --cg-muted: #a3a6af;
  --cg-brand-text: color-mix(in srgb, var(--cg-brand) 55%, #ffffff);
  --cg-danger-text: #ff8a80;
  --cg-shadow: 0 14px 36px rgb(0 0 0 / 0.5);
}

/* derivati: il cliente non li fornisce, si calcolano dal brand */
body {
  --cg-brand-hover: color-mix(in srgb, var(--cg-brand) 86%, #000000);
  --cg-brand-soft: color-mix(in srgb, var(--cg-brand) 12%, var(--cg-bg));
  --cg-brand-soft-hover: color-mix(in srgb, var(--cg-brand) 20%, var(--cg-bg));
  --cg-focus-ring: color-mix(in srgb, var(--cg-brand) 55%, var(--cg-bg));
}

/* 3. COMPONENTE -------------------------------------------------------------- */
.cg-header {
  /* altezze righe */
  --cg-header-top-h: 28px;
  --cg-header-main-h: 64px;
  --cg-header-logo-size: 26px;
  --cg-header-control-h: 40px;
  --cg-header-gutter: 32px;
  --cg-header-speed: 0.22s;
  /* stato compatto allo scroll: on | off. Si spegne dall'adeguamento del cliente,
     anche per singola pagina: body[data-internal="live"] .cg-header { --cg-header-compact: off; } */
  --cg-header-compact: on;

  /* colori */
  --cg-header-bg: var(--cg-bg);
  --cg-header-text: var(--cg-text);
  --cg-header-muted: var(--cg-muted);
  --cg-header-border: var(--cg-border);
  --cg-header-top-bg: var(--cg-bg-deep);
  --cg-header-top-text: var(--cg-on-deep);
  --cg-header-top-muted: var(--cg-on-deep-muted);
  --cg-header-active: var(--cg-brand-text);
  --cg-header-control-bg: var(--cg-surface);
  --cg-header-control-bg-hover: var(--cg-surface-hover);
  --cg-header-cta-bg: var(--cg-brand);
  --cg-header-cta-bg-hover: var(--cg-brand-hover);
  --cg-header-cta-text: var(--cg-on-brand);
  --cg-header-promo-bg: var(--cg-brand-soft);
  --cg-header-promo-bg-hover: var(--cg-brand-soft-hover);
  --cg-header-promo-text: var(--cg-brand-text);
  --cg-header-panel-bg: var(--cg-bg);
  --cg-header-panel-shadow: var(--cg-shadow);
  --cg-header-tip-bg: var(--cg-bg-deep);
  --cg-header-tip-text: var(--cg-on-deep);
  --cg-header-radius: var(--cg-radius);

  position: sticky;
  top: 0;
  /* z-index: resta quello di .fissato-alto (exa.css), gia' sopra a tutta la pagina */
  background: var(--cg-header-bg);
  color: var(--cg-header-text);
  font-family: var(--cg-font-body);
  font-size: 15px;
  line-height: 1.2;
}

/* stato compatto: lo imposta cg-header.js, qui cambiano solo i token */
.cg-header--compact {
  --cg-header-top-h: 0px;
  --cg-header-main-h: 48px;
  --cg-header-logo-size: 21px;
  --cg-header-control-h: 34px;
}

.cg-header *,
.cg-header *::before,
.cg-header *::after {
  box-sizing: border-box;
}

.cg-header [hidden] {
  display: none;
}

.cg-header a {
  color: inherit;
  text-decoration: none;
}

.cg-header button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.cg-header :focus-visible {
  outline: 2px solid var(--cg-focus-ring);
  outline-offset: 2px;
}

.cg-header__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cg-header__icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* -- riga 1: barra legale ---------------------------------------------------- */
.cg-header__top {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--cg-header-top-h);
  padding: 0 var(--cg-header-gutter);
  overflow: hidden;
  background: var(--cg-header-top-bg);
  color: var(--cg-header-top-text);
  font-size: 12px;
  transition: height var(--cg-header-speed) ease, visibility 0s;
}

.cg-header--compact .cg-header__top {
  visibility: hidden; /* fuori dal tab quando è chiusa */
  transition: height var(--cg-header-speed) ease, visibility 0s var(--cg-header-speed);
}

.cg-header__top-links {
  display: flex;
  gap: 18px;
  font-weight: 600;
}

.cg-header__top-links a:hover {
  text-decoration: underline;
}

.cg-header__legal {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: var(--cg-header-top-muted);
}

/* il testo resta su una riga: i <br> del CMS li sostituisce con uno spazio superiore-12.jsp,
   questa regola copre le varianti non previste */
.cg-header__legal br {
  display: none;
}

.cg-header__legal a {
  color: var(--cg-header-top-text);
  text-decoration: underline;
}

.cg-header__badge {
  flex: none;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cg-header__badge--round {
  border-radius: 999px;
}

.cg-header__theme {
  flex: none;
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cg-header-top-text) 28%, transparent);
}

.cg-header .cg-header__theme::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cg-header-top-text);
  transition: translate 0.15s ease;
}

.cg-header__theme[aria-checked="true"]::before {
  translate: 16px 0;
}

/* -- riga 2: logo, menu, azioni ---------------------------------------------- */
.cg-header__main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--cg-header-main-h);
  padding: 0 var(--cg-header-gutter);
  /* sfondo e bordo stanno qui e non su .cg-header: il contenitore ha anche l'id storico
     #cg-header, che alcuni CSS esterni colpiscono con !important */
  background: var(--cg-header-bg);
  border-bottom: 1px solid var(--cg-header-border);
  transition: height var(--cg-header-speed) ease;
}

.cg-header__logo {
  flex: none;
  font-family: var(--cg-font-display);
  font-size: var(--cg-header-logo-size);
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: font-size var(--cg-header-speed) ease;
}

.cg-header__logo em {
  color: var(--cg-header-active);
}

.cg-header__nav {
  flex: 1;
  min-width: 0;
  align-self: stretch;
}

.cg-header__nav-list {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cg-header__nav-item {
  position: relative;
  display: flex;
  flex: none;
}

.cg-header .cg-header__nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  font-weight: 700;
  white-space: nowrap;
}

.cg-header__nav-link:hover,
.cg-header__nav-link[aria-expanded="true"] {
  color: var(--cg-header-active);
}

/* primo livello attivo: colore + sottolineatura sul bordo inferiore */
.cg-header__nav-link--active {
  color: var(--cg-header-active);
}

.cg-header__nav-link--active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
}

.cg-header__chevron {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: rotate 0.15s ease;
}

[aria-expanded="true"] > .cg-header__chevron {
  rotate: 180deg;
}

/* pannelli a tendina (menu, login) */
.cg-header__panel {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 10;
  min-width: 200px;
  padding: 8px;
  background: var(--cg-header-panel-bg);
  border: 1px solid var(--cg-header-border);
  border-radius: calc(var(--cg-header-radius) + 4px);
  box-shadow: var(--cg-header-panel-shadow);
}

.cg-header__panel--menu {
  left: 0;
  top: 100%;
}

.cg-header__panel--end {
  right: 0;
}

.cg-header__menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cg-header__menu a {
  display: block;
  padding: 9px 12px;
  border-radius: calc(var(--cg-header-radius) - 2px);
  font-weight: 600;
  white-space: nowrap;
}

.cg-header__menu a:hover {
  background: var(--cg-header-control-bg);
}

/* azioni a destra */
.cg-header__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cg-header__popover {
  position: relative;
  display: flex;
}

.cg-header__divider {
  width: 1px;
  height: 28px;
  margin: 0 6px;
  background: var(--cg-header-border);
}

/* promo: Bonus (tonale brand) e Spin Lounge (neutro) */
.cg-header .cg-header__promo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--cg-header-control-h);
  padding: 0 14px;
  border-radius: 999px;
  background: var(--cg-header-control-bg);
  font-weight: 700;
  white-space: nowrap;
  transition: height var(--cg-header-speed) ease, background-color 0.15s ease;
}

.cg-header__promo:hover {
  background: var(--cg-header-control-bg-hover);
}

.cg-header .cg-header__promo--accent {
  background: var(--cg-header-promo-bg);
  color: var(--cg-header-promo-text);
}

.cg-header .cg-header__promo--accent:hover {
  background: var(--cg-header-promo-bg-hover);
}

/* bottoni */
.cg-header .cg-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--cg-header-control-h);
  padding: 0 20px;
  border-radius: var(--cg-header-radius);
  font-family: var(--cg-font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: height var(--cg-header-speed) ease, background-color 0.15s ease;
}

.cg-header .cg-header__btn--ghost {
  border: 1.5px solid var(--cg-header-text);
}

.cg-header__btn--ghost:hover,
.cg-header__btn--ghost[aria-expanded="true"] {
  background: var(--cg-header-control-bg);
}

.cg-header .cg-header__btn--primary {
  background: var(--cg-header-cta-bg);
  color: var(--cg-header-cta-text);
}

.cg-header .cg-header__btn--primary:hover {
  background: var(--cg-header-cta-bg-hover);
}

.cg-header__btn--block {
  width: 100%;
}

/* icone con tooltip e contatore */
.cg-header .cg-header__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--cg-header-control-h);
  height: var(--cg-header-control-h);
  border-radius: 50%;
  transition: width var(--cg-header-speed) ease, height var(--cg-header-speed) ease,
    background-color 0.15s ease;
}

.cg-header__icon-btn:hover {
  background: var(--cg-header-control-bg);
}

.cg-header__icon-btn--small {
  --cg-header-control-h: 28px;
  color: var(--cg-header-muted);
}

.cg-header__icon-btn--small .cg-header__icon {
  width: 17px;
  height: 17px;
}

.cg-header__count {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--cg-header-bg);
  border-radius: 999px;
  background: var(--cg-header-cta-bg);
  color: var(--cg-header-cta-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
}

.cg-header__count--dot {
  top: 5px;
  right: 6px;
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
}

/* tooltip: compare su hover e focus da tastiera, con ritardo solo in entrata */
.cg-header [data-cg-tip]::after {
  content: attr(data-cg-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  translate: -50% -4px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--cg-header-tip-bg);
  color: var(--cg-header-tip-text);
  font-family: var(--cg-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, translate 0.12s ease;
}

.cg-header [data-cg-tip]:hover::after,
.cg-header [data-cg-tip]:focus-visible::after {
  opacity: 1;
  translate: -50% 0;
  transition-delay: 0.35s;
}

.cg-header--tips-off [data-cg-tip]::after,
.cg-header [data-cg-tip][aria-expanded="true"]::after {
  display: none;
}

/* saldo + ricarica in un'unica pillola */
.cg-header__wallet {
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--cg-header-control-h);
  margin-left: 6px;
  padding-left: 14px;
  border-radius: var(--cg-header-radius);
  background: var(--cg-header-control-bg);
  transition: height var(--cg-header-speed) ease;
}

.cg-header__wallet-amount {
  min-width: 8ch; /* la pillola non cambia larghezza a saldo nascosto */
  margin-right: 4px;
  font-family: var(--cg-font-display);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cg-header__wallet .cg-header__btn {
  margin-left: 6px;
  padding: 0 14px;
}

.cg-header .cg-header__user {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.cg-header__avatar {
  display: grid;
  place-items: center;
  width: calc(var(--cg-header-control-h) - 4px);
  height: calc(var(--cg-header-control-h) - 4px);
  border: 2px solid var(--cg-header-cta-bg);
  border-radius: 50%;
  background: var(--cg-header-top-bg);
  color: var(--cg-header-top-text);
  font-size: 13px;
  font-weight: 800;
  transition: width var(--cg-header-speed) ease, height var(--cg-header-speed) ease;
}

/* ospite / loggato: nel JSP è il server a rendere solo uno dei due blocchi */
.cg-header[data-cg-auth="guest"] .cg-header__actions--logged,
.cg-header[data-cg-auth="logged"] .cg-header__actions--guest {
  display: none;
}

/* -- larghezze strette e stato compatto: le promo restano solo icona --------- */
.cg-header--compact .cg-header__promo {
  position: relative;
  width: var(--cg-header-control-h);
  padding: 0;
  justify-content: center;
}

.cg-header--compact .cg-header__promo-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 1279px) {
  .cg-header {
    --cg-header-gutter: 20px;
  }

  .cg-header__main {
    gap: 16px;
  }

  .cg-header .cg-header__nav-link {
    padding: 0 9px;
  }

  .cg-header__nav-link--active::after {
    left: 9px;
    right: 9px;
  }

  .cg-header .cg-header__btn {
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cg-header {
    --cg-header-speed: 0s;
  }
}

/* -- aggiunte per il markup reale (JSP) --------------------------------------- */

/* barra superiore: bottoni configurati (TOP / TOPD), lingua, chiusura manuale */
.cg-header__top-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.cg-header__top-link:hover {
  text-decoration: underline;
}

.cg-header__top-img {
  height: 16px;
  width: auto;
}

.cg-header__top-extra {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cg-header .cg-header__top-link--logo {
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cg-header .cg-header__top-link--logo:has(img) {
  padding: 0;
  border: 0;
}

.cg-header .cg-header__theme {
  position: relative;
  width: 34px;
  height: 18px;
  margin: 0;
  background: none;
  cursor: pointer;
}

.cg-header .cg-header__theme::before {
  content: none;
}

.cg-header__theme-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.cg-header__theme-track {
  display: block;
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cg-header-top-text) 28%, transparent);
}

.cg-header__theme-track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cg-header-top-text);
  transition: translate 0.15s ease;
}

.cg-header__theme-input:checked + .cg-header__theme-track::before {
  translate: 16px 0;
}

.cg-header__theme-input:focus-visible + .cg-header__theme-track {
  outline: 2px solid var(--cg-focus-ring);
  outline-offset: 2px;
}

.cg-header__lang {
  flex: none;
  position: relative;
}

.cg-header .cg-header__lang-menu {
  min-width: 100%;
  padding: 0;
}

.cg-header__lang-item {
  padding: 4px 8px;
  text-align: center;
  cursor: pointer;
}

.cg-header__collapse {
  flex: none;
  cursor: pointer;
}

/* logo immagine */
.cg-header .cg-header__logo {
  display: flex;
  align-items: center;
}

.cg-header__logo-img {
  display: block;
  height: var(--cg-header-logo-size);
  width: auto;
  transition: height var(--cg-header-speed) ease;
}

body.dark-mode .cg-header__logo-img {
  content: var(--cg-header-logo-dark, normal);
}

/* menu principale */
.cg-header__nav-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.cg-header__nav-tick {
  display: inline-flex;
}

/* .active la mette header.js sulla voce della pagina corrente */
.cg-header .cg-header__nav-link.active {
  color: var(--cg-header-active);
}

.cg-header__nav-link.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
}

/* .cg-rotated la mette header-buttons-for-08.js quando il mega-menu e' aperto.
   La regola storica (.cg-rotated { transform: rotate(270deg) !important }) puo' essere
   ancora caricata da un altro include: qui va annullata, per questo serve !important. */
.cg-header .cg-header__nav-tick.cg-rotated {
  transform: none !important;
}

.cg-header__nav-tick.cg-rotated .cg-header__chevron {
  rotate: 180deg;
}

/* promo (H2) */
.cg-header__promos {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cg-header .cg-header__promo {
  position: relative;
  cursor: pointer;
}

.cg-header__promo-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* link promozionali / bottoni SL: spenti di default, si accendono per cliente
   con --cg-header-extras-display: flex */
.cg-header #cg-social-link-container.cg-header__extras {
  display: var(--cg-header-extras-display, none);
  align-items: center;
  gap: 10px;
}

.cg-header__extra {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cg-header__extra-img {
  height: 22px;
  width: auto;
}

.cg-header .cg-header__legacy-anchor {
  display: contents;
}

/* login: i link sono bottoni che aprono i modali esistenti */
.cg-header .cg-login__link--center {
  justify-self: center;
}

.cg-header .cg-login__footer .cg-login__link {
  font-size: 14px;
}

.cg-header .cg-login__toggle {
  background-image: none;
}

.cg-header .cg-login__toggle.cg_show_pw {
  color: var(--cg-header-active);
}

.cg-header .spinner-border {
  margin-left: 6px;
}


/* -- etichette che cedono spazio ------------------------------------------------
   cg-header-12.js mette --icon su promo e chip, una alla volta, quando la riga
   non basta; nello stato compatto le promo sono sempre solo icona. */
.cg-header .cg-header__chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--cg-header-control-h);
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  transition: height var(--cg-header-speed) ease, background-color 0.15s ease;
}

.cg-header__chip:hover {
  background: var(--cg-header-control-bg);
}

.cg-header .cg-header__chip--icon,
.cg-header .cg-header__promo--icon {
  width: var(--cg-header-control-h);
  padding: 0;
  justify-content: center;
}

.cg-header__chip--icon .cg-header__chip-label,
.cg-header__promo--icon .cg-header__promo-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* il tooltip serve solo quando l'etichetta non si vede */
.cg-header .cg-header__chip:not(.cg-header__chip--icon)[data-cg-tip]::after,
.cg-header:not(.cg-header--compact) .cg-header__promo:not(.cg-header__promo--icon)[data-cg-tip]::after {
  display: none;
}

/* contatore delle giocate (lo aggiunge header-logged.js): in linea accanto al testo,
   sull'angolo quando resta solo l'icona */
.cg-header__chip .counterTicket {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--cg-header-cta-bg);
  color: var(--cg-header-cta-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.cg-header__chip--icon .counterTicket {
  position: absolute;
  top: 0;
  right: -2px;
}

/* menu "Altro": le voci con sottomenu sono elencate per esteso */
.cg-header .cg-header__panel--menu {
  max-height: calc(100vh - var(--cg-header-height, 140px) - 16px);
  overflow-y: auto;
}

.cg-header .cg-header__menu-heading {
  display: block;
  margin-top: 6px;
  padding: 9px 12px 4px;
  color: var(--cg-header-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cg-header__menu li:first-child .cg-header__menu-heading {
  margin-top: 0;
}

.cg-header .cg-header__menu-sub {
  padding-left: 26px;
  font-weight: 500;
}

/* ==========================================================================
   Mega-menu (#cg-header-extension-block)
   Il markup e' accoppiato a header-buttons-for-08.js e resta quello storico:
   qui ci sono le sue regole (prima nel <style> del JSP e in header12.css),
   riportate sui token del componente.
   ========================================================================== */
.cg-header-extension-block-main-container {
	display: flex;
        justify-content: space-between;
	padding: 15px 25px 15px 25px;
	background:var(--cg-header-panel-bg);
}

.cg-header-extension-block-sfondo {
	flex-grow: 1;
	background-color: #808080CC;
}

.cg-header-extension-block-left-extra {
	display: flex;
	column-gap: 10px;
}

#cg-header-extension-block {
	position: absolute;
	top: 100%;
	width: 100%;
	left: 0;
	display: flex;
	flex-direction: column;
	height: 100vh;
}

.cg-header-extension-block-favourites-container {
	min-width: 40%;
}

.cg-header-extension-block-favourites-center {
	display: grid;
	grid-template-columns: repeat(3, minmax(65px, max-content));
	padding-top: 8px;
	column-gap: 5px;
	row-gap: 8px;
}

.cg-header-extension-block-favourites-top {
	border-bottom: 3px solid var(--cg-header-active);
	color: var(--cg-header-active);
	display: flex;
	justify-content: center;
	line-height: 1.40;
}

.cg-header-extension-block-promo-container {
	display: flex;
	justify-content: center;
	column-gap: 16px;
	min-height: 80px;
	border-top: 2px solid var(--cg-header-border);
	padding: 15px 25px 15px 25px;
}

.cg-header-extension-block-promo-container a {
	color: inherit;
	text-decoration: none;
}

.cg-button-promo {
	display: flex;
	flex-direction: row;
	column-gap: 16px;
	background: none var(--cg-header-control-bg);
	padding: 8px;
	border-radius: 5px;
	border-width: 1px;
	border-style: solid;
	flex: 1 1 0;
	min-width: 0;
	max-width: 363px;
}

.cg-button-promo-icon {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	overflow: hidden;
	display: inline-block;
	flex: 0 0 auto;
}

.cg-button-promo-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cg-button-favourites {
	padding: 8px;
	background-color: var(--cg-header-control-bg);
	border: 1px solid var(--cg-header-border);
	border-radius: 5px;
	position: relative;
}

.cg-button-favourites-content {
	display: flex;
	flex-direction: column;
	row-gap: 5px;
	cursor: pointer;
}

.cg-button-favourites-icon {
	display: flex;
	flex-direction: row;
	column-gap: 10px;
}

.cg-button-favourites-icon>div {
	width: 20px;
	height: 20px;
	background-size: contain !important;
}

.cg-button-favourites-remove {
	--size: 11px;
	--thickness: 2px;
	--color: black;
	--opacity: 0.5;
	width: var(--size);
	height: var(--size);
	cursor: pointer;
	position: absolute;
	top: 2px;
	right: 2px;
}

.cg-button-favourites-remove::before, .cg-button-favourites-remove::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--size);
	height: var(--thickness);
	background-color: var(--color);
	opacity: var(--opacity);
	transform-origin: center;
}

.cg-button-favourites-remove::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.cg-button-favourites-remove::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.cg-button-favourites-remove:hover::before, .cg-button-favourites-remove:hover::after {
	opacity: 1;
}

.cg-ico-sport {
	width: 24px;
	height: 24px;
}

.cg-button-inner {
	display: flex;
	align-items: center;
	column-gap: 10px;
}

.cg-button-icon {
	display: inline-block;
	background-repeat: no-repeat;
	width: 25px;
	height: 25px;
	background-size: contain;
	background-position: center;
	filter: brightness(0) saturate(100%);
}

.cg-button-favourites-casino {
	position: relative;
}

.cg-button-favourites-icon-casino>img {
	width: 65px;
	height: 65px;
	object-fit: cover;
	object-position: center;
	display: block;
	border-radius: 10px;
}

.cg-button-outer>a {
	color:inherit;
}

/* ---------- Sottomenu "Altri giochi" ---------- */
/* via Preferiti e banner Promozioni */
.cg-header #cg-header-extension-block .cg-header-extension-block-favourites-container,
.cg-header #cg-header-extension-block .cg-header-extension-block-promo-container {
	display: none;
}

.cg-header #cg-header-extension-block .cg-header-extension-block-main-container {
	padding: 16px 24px;
	background:var(--cg-header-panel-bg);
	border-bottom: 1px solid var(--cg-header-border);
	box-shadow: 0 10px 24px rgba(23, 23, 27, .08);
}

.cg-header #cg-header-extension-block .cg-header-extension-block-left {
	width: 100%;
}

.cg-header #cg-header-extension-block .cg-header-extension-block-left-subtitle:empty,
.cg-header #cg-header-extension-block .cg-header-extension-block-left-extra:empty {
	display: none;
}

/* voci in riga, come tile cliccabili */
.cg-header #cg-header-extension-block .cg-header-extension-block-left-buttonlist {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.cg-header #cg-header-extension-block .cg-button-outer {
	width: auto;
	height: auto;
	margin: 0;
}

.cg-header #cg-header-extension-block .cg-button-outer > a {
	display: block;
	text-decoration: none;
}

.cg-header #cg-header-extension-block .cg-button-inner {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 44px;
	padding: 0 18px;
	border: 1px solid var(--cg-header-border);
	border-radius: 10px;
	background: var(--cg-header-control-bg);
	color: var(--cg-header-text);
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, transform .15s;
}

/* icona vuota: nascosta */
.cg-header #cg-header-extension-block .cg-button-icon:empty,
.cg-header #cg-header-extension-block .cg-button-icon:not(:has(*)) {
	display: none;
}

.cg-header #cg-header-extension-block .cg-button-text {
	color: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

.cg-header #cg-header-extension-block .cg-button-outer > a:hover .cg-button-inner {
	border-color: #f6c3cd;
	background: var(--cg-header-promo-bg);
	color: var(--cg-header-cta-bg);
	transform: translateY(-1px);
}

.cg-header-extension-block-sfondo {
	display: none;
}


.cg-header #cg-header-extension-block {
  z-index: 5;
  color: var(--cg-header-text);
}

.cg-header #cg-header-extension-block.cg-hide,
.cg-header .cg-header-extension-block-inner.cg-hide {
  display: none;
}

body.dark-mode .cg-header .cg-button-icon {
  filter: brightness(0) invert(1);
}

/* ==========================================================================
   Area loggata (template/desktop/header/logged-sections/logged-user-template-12.jsp)
   ========================================================================== */
.cg-header .cg-header__logged {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.cg-header__count:empty {
  display: none;
}

.cg-header .cg-header__wallet-amount {
  display: flex;
  align-items: baseline;
  gap: 5px;
  transition: filter 0.2s ease;
}

/* saldo nascosto: sfocato, cosi' la pillola non cambia larghezza */
.cg-header__wallet--hidden .cg-header__wallet-amount {
  filter: blur(7px);
  user-select: none;
}

.cg-header__profile {
  position: relative;
  flex: none;
}

/* --------------------------------------------------------------------------
   PONTE tendina profilo
   La tendina e' quella di logged-user-template-01.jsp, copiata senza modifiche:
   il suo markup non e' BEM e resta stilato per id/classi storiche, sugli stessi
   token. Regole riprese da header12.css.
   -------------------------------------------------------------------------- */
/* Profilo */
.cg-header #cg-profile-popup-container{order:6;position:relative;height:auto;width:auto;padding:0}
.cg-header #cg-profile-popup-toggle{display:flex;align-items:center;gap:12px;text-decoration:none}
/* resta solo l'iniziale (.cg-hdr-avatar): niente foto profilo */
.cg-header #cg-profile-popup-toggle #imgVip,.cg-header #cg-profile-popup-toggle>img.user-img{display:none}
.cg-header .cg-hdr-avatar{width:38px;height:38px;border-radius:50%;background:var(--cg-header-top-bg);color:#fff;font-weight:800;font-size:14px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px var(--cg-header-bg),0 0 0 4px var(--cg-header-cta-bg);text-transform:uppercase}
.cg-header #cg-profile-popup-toggle .cg-profile-dropdown-nick{display:flex;flex-direction:column;font-weight:800;font-size:15px;color:var(--cg-header-text);line-height:1.2}
.cg-header #cg-profile-popup-toggle .cg-profile-dropdown-nick::after{content:attr(data-level);font-size:11px;font-weight:700;color:var(--cg-header-cta-bg);letter-spacing:.3px;text-transform:uppercase}
.cg-header #cg-profile-popup-toggle::after{display:block;border:0;content:"";width:8px;height:8px;border-right:2px solid var(--cg-header-text);border-bottom:2px solid var(--cg-header-text);transform:rotate(45deg) translateY(-3px);margin-left:6px}

/* ---------- Tendina profilo ---------- */
.cg-header #cg-profile-popup-container .dropdown-menu{position:absolute;left:auto;right:0;top:calc(100% + 12px);width:280px;min-width:0;padding:0;margin:0;background:var(--cg-header-panel-bg);color:var(--cg-header-text);border:0;border-radius:14px;box-shadow:0 14px 36px rgba(0,0,0,.18);overflow:hidden}
.cg-header #cg-profile-popup-container .dropdown-menu>.row{margin:0}
.cg-header #cg-profile-popup-container .top-account{background:var(--cg-header-top-bg);color:#fff;padding:14px 16px;align-items:center;flex-wrap:nowrap}
.cg-header #cg-profile-popup-container .top-account .user-img{width:38px;height:38px;border-radius:50%;margin-right:12px;object-fit:cover}
.cg-header #cg-profile-popup-container .top-account .nome{font-size:14px;font-weight:700;color:#fff}
.cg-header #cg-profile-popup-container .top-account .id-nome,.cg-header #cg-profile-popup-container .top-account .id-conto{font-size:11px;color:var(--cg-header-muted)}
.cg-header #cg-profile-popup-container .top-account .dettagli-profilo,.cg-header #cg-profile-popup-container .dropdown-menu>.id-nome.smalltext{display:none}
.cg-header #cg-profile-popup-container .middle-account{padding:0;display:block}
.cg-header #cg-profile-popup-container .middle-account .prima-riga,.cg-header #cg-profile-popup-container .middle-account .mostra-port{display:none}
.cg-header #cg-profile-popup-container .riga-divisore{display:block;margin:0;padding:6px 0 0;text-transform:none}
.cg-header #cg-profile-popup-container .riga-divisore .separatore-verticale,.cg-header #cg-profile-popup-container .riga-divisore svg{display:none}
.cg-header #cg-profile-popup-container .riga-divisore>div,.cg-header #cg-profile-popup-container .lista-voci-dash li{display:block;padding:10px 20px;margin:0;line-height:20px;height:auto;font-size:15px;font-weight:600;color:var(--cg-header-text);background:transparent;border:0;border-radius:0;text-align:left;cursor:pointer}
.cg-header #cg-profile-popup-container .riga-divisore>div::first-letter{text-transform:uppercase}
.cg-header #cg-profile-popup-container .riga-divisore>div:hover,.cg-header #cg-profile-popup-container .lista-voci-dash li:hover{background:var(--cg-header-control-bg)}
.cg-header #cg-profile-popup-container .lista-voci-dash{padding:0 0 8px;display:block;border-top:0}
.cg-header #cg-profile-popup-container .lista-voci-dash ul{list-style:none;padding:0;margin:0;width:100%}
.cg-header #cg-profile-popup-container .lista-voci-dash li svg,.cg-header #cg-profile-popup-container .lista-voci-dash li i{display:none}
.cg-header #cg-profile-popup-container .lista-voci-dash li *{color:inherit;font:inherit;text-decoration:none}
.cg-header #cg-profile-popup-container #cg-button-logout{color:var(--cg-header-cta-bg);font-weight:700;margin:8px 10px 0;border:1px solid var(--cg-header-border);border-radius:10px;padding:11px 14px}
.cg-header .cg-hdr-avatar.cg-hdr-avatar-vip{
	width:52px;
	height:52px;
	padding:0;
	font-size:0;
	background:transparent;
	box-shadow:none;
	border-radius:0;
	overflow:visible
	}
.cg-header .cg-hdr-avatar .cg-hdr-vip{
	display:block;
	width:100%;
	height:100%;
	padding:0;
	object-fit:contain
	}

.cg-header .cg-hdr-avatar {
  color: var(--cg-header-top-text);
  width: calc(var(--cg-header-control-h) - 4px);
  height: calc(var(--cg-header-control-h) - 4px);
  transition: width var(--cg-header-speed) ease, height var(--cg-header-speed) ease;
}

.cg-header #cg-profile-popup-toggle {
  cursor: pointer;
}

/* il nome utente sta nella tendina, non nell'header */
.cg-header #cg-profile-popup-toggle .cg-profile-dropdown-nick {
  display: none;
}

.cg-header #cg-profile-popup-container .top-account,
.cg-header #cg-profile-popup-container .top-account .nome {
  color: var(--cg-header-top-text);
}

/* ==========================================================================
   cg-login — form nella tendina (template/desktop/header/login-template-12.jsp)
   ========================================================================== */
.cg-login {
  display: grid;
  gap: 14px;
  width: 320px;
  padding: 10px;
}

.cg-login__field {
  display: grid;
  gap: 6px;
}

.cg-login__label {
  font-size: 13px;
  font-weight: 700;
}

.cg-login__control {
  position: relative;
  display: flex;
}

.cg-login__input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--cg-header-border);
  border-radius: var(--cg-header-radius);
  background: var(--cg-header-control-bg);
  color: var(--cg-header-text);
  font: inherit;
}

.cg-login__input::placeholder {
  color: var(--cg-header-muted);
}

.cg-login__input--with-toggle {
  padding-right: 44px;
}

.cg-login__input[aria-invalid="true"] {
  border-color: var(--cg-danger-text);
}

.cg-header .cg-login__toggle {
  position: absolute;
  top: 5px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--cg-header-muted);
}

.cg-header .cg-login__link {
  justify-self: end;
  color: var(--cg-header-active);
  font-size: 13px;
  font-weight: 700;
}

.cg-login__link:hover {
  text-decoration: underline;
}

.cg-login__error {
  margin: 0;
  color: var(--cg-danger-text);
  font-size: 13px;
  font-weight: 600;
}

.cg-login__footer {
  margin: 0;
  color: var(--cg-header-muted);
  font-size: 13px;
  text-align: center;
}

