/* Telefono del giocatore: una colonna, pulsanti grandi, niente da leggere oltre al necessario. */
:root { --seat: #1f6fe0; --seat-ink: #fff; --gold: #ffd54f; --ink: #0b1a5e; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body { background: #0b1a5e; background-image: radial-gradient(ellipse at 50% 0%, #1b3fa0, #0b1a5e 60%, #050b2e);
  color: #fff; font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; min-height: 100vh;
  padding: env(safe-area-inset-top) 16px calc(16px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
.screen { max-width: 480px; margin: 0 auto; padding-top: 10px; }
.logo { font: 900 30px/1.05 "Arial Black", Arial, sans-serif; text-transform: uppercase; color: var(--gold); text-align: center;
  text-shadow: 0 3px 0 #b8860b; margin: 24px 0; }
.logo span { font-size: .55em; color: #fff; text-shadow: 0 2px 0 #0d47a1; }
.card { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; padding: 16px; }
label { display: block; font-weight: 700; margin-bottom: 8px; }
input { width: 100%; font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .3);
  background: #fff; color: var(--ink); }
.btn { display: block; width: 100%; font: 800 17px/1.1 system-ui, Arial, sans-serif; padding: 13px; border-radius: 13px; border: 0; margin-top: 9px;
  background: #fff; color: var(--ink); cursor: pointer; text-transform: uppercase; letter-spacing: .02em; }
.btn:active { transform: scale(.98); }
.btn.gold { background: var(--gold); }
.btn.red { background: #e53935; color: #fff; }
.btn.green { background: #2e7d32; color: #fff; }
.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .5); }
.btn[disabled] { opacity: .4; }
.row2 { display: flex; gap: 10px; }
.row2 .btn { flex: 1; }
.err { color: #ff8a80; margin-top: 10px; min-height: 1.3em; }

.me { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--seat); color: var(--seat-ink);
  border-radius: 14px; padding: 8px 12px; font-weight: 900; text-transform: uppercase; }
.me-l { min-width: 0; }
.me-name { font-size: 18px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-badges .badge:first-child { margin-left: 0; }
.me-bank { text-align: right; flex: none; background: rgba(0, 0, 0, .28); border-radius: 10px; padding: 4px 10px; }
.me-bank small { display: block; font-size: 9.5px; letter-spacing: .1em; opacity: .85; color: #fff; }
.me-bank b { display: block; font: 900 22px/1.05 "Arial Black", Arial, sans-serif; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); white-space: nowrap; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 10px; background: #fff; color: #6a1b9a; margin-left: 6px; }
.badge.car { color: #00695c; }
.badge.turn { background: var(--gold); color: var(--ink); }
.bank { text-align: center; margin: 14px 0; }
.bank small { opacity: .8; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.bank-total { font: 900 52px/1.1 "Arial Black", Arial, sans-serif; color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.bank-round { opacity: .7; font-size: 12px; text-align: right; padding: 2px 4px 0; }
.bank-round:empty { display: none; }
.def-card { margin-top: 8px; padding: 9px 12px; border-radius: 12px; position: relative; }
.mini-tg { position: absolute; top: 6px; right: 8px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .2); color: #fff; border-radius: 12px;
  padding: 3px 9px; font: 800 11px/1.2 system-ui, Arial, sans-serif; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.mini-tg i { font-style: normal; }
.mini-tg.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.def-card small { display: block; padding-right: 112px; opacity: .75; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.def { font-size: 19px; line-height: 1.2; font-weight: 800; margin-top: 1px; }
.status { text-align: center; margin: 8px 0 2px; font-size: 15px; line-height: 1.3; font-weight: 600; }

.actions { margin-top: 6px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 7px; justify-content: center; margin-top: 6px; }
.key { width: calc((100% - 6 * 7px) / 7); aspect-ratio: 1 / .9; min-height: 40px; font: 900 22px/1 "Arial Black", Arial, sans-serif; border-radius: 10px; border: 0;
  background: #fff; color: var(--ink); cursor: pointer; }
.key.v { background: #ffe082; }
.key.tight { aspect-ratio: 1 / .7; min-height: 32px; font-size: 19px; }
.ans { padding: 10px 12px; margin-top: 8px; }
.ans label { font-size: 14px; margin-bottom: 6px; }
.ans-row { display: flex; gap: 8px; }
.ans-row input { flex: 1; min-width: 0; padding: 10px 12px; }
.ans-row .btn { width: auto; margin: 0; padding: 0 16px; }
.btn.slim { padding: 9px; font-size: 14px; margin-top: 8px; }
/* MALUS su due colonne */
.malus-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.malus-list .btn { flex: 0 0 calc(50% - 3px); margin-top: 0; align-items: flex-start; }
.malus-list .btn:last-child { flex-basis: 100%; }
.key.sel { background: var(--gold); outline: 3px solid #fff; }
.key[disabled] { opacity: .22; }
/* Opzione «sbarrate»: la lettera già chiamata resta leggibile, tagliata da una riga rossa. */
.key.off[disabled] { opacity: .45; background-image: linear-gradient(to top right, transparent calc(50% - 2px), #e53935 calc(50% - 2px), #e53935 calc(50% + 2px), transparent calc(50% + 2px)); }
.called { margin-top: 4px; font-size: 13px; opacity: .9; }
.called s { display: inline-block; margin: 0 2px; padding: 0 6px; border-radius: 5px; background: rgba(255, 255, 255, .14); font-weight: 900; text-decoration-color: #ff5252; text-decoration-thickness: 3px; }
.hint { font-size: 12.5px; line-height: 1.3; opacity: .8; text-align: center; margin-top: 6px; }

.spinpad { margin-top: 6px; height: clamp(120px, 24vh, 210px); border-radius: 20px; border: 3px dashed rgba(255, 213, 79, .8); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle, rgba(255, 213, 79, .18), transparent 70%); }
.spinpad b { font: 900 23px/1.1 "Arial Black", Arial, sans-serif; color: var(--gold); text-transform: uppercase; }
.spinpad .arrow { font-size: 40px; line-height: 1; margin-bottom: 10px; animation: nudge 1.2s infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(10px); } }
.meter { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .15); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd54f, #ff7043); }

/* Prenota: un rettangolo largo quanto lo schermo, facile da colpire senza occupare tutta la pagina */
.buzzer { display: block; width: 100%; height: clamp(96px, 19vh, 160px); margin: 8px 0 6px; border-radius: 20px; border: 5px solid #fff;
  background: linear-gradient(#ff5a4d, #c62828 65%, #9a0007); color: #fff; font: 900 32px/1 "Arial Black", Arial, sans-serif;
  text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 7px 0 #5d0000, 0 0 30px rgba(255, 82, 82, .45); cursor: pointer; }
.buzzer:active { transform: translateY(5px); box-shadow: 0 2px 0 #5d0000; }

.envs { display: flex; gap: 10px; }
.envs .btn { flex: 1; padding: 18px 6px; font-size: 15px; }
.used { margin-top: 8px; text-align: center; font-size: 13px; opacity: .8; }
.used:empty { display: none; }
.used b { letter-spacing: .15em; }
.foot { text-align: center; font-size: 12px; opacity: .6; margin-top: 10px; }
.foot a { color: var(--gold); }
.big-msg { text-align: center; font-size: 20px; font-weight: 700; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); background: #fff; color: var(--ink); border-radius: 12px;
  padding: 12px 14px; font-weight: 700; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.toast.bad { background: #ff8a80; }
.pulse { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 rgba(255, 213, 79, .0); } to { box-shadow: 0 0 24px rgba(255, 213, 79, .9); } }
/* Interazione: barra in basso con emoticon e chat */
body.has-social { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
body.has-social .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
.social { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: rgba(5, 11, 46, .94); border-top: 1px solid rgba(255, 255, 255, .15); }
.emo-bar { flex: 1; display: flex; justify-content: space-around; }
.emo-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); padding: 7px; cursor: pointer; }
.emo-btn img { width: 100%; height: 100%; display: block; }
.emo-btn:active { transform: scale(.88); }
.emo-btn[disabled] { opacity: .35; }
.chat-btn { position: relative; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 24px; padding: 10px 14px; background: #fff; color: var(--ink);
  font: 800 15px/1 system-ui, Arial, sans-serif; cursor: pointer; }
.chat-btn img { width: 22px; height: 22px; }
.chat-btn b { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: #e53935; color: #fff; font-size: 12px;
  line-height: 22px; text-align: center; padding: 0 5px; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: 12vh; z-index: 30; display: flex; flex-direction: column; background: #0d1a6b;
  border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .5); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; }
.sheet.hidden { display: none; }
.sheet-h { display: flex; align-items: center; gap: 8px; }
.sheet-x { border: 0; background: transparent; color: #fff; font-size: 30px; line-height: 1; padding: 0 6px; cursor: pointer; }
.peers { flex: 1; display: flex; gap: 6px; }
.peer { flex: 1; border: 2px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; border-radius: 12px; padding: 10px 6px; font: 800 15px/1.1 system-ui, Arial, sans-serif;
  cursor: pointer; position: relative; }
.peer.on { background: #fff; color: var(--ink); border-color: #fff; }
.peer i { position: absolute; top: -6px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #e53935; }
.chat-list { flex: 1; overflow-y: auto; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .14); align-self: flex-start; word-wrap: break-word; }
.bubble.mine { align-self: flex-end; background: var(--gold); color: var(--ink); }
.bubble .from { display: block; font-size: 12px; font-weight: 800; margin-bottom: 1px; }
.peer { font-size: 14px; padding: 10px 4px; }
.chat-empty { opacity: .6; text-align: center; margin-top: 20px; }
.chat-form { display: flex; gap: 8px; }
.sheet-t { flex: 1; font-size: 18px; }
.report-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.rp { text-align: left; border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.rp small { display: block; font-size: 12.5px; opacity: .8; margin-bottom: 2px; }
.rp b { font: 900 15px/1.2 "Arial Black", Arial, sans-serif; letter-spacing: .02em; }
.rp.on { border-color: #ffd54f; background: rgba(255, 213, 79, .14); }
.report-why { display: flex; gap: 6px; margin-bottom: 8px; }
.report-why button { flex: 1; border: 2px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; border-radius: 10px; padding: 10px 4px; font: 800 14px/1.1 system-ui, Arial, sans-serif; cursor: pointer; }
.report-why button.on { background: #ffd54f; border-color: #ffd54f; color: #0b1a5e; }
#reportNote { font-size: 16px; margin-bottom: 8px; }
.chat-form input { flex: 1; font-size: 17px; }
.chat-form .btn { width: auto; margin: 0; padding: 12px 16px; font-size: 15px; }
.fly { position: fixed; z-index: 40; width: 64px; margin-left: -32px; pointer-events: none; text-align: center; animation: fly 2.4s ease-out forwards; }
.fly img { width: 56px; height: 56px; display: block; margin: 0 auto; }
.fly span { font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 8px; }
@keyframes fly { 0% { transform: translateY(0) scale(.3); opacity: 0; } 15% { transform: translateY(-30px) scale(1.1); opacity: 1; }
  80% { opacity: 1; } 100% { transform: translateY(-46vh) scale(.9); opacity: 0; } }

/* Malus */
.malus-list .btn { text-align: left; text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin-top: 6px; font-size: 15px; }
.malus-list .btn img { width: 26px; height: 26px; flex: none; }
.malus-list .btn small { display: block; font-weight: 600; font-size: 12px; line-height: 1.25; opacity: .75; margin-top: 1px; }
.targets { display: flex; gap: 8px; margin-top: 8px; }
.targets .btn { flex: 1; margin-top: 0; }
.targets .btn.on { background: var(--gold); outline: 3px solid #fff; }
.my-malus { display: inline-block; margin: 6px 4px 0; padding: 4px 10px; border-radius: 14px; background: #7f0000; font-size: 12px; font-weight: 800; }
.buzzer.frozen { background: radial-gradient(circle at 40% 35%, #b3e5fc, #4fc3f7 60%, #0277bd); box-shadow: 0 10px 0 #01579b; font-size: 26px; }
/* Trillo: lo schermo trema a scatti mentre si scrive la risposta (stile MSN) */
body.trillo #play { animation: trillo 1.6s infinite; }
@keyframes trillo {
  0%, 52%, 100% { transform: translate(0, 0); }
  4% { transform: translate(-9px, 3px) rotate(-1deg); } 8% { transform: translate(8px, -4px) rotate(1deg); } 12% { transform: translate(-7px, -2px); }
  16% { transform: translate(9px, 4px) rotate(1deg); } 20% { transform: translate(-8px, 2px) rotate(-1deg); } 24% { transform: translate(6px, -3px); }
  28% { transform: translate(-9px, 4px); } 32% { transform: translate(7px, -2px) rotate(1deg); } 36% { transform: translate(-6px, 3px); }
  40% { transform: translate(8px, 1px); } 44% { transform: translate(-5px, -3px); } 48% { transform: translate(3px, 2px); } }
/* Ingresso dall'icona: codice, partite aperte, lettore QR, invito a installare */
.lnk { color: var(--gold); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; font: 900 26px/1 "Arial Black", Arial, sans-serif; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.code-row .btn { width: auto; margin: 0; padding: 0 20px; }
.open-list { margin-top: 16px; }
.open-list h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin: 0 0 6px; text-align: center; }
.open-list .btn { text-transform: none; letter-spacing: 0; text-align: left; margin-top: 8px; }
.open-list .btn small { display: block; font-weight: 600; font-size: 13px; opacity: .7; margin-top: 3px; }
.scanner { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: 64vw; max-width: 300px; aspect-ratio: 1; border: 4px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.scanner p, .scanner .btn { position: relative; margin-top: 18px; max-width: 300px; text-align: center; font-weight: 700; }
.install { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 45; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  background: #fff; color: var(--ink); border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: 480px; margin: 0 auto; }
.install img { width: 46px; height: 46px; border-radius: 10px; }
.install-t { flex: 1; min-width: 180px; font-size: 13.5px; line-height: 1.35; }
.install-t b { display: block; font-size: 15px; }
.install-b { display: flex; gap: 8px; width: 100%; }
.install-b .btn { margin: 0; padding: 11px; font-size: 14px; }
.install-b .btn.ghost { color: var(--ink); border-color: rgba(11, 26, 94, .35); }
/* Tabellone in miniatura (gioco a distanza) */
.mini { margin-top: 8px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .15); border-radius: 14px; padding: 6px 8px 8px; }
.mini-h { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; color: #fff; padding: 4px 4px 6px;
  font: 800 12px/1 system-ui, Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; opacity: .8; cursor: pointer; }
.mini-h i { font-style: normal; font-size: 14px; }
.mini.closed #miniBody { display: none; }
.mini-board { padding: 5px 3px; border-radius: 8px; background: #0d1b6b; border: 2px solid #ffd54f; }
.mini-board .r { display: flex; justify-content: center; gap: 2px; margin: 2px 0; }
.mini-board .c { flex: 0 0 calc((100% - 13 * 2px) / 14); aspect-ratio: .82; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font: 900 13px/1 "Arial Black", Arial, sans-serif; color: #0b1a5e; }
.mini-board .c.off { background: #0e6b4c; }
.mini-board .c.blank, .mini-board .c.shown { background: #fafafa; }
.mini-board .c.lit { background: #4fc3f7; }
.mini-board .c.flash { background: #fff59d; }
.mini-scores { display: flex; gap: 4px; margin-top: 6px; }
.mini-scores div { flex: 1; min-width: 0; border-radius: 8px; padding: 4px 6px; font-size: 11px; font-weight: 800; line-height: 1.25; color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: .85; }
.mini-scores div b { display: block; font: 900 13px/1.2 "Arial Black", Arial, sans-serif; }
.mini-scores div.on { opacity: 1; outline: 2px solid #fff; }
.mini-scores div.dark { color: #3e2723; }
.cons-end { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 20px; background: #ffd54f; color: #1a1a40; font-weight: 800; }
