/*GLOBAL CSS FCW V 1.8*/

/* Global resets & utilities */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--fcw-text);
  background: var(--fcw-bg);
  line-height: 1.35;
}

/*img, svg { display: block; max-width: 100%; }*/
button { font: inherit; cursor: pointer; }
a { color: var(--fcw-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.fcw-root {
  display: grid;
  grid-template-rows: 50px 1fr;
  height: 100dvh;
}

/* Headbars */
.fcw-headbar,
.fcw-headbar-secondary {
  background: var(--fcw-surface);
  border-bottom: 1px solid var(--fcw-border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 10px;
  height: 50px;
  box-shadow: var(--fcw-shadow);
  position: relative;
  z-index: 130; /* above overlays, below to-top */
}

/* Secondary hidden by default; shown only on mobile */
.fcw-headbar-secondary { display: none; }

.fcw-headbar .left,
.fcw-headbar .center,
.fcw-headbar .right,
.fcw-headbar-secondary .left,
.fcw-headbar-secondary .center,
.fcw-headbar-secondary .right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fcw-headbar .left { justify-content: flex-start; }
.fcw-headbar .center { justify-content: flex-start; flex: 1; }
.fcw-headbar .right { justify-content: flex-end; margin-left: auto; }

/* Site title + icon (no wrap, auto shrink) */
.shrink-text {
  white-space: nowrap;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: clamp(12px, 1.6vw, 18px);
}
.icon-24 { width: 24px; height: 24px; flex: 0 0 24px; }
.icon-20 { width: 20px; height: 20px; flex: 0 0 20px; }

/* Actions area (User / Coins / Notifications / Help) */
.fcw-actions { display: flex; align-items: stretch; gap: 6px; }
.fcw-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--fcw-border);
  background: var(--fcw-surface-2);
  box-shadow: var(--fcw-shadow);
}
.fcw-action:hover { border-color: var(--fcw-primary); }
.fcw-action__label { white-space: nowrap; font-size: clamp(11px, 1.2vw, 14px); }

/* Action dropdown */
.fcw-dd {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--fcw-surface);
  border: 1px solid var(--fcw-border);
  border-radius: 12px;
  box-shadow: var(--fcw-shadow);
  padding: 6px;
  display: none;
  z-index: 80; /* below drawer menu */
}
.fcw-dd.open { display: block; }
.fcw-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  white-space: nowrap;
  font-size: clamp(11px, 1.2vw, 14px);
}
.fcw-dd-item:hover { background: var(--hover-accent); }

/* Notification rows inside dropdown */
.fcw-note {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  margin: 6px 4px;
  border-radius: 10px;
  background: var(--fcw-surface-2);
  font-size: clamp(11px, 1.2vw, 14px);
}

/* Notification badge */
.fcw-badge {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: var(--fcw-primary);
  color: var(--btn-fg, #fff);
  border: 1px solid var(--fcw-border);
  pointer-events: none;
}

.topright{ top: 6px; right: 6px; }

/* Drawer menu */
.fcw-drawer {
  position: fixed;
  top: 50px; /* under headbar */
  left: 0;
  width: 350px;
  height: calc(100dvh - 50px);
  background: var(--fcw-surface);
  border-right: 1px solid var(--fcw-border);
  box-shadow: var(--fcw-shadow);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 200; /* ABOVE dropdowns */
  overflow-y: auto;
}
.fcw-drawer.open { transform: translateX(0); }

.fcw-overlay {
  position: fixed;
  inset: 50px 0 0 0;
  background: var(--fcw-overlay);
  display: none;
  z-index: 150;
}
.fcw-overlay.show { display: block; }

.fcw-menu {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fcw-menu-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--fcw-border);
  background: var(--fcw-surface-2);
  cursor: pointer;
  font-size: clamp(12px, 1.4vw, 15px);
  position: relative;
  z-index: 201; /* each item above lower layers */
}
.fcw-menu-item:hover { border-color: var(--fcw-primary); }
.fcw-menu-item .chev { transform: rotate(0deg); transition: transform .2s; }
.fcw-menu-item[aria-expanded="true"] .chev { transform: rotate(180deg); }

