/* Telefono: una colonna, tasti grandi, tutto raggiungibile col pollice. */
body.phone { min-height: 100dvh; }
/* niente zoom: solo scorrimento verticale (niente pizzico né doppio tocco); il testo non si ingrandisce da solo */
html:has(body.phone), body.phone { touch-action: pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
body.phone * { touch-action: pan-y; }
body.phone button, body.phone .btn, body.phone .buzz { touch-action: manipulation; }
/* iOS ingrandisce la pagina quando si tocca un campo con testo sotto i 16 px */
body.phone input, body.phone select, body.phone textarea { font-size: max(16px, 1em); }
#app { max-width: 560px; margin: 0 auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
.scr { display: flex; flex-direction: column; gap: 14px; }
.lbl { font-size: .85rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.sect { font-size: 1.4rem; margin-top: 6px; }
.center { text-align: center; }

/* intestazione */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: rgba(18, 12, 46, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.me .avbox { width: 44px; height: 44px; }
.me-t { display: flex; flex-direction: column; min-width: 0; }
.me-t b { font-family: var(--f-display); font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-t small { color: var(--gold); font-weight: 900; }
.top-r { display: flex; gap: 8px; }
.ibtn { width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--panel-2); font-size: 1.2rem; cursor: pointer; }

/* ingresso */
.join-logo { text-align: center; margin: 22px 0 8px; }
.join-logo .logo { font-size: clamp(3rem, 15vw, 4.4rem); }
.form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 900; }
.form label small { font-weight: 700; color: var(--ink-2); }
input, select { font: inherit; font-size: 1.15rem; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--ink); width: 100%; }
.code-in { font-family: var(--f-display); font-size: 2rem; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.av-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.av-pick { aspect-ratio: 1; border-radius: 50%; border: 0; background: #fff; padding: 5px; cursor: pointer; box-shadow: 0 0 0 3px transparent; transition: transform .1s, box-shadow .1s; }
.av-pick[aria-checked="true"] { box-shadow: 0 0 0 4px var(--gold); transform: scale(1.06); }
.av-pick:disabled { opacity: .25; }
.err-msg { color: #ff9fb0; font-weight: 900; min-height: 1.2em; }
.foot { text-align: center; }

/* sala d'attesa */
.lobby-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.room-code { font-family: var(--f-display); font-size: 2.1rem; letter-spacing: .14em; color: var(--gold); }
.l-players { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; justify-content: flex-end; }
.l-players .avbox { width: 40px; height: 40px; }
.wait { padding: 16px 18px; font-weight: 800; line-height: 1.4; }
.settings { gap: 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-row > span { font-weight: 900; }
.set-row > span small { display: block; font-weight: 700; color: var(--ink-2); font-size: .85rem; }
.stepper { display: flex; align-items: center; gap: 8px; flex: none; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--panel); font-size: 1.4rem; font-weight: 900; cursor: pointer; }
.stepper b { min-width: 2ch; text-align: center; font-family: var(--f-display); font-size: 1.4rem; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { flex: 1 1 auto; border: 2px solid var(--line); background: transparent; border-radius: 12px; padding: 10px 12px; font-weight: 900; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.switch { width: 58px; height: 34px; border-radius: 17px; border: 0; background: var(--panel); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }

/* playlist */
.pl-list { display: flex; flex-direction: column; gap: 8px; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 2px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.pl-item img, .pl-item .pl-ic { width: 48px; height: 48px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 1.6rem; background: var(--panel); object-fit: cover; }
.pl-item span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pl-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item small { color: var(--ink-2); font-weight: 800; }
.pl-item[aria-pressed="true"] { border-color: var(--green); background: rgba(61, 220, 151, .14); }
.pl-item[aria-pressed="true"]::after { content: '✓'; color: var(--green); font-weight: 900; font-size: 1.3rem; }
.pl-add { flex: none !important; font-size: 1.5rem; color: var(--cyan); }
.hint-s { color: var(--ink-2); font-weight: 800; font-size: .95rem; margin: 0; }
.lbl small { text-transform: none; letter-spacing: 0; }

/* messaggi */
.msg { padding: 26px 20px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.msg .big { font-size: 4rem; line-height: 1; }
.msg .cover { width: 150px; height: 150px; border-radius: 16px; box-shadow: var(--shadow); }
.msg h2 { font-size: 1.8rem; }
.msg p { margin: 0; font-weight: 800; color: var(--ink-2); line-height: 1.4; }
.msg .title { font-family: var(--f-display); font-size: 2rem; color: var(--gold); line-height: 1.1; }
.msg .pts { font-family: var(--f-display); font-size: 1.6rem; }
.msg .pts.good { color: var(--ok); }
.msg .pts.bad { color: var(--bad); }
.msg .btn { margin-top: 6px; }

/* prenotazione */
.buzz-info { text-align: center; font-weight: 900; color: var(--ink-2); min-height: 2.6em; display: grid; place-items: center; font-size: 1.1rem; }
.buzz { width: min(78vw, 360px); aspect-ratio: 1; margin: 6px auto; border-radius: 50%; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; user-select: none;
  background: radial-gradient(circle at 50% 35%, #ff7cb6, var(--pink) 55%, #b8165f); box-shadow: 0 14px 0 #7d0d3f, 0 24px 40px rgba(0, 0, 0, .45), inset 0 4px 0 rgba(255, 255, 255, .3);
  transition: transform .06s, box-shadow .06s, filter .2s; }
.buzz:active:not(:disabled) { transform: translateY(10px); box-shadow: 0 4px 0 #7d0d3f, 0 10px 20px rgba(0, 0, 0, .45), inset 0 4px 0 rgba(255, 255, 255, .3); }
.buzz:disabled { filter: grayscale(.85) brightness(.6); cursor: default; }
.buzz.ready { animation: pulse 1.2s infinite; }
.buzz-in { display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--f-display); font-size: clamp(2rem, 10vw, 2.8rem); color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.buzz-ic { font-size: 1.6em; }

/* risposta */
.ans-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-weight: 900; }
.ans-head > div:first-child { flex: 1; line-height: 1.3; }
.atimer { font-family: var(--f-display); font-size: 2rem; color: var(--gold); min-width: 2.5ch; text-align: right; }
.g-form { display: flex; gap: 10px; }
.g-form input { flex: 1; min-width: 0; }
.g-form .btn { flex: none; }
.opts { display: grid; gap: 10px; }
.opts .btn { justify-content: flex-start; text-align: left; font-size: 1.15rem; min-height: 62px; }
.opts .btn b { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .15); display: grid; place-items: center; }
.g-feed { text-align: center; font-weight: 900; min-height: 1.4em; }
.g-feed .good { color: var(--ok); }
.g-feed .bad { color: var(--bad); }

/* asta */
.au-info { padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.au-info .big { font-family: var(--f-display); font-size: 1.6rem; }
.au-info .big b { color: var(--gold); font-size: 2.6rem; }
.au-info p { margin: 0; color: var(--ink-2); font-weight: 800; }
.au-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.au-btns .btn { font-size: 1.8rem; min-height: 72px; padding: 0; }

/* fine */
#sFinal { text-align: center; }
.fin-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fin-card .big { font-size: 4rem; }
.fin-rank { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.fin-rank div { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); font-weight: 900; }
.fin-rank div.me { box-shadow: 0 0 0 2px var(--gold); }
.fin-rank .avbox { width: 38px; height: 38px; }
.fin-rank span { flex: 1; }

/* finestre */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: grid; place-items: end center; padding: 16px; }
.sheet-in { width: 100%; max-width: 520px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.sheet-in p { margin: 0; color: var(--ink-2); font-weight: 800; }
.dlg-b { display: flex; gap: 10px; }
.dlg-b .btn { flex: 1; }
.net, .toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); padding: 12px 22px; border-radius: 999px; font-weight: 900; z-index: 60; max-width: 90vw; text-align: center; }
.net { background: var(--gold); color: #3a2400; }
.toast { background: var(--panel-2); box-shadow: var(--shadow); }
