/* =========================================================================
   DopeGang Secret Santa - stile "videogame natalizio"
   ========================================================================= */
:root {
  --night: #0b1026;
  --night-2: #151a44;
  --ink: #fff8ec;
  --ink-dim: rgba(255, 248, 236, 0.72);
  --red: #e3222c;
  --red-l: #ff5a5f;
  --red-d: #9e1119;
  --red-dd: #4f070b;
  --green: #22a05a;
  --green-l: #3fd07f;
  --green-d: #0f5c33;
  --green-dd: #07331c;
  --gold-1: #fff7d1;
  --gold-2: #ffe08a;
  --gold-3: #f2b43a;
  --gold-4: #b57418;
  --gold-5: #5c3208;
  --snow: #f4f8ff;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: 'Lilita One', 'Arial Black', system-ui, sans-serif;
  --serif: 'Cinzel', Georgia, serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --snowcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 44' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.65' stop-color='%23f1f6ff'/%3E%3Cstop offset='1' stop-color='%23c9d8f5'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0,20 C8,5 30,2 50,9 C70,0 95,2 112,10 C132,1 160,3 177,11 C197,2 222,3 242,10 C262,1 290,2 307,10 C327,2 352,3 367,10 C382,4 396,7 400,18 L400,24 C392,32 380,28 372,26 C366,40 356,42 351,28 C340,32 325,30 315,27 C300,33 285,31 270,28 C262,43 250,44 246,29 C230,33 210,31 195,27 C180,32 165,32 152,28 C140,37 128,38 124,29 C110,32 95,31 82,27 C70,33 55,32 44,28 C36,41 26,42 22,29 C14,31 4,30 0,26 Z'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; user-select: text; -webkit-user-select: text; }
.hidden { display: none !important; }
.lucide { display: inline-block; vertical-align: middle; flex: none; }

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(120% 80% at 50% 45%, transparent 55%, rgba(4, 4, 18, 0.55) 100%),
    linear-gradient(180deg, rgba(5, 6, 20, 0.35) 0%, transparent 18%, transparent 75%, rgba(5, 6, 20, 0.55) 100%);
}

#app {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
#topbar {
  position: absolute;
  top: calc(var(--safe-t) + 10px);
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
#topbar-right { display: flex; gap: 10px; align-items: center; }
#screen {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   Boot
   ------------------------------------------------------------------------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  background: radial-gradient(80% 60% at 50% 40%, #1d2563 0%, var(--night) 70%);
  transition: opacity 0.8s ease, visibility 0.8s;
}
#boot img { width: min(62vw, 300px); animation: float 3s ease-in-out infinite; filter: drop-shadow(0 18px 30px rgba(0,0,0,.6)); }
#boot.gone { opacity: 0; visibility: hidden; }
.boot-bar { width: 180px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.12); overflow: hidden; box-shadow: 0 0 0 2px rgba(242,180,58,.5); }
.boot-bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--gold-3), var(--gold-1), var(--gold-3)); border-radius: 8px; animation: bootbar 1.1s ease-in-out infinite; }
@keyframes bootbar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* -------------------------------------------------------------------------
   Tipografia oro
   ------------------------------------------------------------------------- */
.gold {
  font-family: var(--display);
  background: linear-gradient(180deg, #fffdf0 0%, #ffeaa6 20%, #f9c94f 42%, #d0901f 50%, #e9ae35 66%, #fff0b3 88%, #fff9e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #8a5410) drop-shadow(0 3px 0 #5c3208) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55));
}
.serif-gold {
  font-family: var(--serif);
  font-weight: 900;
  background: linear-gradient(180deg, #fffdf0 0%, #ffe9a0 25%, #f5c04a 48%, #b97a1c 52%, #f0bb45 72%, #fff3c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #6b3d0c) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}
.title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  letter-spacing: 0.02em;
  text-align: center;
  margin: 0;
  line-height: 1.05;
}
.label {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.muted { color: var(--ink-dim); font-weight: 700; }

/* -------------------------------------------------------------------------
   Bottoni da videogame
   ------------------------------------------------------------------------- */
.btn {
  --b-top: #ff6b6f;
  --b-mid: #e3222c;
  --b-bot: #a8101a;
  --b-edge: #4f070b;
  --b-text-shadow: #7a0c10;
  --b-color: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 14px 22px;
  border: 0;
  border-radius: 20px;
  font-family: var(--display);
  font-size: clamp(1.15rem, 5.2vw, 1.4rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--b-color);
  text-shadow: 0 2px 0 var(--b-text-shadow);
  background: linear-gradient(180deg, var(--b-top) 0%, var(--b-mid) 48%, var(--b-bot) 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.45),
    inset 0 -5px 0 rgba(0, 0, 0, 0.22),
    0 0 0 3px #f6c64f,
    0 0 0 5.5px #6b3d0c,
    0 8px 0 5.5px var(--b-edge),
    0 16px 26px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.07s ease, box-shadow 0.07s ease, filter 0.2s;
  overflow: hidden;
  isolation: isolate;
  outline: none;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 3px 10px auto 10px;
  height: 42%;
  border-radius: 14px 14px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  z-index: -1;
  pointer-events: none;
}
.btn::after {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 34%;
  left: -50%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: skewX(-18deg);
  animation: shine 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine { 0%, 62% { left: -50%; } 100% { left: 140%; } }
.btn:active:not(:disabled), .btn.pressed {
  transform: translateY(7px);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.35),
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    0 0 0 3px #f6c64f,
    0 0 0 5.5px #6b3d0c,
    0 1px 0 5.5px var(--b-edge),
    0 5px 12px rgba(0, 0, 0, 0.5);
}
.btn:disabled { filter: grayscale(0.85) brightness(0.7); cursor: not-allowed; }
.btn:disabled::after { display: none; }
.btn .lucide { width: 1.3em; height: 1.3em; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.btn-green { --b-top: #5be39a; --b-mid: #22a05a; --b-bot: #12703c; --b-edge: #06301a; --b-text-shadow: #0a4524; }
.btn-gold {
  --b-top: #fff3b8; --b-mid: #ffcf4d; --b-bot: #e09a1e; --b-edge: #5c3208; --b-text-shadow: rgba(255, 255, 255, 0.5);
  --b-color: #5a1a06;
}
.btn-gold .lucide { filter: none; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.55);
  min-height: 48px;
  font-size: 1rem;
  text-shadow: none;
}
.btn-ghost::after, .btn-ghost::before { display: none; }
.btn-ghost:active:not(:disabled) { transform: scale(0.97); box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.8); }
.btn-small { min-height: 46px; font-size: 1rem; padding: 10px 16px; border-radius: 16px; }
.btn.pulse { animation: btnpulse 1.6s ease-in-out infinite; }
@keyframes btnpulse {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 210, 90, 0)); }
  50% { filter: brightness(1.12) drop-shadow(0 0 22px rgba(255, 210, 90, 0.85)); }
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--gold-1);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), rgba(30, 20, 60, 0.94) 70%);
  box-shadow: 0 0 0 2px rgba(246, 198, 79, 0.85), 0 0 0 4px rgba(92, 50, 8, 0.85), 0 6px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn .lucide { width: 22px; height: 22px; }

/* -------------------------------------------------------------------------
   Pannello velluto rosso con cornice oro e neve
   ------------------------------------------------------------------------- */
