/* ==========================================================================
   FG-PRO — guscio comune di Milella's Kitchen / Foodgram
   Barra di navigazione (in basso sul telefono, a sinistra su tablet e desktop),
   pulsante Crea, token di colore. Si aggiunge sopra il CSS di ogni pagina.
   ========================================================================== */
:root{
  --fgc-accent:#d4705f; --fgc-accent-2:#b55a4a; --fgc-soft:#fbf3ef; --fgc-bg2:#f3eee9; --fgc-ink:#2b2420;
  --fgc-r:18px; --fgc-r-s:12px; --fgc-shadow:0 1px 2px rgba(43,36,32,.06),0 8px 24px -12px rgba(43,36,32,.18);
  --fgc-rail:248px; --fgc-bottom:64px; --fgc-page:#f6f2ee; --fgc-card:#fff; --fgc-line:#e6ddd6; --fgc-text:#262626; --fgc-text2:#8e8e8e;
}
html.fgc-dark{ --fgc-soft:#1c1816; --fgc-bg2:#1a1715; --fgc-shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px -12px rgba(0,0,0,.6); --fgc-page:#0e0d0c; --fgc-card:#161412; --fgc-line:#2a2624; --fgc-text:#f3eee9; --fgc-text2:#a39b94; }
html.fgc body{ background:var(--fgc-page); }

/* ---------- barra ---------- */
html.fgc #fgcRail{ position:fixed; left:0; right:0; bottom:0; z-index:95; background:var(--fgc-card); border-top:1px solid var(--fgc-line); padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px)); display:flex; align-items:center; font-family:Inter,-apple-system,BlinkMacSystemFont,system-ui,sans-serif; }
html.fgc #fgcRail .fgc-brand, html.fgc #fgcRail .fgc-acct{ display:none; }
html.fgc #fgcRail .fgc-nav{ display:contents; }
html.fgc #fgcRail .fgc-it{ flex:1; padding:6px 2px 4px; font-size:.68rem; font-weight:600; color:var(--fgc-text2); border-radius:14px; display:flex; flex-direction:column; align-items:center; gap:3px; line-height:1; min-height:52px; justify-content:center; text-decoration:none; background:transparent; border:0; cursor:pointer; font-family:inherit; position:relative; }
html.fgc #fgcRail .fgc-it::before{ content:''; width:24px; height:24px; background:currentColor; -webkit-mask:var(--fgc-i) center/contain no-repeat; mask:var(--fgc-i) center/contain no-repeat; }
html.fgc #fgcRail .fgc-it.on{ color:var(--fgc-accent); background:var(--fgc-soft); }
html.fgc #fgcRail .fgc-it:active{ transform:scale(.94); }
html.fgc #fgcRail .fgc-b{ position:absolute; top:4px; left:calc(50% + 6px); background:var(--fgc-accent); color:#fff; font-size:.6rem; font-weight:700; min-width:16px; height:16px; border-radius:8px; display:none; align-items:center; justify-content:center; padding:0 4px; border:2px solid var(--fgc-card); }
html.fgc #fgcRail .fgc-b.on{ display:flex; }
html.fgc .fgc-create{ position:fixed; right:16px; bottom:calc(var(--fgc-bottom) + 14px + env(safe-area-inset-bottom,0px)); z-index:96; width:56px; height:56px; border:0; border-radius:18px; background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2)); color:#fff; box-shadow:0 6px 16px -6px rgba(212,112,95,.8); cursor:pointer; display:flex; align-items:center; justify-content:center; order:3; }
html.fgc .fgc-create::before{ content:''; width:26px; height:26px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; }
html.fgc .fgc-create:active{ transform:scale(.94); }
html.fgc body{ padding-bottom:calc(var(--fgc-bottom) + env(safe-area-inset-bottom,0px)); }
html.fgc.fgc-nobar #fgcRail{ display:none; }
html.fgc.fgc-nobar body{ padding-bottom:0; }

