/* ===========================================================================
   FruitMC — cornice per le pagine che NON sono l'app React.
   La usano il regolamento (/regole/) e le candidature (/candidati, che e'
   un'app Next a parte). Contiene token, intestazione, pie' di pagina e le
   primitive comuni, cosi quelle pagine hanno lo stesso vestito della home.

   ATTENZIONE: e' una copia degli stili della home, non un import. La home
   passa da Vite e ha il suo bundle; qui serve un foglio statico. Se cambi i
   colori o l'intestazione da una parte, cambiali anche dall'altra.
   =========================================================================== */

@font-face {
  font-family: 'Outfit';
  src: url(/assets/fonts/outfit.woff2) format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MinecraftTen';
  src: url(/assets/fonts/minecraft.woff) format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fffaf0;
  --paper-2: #fff1d8;
  --sand: #ffe3b8;
  --card: #fffdf8;
  --card-2: #fff5e4;

  --ink: #4a2110;
  --ink-soft: #8a5227;
  --ink-faint: rgba(74, 33, 16, 0.55);
  --choco: #4a2110;
  --choco-deep: #2c1207;

  --straw: #ef3129;
  --straw-deep: #bd1b26;
  --tang: #ff9214;
  --leaf: #33b757;
  --leaf-deep: #1c8a42;
  --lemon: #ffcf1b;
  --grape: #8b45c9;
  --blue: #2f9be0;

  --line: rgba(74, 33, 16, 0.18);
  --line-strong: rgba(74, 33, 16, 0.42);
  --bd: 3px solid var(--choco);
  --hard: 0 6px 0 rgba(74, 33, 16, 0.26);
  --hard-sm: 0 4px 0 rgba(74, 33, 16, 0.24);
  --hard-lg: 0 10px 0 rgba(74, 33, 16, 0.22), 0 22px 40px -18px rgba(74, 33, 16, 0.5);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shell: 1180px;
}

html[data-theme='dark'] {
  --paper: #1a1020;
  --paper-2: #221530;
  --sand: #2b1a3a;
  --card: #241634;
  --card-2: #2e1d40;

  --ink: #ffeede;
  --ink-soft: #d8b9c9;
  --ink-faint: rgba(255, 238, 222, 0.55);
  --choco: #0f0714;
  --choco-deep: #080410;

  --straw: #ff4a41;
  --straw-deep: #d8232f;
  --tang: #ffa73a;
  --leaf: #45d16d;
  --leaf-deep: #24a353;
  --lemon: #ffd94a;
  --grape: #b06bee;
  --blue: #56b8f5;

  --line: rgba(255, 238, 222, 0.16);
  --line-strong: rgba(255, 238, 222, 0.34);
  --hard: 0 6px 0 rgba(8, 4, 16, 0.6);
  --hard-sm: 0 4px 0 rgba(8, 4, 16, 0.55);
  --hard-lg: 0 10px 0 rgba(8, 4, 16, 0.55), 0 22px 44px -18px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* cielo di fondo, come sulla home */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 45% at 82% -8%, rgba(255, 190, 70, 0.5), transparent 62%),
    radial-gradient(55% 40% at 6% 8%, rgba(239, 49, 41, 0.16), transparent 64%),
    radial-gradient(60% 45% at 20% 100%, rgba(51, 183, 87, 0.2), transparent 62%),
    linear-gradient(172deg, #fff6e4 0%, #ffe9c8 46%, #ffd9a8 100%);
}
html[data-theme='dark'] body::before {
  background:
    radial-gradient(70% 45% at 82% -8%, rgba(176, 107, 238, 0.32), transparent 62%),
    radial-gradient(55% 40% at 6% 8%, rgba(239, 49, 41, 0.18), transparent 64%),
    radial-gradient(60% 45% at 20% 100%, rgba(36, 163, 83, 0.18), transparent 62%),
    linear-gradient(172deg, #1d1128 0%, #160d1f 52%, #0f0916 100%);
}
body > * { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--tang); outline-offset: 3px; border-radius: 8px; }

.pix { image-rendering: pixelated; }
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 20px; }
section[id] { scroll-margin-top: 92px; }