.panel {
  position: relative;
  border-radius: 26px;
  padding: 30px 18px 20px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 120, 120, 0.22), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #9c1620 0%, #6e0c14 55%, #4a070d 100%);
  box-shadow:
    0 0 0 3px #f6c64f,
    0 0 0 6px #6b3d0c,
    0 0 0 7.5px rgba(255, 230, 160, 0.35),
    0 26px 50px rgba(0, 0, 0, 0.6),
    inset 0 0 50px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.18);
}
.panel::before {
  content: '';
  position: absolute;
  top: -17px;
  left: -12px;
  right: -12px;
  height: 36px;
  background: var(--snowcap) center / 100% 100% no-repeat;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}
.panel.green {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(140, 255, 190, 0.18), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #146b3c 0%, #0c4a29 55%, #062e19 100%);
}
.panel.glass {
  background: linear-gradient(180deg, rgba(30, 26, 80, 0.93), rgba(14, 12, 40, 0.96));
}

/* -------------------------------------------------------------------------
   Schermate
   ------------------------------------------------------------------------- */
.scr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-t) + 64px) 20px calc(var(--safe-b) + 22px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.scr-inner { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 22px; margin: auto 0; }

/* Home */
.home .hero {
  position: relative;
  width: min(84vw, 440px);
  aspect-ratio: 1;
  margin: -20px auto -6px;
  display: grid;
  place-items: center;
}
.hero .rays {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 120, 0.22) 0deg 7deg, transparent 7deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%);
  mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: spin 40s linear infinite;
}
.hero .halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 110, 0.55) 0%, rgba(255, 120, 60, 0.18) 45%, transparent 70%);
  filter: blur(8px);
  animation: halo 3.2s ease-in-out infinite;
}
.hero .logo-wrap {
  position: relative;
  width: 100%;
  animation: float 4s ease-in-out infinite;
}
.hero img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.6));
}
.hero .sheen {
  position: absolute;
  inset: 0;
  -webkit-mask: url('/assets/logo-640.webp') center / contain no-repeat;
  mask: url('/assets/logo-640.webp') center / contain no-repeat;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.28) 48%, rgba(255, 250, 220, 0.0) 60%);
  background-size: 250% 100%;
  animation: sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}
.sparkle {
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 8%, transparent 9%),
    conic-gradient(from 45deg, transparent 0 20%, rgba(255, 240, 190, 0.95) 24% 26%, transparent 30% 45%, rgba(255, 240, 190, 0.95) 49% 51%, transparent 55% 70%, rgba(255, 240, 190, 0.95) 74% 76%, transparent 80% 95%, rgba(255, 240, 190, 0.95) 99% 100%);
  -webkit-mask: radial-gradient(circle, #000 0 30%, transparent 62%);
  mask: radial-gradient(circle, #000 0 30%, transparent 62%);
  animation: twinkle 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 220, 140, 0.9));
}
.home .actions { display: flex; flex-direction: column; gap: 24px; padding: 4px 6px 0; }
.home .foot { text-align: center; font-size: 0.82rem; color: rgba(255, 248, 236, 0.5); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px; }