/* foglio "Crea" */
html.fgc #fgcSheet{ position:fixed; inset:0; z-index:1200; display:none; align-items:flex-end; justify-content:center; background:rgba(20,14,12,.45); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
html.fgc #fgcSheet.open{ display:flex; }
html.fgc #fgcSheet .fgc-sh{ width:100%; max-width:520px; background:var(--fgc-card); color:var(--fgc-text); border-radius:24px 24px 0 0; padding:10px 16px calc(20px + env(safe-area-inset-bottom,0px)); box-shadow:0 -10px 40px rgba(0,0,0,.25); animation:fgcUp .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes fgcUp{ from{ transform:translateY(40px); opacity:0 } to{ transform:none; opacity:1 } }
html.fgc #fgcSheet .fgc-grip{ width:40px; height:4px; border-radius:2px; background:var(--fgc-line); margin:0 auto 14px; }
html.fgc #fgcSheet h3{ margin:0 0 12px; font-size:1.05rem; }
html.fgc #fgcSheet .fgc-opts{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
html.fgc #fgcSheet a{ border:1px solid var(--fgc-line); background:var(--fgc-soft); color:var(--fgc-text); border-radius:16px; padding:16px 8px 12px; font:inherit; font-weight:600; font-size:.85rem; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:8px; text-decoration:none; }
html.fgc #fgcSheet a span{ font-size:1.7rem; line-height:1; }

/* componenti comuni */
html.fgc .fgc-pill{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 18px; border-radius:999px; font-weight:700; font-size:.9rem; border:0; cursor:pointer; text-decoration:none; font-family:inherit; }
html.fgc .fgc-pill-primary{ background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2)); color:#fff; box-shadow:0 6px 16px -8px rgba(212,112,95,.9); }
html.fgc .fgc-pill-soft{ background:var(--fgc-soft); color:var(--fgc-text); border:1px solid var(--fgc-line); }