.mc { font-family: 'MinecraftTen', 'Outfit', sans-serif; font-weight: 400; letter-spacing: 0.02em; line-height: 1.05; }
.sticker {
  color: var(--straw);
  text-shadow:
    -3px -3px 0 var(--paper), 3px -3px 0 var(--paper),
    -3px 3px 0 var(--paper), 3px 3px 0 var(--paper),
    0 0 3px var(--paper), 6px 7px 0 rgba(74, 33, 16, 0.3);
}
html[data-theme='dark'] .sticker {
  text-shadow:
    -3px -3px 0 #150c1e, 3px -3px 0 #150c1e,
    -3px 3px 0 #150c1e, 3px 3px 0 #150c1e,
    0 0 3px #150c1e, 6px 7px 0 rgba(0, 0, 0, 0.55);
}

/* ── intestazione di sezione ────────────────────────────────────────────── */
.sec-head { display: grid; justify-items: center; text-align: center; gap: 10px; margin-bottom: 36px; }
.sec-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px 7px 10px;
  border: 2px solid var(--choco);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--hard-sm);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.sec-kicker img { width: 20px; height: 20px; }
.sec-title { margin: 0; font-size: clamp(2rem, 5.4vw, 3.2rem); }
.sec-sub { margin: 0; max-width: 62ch; font-size: 1.04rem; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }

/* ── bottoni ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 21px;
  border: var(--bd);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--hard-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(74, 33, 16, 0.26); filter: saturate(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(74, 33, 16, 0.26); }
.btn img, .btn svg { width: 22px; height: 22px; flex: none; }
.btn-play { background: linear-gradient(180deg, #ff6a4a, var(--straw)); color: #fff; }
.btn-leaf { background: linear-gradient(180deg, #48cd6c, var(--leaf-deep)); color: #fff; }
.btn-disc { background: linear-gradient(180deg, #7b8cf5, #5865f2); color: #fff; }
.btn-gold { background: linear-gradient(180deg, var(--lemon), var(--tang)); color: #3a1a05; }
.btn-lg { padding: 16px 27px; font-size: 1.06rem; border-radius: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 2px solid var(--choco);
  border-radius: 999px;
  background: var(--card-2);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.chip-straw { background: var(--straw); color: #fff; }
.chip-leaf { background: var(--leaf); color: #06280f; }
.chip-tang { background: var(--tang); color: #3a1a05; }
.chip-grape { background: var(--grape); color: #fff; }
.chip-blue { background: var(--blue); color: #04202f; }

/* ── HEADER ────────────────────────────────────────────────────────────── */
.head { position: sticky; top: 0; z-index: 90; }
.head-awn {
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--straw) 0 32px, #fff9ef 32px 64px);
  position: relative;
  z-index: 2;
}
.head-awn::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  background-image:
    radial-gradient(circle at 16px 0, var(--straw) 16px, transparent 17px),
    radial-gradient(circle at 48px 0, #fff9ef 16px, transparent 17px);
  background-size: 64px 12px;
  background-repeat: repeat-x;
}
.head-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #6a3418, #43200f 45%, #2c1207);
  border-bottom: 4px solid #200d05;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6);
}
html[data-theme='dark'] .head-bar { background: linear-gradient(180deg, #2a1740, #180d24 45%, #0d0714); border-bottom-color: #070310; }

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 3px;
  border: 3px solid #200d05;
  border-radius: 13px;
  background: linear-gradient(180deg, #ff6a4a, var(--straw));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 3px 0 rgba(0, 0, 0, 0.45);
}
.brand-badge img { width: 100%; height: 100%; object-fit: contain; }
.brand-word { font-family: 'MinecraftTen', 'Outfit', sans-serif; font-size: 1.3rem; line-height: 1; color: #ff5b48; text-shadow: 2px 2px 0 #200d05; }
.brand-word b { color: #fff; font-weight: 400; }
.brand-sub { display: block; margin-top: 3px; font-size: 0.6rem; font-weight: 900; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 226, 190, 0.62); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-item {
  isolation: isolate;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  /* Il bordo c'e' sempre, solo trasparente finche' la voce non e' attiva:
     prima lo aggiungeva `.on`, e la voce attiva era 4px piu' larga delle
     altre, spingendo di lato tutta la hotbar. Come nella home. */
  border: 2px solid transparent;
  border-radius: 11px;
  font-weight: 800;
  font-size: 0.94rem;
  color: rgba(255, 232, 205, 0.82);
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-item img { width: 19px; height: 19px; flex: none; }
.nav-item.on { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); }

/* la voce Store, l'unica con un fondo suo e un riflesso che la attraversa */
.nav-item.nav-hot {
  overflow: hidden;
  background: linear-gradient(180deg, #ffd94a, var(--tang));
  color: #3a1a05;
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 0 rgba(0, 0, 0, 0.35);
  font-weight: 900;
}
.nav-item.nav-hot:hover { color: #2b1204; filter: brightness(1.06); }
/* Sulla voce gialla un fondo bianco non si vedrebbe: anello chiaro. */
.nav-item.nav-hot.on {
  background: linear-gradient(180deg, #ffe473, #ffa22e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.55), 0 2px 0 rgba(0, 0, 0, 0.35);
}
.nav-item.nav-hot::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -60%;
  bottom: -60%;
  left: -40%;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transform: skewX(-18deg);
  animation: riflesso 4.2s ease-in-out infinite;
}
@keyframes riflesso { 0%, 68% { left: -40%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .nav-item.nav-hot::after { animation: none; opacity: 0; } }

.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffe6c8;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.ico-disc { background: #5865f2; border-color: #4650c9; color: #fff; }
.icon-btn.ico-disc:hover { background: #6c78f5; }

.head-ip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffe6c8;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
}
.head-ip:hover { background: rgba(255, 255, 255, 0.2); }
.head-ip svg { width: 15px; height: 15px; }

.burger { display: none; }
.mob { overflow: hidden; max-height: 0; transition: max-height 0.28s ease; background: linear-gradient(180deg, #43200f, #2c1207); border-bottom: 4px solid #200d05; }
.mob.open { max-height: 460px; }
html[data-theme='dark'] .mob { background: linear-gradient(180deg, #1d1029, #0d0714); }
.mob-in { display: grid; gap: 4px; padding: 12px 18px 16px; }
.mob-in a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); color: #ffe6c8; font-weight: 800; }
.mob-in a img { width: 20px; height: 20px; }
.mob-in a.nav-hot { background: linear-gradient(180deg, #ffd94a, var(--tang)); color: #3a1a05; font-weight: 900; }

@media (max-width: 1300px) {
  .nav { display: none; }
  .burger { display: grid; }
  .head-ip .head-ip-label { display: none; }
}
@media (max-width: 560px) { .head-ip { display: none; } .brand-sub { display: none; } }

/* ── FOOTER ────────────────────────────────────────────────────────────── */
.foot { position: relative; margin-top: 90px; padding-bottom: 26px; }
.foot-grass {
  position: relative;
  height: 22px;
  background: linear-gradient(180deg, #6ac04a 0 9px, #4e9c35 9px 100%);
  border-top: 3px solid var(--choco);
}
.foot-grass::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 7px;
  background-image: radial-gradient(circle at 9px -4px, #4e9c35 8px, transparent 9px);
  background-size: 18px 7px;
  background-repeat: repeat-x;
}
html[data-theme='dark'] .foot-grass { background: linear-gradient(180deg, #3f8f3c 0 9px, #2e6b2c 9px 100%); }
html[data-theme='dark'] .foot-grass::after { background-image: radial-gradient(circle at 9px -4px, #2e6b2c 8px, transparent 9px); }
.foot-dirt {
  padding: 46px 0 0;
  background:
    repeating-linear-gradient(115deg, rgba(0, 0, 0, 0.05) 0 3px, transparent 3px 26px),
    linear-gradient(180deg, #8a5a34, #6b4222 55%, #55321a);
  border-bottom: 3px solid var(--choco);
}
html[data-theme='dark'] .foot-dirt {
  background:
    repeating-linear-gradient(115deg, rgba(0, 0, 0, 0.14) 0 3px, transparent 3px 26px),
    linear-gradient(180deg, #35213f, #241531 55%, #170d21);
}
.foot-card { border: var(--bd); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--hard-lg); overflow: hidden; }
.foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; padding: 34px 32px; }
.foot-brand { display: grid; gap: 14px; justify-items: start; }
.foot-brand img.logo { width: 132px; }
.foot-brand p { margin: 0; max-width: 32ch; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }
.foot-ip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 2px solid var(--choco);
  border-radius: 11px;
  background: var(--card-2);
  box-shadow: var(--hard-sm);
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.foot-ip:hover { transform: translateY(-2px); }
.foot-ip small { display: block; font-size: 0.7rem; font-weight: 800; color: var(--ink-faint); letter-spacing: 0.04em; text-transform: uppercase; }
.foot-ip svg { width: 16px; height: 16px; flex: none; color: var(--ink-faint); }
.foot-col h3 { margin: 0 0 14px; font-size: 1.15rem; }
.foot-col nav { display: grid; gap: 9px; }
.foot-col nav a { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink-soft); }
.foot-col nav a:hover { color: var(--straw); }
.foot-col nav a img { width: 19px; height: 19px; }
.foot-fine {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-top: 3px solid var(--choco);
  background: var(--card-2);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-faint);
}
.foot-fine a { text-decoration: underline; text-underline-offset: 3px; }
.foot-fine b { color: var(--straw); }
@media (max-width: 980px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 26px; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; padding: 26px 20px; } .foot-fine { padding: 16px 20px; justify-content: center; text-align: center; } }

/* ── toast ─────────────────────────────────────────────────────────────── */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 26px; z-index: 300; display: grid; justify-items: center; pointer-events: none; padding: 0 16px; }
.toast {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 20px;
  border: var(--bd);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--hard);
  font-weight: 800;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast img { width: 24px; height: 24px; }
.toast b { color: var(--straw); }

/* ── cartellino cookie ─────────────────────────────────────────────────── */
html.locked, html.locked body { overflow: hidden; }
#gate { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 22px; background: linear-gradient(180deg, #ffe9c6, #ffd7a1); opacity: 1; transition: opacity 0.35s ease, visibility 0.35s; }
html[data-theme='dark'] #gate { background: linear-gradient(180deg, #1e1229, #120b1a); }
#gate.hidden { opacity: 0; visibility: hidden; }
.consent { width: min(460px, 92vw); padding: 30px 28px 26px; border: var(--bd); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--hard-lg); text-align: center; }
.consent-ico { display: inline-grid; place-items: center; width: 60px; height: 60px; border: var(--bd); border-radius: 16px; background: linear-gradient(180deg, #ff6a4a, var(--straw)); color: #fff; box-shadow: var(--hard-sm); }
.consent-ico svg { width: 30px; height: 30px; }
.consent h2 { margin: 16px 0 6px; font-size: 1.9rem; }
.consent p { margin: 0; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }
.consent a { color: var(--straw); text-decoration: underline; text-underline-offset: 3px; }
.consent-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.consent-note { display: none; margin-top: 14px; font-size: 0.86rem; font-weight: 800; color: var(--straw-deep); }
#gate.refused .consent-note { display: block; }

/* l'interruttore mostra la luna di giorno e il sole di notte */
.js-theme .ic-sun { display: none; }
.js-theme .ic-moon { display: block; }
html[data-theme='dark'] .js-theme .ic-sun { display: block; }
html[data-theme='dark'] .js-theme .ic-moon { display: none; }

/* ── su cellulare ──────────────────────────────────────────────────────────
   Le voci del pie' di pagina erano alte 20px: un dito le manca. Etichette e
   sottotitoli minuti salgono a 12px, che e' il minimo perche' restino
   leggibili su uno schermo piccolo. */
@media (max-width: 820px) {
  .foot-col nav { gap: 2px; }
  .foot-col nav a { min-height: 42px; align-items: center; }
  .foot-ip { min-height: 46px; }
  .head-ip { min-height: 40px; }
  .foot-fine { font-size: 0.9rem; }
  .foot-ip small { font-size: 0.74rem; }
  .sec-kicker { font-size: 0.8rem; }
}

@media (max-width: 820px) {
  .foot-fine a { display: inline-block; padding: 12px 0; }
  .foot-ip small { font-size: 0.78rem; }
  .brand-sub { display: none; }
}
