/* Cu fu? — telefono. Una colonna, comandi in basso a portata di pollice, niente zoom del browser. */
html, body { height: 100%; }
body { overflow: hidden; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.on { display: flex; }
.pad { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
h1.t { font: 900 italic 1.6rem/1.1 var(--f-display); margin: 0; text-wrap: balance; }
.sub { color: var(--muted); font-weight: 600; font-size: .92rem; line-height: 1.4; margin: 0; }
.lbl { font: 800 .64rem/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--maj-yellow); margin: 6px 2px 0; }
.err { color: #ff8d88; font-weight: 700; min-height: 1.2em; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ingresso */
.join { gap: 14px; padding-block: 18px 24px; }
.join .logo { width: min(260px, 70vw); height: auto; align-self: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 800 .7rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field input { font: 800 1.15rem/1 var(--f-body); padding: 14px 16px; border-radius: 14px; border: 0; background: var(--night-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--line); width: 100%; }
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--maj-yellow); }
.field input.code { letter-spacing: .4em; text-transform: uppercase; text-align: center; font: 900 1.8rem/1 var(--f-display); }
.who6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.who6 button { appearance: none; border: 0; background: var(--night-2); border-radius: 16px; padding: 10px 6px 8px; display: grid; justify-items: center; gap: 4px; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; }
.who6 button svg { width: 64px; height: 64px; }
.who6 button b { font: 800 .74rem/1.1 var(--f-body); text-align: center; }
.who6 button small { font: 600 .64rem/1 var(--f-body); color: var(--muted); }
.who6 button.sel { box-shadow: inset 0 0 0 3px var(--maj-yellow); background: var(--night-3); }
.who6 button:disabled { opacity: .3; }

/* barra in alto */
.bar { display: flex; align-items: center; gap: 10px; padding-block: 10px 8px; background: linear-gradient(180deg, #16233a, rgba(22, 35, 58, 0)); flex: none; }
.bar .portrait { width: 42px; height: 42px; flex: none; }
.bar .me { flex: 1; min-width: 0; line-height: 1.15; }
.bar .me b { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .me small { color: var(--muted); font-weight: 600; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.pill { padding: 7px 12px; border-radius: 999px; font-weight: 800; font-size: .78rem; background: var(--night-3); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; flex: none; }
.pill.go { background: linear-gradient(180deg, #ffd56b, #e2a62a); color: #2a1a00; box-shadow: none; }
.pill.out { background: #3a2026; color: #ff8d88; }
.iconbtn { appearance: none; border: 0; background: transparent; color: var(--muted); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; flex: none; cursor: pointer; }
.iconbtn svg { width: 22px; height: 22px; }

/* schede */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); background: #0b1322; border-top: 1px solid var(--line); flex: none; }
.tabs button { appearance: none; border: 0; background: transparent; display: grid; justify-items: center; gap: 3px; font: 800 .68rem/1 var(--f-body); color: var(--muted); padding: 6px 0; cursor: pointer; position: relative; }
.tabs button.on { color: var(--maj-yellow); }
.tabs button svg { width: 24px; height: 24px; }
.tabs button .dot { position: absolute; top: 2px; right: 26%; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #0b1322; }
.pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pane.on { display: flex; }

/* azioni (in basso, sopra le schede) */
.dock { flex: none; padding-block: 10px 10px; background: linear-gradient(0deg, #0e1828 70%, rgba(14, 24, 40, 0)); display: flex; flex-direction: column; gap: 10px; }
.dock:empty { display: none; }
.dock .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dock .msg { font-weight: 700; color: var(--muted); text-align: center; font-size: .92rem; line-height: 1.35; }
.dock .msg b { color: var(--text); }
.dice { display: flex; gap: 10px; align-items: center; justify-content: center; }
.dice .die { width: 44px; height: 44px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.dice .die.roll { animation: cf-roll .18s linear infinite; }
.dice b { font: 900 1.8rem/1 var(--f-display); color: var(--maj-yellow); margin-left: 4px; }
@keyframes cf-roll { 0% { transform: rotate(0); } 50% { transform: rotate(14deg) translateY(-4px); } 100% { transform: rotate(-10deg); } }

/* piantina sul telefono: niente zoom del browser, ingrandimento del gioco e scorrimento con un dito */
.mapbox { position: relative; flex: 1; min-height: 0; margin: 0 10px; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); background: #1b130c; }
.mapscroll { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; scrollbar-width: none; }
.mapscroll::-webkit-scrollbar { display: none; }
.mapinner { position: relative; }
.mapinner > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mapinner .ov .tok { transition: transform .8s cubic-bezier(.4, 0, .2, 1); }
.mapinner .ov .wtok { transition: transform .9s ease; }
.mapinner .hit { fill: #ffe27a; fill-opacity: .7; stroke: #b8860b; stroke-width: 3; animation: cf-blink 1.4s ease-in-out infinite; cursor: pointer; }
.mapinner .hitroom { fill: #ffe27a; fill-opacity: .22; stroke: #ffd23f; stroke-width: 7; animation: cf-blink 1.4s ease-in-out infinite; cursor: pointer; }
.mapctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.mapctl button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(14, 24, 40, .9); color: var(--text); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.mapctl svg { width: 22px; height: 22px; }
.maphint { position: absolute; left: 10px; right: 64px; bottom: 10px; background: rgba(14, 24, 40, .92); border-radius: 12px; padding: 9px 12px; font-weight: 700; font-size: .84rem; display: flex; gap: 8px; align-items: center; z-index: 2; }
.maphint i { width: 14px; height: 14px; border-radius: 4px; background: #ffe27a; border: 2px solid #b8860b; flex: none; }
.maphint:empty { display: none; }

/* scelta delle carte (ipotesi, accusa, smentita) */
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.strip .card { width: 84px; flex: none; aspect-ratio: 4 / 5; scroll-snap-align: start; }
.strip .card .nm { font-size: .7rem; }
.sentence { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 12px 14px; font: 700 1rem/1.35 var(--f-display); }
.sentence em { font-style: normal; color: #a3262b; }
.sentence .q { color: #7a6646; font-style: italic; }
.big2 { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.big2 .card { width: 118px; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(5, 9, 18, .72); display: flex; flex-direction: column; justify-content: flex-end; animation: fadein .2s ease; }
.sheet .in { background: var(--night); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); max-height: 94%; display: flex; flex-direction: column; padding-top: 14px; animation: slideup .28s cubic-bezier(.2, .8, .3, 1); }
.sheet .in .scroll { padding-bottom: 10px; }
.sheet .foot { padding-block: 10px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; margin-bottom: 8px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes slideup { from { transform: translateY(40%); } }
.warn { background: #3a2026; color: #ffb3ae; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: .88rem; line-height: 1.4; }

/* carte */
.hand { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-list > div { display: flex; gap: 10px; align-items: center; background: var(--night-2); border-radius: 12px; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: .9rem; }
.mini-list .card { width: 44px; flex: none; aspect-ratio: 4 / 5; }
.mini-list .card .nm, .mini-list .card .k { display: none; }
.mini-list .portrait { width: 30px; height: 30px; flex: none; }

/* taccuino */
.notes-wrap { border-radius: 14px; background: #101c30; padding: 0 4px 6px; }
.notes .cols th { text-align: center; padding: 10px 0 6px; position: sticky; top: 0; background: #101c30; z-index: 1; }
.notes .cols th svg { width: 26px; height: 26px; }
.notes .cols .pn { display: block; font: 700 .55rem/1 var(--f-body); color: var(--muted); letter-spacing: 0; text-transform: none; margin-top: 3px; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-inline: auto; }
.notes .mk { width: 34px; }
.notes .mk button { width: 30px; height: 32px; }
.notes .mk button.auto { box-shadow: inset 0 0 0 1.5px currentColor; }
.notes td.nm { font-size: .84rem; gap: 7px; }
.notes td.nm svg { width: 24px; height: 24px; }
.notes .cnt { color: var(--muted); }

/* indagine */
.log { display: flex; flex-direction: column; gap: 8px; }
.log > div { background: var(--night-2); border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 6px; }
.log .top { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; }
.log .top .portrait { width: 28px; height: 28px; flex: none; }
.log .ic3 { display: flex; gap: 6px; }
.log .ic3 > span { width: 38px; height: 38px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.log .ic3 svg { width: 90%; height: 90%; }
.log .res { color: var(--muted); font-size: .84rem; font-weight: 600; }
.log .res b { color: var(--text); }
.log .mine { color: #7ff0b4; }

/* sala d'attesa */
.plist { display: flex; flex-direction: column; gap: 8px; }
.plist > div { display: flex; align-items: center; gap: 10px; background: var(--night-2); border-radius: 14px; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--line); }
.plist .portrait { width: 44px; height: 44px; flex: none; }
.plist .nm { flex: 1; min-width: 0; }
.plist .nm b { display: block; }
.plist .nm small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { appearance: none; border: 0; border-radius: 999px; padding: 8px 12px; font: 800 .78rem/1 var(--f-body); background: var(--night-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.chips button.on { background: var(--maj-yellow); color: #2a1a00; box-shadow: none; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--night-2); border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; }
.toggle small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; margin-top: 2px; }
.sw { width: 52px; height: 30px; border-radius: 15px; background: var(--night-3); position: relative; flex: none; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform .2s; }
.sw.on { background: var(--maj-green); }
.sw.on::after { transform: translateX(22px); background: #fff; }

/* avvisi a tutto schermo */
.flash { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(233, 178, 60, .35), rgba(14, 24, 40, .96) 60%); animation: flash 1.9s ease forwards; pointer-events: none; text-align: center; }
.flash .in { display: grid; gap: 12px; justify-items: center; }
.flash .portrait { width: 120px; height: 120px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.flash b { font: 900 italic 2.4rem/1 var(--f-display); color: var(--maj-yellow); }
.flash small { font-weight: 700; color: var(--text); font-size: 1rem; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pop { from { transform: scale(.4); } }
/* la carta che ti mostrano: si gira */
.reveal { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(5, 9, 18, .86); animation: fadein .25s ease; }
.reveal .in { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 0 24px; }
.reveal .flip { width: 180px; perspective: 900px; }
.reveal .flip .card { animation: flip 1s cubic-bezier(.3, .9, .4, 1) both; transform-style: preserve-3d; }
@keyframes flip { 0% { transform: rotateY(180deg) scale(.8); filter: brightness(.2); } 55% { filter: brightness(.6); } 100% { transform: rotateY(0) scale(1); filter: none; } }
.reveal p { margin: 0; font-weight: 700; font-size: 1.05rem; line-height: 1.4; }
.reveal p b { color: var(--maj-yellow); }
.pausebox { position: fixed; inset: 0; z-index: 50; background: rgba(5, 9, 18, .9); display: grid; place-items: center; text-align: center; }
.pausebox .in { display: grid; gap: 14px; padding: 0 24px; justify-items: center; }
.pausebox h2 { font: 900 italic 2rem/1 var(--f-display); color: var(--maj-yellow); margin: 0; }
.envelope3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