/* Form */
.back-btn { position: absolute; top: calc(var(--safe-t) + 10px); left: 12px; z-index: 21; }
.field { display: flex; flex-direction: column; }
.input {
  width: 100%;
  height: 58px;
  border-radius: 16px;
  border: 0;
  padding: 0 18px;
  font-family: var(--body);
  font-weight: 900;
  font-size: 1.25rem;
  color: #4a0a0d;
  background: linear-gradient(180deg, #fffaf0, #f6e7cf);
  box-shadow: inset 0 3px 6px rgba(90, 40, 0, 0.25), 0 0 0 3px rgba(246, 198, 79, 0.9), 0 0 0 5px rgba(92, 50, 8, 0.9);
  outline: none;
  transition: box-shadow 0.2s;
}
.input::placeholder { color: rgba(110, 50, 20, 0.4); font-weight: 800; }
.input:focus { box-shadow: inset 0 3px 6px rgba(90, 40, 0, 0.25), 0 0 0 3px #ffe08a, 0 0 0 5px rgba(92, 50, 8, 0.9), 0 0 24px rgba(255, 210, 100, 0.7); }

.pin-boxes { display: flex; gap: 10px; justify-content: center; position: relative; }
.pin-boxes input.pin-real {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  font-size: 16px;
  caret-color: transparent;
  z-index: 2;
}
.pin-box {
  width: clamp(54px, 16vw, 66px);
  height: clamp(66px, 19vw, 78px);
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: clamp(2.1rem, 10vw, 2.6rem);
  color: #8e0f16;
  background: linear-gradient(180deg, #fffaf0 0%, #f3dfbf 100%);
  box-shadow: inset 0 4px 8px rgba(90, 40, 0, 0.28), 0 0 0 3px rgba(246, 198, 79, 0.9), 0 0 0 5px rgba(92, 50, 8, 0.9), 0 8px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}
.pin-box.active { box-shadow: inset 0 4px 8px rgba(90, 40, 0, 0.28), 0 0 0 3px #fff2b0, 0 0 0 5px rgba(92, 50, 8, 0.9), 0 0 26px rgba(255, 220, 110, 0.85); transform: translateY(-3px); }
.pin-box.active:empty::after { content: ''; width: 3px; height: 50%; background: #c0392b; border-radius: 2px; animation: caret 1s steps(1) infinite; }
.pin-box.filled { animation: pop 0.25s ease; }
.pin-row { display: flex; align-items: center; gap: 10px; justify-content: center; }
.pin-row .icon-btn { width: 52px; height: 52px; }

.avatar-picker {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: 60px;
  gap: 14px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 16px 6px 10px;
  margin: 0 -8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.avatar-picker::-webkit-scrollbar { display: none; }
.avatar-opt {
  border: 0;
  background: none;
  padding: 4px 0;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  transition: transform 0.15s;
}
.avatar-opt .bauble { --s: 48px; transition: transform 0.2s, box-shadow 0.2s; }
.avatar-opt.sel .bauble { transform: scale(1.14); box-shadow: inset -6px -8px 14px rgba(0, 0, 0, 0.3), 0 0 0 3px #fff2b0, 0 0 18px 4px rgba(255, 215, 110, 0.9); }
.avatar-opt:active { transform: scale(0.9); }

/* Crea la tua pallina: colore e simbolo separati, con anteprima che dondola */
.ball-maker { --pick: #e23b3b; --pick-ic: #fff; display: flex; flex-direction: column; gap: 10px; }
.ball-maker.light { --pick-ic: #4a1410; }
.ball-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0 4px; }
.ball-hang { position: relative; transform-origin: 50% -30px; animation: swing 2.4s ease-in-out infinite alternate; }
.ball-hang::before { content: ''; position: absolute; left: 50%; top: -30px; width: 2px; height: 22px; transform: translateX(-50%); background: linear-gradient(#d9a63e00, #d9a63e); }
.ball-prev .bauble { --s: 84px; }
.ball-pop { animation: pop 0.45s cubic-bezier(.3, 1.6, .5, 1); }
.ball-name { font-family: var(--display); font-size: 1.15rem; color: var(--gold-2); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ball-sub { font-weight: 900; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 240, 215, 0.75); margin-top: 4px; }
.color-grid, .symbol-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.color-opt {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75) 0 8%, transparent 30%), radial-gradient(circle at 45% 40%, color-mix(in srgb, var(--c) 80%, white), var(--c) 45%, color-mix(in srgb, var(--c) 55%, black));
  box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: scale 0.15s, box-shadow 0.15s;
}
.symbol-opt {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--pick-ic);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.6) 0 7%, transparent 28%), radial-gradient(circle at 45% 40%, color-mix(in srgb, var(--pick) 80%, white), var(--pick) 45%, color-mix(in srgb, var(--pick) 55%, black));
  box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.35);
  opacity: 0.82;
  transition: scale 0.15s, box-shadow 0.15s, opacity 0.15s, background 0.25s;
}
.symbol-opt .lucide { width: 58%; height: 58%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }
.color-opt:active, .symbol-opt:active { scale: 0.88; }
.color-opt.sel, .symbol-opt.sel { scale: 1.16; opacity: 1; box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.25), 0 0 0 3px #fff2b0, 0 0 14px 3px rgba(255, 215, 110, 0.85); }
.bauble.light { color: #4a1410; }
.bauble.light .lucide { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45)); }
.secret-hint.bad { color: #ffd2d2; }
.secret-hint.good { color: #b9f5c9; }
.input.secret.bad { border-color: #ff7b7b; }

.err { color: #ffd2d2; font-weight: 800; text-align: center; min-height: 1.2em; font-size: 0.95rem; }

/* -------------------------------------------------------------------------
   Pallina di Natale (avatar)
   ------------------------------------------------------------------------- */
.bauble {
  --c: #e23b3b;
  --s: 64px;
  position: relative;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.95) 0 5%, rgba(255, 255, 255, 0.45) 10%, transparent 26%),
    radial-gradient(circle at 70% 78%, rgba(255, 255, 255, 0.22) 0 6%, transparent 20%),
    radial-gradient(circle at 45% 40%, color-mix(in srgb, var(--c) 78%, white) 0%, var(--c) 42%, color-mix(in srgb, var(--c) 52%, black) 100%);
  box-shadow: inset -5px -7px 12px rgba(0, 0, 0, 0.35), inset 3px 4px 8px rgba(255, 255, 255, 0.2), 0 6px 14px rgba(0, 0, 0, 0.45);
}
.bauble::before {
  content: '';
  position: absolute;
  top: -11%;
  left: 50%;
  width: 30%;
  height: 16%;
  transform: translateX(-50%);
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(90deg, #8a5a14, #ffe6a0 35%, #d7a23a 60%, #7a4a0e);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4);
}
.bauble::after {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  width: 14%;
  height: 12%;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid #d9a63e;
  border-bottom-color: transparent;
}
.bauble .lucide { width: 46%; height: 46%; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45)); }

/* -------------------------------------------------------------------------
   Lobby
   ------------------------------------------------------------------------- */
.lobby { padding-top: calc(var(--safe-t) + 64px); padding-bottom: 0; }
.lobby .scr-inner { margin: 0; gap: 18px; flex: 1; }
.lobby-head { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: -40px; }
.lobby-head img { width: 92px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)); animation: float 4s ease-in-out infinite; }
.lobby-head .title { font-size: clamp(1.5rem, 7vw, 2rem); text-align: left; }
.pin-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 26px 16px 16px; }
.pin-digits { display: flex; gap: 6px; }
.pin-digit {
  width: 44px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 2.1rem;
  background: linear-gradient(180deg, #2a0306 0%, #4b070d 50%, #2a0306 100%);
  box-shadow: inset 0 0 0 2px rgba(246, 198, 79, 0.75), inset 0 8px 10px rgba(0, 0, 0, 0.5), 0 3px 0 #1b0103;
}
.pin-digit span { line-height: 1; }
.pin-meta { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

.players-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 4px; }
.players-head .count { font-family: var(--display); font-size: 1.5rem; }
.garland {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px 4px;
  padding: 4px 0 8px;
}
.orn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--str, 22px);
  transform-origin: 50% 0;
  animation: swing var(--dur, 3.2s) ease-in-out var(--del, 0s) infinite alternate;
}
.orn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: calc(var(--str, 22px) - 4px);
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 230, 150, 0.15), #e9c068);
}
.orn .bauble { --s: 66px; }
.orn.enter { animation: drop 0.9s cubic-bezier(.2, 1.6, .4, 1) both, swing var(--dur, 3.2s) ease-in-out 0.9s infinite alternate; }
.orn.leave { animation: fall 0.6s ease-in forwards; }
.orn .name {
  margin-top: 9px;
  max-width: 100%;
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.orn .badge {
  position: absolute;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 2px 7px 1px;
  border-radius: 999px;
  text-transform: uppercase;
}
.orn .badge.you { top: calc(var(--str, 22px) + 46px); right: 50%; transform: translateX(46px); background: linear-gradient(180deg, #fff3b8, #f2b43a); color: #5a1a06; box-shadow: 0 2px 0 #5c3208; }
.orn .crown { position: absolute; top: calc(var(--str, 22px) - 22px); left: 50%; transform: translateX(-50%) rotate(-12deg); color: #ffd75e; filter: drop-shadow(0 2px 0 #5c3208) drop-shadow(0 0 8px rgba(255, 210, 80, 0.8)); }
.orn .crown .lucide { width: 22px; height: 22px; fill: #ffcf4d; }
.orn .status { position: absolute; top: calc(var(--str, 22px) + 2px); right: 50%; transform: translateX(36px); width: 16px; height: 16px; border-radius: 50%; background: #3fe07f; box-shadow: 0 0 0 2px #0b2a17, 0 0 10px #3fe07f; }
.orn.offline .bauble { filter: grayscale(0.9) brightness(0.55); }
.orn.offline .status { background: #555; box-shadow: 0 0 0 2px #222; }
.orn.offline .name { opacity: 0.6; }
.orn .off-label { font-size: 0.72rem; font-weight: 900; color: #ffb3b3; display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.orn .off-label .lucide { width: 13px; height: 13px; }
.orn .kick {
  position: absolute;
  top: calc(var(--str, 22px) - 6px);
  left: 50%;
  transform: translateX(-46px);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: #2b0b10;
  color: #ffb3b3;
  box-shadow: 0 0 0 2px #ff8080;
}
.orn .kick .lucide { width: 15px; height: 15px; }
.orn.opened .bauble::marker { content: none; }
.orn .check { position: absolute; top: calc(var(--str, 22px) + 40px); left: 50%; transform: translateX(16px); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; box-shadow: 0 0 0 2px #fff, 0 3px 6px rgba(0,0,0,.4); animation: pop .4s ease; }
.orn .check .lucide { width: 16px; height: 16px; }

.lobby-foot {
  position: sticky;
  bottom: 0;
  margin: auto -20px 0;
  padding: 18px 22px calc(var(--safe-b) + 18px);
  background: linear-gradient(180deg, rgba(8, 10, 30, 0) 0%, rgba(8, 10, 30, 0.85) 30%, rgba(8, 10, 30, 0.95) 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}
.lobby-foot .hint { text-align: center; font-weight: 800; font-size: 0.95rem; color: var(--ink-dim); display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 1.4em; }
.lobby-foot .hint .lucide { width: 18px; height: 18px; color: var(--gold-2); }
.waiting { display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.03em; text-align: center; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.35); }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-2); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

/* -------------------------------------------------------------------------
   Show: countdown, banner, prompt
   ------------------------------------------------------------------------- */
.cd {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.cd-num {
  font-family: var(--display);
  font-size: min(58vw, 46vh);
  line-height: 1;
  will-change: transform, opacity;
}
.cd-word { font-size: min(19vw, 15vh); text-align: center; line-height: 0.95; }
.shock {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40vmin;
  height: 40vmin;
  margin: -20vmin 0 0 -20vmin;
  border-radius: 50%;
  border: 6px solid rgba(255, 225, 140, 0.95);
  box-shadow: 0 0 30px rgba(255, 200, 90, 0.9), inset 0 0 30px rgba(255, 200, 90, 0.8);
  pointer-events: none;
}
.banner {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-t) + 74px);
  transform: translateX(-50%);
  padding: 12px 22px 11px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 2px 0 #5a070c;
  background: linear-gradient(180deg, #e8323b, #9c1119);
  box-shadow: 0 0 0 3px #f6c64f, 0 0 0 5px #6b3d0c, 0 10px 22px rgba(0, 0, 0, 0.5);
}
.prompt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
.prompt .big { font-family: var(--display); font-size: clamp(1.6rem, 8vw, 2.2rem); text-align: center; letter-spacing: 0.03em; }
.prompt .hand { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #5a1a06; background: radial-gradient(circle at 35% 30%, #fff8d0, #f2b43a 70%); box-shadow: 0 0 0 3px #6b3d0c, 0 0 30px rgba(255, 210, 90, 0.9); animation: tap 1s ease-in-out infinite; }
.prompt .hand .lucide { width: 34px; height: 34px; }
.taps { display: flex; gap: 12px; }
.taps i { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.7); transition: all 0.2s; }
.taps i.on { background: radial-gradient(circle at 35% 30%, #fff8d0, #f2b43a); box-shadow: 0 0 14px rgba(255, 210, 90, 1); transform: scale(1.25); }
.tapzone { position: absolute; inset: 0; pointer-events: auto; z-index: 1; }

/* -------------------------------------------------------------------------
   Reveal
   ------------------------------------------------------------------------- */
.reveal-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(var(--safe-t) + 60px) 18px calc(var(--safe-b) + 18px);
  pointer-events: auto;
  overflow-y: auto;
}
.card3d { width: min(86vw, 360px); aspect-ratio: 0.72; perspective: 1200px; flex: none; }
.card-flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(.3, 1.4, .5, 1); }
.card-flip.hidden-side { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 26px 18px;
  background:
    radial-gradient(110% 60% at 50% 0%, rgba(255, 140, 140, 0.25), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #a3141f 0%, #6a0a13 60%, #3f050b 100%);
  box-shadow: 0 0 0 4px #f6c64f, 0 0 0 8px #6b3d0c, 0 0 0 10px rgba(255, 230, 160, 0.4), 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(0, 0, 0, 0.45);
}
.card-face::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: 2px solid rgba(255, 224, 138, 0.55);
  pointer-events: none;
}
.card-face .foil {
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.12) 45%, rgba(255, 230, 160, 0.16) 50%, rgba(160, 220, 255, 0.1) 55%, transparent 62%);
  animation: foil 4s ease-in-out infinite;
  pointer-events: none;
}
.card-back { transform: rotateY(180deg); background: radial-gradient(circle at 50% 40%, #1e2a6e, #0b1026 75%); }
.card-back img { width: 78%; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6)); }
.card-back .muted { display: flex; gap: 8px; align-items: center; }
.card-face .kicker { font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.12em; color: var(--gold-2); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); text-align: center; }
.card-face .bauble { --s: 112px; }
.card-face .corner { position: absolute; color: rgba(255, 224, 138, 0.75); }
.card-face .corner .lucide { width: 22px; height: 22px; }
.card-face .corner.tl { top: 22px; left: 22px; }
.card-face .corner.tr { top: 22px; right: 22px; }
.card-face .corner.bl { bottom: 22px; left: 22px; }
.card-face .corner.br { bottom: 22px; right: 22px; }
.reel {
  position: relative;
  width: 100%;
  height: 84px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #1a0204 0%, #3a060b 50%, #1a0204 100%);
  box-shadow: inset 0 0 0 2px rgba(246, 198, 79, 0.75), inset 0 14px 18px rgba(0, 0, 0, 0.7), inset 0 -14px 18px rgba(0, 0, 0, 0.7);
}
.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}
.reel-strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.reel-item {
  height: 84px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.7rem, 8.5vw, 2.4rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
  color: #ffe9a6;
  text-shadow: 0 2px 0 #5c3208, 0 0 18px rgba(255, 200, 90, 0.4);
}
.reel.blur .reel-strip { filter: blur(1.4px); }
.reel.won { animation: won 0.8s ease; box-shadow: inset 0 0 0 3px #fff3b0, inset 0 14px 18px rgba(0, 0, 0, 0.5), 0 0 36px rgba(255, 215, 110, 0.9); }
.secret-note { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 0.95rem; color: rgba(255, 248, 236, 0.85); }
.secret-note .lucide { width: 17px; height: 17px; color: var(--gold-2); }

.reveal-actions { width: min(86vw, 360px); display: flex; flex-direction: column; gap: 14px; }
.progress-box { width: min(92vw, 400px); padding: 26px 14px 12px; }
.progress-box .label { justify-content: center; }
.mini-row { display: flex; flex-wrap: wrap; gap: 10px 8px; justify-content: center; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; position: relative; }
.mini .bauble { --s: 38px; }
.mini .bauble .lucide { width: 50%; height: 50%; }
.mini span { font-size: 0.7rem; font-weight: 900; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini.pending .bauble { filter: grayscale(0.7) brightness(0.6); animation: breathe 1.6s ease-in-out infinite; }
.mini .ok { position: absolute; top: -4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.mini .ok .lucide { width: 12px; height: 12px; color: #fff; }

.final-banner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.final-banner .title { font-size: clamp(1.7rem, 8vw, 2.3rem); }

/* -------------------------------------------------------------------------
   Toast, connessione, flash
   ------------------------------------------------------------------------- */
#toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 70px);
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 0.98rem;
  color: #fff;
  background: linear-gradient(180deg, #c81e28, #8a0d15);
  box-shadow: 0 0 0 2px #f6c64f, 0 12px 24px rgba(0, 0, 0, 0.5);
  animation: toastin 0.4s cubic-bezier(.2, 1.6, .4, 1);
}
.toast-item.ok { background: linear-gradient(180deg, #23a35b, #11693a); }
.toast-item .lucide { width: 20px; height: 20px; flex: none; }
.toast-item.out { animation: toastout 0.3s ease forwards; }
#conn {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 12px);
  transform: translateX(-50%);
  z-index: 61;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.9rem;
  background: rgba(30, 6, 10, 0.92);
  box-shadow: 0 0 0 2px #ff7b7b;
  white-space: nowrap;
}
#conn .lucide { width: 18px; height: 18px; color: #ff9b9b; }
#flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: radial-gradient(circle at 50% 55%, rgba(255, 251, 232, 0.95), rgba(255, 233, 168, 0.55) 38%, rgba(255, 220, 140, 0) 78%); opacity: 0; }

/* -------------------------------------------------------------------------
   Animazioni
   ------------------------------------------------------------------------- */
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-0.6deg); } 50% { transform: translateY(-12px) rotate(0.6deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes halo { 0%, 100% { opacity: 0.75; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes sheen { 0%, 55% { background-position: 150% 0; } 100% { background-position: -60% 0; } }
@keyframes twinkle { 0%, 100% { transform: scale(0.2) rotate(0deg); opacity: 0; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes swing { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes drop { 0% { transform: translateY(-120vh) rotate(-20deg); } 70% { transform: translateY(8px) rotate(6deg); } 100% { transform: translateY(0) rotate(-4deg); } }
@keyframes fall { to { transform: translateY(80vh) rotate(40deg); opacity: 0; } }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes tap { 0%, 100% { transform: scale(1); } 40% { transform: scale(0.82) translateY(4px); } }
@keyframes foil { 0% { transform: translateX(-30%) translateY(-10%); } 100% { transform: translateX(30%) translateY(10%); } }
@keyframes won { 0% { transform: scale(1); } 30% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.9); } }
@keyframes toastin { from { transform: translateY(-20px) scale(0.9); opacity: 0; } }
@keyframes toastout { to { transform: translateY(-14px); opacity: 0; } }
@keyframes scrIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } }

.scr-enter { animation: scrIn 0.55s cubic-bezier(.2, 1.2, .4, 1) both; }
.stagger > * { animation: scrIn 0.6s cubic-bezier(.2, 1.3, .4, 1) both; }
.stagger > *:nth-child(2) { animation-delay: 0.07s; }
.stagger > *:nth-child(3) { animation-delay: 0.14s; }
.stagger > *:nth-child(4) { animation-delay: 0.21s; }
.stagger > *:nth-child(5) { animation-delay: 0.28s; }
.stagger > *:nth-child(6) { animation-delay: 0.35s; }

@media (min-width: 700px) {
  .garland { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
@media (max-height: 640px) {
  .home .hero { width: min(70vw, 340px); }
  .card3d { width: min(74vw, 300px); }
}
@media (prefers-reduced-motion: reduce) {
  .orn, .hero .rays, .hero .logo-wrap, .btn::after { animation: none !important; }
}

/* -------------------------------------------------------------------------
   Aggiunte: form, prompt, stati
   ------------------------------------------------------------------------- */
.form .scr-inner { gap: 26px; }
.form .lobby-head { margin-top: -30px; }
.form-panel { display: flex; flex-direction: column; gap: 20px; padding-top: 34px; }
.sub-hint { text-align: center; font-size: 0.85rem; font-weight: 800; color: rgba(255, 240, 210, 0.7); margin-top: 10px; }
.form .err:empty { display: none; }
.form .err { display: flex; flex-direction: column; align-items: center; gap: 10px; line-height: 1.35; }
.err .err-act { margin: 0; }
.name-hint:empty { display: none; }
.name-hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-weight: 800; font-size: 0.85rem; line-height: 1.35; color: #ffd2d2; }
.name-hint .lucide { flex: none; margin-top: 1px; color: #ff9b9b; }
.name-hint b { color: #fff; }
.input.bad { border-color: #ff7b7b; box-shadow: 0 0 0 3px rgba(255, 90, 90, 0.25); }
.icon-btn.locked { animation: btnpulse 1.4s ease-in-out infinite; }
.prompt-layer { position: absolute; inset: 0; pointer-events: auto; }
.prompt-layer .prompt { z-index: 2; }
.cd-wrap { display: grid; place-items: center; will-change: transform, opacity; }
.rec-bauble { display: grid; place-items: center; min-height: 118px; }
.orn .kick.arm { background: #c81e28; color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 14px #ff5a5f; animation: pop 0.3s ease; }
.show-scr { pointer-events: auto; }
.btn .dots i { background: currentColor; }
.final-banner .btn { width: auto; margin-top: 8px; }
.card-front .kicker { margin-top: 6px; }

.pin-card { padding: 26px 14px 16px; }
.pin-digit { width: 42px; height: 54px; font-size: 2rem; }
.share-btn { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.share-btn .icon-btn { width: 52px; height: 52px; color: #fff; background: radial-gradient(circle at 35% 30%, #6be8a4, #1c8a4b 70%); }
.share-btn:active .icon-btn { transform: scale(0.9); }
.share-label { font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-2); }
.pin-box { width: clamp(48px, 14vw, 64px); height: clamp(60px, 17.5vw, 76px); }
.pin-row { gap: 8px; }
.pin-boxes { gap: 8px; }
.pin-row .icon-btn { width: 46px; height: 46px; }

/* rivelazione: scorrimento verticale sicuro, niente barre */
.scr, .reveal-wrap { scrollbar-width: none; }
.scr::-webkit-scrollbar, .reveal-wrap::-webkit-scrollbar { display: none; }
.reveal-wrap { overflow-x: hidden; justify-content: flex-start; }
.reveal-wrap > :first-child { margin-top: auto; }
.reveal-wrap > :last-child { margin-bottom: auto; }
.reveal-actions .btn-ghost, .final-banner .btn-ghost {
  background: rgba(14, 12, 40, 0.72);
}
.final-banner {
  width: min(92vw, 400px);
  padding: 18px 16px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 16, 54, 0.82), rgba(10, 8, 30, 0.9));
  box-shadow: 0 0 0 2px rgba(246, 198, 79, 0.7), 0 16px 30px rgba(0, 0, 0, 0.5);
}

.scr-leave { opacity: 0 !important; transform: translateY(-18px); transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none !important; }

/* -------------------------------------------------------------------------
   Login e PIN personale
   ------------------------------------------------------------------------- */
.link-btn {
  border: 0;
  background: rgba(10, 10, 34, 0.55);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.45);
  transition: transform 0.1s;
  margin-top: -6px;
}
.link-btn b { color: var(--gold-2); font-weight: 900; }
.link-btn .lucide { color: var(--gold-2); }
.link-btn:active { transform: scale(0.97); }
.form-intro { font-weight: 800; font-size: 0.95rem; line-height: 1.35; color: rgba(255, 240, 215, 0.9); text-align: center; }
.secret-wrap { position: relative; }
.secret-wrap .input { padding-right: 58px; font-family: var(--display); font-size: 1.5rem; letter-spacing: 0.3em; }
.secret-wrap .input::placeholder { font-family: var(--body); font-size: 1.05rem; letter-spacing: 0; }
.secret-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(142, 15, 22, 0.1);
  color: #8e0f16;
}
.recover-hint { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; font-weight: 800; line-height: 1.35; color: rgba(255, 245, 225, 0.88); padding: 12px 14px; border-radius: 16px; background: rgba(12, 10, 36, 0.72); box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.35); }
.recover-hint .lucide { color: var(--gold-2); margin-top: 2px; }
.recover-hint b { color: var(--gold-2); }

/* -------------------------------------------------------------------------
   Foglio d'invito
   ------------------------------------------------------------------------- */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 14px calc(var(--safe-b) + 14px);
  background: rgba(4, 4, 18, 0.6);
}
.sheet {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 18px 18px;
}
.sheet-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; z-index: 2; }
.sheet-title { font-size: clamp(1.6rem, 7vw, 2rem); }
.sheet-sub { text-align: center; font-weight: 800; font-size: 0.92rem; color: rgba(255, 240, 215, 0.9); max-width: 300px; }
.qr-box { padding: 10px; border-radius: 18px; background: #fff8ec; box-shadow: 0 0 0 3px #f6c64f, 0 0 0 5px #6b3d0c, 0 10px 24px rgba(0, 0, 0, 0.45); }
.qr-box img { display: block; width: min(52vw, 190px); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.link-box {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  color: #ffe9a6;
  box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.5);
  font-weight: 900;
  font-size: 0.95rem;
  text-align: left;
}
.link-box .link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; -webkit-user-select: all; }
.sheet-actions { width: 100%; display: flex; gap: 12px; margin-top: 4px; }
.sheet-actions .btn { flex: 1; min-width: 0; padding: 10px 12px; font-size: 0.95rem; }
.sheet-pin { font-weight: 800; font-size: 0.85rem; color: rgba(255, 240, 215, 0.75); margin-top: 6px; }
.sheet-pin b { color: var(--gold-2); letter-spacing: 0.1em; }

/* -------------------------------------------------------------------------
   Regolamento
   ------------------------------------------------------------------------- */
.rules .scr-inner { gap: 22px; }
.rules .lobby-head { margin-top: -30px; }
.rules-panel { display: flex; flex-direction: column; gap: 16px; padding-top: 32px; }
.rules-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rules-list li { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; font-size: 0.93rem; line-height: 1.35; color: rgba(255, 245, 228, 0.92); }
.rules-list b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.08rem; letter-spacing: 0.02em; color: var(--gold-2); margin-bottom: 2px; }
.rules-list b.hl { display: inline; font-family: var(--body); font-weight: 900; font-size: inherit; color: #fff; }
.rule-ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #5a1a06; background: radial-gradient(circle at 35% 30%, #fff8d0, #f2b43a 70%); box-shadow: 0 0 0 2px #6b3d0c, 0 4px 8px rgba(0, 0, 0, 0.35); }
.rule-ico .lucide { width: 21px; height: 21px; }
.rules-ok { position: relative; }
.rules-ok .rules-fill { position: absolute; inset: 0; z-index: -1; transform: scaleX(0); transform-origin: left center; background: linear-gradient(90deg, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.45)); }
.rules-ok:disabled { filter: saturate(0.6) brightness(0.85); }
.rules-wait { display: flex; flex-direction: column; gap: 10px; }
.rules-note { text-align: center; font-weight: 800; font-size: 0.88rem; color: rgba(255, 240, 215, 0.85); line-height: 1.4; }
.rules-note b { color: var(--gold-2); }
.waiting .lucide { width: 20px; height: 20px; color: var(--green-l); }

/* -------------------------------------------------------------------------
   Sondaggio
   ------------------------------------------------------------------------- */
.poll-backdrop, .verdict-backdrop { position: absolute; z-index: 30; }
.verdict-backdrop { align-items: center; }
.poll-sheet { gap: 12px; }
.poll-timer { position: relative; width: 64px; height: 64px; margin-top: -4px; }
.poll-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.poll-timer circle { fill: none; stroke-width: 4; }
.poll-timer .track { stroke: rgba(255, 255, 255, 0.15); }
.poll-timer .arc { stroke: var(--gold-2); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset 0.2s linear; filter: drop-shadow(0 0 4px rgba(255, 210, 90, 0.8)); }
.poll-secs { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.45rem; color: #fff; }
.poll-timer.hurry .arc { stroke: #ff6b6b; filter: drop-shadow(0 0 6px rgba(255, 90, 90, 0.9)); }
.poll-timer.hurry { animation: breathe 1s ease-in-out infinite; }
.vote-area { width: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.vote-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: 100%; max-width: 340px; }
.vote-btn {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.45rem;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.85) 0 6%, rgba(255, 255, 255, 0.25) 14%, transparent 30%), radial-gradient(circle at 45% 40%, hsl(var(--h), 80%, 62%), hsl(var(--h), 75%, 42%) 55%, hsl(var(--h), 70%, 24%));
  box-shadow: inset -4px -5px 10px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.4);
  /* entrata a cascata solo in CSS: lo stato finale è quello normale, visibile anche se l'animazione salta */
  animation: voteIn 0.45s cubic-bezier(.3, 1.7, .5, 1) backwards;
  animation-delay: calc(0.3s + var(--i, 0) * 0.04s);
  transition: scale 0.15s, box-shadow 0.15s;
}
@keyframes voteIn { from { opacity: 0; scale: 0.2; } }
.vote-btn:active { scale: 0.9; }
.vote-btn.sel { scale: 1.15; box-shadow: inset -4px -5px 10px rgba(0, 0, 0, 0.25), 0 0 0 3px #fff2b0, 0 0 20px 4px rgba(255, 215, 110, 0.85); }
.voted-box .vote-btn { animation: none; }
.vote-send { max-width: 340px; }
.voted-box { display: flex; align-items: center; gap: 14px; font-weight: 800; color: rgba(255, 245, 228, 0.9); padding: 6px 0; }
.voted-box .vote-btn { width: 60px; font-size: 1.7rem; }
.voted-box b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--gold-2); }
.poll-status { width: 100%; display: flex; flex-direction: column; gap: 10px; }

/* -------------------------------------------------------------------------
   Verdetto
   ------------------------------------------------------------------------- */
.verdict { width: min(92vw, 400px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 18px 22px; text-align: center; }
.verdict .label { justify-content: center; }
.verdict-avg { font-size: clamp(4rem, 26vw, 6.5rem); line-height: 1; margin-top: 4px; }
.verdict-sub { font-weight: 800; font-size: 0.9rem; color: rgba(255, 240, 215, 0.8); }
.verdict-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: clamp(1.5rem, 7vw, 2rem); margin-top: 10px; }
.verdict-title .lucide { width: 30px; height: 30px; }
.verdict.ok .verdict-title { color: #7dffb0; text-shadow: 0 2px 0 #0a4524, 0 0 18px rgba(80, 255, 150, 0.5); }
.verdict.ko .verdict-title { color: #ff8a8a; text-shadow: 0 2px 0 #5a070c, 0 0 18px rgba(255, 90, 90, 0.55); }
.verdict.ko { box-shadow: 0 0 0 3px #ff8a8a, 0 0 0 6px #6b0c10, 0 26px 50px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 80, 80, 0.35); }
.verdict-note { font-weight: 800; font-size: 0.95rem; color: rgba(255, 245, 228, 0.92); max-width: 300px; }
.verdict-note b { color: var(--gold-2); }
.verdict .btn { width: auto; margin-top: 8px; }
.verdict-dots { margin-top: 8px; }
.round-tag { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-family: var(--display); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: #5a1a06; background: linear-gradient(180deg, #fff3b8, #f2b43a); box-shadow: 0 2px 0 #5c3208; }

/* -------------------------------------------------------------------------
   Dopo l'estrazione: listone dei consigli, regalo comprato
   ------------------------------------------------------------------------- */
textarea { font: inherit; user-select: text; -webkit-user-select: text; }
.input.area { height: auto; min-height: 66px; padding: 10px 14px; font-size: 1.05rem; line-height: 1.3; resize: none; display: block; }
.after { width: min(92vw, 400px); display: flex; flex-direction: column; gap: 16px; }
.after-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 16px 14px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 16, 54, 0.84), rgba(10, 8, 30, 0.92));
  box-shadow: 0 0 0 2px rgba(246, 198, 79, 0.55), 0 14px 26px rgba(0, 0, 0, 0.45);
}
.after-card .label { margin: 0; justify-content: center; }
.after-card .btn { width: auto; }
.after-text { font-weight: 800; font-size: 0.95rem; color: rgba(255, 245, 228, 0.92); }
.after-text b { color: var(--gold-2); }
.after-hint { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-weight: 800; font-size: 0.8rem; line-height: 1.35; color: rgba(255, 240, 215, 0.72); }
.after-hint .lucide { color: var(--gold-2); flex: none; }
.gift-note {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.4);
  font-weight: 900;
  color: #fff3cf;
  text-align: left;
  overflow-wrap: anywhere;
}
.gift-note .lucide { color: var(--gold-2); }
.mini .gift-ok { background: var(--gold-3); }
.mini .gift-ok .lucide { color: #4a2a00; }

.ideas-backdrop, .board-backdrop, .gift-backdrop { position: absolute; z-index: 30; }
.ideas-sheet { padding-left: 0; padding-right: 0; }
.sheet-body {
  width: 100%;
  max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 70px);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 18px 4px;
}
.sheet-body::-webkit-scrollbar { display: none; }
.ideas-timer .poll-secs { font-size: 1rem; }
.ideas-form { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.idea-row { display: flex; flex-direction: column; gap: 7px; }
.idea-who { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.02em; color: #fff3cf; }
.idea-who .bauble { --s: 34px; flex: none; }
.ideas-sent { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ideas-sent .voted-box .lucide { color: var(--green-l); flex: none; }
.ideas-status .after-hint { margin-top: 2px; }

.board-sheet { gap: 10px; }
.board-sheet .label { margin: 0; }
.board-list {
  width: 100%;
  max-height: min(56dvh, 520px);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 6px 12px;
}
.board-list::-webkit-scrollbar { display: none; }
.idea-card {
  --rot: 0deg;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.3;
  color: #3b0a0d;
  background: linear-gradient(180deg, #fffaf0, #f3e2c4);
  box-shadow: 0 0 0 2px rgba(246, 198, 79, 0.9), 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--rot));
  overflow-wrap: anywhere;
  animation: ideaIn 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.idea-card .lucide { flex: none; margin-top: 1px; color: var(--red); }
.idea-card:nth-child(3n + 2) .lucide { color: var(--green); }
.idea-card:nth-child(3n) .lucide { color: var(--gold-4); }
@keyframes ideaIn {
  from { opacity: 0; transform: translateY(18px) scale(0.85) rotate(var(--rot)); }
  to { opacity: 1; transform: rotate(var(--rot)); }
}
.gift-sheet .input { text-align: center; }

/* -------------------------------------------------------------------------
   Presentazione dello scambio dei regali
   ------------------------------------------------------------------------- */
.exchange { padding-top: calc(var(--safe-t) + 58px); }
.ex-wrap { position: relative; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 14px; margin: auto 0; }
.ex-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ex-head .label { margin: 0; }
.ex-count { font-size: clamp(1.4rem, 6vw, 1.8rem); }
.ex-ring {
  --s: 48px;
  position: relative;
  width: clamp(250px, min(86vw, calc(100dvh - 400px)), 420px);
  aspect-ratio: 1;
}
.ex-ring.mid { --s: 38px; }
.ex-ring.crowded { --s: 28px; }
.ex-ring::before { content: ''; position: absolute; inset: 2%; border-radius: 50%; background: radial-gradient(circle, rgba(8, 8, 30, 0.72) 0%, rgba(8, 8, 30, 0.55) 62%, rgba(8, 8, 30, 0) 71%); }
.ex-ring::after { content: ''; position: absolute; inset: 9%; border-radius: 50%; border: 1.5px dashed rgba(255, 224, 138, 0.22); pointer-events: none; }
.ex-threads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ex-line { fill: none; stroke: url(#exGold); stroke-width: 1.3; stroke-linecap: round; filter: url(#exGlow); }
.ex-spark { fill: #fffbe6; filter: url(#exGlow); }
.ex-node {
  position: absolute;
  width: var(--s);
  height: var(--s);
  transform: translate(-50%, -50%);
  transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1), filter 0.4s;
  z-index: 1;
}
.ex-node .bauble { --s: inherit; }
.ex-name {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 76px;
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.ex-ring.crowded .ex-name { display: none; }
.ex-ring.crowded .ex-node.current .ex-name { display: block; }
.ex-node i { position: absolute; width: 18px; height: 18px; border-radius: 50%; display: none; place-items: center; box-shadow: 0 0 0 2px #fff; font-style: normal; }
.ex-node i .lucide { width: 11px; height: 11px; }
.ex-gift { top: -6px; right: -7px; background: var(--gold-3); color: #4a2a00; }
.ex-done { bottom: -3px; right: -7px; background: var(--green); color: #fff; }
.ex-node.has-gift:not(.given) .ex-gift { display: grid; }
.ex-node.given .ex-done { display: grid; }
.ex-node.given .bauble { filter: brightness(0.82) saturate(0.85); }
.ex-node.current { transform: translate(-50%, -50%) scale(1.35); z-index: 3; }
.ex-node.current .bauble { box-shadow: inset -5px -7px 12px rgba(0, 0, 0, 0.35), 0 0 0 3px #fff2b0, 0 0 22px 6px rgba(255, 215, 110, 0.85); }
.ex-node.spot { transform: translate(-50%, -50%) scale(1.25); z-index: 3; }
.ex-node.spot .bauble { box-shadow: 0 0 0 3px #fff, 0 0 20px 6px rgba(255, 255, 255, 0.8); }
.ex-center { position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; pointer-events: none; }
.ex-center .bauble { --s: min(18vw, 76px); animation: breathe 2.4s ease-in-out infinite; }
.ex-center img { width: 100%; height: auto; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)); }
.ex-q { width: min(18vw, 76px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: var(--gold-2); background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.5); animation: breathe 0.9s ease-in-out infinite; }
.ex-q .lucide { width: 50%; height: 50%; }
.ex-msg { width: min(92vw, 400px); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 24px 16px 18px; }
.ex-kicker { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-2); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.ex-big { font-size: clamp(2rem, 10vw, 2.8rem); line-height: 1.05; text-align: center; overflow-wrap: anywhere; }
.ex-sub { font-weight: 800; font-size: 1rem; color: rgba(255, 245, 228, 0.92); }
.ex-sub b { color: var(--gold-2); }
.ex-msg .btn { width: auto; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 900; font-size: 0.85rem; margin-top: 2px; }
.chip.ok { background: rgba(34, 160, 90, 0.25); color: #8dffbe; box-shadow: inset 0 0 0 1.5px rgba(80, 255, 150, 0.5); }
.ex-controls { width: min(92vw, 400px); display: flex; gap: 12px; }
.ex-controls .btn { flex: 1; min-width: 0; width: auto; }
.ex-controls .btn-ghost { flex: 0 0 auto; }
.ex-controls .waiting { flex: 1; font-size: 1rem; }

/* -------------------------------------------------------------------------
   Scelta della musica (host)
   ------------------------------------------------------------------------- */
.music-backdrop { position: absolute; z-index: 30; }
.music-sheet { padding-left: 0; padding-right: 0; }
.song-list { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.song-row {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff4dc;
  box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.22);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.song-row:active { transform: scale(0.97); }
.song-row .song-ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffe08a;
  background: rgba(255, 224, 138, 0.12);
}
.song-row .song-txt { display: flex; flex-direction: column; min-width: 0; }
.song-row b { font-weight: 900; font-size: 0.98rem; line-height: 1.2; }
.song-row small { font-weight: 700; font-size: 0.76rem; color: rgba(255, 240, 215, 0.7); line-height: 1.25; }
.song-row.on { background: rgba(47, 168, 106, 0.32); box-shadow: inset 0 0 0 2px #7ed6a5; }
.song-row.on .song-ico { color: #0f3d24; background: #7ed6a5; }
.song-row.wait { opacity: 0.6; }
.music-sheet .sheet-body { max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 110px); }
.music-sheet .sheet-body > .label { padding: 0 46px; text-align: center; }

/* -------------------------------------------------------------------------
   Preferiti (sul regolamento) e abbinamenti desiderati (prima dello scambio)
   ------------------------------------------------------------------------- */
.wish-step { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wish-q { font-family: var(--display); font-size: 1.25rem; color: var(--gold-2); text-align: center; line-height: 1.2; }
.wish-sub { text-align: center; font-weight: 800; font-size: 0.88rem; line-height: 1.4; color: rgba(255, 240, 215, 0.9); }
.wish-sub b { color: #fff; }
.wish-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 6px; width: 100%; }
.wish {
  position: relative;
  width: 70px;
  padding: 8px 2px 6px;
  border: 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff4dc;
  box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.18);
  font: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s;
}
.wish .bauble { --s: 42px; }
.wish .bauble .lucide { width: 50%; height: 50%; }
.wish span { font-size: 0.74rem; font-weight: 900; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wish-tick { position: absolute; top: 4px; right: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #e2508f; box-shadow: 0 0 0 2px #fff; transform: scale(0); transition: transform 0.25s cubic-bezier(.34,1.8,.64,1); }
.wish-tick .lucide { width: 12px; height: 12px; color: #fff; fill: #fff; }
.wish.on { background: rgba(226, 80, 143, 0.28); box-shadow: inset 0 0 0 2px #f48fb1; }
.wish.on .wish-tick { transform: scale(1); }
.wish.dim { opacity: 0.45; filter: grayscale(0.6); }
.wish-ok { width: 100%; }

.ex-wish { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; padding: 2px 9px; border-radius: 999px; background: rgba(226, 80, 143, 0.22); box-shadow: inset 0 0 0 1.5px rgba(244, 143, 177, 0.6); font-weight: 900; font-size: 0.72rem; color: #ffe3ee; }
.ex-wish .lucide { color: #f48fb1; fill: #f48fb1; }
.ex-wishwrap { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none; }
.ex-wishcard { width: min(86%, 340px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 18px 20px; text-align: center; }
.ex-wishcard .label .lucide { color: #f48fb1; fill: #f48fb1; }
.ex-wish-big { font-family: var(--display); font-size: 3.4rem; line-height: 1; }
.ex-wish-big small { font-size: 1.4rem; }
.ex-wish-bar { width: 100%; height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); overflow: hidden; box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.25); }
.ex-wish-bar i { display: block; height: 100%; border-radius: inherit; transform-origin: left center; background: linear-gradient(90deg, #e2508f, #f48fb1, #ffe08a); }
.ex-wish-pct { font-weight: 900; font-size: 1.3rem; color: #fff; }
.ex-wish-sub { font-weight: 800; font-size: 0.9rem; line-height: 1.4; color: rgba(255, 240, 215, 0.9); }
.ex-wish .lucide { width: 13px; height: 13px; }
.ex-wrap:has(.ex-wish) .ex-ring { width: clamp(226px, min(86vw, calc(100dvh - 426px)), 420px); }

/* -------------------------------------------------------------------------
   Mail, PIN da ricordare e passkey
   ------------------------------------------------------------------------- */
.pin-warn { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 16px; font-size: 0.85rem; font-weight: 800; line-height: 1.38; text-align: left; color: #fff3d6; background: rgba(120, 12, 20, 0.55); box-shadow: inset 0 0 0 1.5px rgba(255, 196, 120, 0.55); }
.pin-warn .lucide { flex: none; margin-top: 1px; color: var(--gold-2); }
.pin-warn b { color: var(--gold-2); font-weight: 900; }
.input.email { font-size: 1.05rem; }
.pk-backdrop { position: absolute; z-index: 40; }
.pk-sheet .sheet-body { gap: 14px; padding-top: 6px; }
.pk-sheet .pin-warn { margin-top: 0; }
.pk-sheet .btn { width: 100%; }
.pk-sheet .link-btn { width: 100%; margin-top: 0; }
.pk-sheet .err:empty { display: none; }
.pk-sheet .err { text-align: center; font-weight: 800; font-size: 0.9rem; color: #ffd2d2; }
.pk-badge { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; color: #4a2a00; background: radial-gradient(circle at 35% 30%, #fff1b8, #f6c64f 55%, #c98a1a); box-shadow: 0 0 0 3px rgba(255, 240, 200, 0.5), 0 10px 26px rgba(0, 0, 0, 0.45); }

/* -------------------------------------------------------------------------
   Installazione dell'app
   ------------------------------------------------------------------------- */
.install-banner { width: 100%; border: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; text-align: left; font: inherit; font-weight: 800; font-size: 0.86rem; line-height: 1.3; color: #fff3d6; background: linear-gradient(90deg, rgba(28, 138, 75, 0.55), rgba(12, 10, 36, 0.75)); box-shadow: inset 0 0 0 1.5px rgba(107, 232, 164, 0.55); cursor: pointer; transition: transform 0.1s; }
.install-banner:active { transform: scale(0.98); }
.install-banner b { color: #9ff5c6; font-weight: 900; }
.install-banner .ib-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, #6be8a4, #1c8a4b 70%); }
.install-banner .ib-txt { flex: 1; }
.install-banner > .lucide { flex: none; color: #9ff5c6; }
.home .install-banner { margin-top: -6px; }
.lobby .install-banner { margin: -10px 0 -12px; padding: 7px 10px; font-size: 0.8rem; }
.lobby .install-banner .ib-ico { width: 28px; height: 28px; }
.lobby .install-banner .ib-ico .lucide { width: 16px; height: 16px; }
.install-sheet .sheet-body { gap: 14px; padding-top: 6px; }
.install-sheet .btn, .install-sheet .link-btn { width: 100%; margin-top: 0; }
.install-steps { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { display: flex; gap: 10px; align-items: flex-start; font-weight: 800; font-size: 0.9rem; line-height: 1.4; color: #fff3d6; }
.install-steps li .lucide { vertical-align: -3px; color: var(--gold-2); }
.install-steps b { color: var(--gold-2); }
.is-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 0.95rem; color: #4a2a00; background: var(--gold-2); }
.install-note { display: flex; gap: 8px; align-items: flex-start; width: 100%; font-size: 0.8rem; font-weight: 800; line-height: 1.35; color: rgba(255, 240, 215, 0.85); }
.install-note .lucide { flex: none; margin-top: 1px; color: var(--gold-2); }
.install-note b { color: var(--gold-2); }
/* con l'avviso d'installazione la home deve stare comunque in uno schermo da 640px */
.home:has(.install-banner:not(.hidden)) .actions { gap: 16px; }
@media (max-height: 700px) {
  .home:has(.install-banner:not(.hidden)) .hero { width: min(62vw, 300px); }
  .home:has(.install-banner:not(.hidden)) .scr-inner { gap: 16px; }
}