/* ---------- tablet: barra a sinistra solo icone ---------- */
@media (min-width:768px){
  html.fgc{ --fgc-rail:88px; }
  html.fgc body{ padding-bottom:0; padding-left:var(--fgc-rail); }
  html.fgc #fgcRail{ top:0; bottom:0; right:auto; width:var(--fgc-rail); flex-direction:column; align-items:stretch; padding:14px 12px 16px; border-top:0; border-right:1px solid var(--fgc-line); background:var(--fgc-card); -webkit-backdrop-filter:none; backdrop-filter:none; gap:4px; overflow-y:auto; scrollbar-width:none; }
  html.fgc #fgcRail .fgc-brand{ display:flex; align-items:center; justify-content:center; height:52px; margin-bottom:10px; text-decoration:none; }
  html.fgc #fgcRail .fgc-brand b{ font-family:'Pacifico','Playfair Display',serif; font-weight:400; font-size:1.5rem; color:var(--fgc-accent); display:none; }
  html.fgc #fgcRail .fgc-brand i{ width:44px; height:44px; border-radius:14px; background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2)); display:flex; align-items:center; justify-content:center; font-style:normal; font-size:1.4rem; }
  html.fgc #fgcRail .fgc-it,html.fgc #fgcRail .fgc-it:nth-child(n){ order:0; flex:0 0 auto; flex-direction:row; justify-content:center; gap:14px; min-height:0; height:48px; padding:0; border-radius:14px; font-size:.95rem; color:var(--fgc-text); }
  html.fgc #fgcRail .fgc-it::before{ width:26px; height:26px; flex:0 0 26px; }
  html.fgc #fgcRail .fgc-it:hover{ background:var(--fgc-soft); }
  html.fgc #fgcRail .fgc-it.on{ background:var(--fgc-soft); color:var(--fgc-accent); }
  html.fgc #fgcRail .fgc-it span{ display:none; }
  html.fgc #fgcRail .fgc-create{ position:static; order:1; width:auto; height:48px; margin:8px 0; border-radius:14px; right:auto; bottom:auto; }
  html.fgc #fgcRail .fgc-acct{ display:flex; flex-direction:column; gap:4px; margin-top:auto; padding-top:10px; border-top:1px solid var(--fgc-line); order:2; }
  html.fgc #fgcRail .fgc-b{ top:6px; left:calc(50% + 4px); }
}
/* ---------- desktop: etichette ---------- */
@media (min-width:1100px){
  html.fgc{ --fgc-rail:248px; }
  html.fgc #fgcRail{ padding:18px 16px 20px; }
  html.fgc #fgcRail .fgc-brand{ justify-content:flex-start; gap:12px; padding:0 8px; }
  html.fgc #fgcRail .fgc-brand b{ display:block; }
  html.fgc #fgcRail .fgc-brand i{ width:40px; height:40px; }
  html.fgc #fgcRail .fgc-it,html.fgc #fgcRail .fgc-it:nth-child(n){ justify-content:flex-start; padding:0 14px; }
  html.fgc #fgcRail .fgc-it span{ display:inline; }
  html.fgc .fgc-create::after{ content:attr(data-label); font-weight:700; font-size:.95rem; margin-left:10px; }
  html.fgc #fgcRail .fgc-b{ position:static; margin-left:auto; border:0; }
}
@media (prefers-reduced-motion:reduce){ html.fgc #fgcSheet .fgc-sh{ animation:none; } }

/* ==========================================================================
   GAMIFICATION — una sola barra pulita (stile "I tuoi progressi" del telefono)
   via il joystick e tutto quello che apriva, il pannello laterale, la barra in basso, la card "giorni" doppia
   ========================================================================== */
.dopamine-fab-container, #dopamine-fab-overlay, .dopamine-fab-overlay, #micro-progress-widget, #gamificationBar, .gamification-mobile-bar, .dopamine-streak-indicator{ display:none!important; }
body.fab-open, body.dopamine-fab-open{ filter:none!important; overflow:auto!important; }
@media (min-width:769px){
  .dopamine-xp-bar{ background:var(--fgc-card,#fff)!important; border-bottom:1px solid var(--fgc-line,#e6ddd6)!important; box-shadow:0 6px 18px -14px rgba(43,36,32,.35)!important; padding:8px 20px!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; font-family:Inter,-apple-system,BlinkMacSystemFont,system-ui,sans-serif!important; color:var(--fgc-text,#262626)!important; }
  .dopamine-xp-bar::before, .dopamine-xp-bar::after{ display:none!important; }
  .dopamine-xp-bar .xp-bar-container{ max-width:1100px!important; margin:0 auto!important; display:flex!important; align-items:center!important; gap:14px!important; background:none!important; padding:0!important; }
  .dopamine-xp-bar .xp-level-badge{ width:40px!important; height:40px!important; min-width:40px; border-radius:50%!important; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; box-shadow:0 0 0 3px var(--fgc-soft,#fbf3ef)!important; border:0!important; animation:none!important; display:flex!important; align-items:center; justify-content:center; cursor:pointer; }
  .dopamine-xp-bar .xp-level-badge::before, .dopamine-xp-bar .xp-level-badge::after{ display:none!important; }
  .dopamine-xp-bar .level-number{ color:#fff!important; font:800 15px/1 Inter,system-ui,sans-serif!important; text-shadow:none!important; -webkit-text-fill-color:#fff!important; background:none!important; }
  .dopamine-xp-bar .xp-progress-track{ flex:1 1 auto!important; height:10px!important; border-radius:999px!important; background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; box-shadow:none!important; overflow:hidden; }
  .dopamine-xp-bar .xp-progress-fill{ background:linear-gradient(90deg,var(--fgc-accent,#d4705f),#e8a25f)!important; border-radius:999px!important; box-shadow:none!important; animation:none!important; }
  .dopamine-xp-bar .xp-progress-fill::after, .dopamine-xp-bar .xp-progress-glow{ display:none!important; }
  .dopamine-xp-bar .xp-info{ display:flex!important; flex-direction:column; line-height:1.15; min-width:110px; }
  .dopamine-xp-bar .xp-current{ color:var(--fgc-text,#262626)!important; font-weight:800!important; font-size:.88rem!important; text-shadow:none!important; }
  .dopamine-xp-bar .xp-needed{ color:var(--fgc-text2,#8e8e8e)!important; font-size:.72rem!important; opacity:1!important; }
  .dopamine-xp-bar .coins-display{ display:inline-flex!important; align-items:center!important; gap:6px!important; height:36px; padding:0 14px!important; border-radius:999px!important; background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; box-shadow:none!important; color:var(--fgc-text,#262626)!important; margin:0!important; cursor:pointer; transition:transform .15s ease; }
  .dopamine-xp-bar .coins-display:hover{ transform:translateY(-1px); }
  .dopamine-xp-bar .coins-display .coin-icon{ font-size:0!important; width:18px; height:18px; display:inline-block; background:var(--fgc-accent,#d4705f); -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M14.5 9.5c-.5-1-1.5-1.5-2.5-1.5-1.7 0-2.8 1-2.8 2.2 0 2.8 5.6 1.6 5.6 4.4 0 1.2-1.2 2.2-2.8 2.2-1.1 0-2.1-.5-2.6-1.5M12 6.5V8M12 16.5V18'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M14.5 9.5c-.5-1-1.5-1.5-2.5-1.5-1.7 0-2.8 1-2.8 2.2 0 2.8 5.6 1.6 5.6 4.4 0 1.2-1.2 2.2-2.8 2.2-1.1 0-2.1-.5-2.6-1.5M12 6.5V8M12 16.5V18'/%3E%3C/svg%3E") center/contain no-repeat; animation:none!important; }
  .dopamine-xp-bar .fg-chip-streak .coin-icon{ -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22c4 0 7-2.7 7-6.8 0-3.6-2.6-6.2-4.4-8.4-.4 2-1.4 3.4-2.9 4.1.3-3.2-1.2-6.4-3.7-8.4.2 3.4-2.9 5.8-3.7 8.3C3.6 15.4 6.3 22 12 22z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22c4 0 7-2.7 7-6.8 0-3.6-2.6-6.2-4.4-8.4-.4 2-1.4 3.4-2.9 4.1.3-3.2-1.2-6.4-3.7-8.4.2 3.4-2.9 5.8-3.7 8.3C3.6 15.4 6.3 22 12 22z'/%3E%3C/svg%3E"); }
  .dopamine-xp-bar .coins-amount{ color:var(--fgc-text,#262626)!important; font:800 .88rem/1 Inter,system-ui,sans-serif!important; text-shadow:none!important; -webkit-text-fill-color:currentColor!important; }
  .dopamine-xp-bar .rewards-btn{ display:inline-flex!important; align-items:center; gap:8px; height:36px; padding:0 18px!important; border:0!important; border-radius:999px!important; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; color:#fff!important; font:700 .88rem/1 Inter,system-ui,sans-serif!important; box-shadow:0 6px 14px -8px rgba(212,112,95,.9)!important; animation:none!important; cursor:pointer; }
  .dopamine-xp-bar .rewards-btn::before{ content:''; width:16px; height:16px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l1 14H5L6 7z'/%3E%3Cpath d='M9 10V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l1 14H5L6 7z'/%3E%3Cpath d='M9 10V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E") center/contain no-repeat; }
}

/* il pannello dell'hub esiste solo sul telefono: su PC (e dove manca il suo stile) non si vede */
.fgc-hub-pan{ display:none; }
/* vecchia barra/pannello "I Tuoi Progressi" del gioco: sostituita dalla barra in alto e dal foglio progressi */
.gm-stats-panel, #gmStatsPanel, .gamification-mobile-bar, #gamificationBar, #micro-progress-widget, .dopamine-fab-container, #dopamine-fab-overlay{ display:none!important; }