.fcw-submenu { display: none; padding-left: 34px; margin-top: 4px; position: relative; z-index: 201; }
.fcw-submenu.open { display: grid; gap: 6px; }
.fcw-submenu .fcw-menu-item { background: var(--fcw-surface); }

/* Content area */
.fcw-content { min-height: 0; overflow: hidden; position: relative; }
.fcw-scroll { height: 100%; overflow: auto; /*padding: 12px;*/ padding-left: 12px; padding-right: 12px; scroll-behavior: smooth; }

/* Tables */
/* === v1.8: Table column filters (search row) ============================= */
/* Default sticky stacking: filter row sits under main header row */
.fcw-table { --th-row-h: 44px; } /* adjust if header row height differs */
.fcw-table thead .fcw-filter-row th {
  background: var(--fcw-surface-2);
  position: sticky;
  top: var(--th-row-h);
  z-index: 1;
  padding: 6px 8px;
}
.fcw-filter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}
.fcw-filter-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--fcw-border);
  background: var(--fcw-surface);
  color: var(--fcw-text);
  border-radius: 8px;
  outline: none;
}
.fcw-filter-input:focus { border-color: var(--fcw-primary); box-shadow: var(--fcw-focus); }

/* small clear button */
.fcw-btn.sm { padding: 4px 8px; font-size: 12px; line-height: 1; border-width: 2px; }

/* hide rows not matching all active filters */
.fcw-table tbody tr.fcw-row-hidden { display: none; }
/* ======================================================================== */

.table-wrap { position: relative; overflow-x: auto; padding-bottom: 14px; }
.fcw-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--fcw-surface);
  border: 1px solid var(--fcw-border);
  border-radius: 12px;
  overflow: hidden;
}
.fcw-table th, .fcw-table td {
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.fcw-table thead th {
  background: var(--fcw-primary);
  color: var(--fcw-bg);
  position: sticky; top: 0; z-index: 1;
}
.fcw-table tbody tr:nth-child(odd) { background: var(--row-odd); }
.fcw-table tbody tr:nth-child(even) { background: var(--row-even); }
.fcw-table tbody tr:hover { background: var(--hover-row); color: var(--hover-fg); }

/* Allineamento coerente testo + icone in tutte le tabelle */
table td, table th {
  vertical-align: middle;
}
/* Le immagini inline nei <td>/<th> si allineano al centro della linea di testo */
table td img, table th img {
  vertical-align: middle;
  display: inline-block;
  line-height: 1; /* evita extra gap dovuto al baseline */
}

/* Utility: wrapper per testo + icona affiancati e centrati verticalmente */
.fcw-inline {
  display: inline-flex;
  align-items: center;
  gap: .4em;   /* spazio tra numero e icona */
  line-height: 1; /* evita "salti" di riga con icone grandi */
}

/* Forms */
.fcw-form-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  border: 1px solid var(--fcw-border);
  border-radius: 12px;
  overflow: hidden;
}
.fcw-form-grid .row { display: contents; }
.fcw-form-grid label {
  padding: 12px;
  border-bottom: 1px solid var(--fcw-border);
  border-right: 1px solid var(--fcw-border);
  background: var(--fcw-surface-2);
  font-weight: 600;
  white-space: nowrap;
  font-size: clamp(11px, 1.2vw, 14px);
}
.fcw-form-grid .field {
  padding: 10px;
  border-bottom: 1px solid var(--fcw-border);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

/* Monocolumn form */
.fcw-form-onecol { display: grid; gap: 10px; }
.fcw-form-onecol .grp { display: grid; gap: 6px; }
.fcw-form-onecol label { font-weight: 600; font-size: clamp(12px, 1.3vw, 15px); }

/* Inputs */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--fcw-border);
  background: var(--fcw-surface);
  color: var(--fcw-text);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s, color .2s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--fcw-primary); box-shadow: var(--fcw-focus); }
input.too-short, input.too-long { border-color: var(--fcw-danger) !important; }

/* Buttons (hover invert + alternative variant) */

.fcw-btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;  
  margin-left: 5px;
}

