/* Protein Score — "Le pagelle": sports-paper pink, black ink, one red for the leader. */

@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("/fonts/barlow-condensed-800.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-600.woff2") format("woff2"); }

:root {
  --rosa: #F7D7DE;
  --rosa-2: #F1C5CF;
  --carta: #FFFFFF;
  --inchiostro: #151515;
  --inchiostro-2: #6E2C3A;
  --rosso: #C3102C;
  --filo: rgba(21, 21, 21, .4);
  --spento: #B98E99;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --testo: "Barlow", system-ui, sans-serif;
  --colonna: 600px;
  --margine: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--rosa);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--inchiostro-2) var(--rosa);
}

body {
  margin: 0 auto;
  max-width: var(--colonna);
  min-height: 100dvh;
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
  background: var(--rosa);
  color: var(--inchiostro);
  font: 16px/1.4 var(--testo);
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--rosso); color: #fff; }
input { caret-color: var(--rosso); }
:focus-visible { outline: 3px solid var(--inchiostro); outline-offset: 2px; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
p { margin: 0; }

.simboli { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ——— masthead ——— */
.testata { padding: calc(10px + env(safe-area-inset-top)) var(--margine) 0; }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.marchio { font: 800 21px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.io {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; max-width: 55%;
  padding: 0 12px; border: 1.5px solid var(--inchiostro); background: transparent;
  font: 600 15px/1 var(--testo); cursor: pointer;
}
.io span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io .ico { width: 18px; height: 18px; stroke-width: 2; }
h1 {
  margin: 10px 0 0; padding-bottom: 10px;
  border-bottom: 6px solid var(--rosso);
  font: 800 clamp(46px, 14.5vw, 64px)/.9 var(--display);
  text-transform: uppercase; letter-spacing: -.005em;
}

/* ——— tabs ——— */
.schede {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 22px; padding: 0 var(--margine);
  /* pink across the whole column, so the white leader row never shows beside it; the rule stays inside the margins */
  background: var(--rosa);
}
.schede::after { content: ""; position: absolute; left: var(--margine); right: var(--margine); bottom: 0; height: 1px; background: var(--inchiostro); }
.schede button {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 0 0;
  border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none;
  font: 600 15px/1 var(--testo); color: var(--inchiostro-2); cursor: pointer; white-space: nowrap;
}
.schede button[aria-selected="true"] { color: var(--inchiostro); border-bottom-color: var(--inchiostro); }
.conta {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--rosso); color: #fff; font: 800 14px/1 var(--display);
}

/* ——— standings ——— */
main { padding: 0 var(--margine); }
.riga { position: relative; border-bottom: 1px solid var(--filo); scroll-margin-top: 64px; }
.riga-testa {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
  width: 100%; padding: 14px 0 13px; border: 0; background: none; text-align: left; cursor: pointer;
}
.pos { align-self: start; display: flex; flex-direction: column; gap: 2px; font: 800 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.chi { min-width: 0; }
.gusto { display: block; font: 800 25px/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.prodotto { display: block; margin-top: 4px; font-size: 14px; color: var(--inchiostro-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media { font: 800 46px/.9 var(--display); font-variant-numeric: tabular-nums; text-align: right; min-width: 2ch; }
.giudizi { grid-column: 2 / 4; margin-top: 7px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.giudizi b { font-weight: 600; }
.giudizi.righe { white-space: normal; }
.giudizi.righe > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.giudizi.righe > span + span { margin-top: 2px; }
.media-box { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.distacco { font: 600 14px/1 var(--testo); font-variant-numeric: tabular-nums; color: var(--inchiostro-2); white-space: nowrap; }
.riga-testa[aria-expanded="true"] .giudizi { visibility: hidden; height: 0; margin: 0; }

.riga.prima { background: var(--carta); margin: 16px calc(var(--margine) * -.5) 4px; padding: 0 calc(var(--margine) * .5); border-bottom: 0; }
.riga.prima .media { color: var(--rosso); font-size: 60px; }
.riga.prima + .riga.prima { margin-top: 0; border-top: 1px solid var(--filo); }
.riga.senza .media, .riga.senza .pos { color: var(--inchiostro-2); }
.riga.senza .giudizi { color: var(--inchiostro-2); }

.sposta { display: inline-flex; align-items: center; gap: 2px; font: 800 18px/1 var(--display); }
.sposta svg { width: 11px; height: 11px; fill: currentColor; }
.sposta.su { color: var(--rosso); }
.riga.sale { z-index: 2; animation: sale 1.6s var(--ease); }
@keyframes sale { from { background-color: var(--carta); } }

.dettaglio { padding: 0 0 18px 48px; }
.voti-lista { list-style: none; margin: 0; padding: 0; }
.voti-lista li {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 8px; row-gap: 2px;
  padding: 9px 0; border-top: 1px dashed var(--filo);
}
.voti-lista li:first-child { border-top: 0; padding-top: 0; }
.voti-lista b { font-weight: 600; }
.voti-lista .n { font: 800 22px/1 var(--display); }
.voti-lista q, .voti-lista time { grid-column: 1 / 4; }
q { quotes: "«" "»"; }
.voti-lista time, .nota-p { font-size: 13px; color: var(--inchiostro-2); }
.stelle { display: inline-flex; gap: 1px; vertical-align: -2px; }
.stelle svg { width: 16px; height: 16px; fill: var(--inchiostro); }
.stelle svg.vuota { fill: none; stroke: var(--inchiostro); stroke-width: 1.6; }
.manca, .nota-p { margin-top: 8px; font-size: 14px; color: var(--inchiostro-2); }
.comandi { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin-top: 14px; }
.comandi [data-azione="vota"] { grid-column: 1 / -1; }
.comandi .testo { justify-self: end; text-align: right; }

/* ——— buttons ——— */
.secondario {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--inchiostro); background: transparent;
  font: 600 15px/1 var(--testo); text-decoration: none; cursor: pointer;
}
.secondario .ico { width: 16px; height: 16px; }
.secondario.nero { background: var(--inchiostro); color: #fff; }
.testo {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: 600 15px/1 var(--testo); text-decoration: underline; text-underline-offset: 3px;
}
.testo.rosso, .testo.conferma { color: var(--rosso); }
.grosso {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 16px;
  border: 0; background: var(--inchiostro); color: #fff; cursor: pointer;
  font: 800 25px/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
}
.grosso .ico { width: 22px; height: 22px; stroke-width: 3; }
.grosso:active { transform: translateY(1px); }
.grosso:disabled { background: var(--spento); cursor: default; transform: none; }

/* ——— feed and to-rate ——— */
.eventi, .elenco { list-style: none; margin: 0; padding: 0; }
.evento { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--filo); }
.evento .n { font: 800 46px/.9 var(--display); text-align: center; }
.t { font: 800 21px/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.d { margin-top: 4px; font-size: 14px; color: var(--inchiostro-2); }
.d b { color: var(--inchiostro); font-weight: 600; }
.evento q { display: block; margin-top: 4px; font-size: 15px; }
.davotare { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--filo); }
.davotare > div { flex: 1; min-width: 0; }

.vuoto { padding: 28px 0 8px; font-size: 17px; max-width: 34ch; }
.vuoto + .secondario { margin-top: 14px; }

.piede { padding: 34px var(--margine) 8px; font-size: 13px; color: var(--inchiostro-2); }

/* ——— bottom action ——— */
.azione {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 18px var(--margine) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(247, 215, 222, 0), var(--rosa) 34%);
}
.azione .grosso { max-width: calc(var(--colonna) - 2 * var(--margine)); margin: 0 auto; }

/* ——— gate ——— */
.cancello { padding: 26px var(--margine) 0; }
.cancello > p { margin: 0 0 20px; max-width: 38ch; font-size: 17px; }
.cancello .grosso { margin-top: 18px; }

/* ——— sheets ——— */
dialog.foglio {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: var(--colonna); max-height: 92dvh; margin: 0 auto;
  padding: 0; border: 0; border-top: 6px solid var(--rosso);
  background: var(--carta); color: var(--inchiostro); overflow: auto; overscroll-behavior: contain;
}
dialog.foglio[open] { animation: apri .34s var(--ease); }
@keyframes apri { from { transform: translateY(48px); opacity: .5; } }
@keyframes sopra { from { transform: translateY(10px); opacity: .5; } }
dialog::backdrop { background: rgba(21, 21, 21, .5); }
.foglio form { padding: 20px var(--margine) calc(16px + env(safe-area-inset-bottom)); }
.foglio h2 { margin: 0; font: 800 34px/.95 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.foglio header p { margin-top: 6px; font-size: 15px; color: var(--inchiostro-2); }
label, legend { display: block; margin: 18px 0 6px; padding: 0; font: 600 14px/1.2 var(--testo); }
.facolt { font-weight: 400; color: var(--inchiostro-2); }
input[type="text"], input[type="url"] {
  width: 100%; min-height: 50px; padding: 0 12px; border: 1.5px solid var(--inchiostro); border-radius: 0;
  background: #fff; color: var(--inchiostro); font: 17px/1.2 var(--testo);
}
input::placeholder { color: #8E6670; }
input:focus-visible { outline: 3px solid var(--rosso); outline-offset: 0; }
.errore { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--rosso); }
.errore:empty { display: none; }
.comandi-foglio { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 22px; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.stelle-voto { margin-top: 22px; }
.stelle-voto legend { margin-top: 0; }
[tabindex="-1"]:focus { outline: none; }
.stelle-scelta { display: flex; gap: 4px; margin-left: -6px; }
.stelle-scelta label { margin: 0; display: grid; place-items: center; width: 58px; height: 58px; cursor: pointer; }
.stelle-scelta input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stelle-scelta svg { width: 46px; height: 46px; fill: none; stroke: var(--inchiostro); stroke-width: 1.4; transition: transform .2s var(--ease); }
.stelle-scelta label.piena svg { fill: var(--inchiostro); }
.stelle-scelta label:has(input:focus-visible) { outline: 3px solid var(--rosso); outline-offset: -4px; }
.stelle-scelta label:active svg { transform: scale(.9); }
.didascalia { margin-top: 6px; min-height: 1.1em; font: 800 26px/1 var(--display); text-transform: uppercase; }
.didascalia.vuota { color: var(--inchiostro-2); font: 400 15px/1.7 var(--testo); text-transform: none; }

.incolla { display: flex; gap: 8px; }
.incolla input { flex: 1; min-width: 0; }
.incolla .secondario { min-height: 50px; }
.anteprima { margin-top: 16px; padding: 2px 12px 14px; background: var(--rosa); }
.anteprima label { margin-top: 12px; }
.dati { margin-top: 10px; font-size: 14px; color: var(--inchiostro-2); }

.gia { margin-top: 16px; }
.gia p { font: 600 14px/1.2 var(--testo); }
.nomi { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.voce { margin-top: 18px; }
.voce + .voce { padding-top: 16px; border-top: 1px solid var(--rosa-2); }
.voce h3 { margin: 0 0 4px; font: 800 21px/1 var(--display); text-transform: uppercase; }
.voce p { margin-bottom: 10px; font-size: 15px; color: var(--inchiostro-2); }

/* ——— toast ——— */
.avviso {
  position: fixed; z-index: 30; left: var(--margine); right: var(--margine);
  bottom: calc(12px + env(safe-area-inset-bottom)); min-height: 56px;
  max-width: calc(var(--colonna) - 2 * var(--margine)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 14px; border-top: 3px solid var(--rosso);
  background: var(--inchiostro); color: #fff; font-size: 15px;
  animation: sopra .3s var(--ease);
}
.avviso .testo { color: #fff; flex: none; }

@media (hover: hover) {
  .io:hover, .secondario:hover { background: var(--rosa-2); }
  .secondario.nero:hover, .grosso:hover:not(:disabled) { background: #000; }
  .schede button:hover { color: var(--inchiostro); }
  .riga-testa:hover .gusto { text-decoration: underline 2px; text-underline-offset: 4px; }
}

@media (min-width: 640px) {
  :root { --margine: 24px; }
  .testata { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog.foglio[open], .avviso, .riga.sale { animation: none; }
  .stelle-scelta svg { transition: none; }
}
