@font-face { font-family: Baloo; src: url(../fonts/Baloo2-ExtraBold.ttf); font-display: swap; }
@font-face { font-family: Barlow; src: url(../fonts/Barlow-Regular.ttf); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 700; src: url(../fonts/Barlow-Bold.ttf); font-display: swap; }
@font-face { font-family: Caveat; src: url(../fonts/Caveat-Bold.ttf); font-display: swap; }

:root { --green: #0f3d2a; --green2: #164f37; --red: #8e1c2b; --gold: #e9be50; --cream: #fff6e6; --ink: #1b1b1b; --muted: rgba(255,246,230,.75); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.5 Barlow, system-ui, sans-serif; color: var(--cream);
  background: radial-gradient(circle at 20% 0%, #1f6b47 0%, var(--green) 45%, #0a2b1d 100%) fixed; min-height: 100vh; }
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff8, transparent), radial-gradient(2px 2px at 80px 120px, #fff6, transparent),
  radial-gradient(1.5px 1.5px at 140px 60px, #fff7, transparent), radial-gradient(2.5px 2.5px at 200px 160px, #fff5, transparent);
  background-size: 240px 220px; animation: fall 30s linear infinite; opacity: .55; }
@keyframes fall { to { background-position: 0 660px; } }
@media (prefers-reduced-motion: reduce) { #snow { animation: none; } * { transition: none !important; } }
#app { position: relative; z-index: 1; }
a { color: var(--gold); }
h1, h2, h3 { font-family: Baloo, Barlow, sans-serif; line-height: 1.1; margin: .2em 0 .4em; font-weight: 800; }
h1 { font-size: clamp(30px, 6vw, 46px); } h2 { font-size: 24px; } h3 { font-size: 19px; margin-top: 1em; }
.script { font-family: Caveat, cursive; color: var(--gold); margin: 0; } .script.big { font-size: 34px; }
.small { font-size: 14px; color: var(--muted); }
.center { justify-content: center; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.top { position: sticky; top: 0; z-index: 10; background: rgba(8,36,24,.92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--gold); }
.top-in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; }
.brand .script { font-size: 17px; } .brand .club { font-family: Baloo; color: var(--cream); font-size: 22px; }
nav { display: flex; flex-wrap: nowrap; gap: 2px; }
nav a { color: var(--cream); text-decoration: none; padding: 8px 12px; border-radius: 99px; font-weight: 700; font-size: 15px; white-space: nowrap; }
nav a[aria-current], nav a:hover { background: var(--red); }
.burger { display: none; width: 46px; height: 46px; border: 2px solid var(--gold); border-radius: 12px; background: transparent; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.burger span { display: block; width: 22px; height: 2.5px; background: var(--cream); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
@media (max-width: 900px) {
  .burger { display: flex; }
  nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; padding: 8px 14px 14px;
    background: rgba(8,36,24,.98); border-bottom: 2px solid var(--gold); box-shadow: 0 14px 30px rgba(0,0,0,.4); }
  nav.open { display: flex; }
  nav a { padding: 13px 14px; border-radius: 12px; font-size: 17px; border-bottom: 1px solid rgba(255,255,255,.08); }
}
main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.foot { text-align: center; padding: 24px 16px 40px; font-size: 14px; color: var(--muted); }
.page-title { text-align: center; margin-top: 10px; } .lead { text-align: center; max-width: 640px; margin: 0 auto 18px; color: var(--muted); }

.panel { background: rgba(255,255,255,.07); border: 1px solid rgba(233,190,80,.35); border-radius: 22px; padding: 20px 22px; margin: 16px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border-radius: 99px; border: 2px solid var(--gold);
  background: transparent; color: var(--cream); font: 700 16px Barlow, sans-serif; cursor: pointer; text-decoration: none; }
.btn.gold { background: var(--gold); color: #2a1a00; } .btn:hover { filter: brightness(1.08); }
.chip { display: inline-block; padding: 7px 13px; border-radius: 99px; background: rgba(0,0,0,.25); color: var(--cream); text-decoration: none; font-size: 15px; }
input, textarea { width: 100%; font: 18px Barlow, sans-serif; padding: 12px 14px; border-radius: 14px; border: 2px solid rgba(233,190,80,.6); background: #fff; color: var(--ink); margin-top: 6px; }
label { display: block; font-weight: 700; margin: 10px 0; }

/* gate */
.gate { display: grid; gap: 24px; place-items: center; min-height: 100vh; padding: 28px 16px; grid-template-columns: 1fr; max-width: 980px; margin: auto; }
@media (min-width: 820px) { .gate { grid-template-columns: 1.1fr 1fr; } }
.gate-cover { width: 100%; max-width: 520px; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5); transform: rotate(-2deg); }
.gate-card { background: rgba(0,0,0,.28); border: 2px solid var(--gold); border-radius: 26px; padding: 26px; max-width: 460px; }
.gate-card input { text-transform: uppercase; letter-spacing: .12em; text-align: center; font-weight: 700; }
.gate-card .btn { width: 100%; margin-top: 10px; }
.err { color: #ffb3b3; font-weight: 700; }

/* home */
.hero { text-align: center; padding: 10px 0 4px; }
.count { font-family: Baloo; font-size: 26px; margin: 0; } .count strong { font-size: 76px; color: var(--gold); display: block; line-height: 1; }
.hero .row { justify-content: center; }
.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
@media (min-width: 640px) { .doors { grid-template-columns: repeat(6, 1fr); gap: 14px; } }
.door { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; text-decoration: none; color: var(--cream); display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: linear-gradient(160deg, #7a1b26, #4d0f18); border: 2px solid rgba(233,190,80,.6);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,.15), 0 6px 16px rgba(0,0,0,.35); transition: transform .2s; overflow: hidden; }
.door:nth-child(3n) { background: linear-gradient(160deg, #1d6a46, #0f3d2a); } .door:nth-child(4n) { background: linear-gradient(160deg, #a7782c, #6e4c14); }
.door .num { font-family: Baloo; font-size: clamp(28px, 7vw, 44px); line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.door img { width: 62%; max-height: 42%; object-fit: contain; margin: 4px 0; }
.door .lock { font-size: 20px; opacity: .7; margin: 6px 0; }
.door .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; opacity: .9; text-align: center; padding: 0 4px; }
.door:not(.is-open) { filter: saturate(.55) brightness(.75); cursor: default; }
.door.is-open:not(.is-seen) { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px var(--gold), 0 0 24px var(--gold); } }
.door.is-open:hover { transform: translateY(-3px) rotate(-1deg); }

/* door view */
.door-view { text-align: center; animation: open .45s ease-out; }
@keyframes open { from { transform: perspective(800px) rotateY(-70deg); opacity: 0; } to { transform: none; opacity: 1; } }
.door-view .art { width: 150px; max-width: 45%; margin: 4px auto 10px; display: block; }
.door-view ol, .door-view ul { text-align: left; max-width: 620px; margin: 8px auto; }
.tag { text-transform: uppercase; letter-spacing: .1em; font-size: 13px; color: var(--gold); font-weight: 700; margin: 0; }
.steps li, .list li, .songs li { margin: 6px 0; }
.songs { font-size: 18px; }
.coupon { background: var(--cream); color: var(--ink); border: 3px dashed var(--red); border-radius: 18px; padding: 22px; max-width: 560px; margin: 10px auto; }
.coupon h2 { color: var(--red); } .coupon .sig { color: #555; font-size: 15px; }
.deck .card { background: var(--cream); color: var(--ink); font-size: 22px; font-weight: 700; border-radius: 18px; padding: 30px 22px; min-height: 140px;
  display: grid; place-items: center; max-width: 560px; margin: 10px auto; box-shadow: 0 8px 0 var(--red); }
.deck .row { justify-content: center; }
.quiz { list-style: none; padding: 0; } .quiz li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.quiz .emo { font-size: 30px; }
details summary { cursor: pointer; color: var(--gold); font-weight: 700; }
.tonight { border-color: var(--gold); }

/* referee */
.clock { font-family: Baloo; font-size: 96px; text-align: center; margin: 4px 0; color: var(--gold); line-height: 1; }
.clock.done { color: #ff8a8a; animation: pulse .5s 6 alternate; } @keyframes pulse { to { transform: scale(1.08); } }
.letter { font-family: Baloo; font-size: 110px; text-align: center; margin: 0; color: var(--gold); line-height: 1.1; }
.small-letter { font-size: 34px; }
.wheel-out { text-align: center; font-size: 20px; }

/* scoreboard */
.names { display: grid; gap: 12px; grid-template-columns: 1fr; } @media (min-width: 600px) { .names { grid-template-columns: 1fr 1fr; } }
.total { display: flex; justify-content: space-around; align-items: center; text-align: center; }
.total p { margin: 0; } .total span { display: block; font-weight: 700; } .total strong { font-family: Baloo; font-size: 64px; color: var(--gold); line-height: 1; }
.total .vs { font-family: Baloo; font-size: 28px; }
.board { width: 100%; border-collapse: collapse; font-size: 15px; } .board td, .board th { padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.12); text-align: left; }
.pick { white-space: nowrap; } .pk { min-width: 44px; min-height: 40px; margin: 2px; border-radius: 10px; border: 1px solid var(--gold); background: transparent; color: var(--cream); font: 700 15px Barlow; cursor: pointer; }
.pk.on { background: var(--gold); color: #2a1a00; }
.preview { width: 100%; max-width: 420px; border-radius: 16px; display: block; margin: 12px auto; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* cards and lists */
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; } @media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.pick-card { display: block; text-decoration: none; color: var(--cream); } .pick-card .btn { margin-top: 8px; }
.acc summary { list-style: none; } .acc summary h2 { display: inline; } .acc summary::after { content: ' ▾'; color: var(--gold); }
.qa { padding-left: 0; list-style: none; } .qa li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12); } .qa li span { display: block; }
.review { text-align: center; border-color: var(--gold); }

/* printable sheets */
.sheet { background: #fff; color: #111; border-radius: 12px; padding: 24px; } .sheet h1 { color: #111; text-align: center; }
.sheet .small { color: #555; } .pboard { width: 100%; height: auto; display: block; margin: 10px 0; } .pboard .dot { fill: #111; }
.sheet .btn { color: #111; } .sheet-foot { font-size: 16px; }
.voucher { border: 4px double #8e1c2b; border-radius: 14px; padding: 26px; text-align: center; margin-bottom: 18px; }
.voucher .script { color: #8e1c2b; font-size: 32px; } .voucher h1 { font-size: 36px; } .voucher .msg { font-size: 19px; font-style: italic; }
.tags { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gtag { border: 2px dashed #8e1c2b; border-radius: 14px 14px 40px 14px; padding: 18px; text-align: center; } .gtag .script { color: #8e1c2b; font-size: 28px; }

@media print {
  body { background: #fff !important; color: #000; } #snow, .top, .foot, .no-print, .tonight, nav { display: none !important; }
  main { padding: 0; max-width: none; } .sheet, .panel { box-shadow: none; border: none; background: #fff; color: #000; }
  .coupon { border-color: #000; } .door-view .art { filter: invert(1); }
  /* stampanti USA: US Letter (8.5 x 11 in). Tavoli da gioco e buoni in orizzontale, kit regalo in verticale */
  @page { size: letter landscape; margin: 0.5in; }
  @page giftpage { size: letter portrait; margin: 0.5in; }
  .gift-sheet { page: giftpage; }
  .pboard { height: 5.6in; width: auto; max-width: 100%; margin: 0 auto; }
  .sheet { padding: 0; } .sheet h1 { margin: 0 0 .1in; font-size: 26pt; } .sheet-foot { margin: .1in 0 0; }
  main, #app { padding: 0 !important; margin: 0 !important; }
}

/* private area (shared with the other companion apps) */
.pv-login { max-width: 360px; margin: auto; } .pv-chart { width: 100%; height: auto; } .pv-grid { stroke: rgba(255,255,255,.15); }
.pv-axis { fill: var(--muted); font-size: 12px; } .pv-bar { fill: var(--gold); }
.pv-nav { display: flex; justify-content: space-between; align-items: center; } .pv-totals { display: flex; flex-wrap: wrap; gap: 18px; }
.pv-year summary { display: flex; justify-content: space-between; } .pv-year ul { list-style: none; padding: 0; }
.pv-month { width: 100%; display: flex; justify-content: space-between; background: none; border: 0; color: var(--cream); padding: 8px 4px; font: 16px Barlow; cursor: pointer; }
.pv-month.is-sel { color: var(--gold); } .pv-note { font-size: 13px; color: var(--muted); } .field-error { color: #ffb3b3; }