.fcw-btn {
  padding: 2px 8px;
  border: 3px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  box-shadow: var(--fcw-shadow);
  transition: background .15s, color .15s, border-color .15s;  
  display: flex;
  align-items: center;
  justify-content: center;
}
.fcw-btn:hover { 
  background: var(--btn-fg); 
  color: var(--btn-bg);
  border-color: var(--btn-bg); 
}

.fcw-btn.secondary { 
  background: var(--btn-fg); 
  color: var(--btn-bg);
  border-color: var(--btn-bg);
}
.fcw-btn.secondary:hover { 
  background: var(--btn-bg); 
  color: var(--btn-fg); 
}

.fcw-btn.ghost { 
  background: transparent; 
  color: var(--btn-bg); 
  border-color: var(--fcw-border); 
}
.fcw-btn.ghost:hover { 
  background: var(--btn-bg); 
  color: var(--ghost-hover-fg); 
  border-color: var(--btn-bg); 
}

.fcw-btn.alt {
  border-style: dashed;
  background: transparent; 
  color: var(--fcw-primary);
}
.fcw-btn.alt:hover { 
  background: var(--btn-bg); 
  color: var(--btn-alt-hover-fg);
  border-color: var(--btn-tx); 
}

.fcw-btn.error {
  border-style: dashed;
  background: var(--fcw-warning);  
  border-color: var(--fcw-danger); 
  color: var(--fcw-danger); 
}
.fcw-btn.error:hover {
  background: var(--fcw-danger);  
  border-color: var(--fcw-warning); 
  color: var(--fcw-warning);
}

.fcw-btn.success { 
  background: var(--fcw-success);
  color: var(--fcw-bg);
  border-color: var(--fcw-success);
}
.fcw-btn.success:hover { 
  background: var(--fcw-bg);
  color: var(--fcw-success);
}

.fcw-btn.cancel { 
  background: var(--fcw-warning); 
  color: var(--fcw-text);
  border-color: var(--fcw-warning);
}
.fcw-btn.cancel:hover { 
  background: var(--fcw-bg);
  color: var(--fcw-warning);
}

.fcw-btn.transfer { 
  background: var(--fcw-transfer);
  color: var(--fix-white);
  border-color: var(--fcw-transfer);
}
.fcw-btn.transfer:hover { 
  background: var(--fix-white);
  color: var(--fcw-transfer);
}

/* Switch (styled checkbox) with YES/NO text) */
.fcw-switch {
  --w: 52px; --h: 28px;
  position: relative; width: var(--w); height: var(--h);
  border-radius: var(--h);
  border: 1px solid var(--fcw-border);
  transition: background .2s;
}
.fcw-switch input { display: none; }
.fcw-switch .knob {
  position: absolute; top: 2px; left: 2px;
  width: calc(var(--h) - 4px); height: calc(var(--h) - 4px);
  border-radius: 50%;
  box-shadow: var(--fcw-shadow);
  transition: left .2s, background .2s;
}
.fcw-switch .track {
  position: absolute; inset: 0;
  border-radius: var(--h);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .5px;
}
.fcw-switch .track::after { content: "NO"; }
/* unchecked styles */
.fcw-switch:not(:has(input:checked)) .track { background: var(--sw-off-bg); color: var(--sw-off-fg); }
.fcw-switch:not(:has(input:checked)) .knob { background: var(--sw-knob); }
/* checked styles */
.fcw-switch input:checked + .knob { left: calc(var(--w) - var(--h) + 2px); }
.fcw-switch input:checked ~ .track { background: var(--sw-on-bg); color: var(--sw-on-fg); }
.fcw-switch input:checked ~ .track::after { content: "YES"; }

/* Slider */
.fcw-range { accent-color: var(--fcw-primary); width: 100%; }
.fcw-range.vert { writing-mode: bt-lr;  height: 120px; }

/*appearance: slider-vertical;*/

