/* Aspetto delle pagine per le persone: colori caldi, testata con il pittogramma, riepilogo in evidenza,
   etichette per piattaforma, podio, barra delle sezioni con icone.
   Si carica DOPO lo stile scritto nelle pagine e dopo responsive-app.css. I colori del testo piccolo
   restano sopra 4,5:1 (CLAUDE.md regola 5): accento scuro #C2321A su bianco, bianco su #B92F18–#D63A1F. */
:root {
  --accent: #EF4629;
  --accent-dark: #C2321A;
  --hero-from: #B92F18;
  --hero-to: #D63A1F;
  --ink: #1B2440;
  --muted: #4B5563;
  --bg: #FBF6F2;
  --card: #FFFFFF;
  --line: #EADFD8;
  --tint: #FDE8E4;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(27, 36, 64, 0.05), 0 8px 24px rgba(27, 36, 64, 0.06);
}

body { background: var(--bg); color: var(--ink); }
h1, h2 { letter-spacing: -0.01em; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}
input[type="url"]:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus {
  border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(239, 70, 41, 0.18); outline: none;
}

/* ---------- Testata ---------- */
.topbar { align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; }
.logo img { width: 40px; height: 40px; display: block; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.logo-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.region-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--tint); color: #9A2A16; font-weight: 700; }
.region-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Schede ---------- */
.card, .summary, .item, .watch-item, .watch-menu, .empty, .moment {
  border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.moment { border-color: var(--line) var(--line) var(--line) var(--accent); }
.moment .deadline { display: inline-block; align-self: flex-start; background: var(--tint); padding: 4px 10px; border-radius: 999px; color: #9A2A16; }
.watch-btn { border-radius: 14px; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.watch-btn:hover { box-shadow: 0 4px 12px rgba(239, 70, 41, 0.35); }
button.primary { border-radius: 14px; transition: transform 0.12s ease, box-shadow 0.12s ease; box-shadow: 0 6px 16px rgba(239, 70, 41, 0.28); }
button.primary:hover { box-shadow: 0 8px 20px rgba(239, 70, 41, 0.38); }
button.primary:active { transform: translateY(1px); }

/* ---------- Riepilogo in evidenza (Oggi, I miei punti) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px; color: #FFFFFF;
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  box-shadow: 0 10px 30px rgba(185, 47, 24, 0.28); display: flex; flex-direction: column; gap: 16px;
}
.hero::after {
  content: ""; position: absolute; right: -36px; top: -36px; width: 210px; height: 210px; pointer-events: none;
  background: url(/static/img/pittogramma.png) center / contain no-repeat; filter: brightness(0) invert(1); opacity: 0.16;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 0; color: #FFFFFF; font-size: 30px; line-height: 1.1; font-weight: 800; }
.hero-sub { margin: 4px 0 0; font-size: 15px; font-weight: 500; }
.hero-stats { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.hero-points { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.hero-points b { font-size: 56px; line-height: 1; font-weight: 800; }
.hero-points span { font-size: 14px; font-weight: 600; }
.hero-today { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; }
.hero-today .label { font-size: 14px; font-weight: 600; }
.dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.dot { width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; border: 2px solid #FFFFFF; background: transparent; }
.dot.on { background: #FFFFFF; }

/* ---------- Etichette per piattaforma ---------- */
.watch-platform, .chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 3px 10px 3px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; background: #EEF1F6; color: #374151;
}
.watch-platform::before, .chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.p-instagram { background: #FCE7F1; color: #9D174D; }
.p-instagram::before { background: #E1306C; }
.p-tiktok { background: #E8EAF0; color: #111827; }
.p-tiktok::before { background: #111827; }
.p-youtube { background: #FDE2E2; color: #991B1B; }
.p-youtube::before { background: #E11D1D; }
.p-facebook { background: #E0ECFF; color: #1E40AF; }
.p-facebook::before { background: #1877F2; }

/* ---------- Classifica: podio e persone ---------- */
.podium { list-style: none; margin: 4px 0 0; padding: 0; display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.podium li { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.podium li:nth-child(1) { order: 2; }
.podium li:nth-child(2) { order: 1; }
.podium li:nth-child(3) { order: 3; }
.medal { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 800; }
.medal-1 { background: #FFD86B; color: #5B4300; }
.medal-2 { background: #E5E7EB; color: #374151; }
.medal-3 { background: #F2C29B; color: #6B3A12; }
.podium .name { font-size: 14px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.podium .score { font-size: 13px; color: var(--muted); }
.podium .block { width: 100%; border-radius: 12px 12px 0 0; background: linear-gradient(#FDE8E4, #FAD2C8); }
.podium li:nth-child(1) .block { height: 92px; }
.podium li:nth-child(2) .block { height: 68px; }
.podium li:nth-child(3) .block { height: 52px; }
.podium li.mine .block { background: linear-gradient(var(--hero-to), var(--hero-from)); }
.podium li.mine .name { color: var(--accent-dark); }
.mine-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--tint); color: #7A200F; font-weight: 700; font-size: 15px; }
.note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.prow { display: grid; grid-template-columns: 22px 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.prow:first-of-type { border-top: 0; }
.prow .pos { font-size: 14px; font-weight: 700; color: var(--muted); text-align: center; }
.prow .pname { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.prow b { font-size: 16px; }
.prow .pbar { grid-column: 3 / -1; height: 6px; border-radius: 999px; background: #F3E9E3; overflow: hidden; margin-top: -4px; }
.prow .pbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #F59C86, var(--accent)); }
.prow.me .pname, .prow.me b, .prow.me .pos { color: var(--accent-dark); font-weight: 800; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.av-0 { background: #FDE8E4; color: #9A2A16; }
.av-1 { background: #E0ECFF; color: #1E40AF; }
.av-2 { background: #DFF5E7; color: #166534; }
.av-3 { background: #F1E6FB; color: #6B21A8; }
.av-4 { background: #FEF0C7; color: #854D0E; }

/* ---------- Stati vuoti ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 18px; text-align: center;
  background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius);
}
.empty-state img { width: 64px; height: 64px; opacity: 0.45; }
.empty-state p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 15px; line-height: 1.45; }
.empty-state a { color: var(--accent-dark); font-weight: 700; }

/* ---------- Esito positivo: un piccolo gesto di festa ---------- */
.msg-ok { display: flex; align-items: center; gap: 10px; animation: pop 0.35s ease-out; }
.msg-ok::before { content: "✓"; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #14532D; color: #FFFFFF; font-size: 15px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .msg-ok { animation: none; }
  .watch-btn, button.primary { transition: none; }
}

/* ---------- Accesso e registrazione ---------- */
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.auth-logo img { width: 72px; height: 72px; }
.auth-logo strong { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.auth-logo small { font-size: 13px; color: var(--muted); }
.wrap.narrow { border-color: var(--line); }

/* ---------- Riquadro laterale (si vede solo su schermi grandi) ---------- */
.side { display: none; }

/* ---------- Barra delle sezioni: telefono e tablet (in basso, con icone) ---------- */
@media (max-width: 1023px) {
  .tabbar { gap: 4px; padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(27, 36, 64, 0.06); }
  .tabbar .tab { flex-direction: column; gap: 2px; min-height: 60px; border-top: 0; border-radius: 14px; font-size: 12.5px; font-weight: 600; }
  .tabbar .tab .ico { width: 56px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background 0.15s ease; }
  .tabbar .tab.active { color: #9A2A16; font-weight: 800; }
  .tabbar .tab.active .ico { background: var(--tint); }
}
.tab .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Computer ---------- */
@media (min-width: 1024px) {
  .wrap:not(.narrow):not(.doc) { background: transparent; border: 0; }
  .tabbar { background: transparent; box-shadow: none; }
  .tabbar .tab { flex-direction: row; gap: 8px; font-size: 16px; font-weight: 600; }
  .tabbar .tab .ico { width: auto; height: auto; background: none; }
  .tabbar .tab.active { color: #9A2A16; font-weight: 800; }

  .side {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 20px; padding: 22px; border-radius: 24px; color: #FFFFFF;
    background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); box-shadow: 0 10px 30px rgba(185, 47, 24, 0.28); overflow: hidden;
  }
  .side::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 170px; height: 170px; pointer-events: none; background: url(/static/img/pittogramma.png) center / contain no-repeat; filter: brightness(0) invert(1); opacity: 0.14; }
  .side > * { position: relative; z-index: 1; }
  .side-label { font-size: 14px; font-weight: 600; }
  .side-points { font-size: 56px; line-height: 1; font-weight: 800; }
  .side-line { font-size: 14px; font-weight: 500; line-height: 1.35; }
  .side-link { margin-top: 10px; color: #FFFFFF; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
  .side-link:focus-visible { outline-color: #FFFFFF; }
  /* Su schermi grandi la testata di "Oggi" e "I miei punti" occupa tutta la larghezza */
  .hero { padding: 28px; flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
  .hero h1 { font-size: 36px; }
  .hero-stats { gap: 48px; align-items: center; }
  /* Su schermi grandi il blocco "video condivisi" è allineato a destra, vicino ai punti */
  .hero-today { align-items: flex-end; text-align: right; }
  .hero-today .dots { justify-content: flex-end; }
}

/* ---------- I miei punti: "Mostra altri" ---------- */
h2 .count { font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--muted); }
.items > .more-wrap { grid-column: 1 / -1; display: flex; justify-content: center; }
.more {
  min-height: 48px; padding: 0 24px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--accent); border-radius: 14px; background: #FFFFFF; color: var(--accent-dark);
  font-size: 16px; font-weight: 700; text-decoration: none; transition: background 0.12s ease;
}
.more:hover { background: var(--tint); }
.item { scroll-margin-top: 16px; }
@media (max-width: 599px) { .more { width: 100%; } }