/* Progress Bars */
.fcw-xp {
  --bar: var(--fcw-primary);
  --fg: var(--fcw-text);
  width: 100%;
  border: 1px solid var(--fcw-border);
  border-radius: 14px;
  padding: 3px;
  background: transparent;
  position: relative;
  overflow: hidden;
}
.fcw-xp-inner {
  height: 22px; width: 0%;
  background: var(--bar);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--fcw-text); font-weight: 800;
}
/* 15 variants */
.fcw-xp.v1 { --bar:#00a2ff; --fg: var(--fcw-text); }
.fcw-xp.v2 { --bar:#22a06b; }
.fcw-xp.v3 { --bar:#ff4d6d; }
.fcw-xp.v4 { --bar:#ffb703; --fg: var(--fcw-text); }
.fcw-xp.v5 { --bar:#6c5ce7; }
.fcw-xp.v6 { --bar:#2dd4bf; --fg: var(--fcw-text); }
.fcw-xp.v7 { --bar:#f97316; }
.fcw-xp.v8 { --bar:#0ea5e9; --fg: var(--fcw-text); }
.fcw-xp.v9 { --bar:#a855f7; }
.fcw-xp.v10{ --bar:#10b981; }
.fcw-xp.v11{ --bar:#ef4444; }
.fcw-xp.v12{ --bar:#84cc16; --fg: var(--fcw-text); }
.fcw-xp.v13{ --bar:#eab308; --fg: var(--fcw-text); }
.fcw-xp.v14{ --bar:#dc2626; }
.fcw-xp.v15{ --bar:#1f2937; }

/* v1.8: XP label centered over full container, using data-value */
.fcw-xp { position: relative; }
.fcw-xp::after {
  content: attr(data-value) '%';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fg);
  font-weight: 800;
  pointer-events: none;
}

/* Color Picker (panel opened directly) */
.fcw-color {
  display: grid; grid-template-columns: 100px 36px; gap: 10px; align-items: center;
  position: relative;
}
.fcw-color .swatch {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--fcw-border); box-shadow: var(--fcw-shadow);
}
.fcw-color-panel {
  position: absolute; left: 0; top: calc(100% + 8px);
  background: var(--fcw-surface);
  border: 1px solid var(--fcw-border);
  border-radius: 12px;
  padding: 10px;
  display: none;
  box-shadow: var(--fcw-shadow);
  z-index: 90;
  min-width: 260px;
}
.fcw-color.open .fcw-color-panel { display: grid; gap: 10px; }
.fcw-color .preset-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.fcw-color .preset {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--fcw-border);
}

/* Dropdown with icons (z-index below drawer) */
.fcw-ddl { position: relative; z-index: 70; }
.fcw-ddl .display {
  display: flex;  grid-template-columns: 28px 1fr 20px; gap: 8px; align-items: center;
  border: 1px solid var(--fcw-border); border-radius: 10px; padding: 8px 10px; background: var(--fcw-surface);
  cursor: pointer;
}
.fcw-ddl .panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--fcw-surface); border: 1px solid var(--fcw-border);
  border-radius: 12px; box-shadow: var(--fcw-shadow);
  display: none; max-height: 500px; overflow: auto; z-index: 75;
}
.fcw-ddl.open .panel { display: block; }
.fcw-ddl .opt { display: flex; grid-template-columns: 60px 1fr; gap: 10px; align-items: center; padding: 10px; }
.fcw-ddl .opt:hover { background: var(--hover-accent); }

/* Cookie banner */
.fcw-cookie {
  position: absolute;
  right: 12px;
  top: 100%;
  margin-top: 12px;
  background: var(--fcw-surface);
  border: 1px solid var(--fcw-border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--fcw-shadow);
  display: grid; gap: 10px;
  max-width: min(560px, 92vw);
}

/* Scroll To Top button */
.fcw-to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--fcw-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  display: none;
  place-items: center;
  box-shadow: var(--fcw-shadow);
  z-index: 300;
}
.fcw-to-top.show { display: grid; }
.fcw-to-top:hover { background: var(--btn-fg); color: var(--btn-bg); border-color: var(--btn-fg); }

/* Login/Register page */
.fcw-auth { position: relative; height: 100dvh; width: 100%; display: grid; place-items: center; overflow: hidden; }
.fcw-auth .bg { 
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}
.fcw-auth .panel {
  position: relative;
  width: min(560px, 92vw);
  background: color-mix(in srgb, var(--fcw-surface) 72%, transparent);
  border: 1px solid var(--fcw-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--fcw-shadow);
  display: grid; gap: 12px;
}
.fcw-auth .brand { display:flex; align-items:center; gap:10px; }
.fcw-auth .cookie { margin-top: 6px; }

/* Responsive rules */
@media (max-width: 900px) {
  .fcw-headbar { justify-content: center; }
  .fcw-headbar .left { order: 3; justify-content: flex-end; position: absolute; right: 6px; }
  .fcw-headbar .center { order: 2; justify-content: center; }
  .fcw-headbar .right { display: none; }
  .fcw-headbar-secondary { display: flex; }
  .fcw-actions .fcw-action__label { display: none; }
  .fcw-drawer { top: 100px; width: 100vw; height: calc(100dvh - 100px); }
  .fcw-overlay { inset: 100px 0 0 0; }
  .fcw-form-grid { grid-template-columns: 1fr; }
  .fcw-root { grid-template-rows: 50px 50px 1fr; }
  .fcw-headbar-secondary { grid-row: 2; }
  .fcw-content { grid-row: 3; }  
}

/* Utility */
.row-center:not(td) { display:flex; align-items:center; justify-content:center; gap:10px; }
.hidden { display: none !important; }

/* === FCW patch: safe centering for table cells ========================== */
.fcw-table td.row-center {
  display: table-cell !important;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
}

.fcw-table td.row-center > * {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  margin-inline: 6px;
}

.fcw-table td.row-center > * + * {
  margin-inline-start: 10px;
}
/* === end patch =========================================================== */


/* === Custom table column widths (percentage) ===================
   Usage:
   - Keep your existing .fcw-table for automatic sizing.
   - For manual sizing, add class `.fcw-table--custom` to the table and set
     column widths via <colgroup><col class="w-20">…</colgroup> or by adding
     width classes to <th>/<td> (e.g. class="w-30"). Unspecified columns
     share the remaining space. No JS required.
============================================================================ */
/*.fcw-table--custom { 
  table-layout: fixed;
  width: 100%;
}*/
/* clip long content nicely in fixed layout (base already sets nowrap) */
/*.fcw-table--custom th, .fcw-table--custom td {
  overflow: hidden;
  text-overflow: ellipsis;
}*/

/* Width utilities for <col> elements */
.fcw-table--custom col.w-5{width:5%;}
.fcw-table--custom col.w-10{width:10%;}
.fcw-table--custom col.w-15{width:15%;}
.fcw-table--custom col.w-20{width:20%;}
.fcw-table--custom col.w-25{width:25%;}
.fcw-table--custom col.w-30{width:30%;}
.fcw-table--custom col.w-35{width:35%;}
.fcw-table--custom col.w-40{width:40%;}
.fcw-table--custom col.w-45{width:45%;}
.fcw-table--custom col.w-50{width:50%;}
.fcw-table--custom col.w-55{width:55%;}
.fcw-table--custom col.w-60{width:60%;}
.fcw-table--custom col.w-65{width:65%;}
.fcw-table--custom col.w-70{width:70%;}
.fcw-table--custom col.w-75{width:75%;}
.fcw-table--custom col.w-80{width:80%;}
.fcw-table--custom col.w-85{width:85%;}
.fcw-table--custom col.w-90{width:90%;}
.fcw-table--custom col.w-95{width:95%;}

/* Width utilities for header/cell fallback */
.fcw-table--custom th.w-5, .fcw-table--custom td.w-5{width:5%;}
.fcw-table--custom th.w-10, .fcw-table--custom td.w-10{width:10%;}
.fcw-table--custom th.w-15, .fcw-table--custom td.w-15{width:15%;}
.fcw-table--custom th.w-20, .fcw-table--custom td.w-20{width:20%;}
.fcw-table--custom th.w-25, .fcw-table--custom td.w-25{width:25%;}
.fcw-table--custom th.w-30, .fcw-table--custom td.w-30{width:30%;}
.fcw-table--custom th.w-35, .fcw-table--custom td.w-35{width:35%;}
.fcw-table--custom th.w-40, .fcw-table--custom td.w-40{width:40%;}
.fcw-table--custom th.w-45, .fcw-table--custom td.w-45{width:45%;}
.fcw-table--custom th.w-50, .fcw-table--custom td.w-50{width:50%;}
.fcw-table--custom th.w-55, .fcw-table--custom td.w-55{width:55%;}
.fcw-table--custom th.w-60, .fcw-table--custom td.w-60{width:60%;}
.fcw-table--custom th.w-65, .fcw-table--custom td.w-65{width:65%;}
.fcw-table--custom th.w-70, .fcw-table--custom td.w-70{width:70%;}
.fcw-table--custom th.w-75, .fcw-table--custom td.w-75{width:75%;}
.fcw-table--custom th.w-80, .fcw-table--custom td.w-80{width:80%;}
.fcw-table--custom th.w-85, .fcw-table--custom td.w-85{width:85%;}
.fcw-table--custom th.w-90, .fcw-table--custom td.w-90{width:90%;}
.fcw-table--custom th.w-95, .fcw-table--custom td.w-95{width:95%;}
/* === end v1.2 ============================================================ */

/* === Page Title & Info Panel (v1.4) ===================================== */
/* Full-width title bar centered horizontally */
.fcw-titlebar {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 12px 8px;
  background: var(--fcw-surface);
  border-bottom: 1px solid var(--fcw-primary);
  border-top: 1px solid var(--fcw-primary);
}
.fcw-titlebar .fcw-title {
  font-weight: 800;
  letter-spacing: .2px;
  text-align: center;
  /* Evita spezzature antiestetiche su titoli molto lunghi */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(16px, 2.4vw, 28px);
}

/* Descriptive panel: full-width, thin border, contrasted background */
.fcw-info {
  width: 100%;
  border: 1px solid var(--fcw-border);
  background: var(--fcw-surface-2);
  color: var(--fcw-text);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
}
.fcw-info .icon {
  width: 20px;
  height: 20px;
}
.fcw-info .text {
  font-size: clamp(12px, 1.4vw, 14px);
  line-height: 1.45;
}

/* Spacing helper when stacking title and panel */
.fcw-page-block { margin-top: 15px; margin-bottom: 15px; }


/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */

.fcw-ads-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,.85);
  display: none;
}
.fcw-ads-overlay.show { display: block; }

.fcw-ads-viewport {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  grid-template-rows: 120px minmax(0, 1fr) 120px;
  gap: 12px; padding: 16px;
}

/* Slot pubblicità placeholder (sostituirai i contenuti in PHP) */
.fcw-ads-slot {
  border: 1px dashed var(--fcw-border);
  background: var(--fcw-surface);
  border-radius: 12px;
}
.fcw-ads-slot.top    { grid-column: 1 / -1; grid-row: 1; }
.fcw-ads-slot.bottom { grid-column: 1 / -1; grid-row: 3; }
.fcw-ads-slot.left   { grid-column: 1; grid-row: 2; }
.fcw-ads-slot.right  { grid-column: 3; grid-row: 2; }

/* Area centrale */
.fcw-ads-stage { grid-column: 2; grid-row: 2; display: grid; gap: 12px; align-content: space-evenly; }
.fcw-ads-player-wrap {
  position: relative;
  margin: 0 auto;
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--fcw-shadow);
}
#fcw-ads-player { width: 100%; height: 100%; }
.fcw-ads-shield { position: absolute; inset: 0; pointer-events: auto; } /* blocca click/gesti sul player */

/* Countdown sotto il player */
.fcw-ads-controls { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; align-items: center; }
.fcw-ads-countdown {
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--fcw-border);
  background: var(--fcw-surface-2);
}

/* Mobile: nascondi colonne laterali per dare spazio al video */
@media (max-width: 900px) {
  .fcw-ads-viewport {
    grid-template-columns: 1fr;
    grid-template-rows: 80px minmax(0, 1fr) 80px;
  }
  .fcw-ads-slot.left, .fcw-ads-slot.right { display: none; }
  .fcw-ads-stage { grid-column: 1; }
}
/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */
/* === FCW Ads Overlay (YouTube) ========================================= */


/* ======================================================================== */
/* ==========================  CUSTOM ZONE  =============================== */
/* ======================================================================== */

.hiddenElement{
    display: none;
}

/* ==========================  AUTOGRID  =============================== */
.autoGrid{
  /* display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: stretch;
  align-items: baseline;
  flex-direction:row;
  align-content: center; */
  width:100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: normal;  
}

.autoGrid.center{
  justify-content: center; 
}
.autoGrid.left{
  justify-content: left; 
}
.autoGrid.autoSpace{
  justify-content: space-evenly; 
}

.autoGridElement{
  width: calc(49% - 4px);
}

@media (max-width: 900px) {
  
  .autoGridElement{
    width: calc(100% - 4px);
  }
  .autoGrid.center,
  .autoGrid.left{
    justify-content: space-evenly; 
  }
}

/* ==========================  ICONE  =============================== */
.icon20 {
  width: 20px; min-width: 20px;
  height: 20px; min-height: 20px;
}

.icon30 {
  width: 30px; min-width: 30px;
  height: 30px; min-height: 30px;
}

.icon50 {
  width: 50px; min-width: 50px;
  height: 50px; min-height: 50px;
}

.icon60 {
  width: 60px; min-width: 60px;
  height: 60px; min-height: 60px;
}

.icon80 {
  width: 80px; min-width: 80px;
  height: 80px; min-height: 80px;
}

.icon100 {
  width: 100px; min-width: 100px;
  height: 100px; min-height: 100px;
}

/* ==========================  IMMAGINI  =============================== */

.img180{
  width: 180px; min-width: 180px;
  height: 180px; min-height: 180px;
}

/* ================= TESTO A SCORRIMENTO FOOTER ====================== */
.scroll-wrapper {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.scroll-text {
    display: inline-block;
    padding-left: 100%;
    animation: scroll-left 20s linear infinite;
}

@keyframes scroll-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ======================================================================== */
/* ==========================  CUSTOM ZONE  =============================== */
/* ======================================================================== */

/* === v1.5: Mobile full-screen action dropdowns (below the 2 headbars) === */
@media (max-width: 900px) {
  /* Turn any action dropdown into a fixed sheet occupying all space under headbars */
  .fcw-action .fcw-dd {
    position: fixed;
    inset: 100px 0 0 0;                 /* leave 2 headbars (50px + 50px) visible */
    width: 100vw;
    height: calc(100dvh - 100px);
    max-width: none;
    min-width: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 12px;                       /* more comfortable touch target spacing */
    overflow: auto;
    z-index: 180;                        /* below drawer(200), above overlay(150) */
  }
  /* Optional: make dd items slightly larger on mobile */
  .fcw-dd .fcw-dd-item, .fcw-note { font-size: clamp(13px, 3.5vw, 16px); }
}
/* === end v1.5 ============================================================ */

/* === v1.6: Vertical range slider fix (cross-browser) ===================== */
/* Horizontal (unchanged) */
.fcw-range { accent-color: var(--fcw-primary); width: 100%; }

/* Vertical variant: use appearance + sane dimensions */
.fcw-range.vert {
  -webkit-appearance: slider-vertical;
          appearance: slider-vertical;
  width: 28px;            /* override horizontal width */
  height: 120px;
  writing-mode: bt-lr;    /* fallback for old engines */
}

/* Ensure the track fills full height */
.fcw-range.vert::-webkit-slider-runnable-track { height: 100%; }
.fcw-range.vert::-moz-range-track { height: 100%; }
/* ======================================================================== */


/* === v1.9: Confirm Dialog (prevent accidental click) ===================== */
.fcw-confirm-overlay{
  position: fixed;
  inset: 0;
  background: var(--fcw-overlay, rgba(0,0,0,.6));
  display: none;
  z-index: 400; /* sopra drawer(200) e dropdowns */
}
.fcw-confirm-overlay.show{ display: block; }

.fcw-confirm{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: min(520px, 92vw);
  background: var(--fcw-surface);
  color: var(--fcw-text);
  border: 1px solid var(--fcw-border);
  border-radius: 12px;
  box-shadow: var(--fcw-shadow);
  padding: 14px;
  display: grid; gap: 10px;
}
.fcw-confirm .title{
  font-weight: 800;
  font-size: clamp(14px, 1.6vw, 18px);
}
.fcw-confirm .msg{
  font-size: clamp(12px, 1.4vw, 14px);
  line-height: 1.45;
}
.fcw-confirm .actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.fcw-confirm .actions .fcw-btn{ min-width: 110px; }

/* ======================================================================= */
