:root {
  --bg: #070b16;
  --panel: #111830;
  --panel-2: #18213f;
  --line: #27325a;
  --text: #e8ecf8;
  --muted: #93a0c4;
  --accent: #ffb020;
  --pro: #3ecf8e;
  --contro: #ff5d6c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 30% 20%, #101a3a, var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 system-ui, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 20px;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}

/* Logo animato (circa 7,7 s). La scena va in grande al centro dello schermo:
   l'oratore entra, appoggia i fogli, sistema il microfono, prende fiato, punta il dito
   e urla; poi tutto si rimpicciolisce nel logo ed escono "Argue" e "oss".
   --ix/--iy/--is (posizione e scala della scena) sono calcolate in index.html. */
#intro-backdrop {
  position: fixed; inset: 0; z-index: 4; cursor: pointer;
  background: radial-gradient(ellipse 46% 52% at 50% 46%, #22346a 0%, #101a3a 38%, #05070f 78%);
  animation: backdrop-out 0.9s 6.8s ease-in forwards;
}
#intro-backdrop::after {
  content: "Clicca per saltare"; position: absolute; bottom: 24px; left: 0; right: 0;
  text-align: center; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #93a0c4; opacity: 0.6;
}
@keyframes backdrop-out { to { opacity: 0; visibility: hidden; } }

.logo {
  display: flex; align-items: flex-end; position: relative; z-index: 5;
  font-size: 34px; line-height: 1; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.5px;
  transform-origin: left top; animation: logo-zoom 0.9s 6.8s cubic-bezier(0.6, 0, 0.2, 1) backwards;
}
.logo-argue, .logo-oss { padding-bottom: 2px; animation: logo-text 0.7s 7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.logo-argue { --from-x: 40px; --from-clip: inset(-40% 0 -40% 100%); }
.logo-oss { --from-x: -40px; --from-clip: inset(-40% 100% -40% 0); color: #b5713c; margin-left: -3px; }
.logo-man { height: 64px; width: 68.4px; overflow: visible; margin-left: -29px; flex: none; pointer-events: none; }
.logo-man * { transform-box: view-box; }

.stage-light { animation: stage-light 0.9s 6.8s ease-in both; }
.walker { animation: man-walk 2.4s linear backwards; }
.bob { animation: man-bob 0.15s 16 alternate ease-in-out; }
.thigh { transform-origin: 66.5px 75px; animation: thigh-walk 0.6s 4 linear; }
.shin { transform-origin: 66.5px 94px; animation: shin-walk 0.6s 4 linear; }
/* gamba lontana: mezzo ciclo di sfasamento, poi chiude il passo */
.thigh.far-leg { animation: thigh-walk 0.6s -0.3s 4.5 linear, thigh-settle 0.3s 2.4s ease-in-out backwards; }
.shin.far-leg { animation: shin-walk 0.6s -0.3s 4.5 linear, shin-settle 0.3s 2.4s ease-in-out backwards; }

/* Recitazione: una sola linea del tempo di 7,4 s per ogni articolazione, con
   accelerazione e frenata morbide fra una posa e l'altra. */
.upper, .head, .jaw, .brow, .flush, .lid, .tie, .arm, .forearm, .finger, .far-arm, .mic, .wave, .papers-hand, .papers-desk, .smile, .cheer, .palm {
  animation-duration: 7.4s; animation-fill-mode: both; animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1);
}
.upper { transform-origin: 66.5px 75px; animation-name: upper-act; }
.head { transform-origin: 67px 35px; animation-name: head-act; }
.jaw { transform-origin: 65px 30.5px; animation-name: jaw-act; }
.brow { transform-origin: 75px 20.6px; animation-name: brow-act; }
.flush { animation-name: flush-act; }
.lid { transform-origin: 75px 22px; animation-name: lid-act; }
.tie { transform-origin: 77.2px 44px; animation-name: tie-act; }
.arm { transform-origin: 68.2px 44.5px; animation-name: arm-act; }
.forearm { transform-origin: 68.2px 60px; animation-name: forearm-act; }
.finger { transform-origin: 68px 78.6px; animation-name: finger-act; }
.far-arm { transform-origin: 66.8px 45px; animation: far-arm-act 7.4s both, far-arm-swing 0.6s 4 ease-in-out; }
.mic { transform-origin: 112px 56.4px; animation-name: mic-act; }
.wave { animation-name: wave-act; }
.w2 { animation-delay: 0.07s; }
.w3 { animation-delay: 0.14s; }
.papers-hand { animation-name: papers-hand; }
.smile, .cheer { animation-name: smile-act; }
.palm { animation-name: palm-act; }
.papers-desk { animation-name: papers-desk; }

@keyframes logo-zoom {
  from { transform: translate(var(--ix, 0px), var(--iy, 0px)) scale(var(--is, 1.6)); }
  to { transform: translate(0, 0) scale(1); }
}
@keyframes logo-text {
  from { opacity: 0; clip-path: var(--from-clip); transform: translateX(var(--from-x)); }
  to { opacity: 1; clip-path: inset(-40% -5% -40% -5%); transform: translateX(0); }
}
@keyframes stage-light { from { opacity: 0.07; } to { opacity: 0; } }
@keyframes man-walk { 0% { transform: translateX(-300px); opacity: 0; } 22% { opacity: 1; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes man-bob { from { transform: translateY(0); } to { transform: translateY(-1.4px); } }
/* Ciclo del passo (parte e finisce a metà appoggio, gamba tesa e verticale):
   appoggio 0-20% e 60-100% con la gamba quasi tesa, spinta al 20%, avanzamento 20-60% con il ginocchio piegato. */
@keyframes thigh-walk {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(20deg); }
  35% { transform: rotate(6deg); }
  50% { transform: rotate(-21deg); }
  60% { transform: rotate(-25deg); }
  78% { transform: rotate(-14deg); }
}
@keyframes shin-walk {
  0%, 100% { transform: rotate(0deg); }
  12% { transform: rotate(4deg); }
  20% { transform: rotate(22deg); }
  33% { transform: rotate(52deg); }
  48% { transform: rotate(14deg); }
  58% { transform: rotate(0deg); }
  70% { transform: rotate(7deg); }
  85% { transform: rotate(2deg); }
}
/* la gamba lontana, sfasata di mezzo passo, chiude il passo e si affianca all'altra */
@keyframes thigh-settle { from { transform: rotate(-21deg); } to { transform: rotate(0deg); } }
@keyframes shin-settle { from { transform: rotate(14deg); } to { transform: rotate(0deg); } }
@keyframes far-arm-swing { 0%, 100% { transform: rotate(-5deg); } 25% { transform: rotate(-22deg); } 75% { transform: rotate(18deg); } }

/* Tempi su 7,4 s: cammina 0-32% · fogli 32-45% · si raddrizza 49% · microfono 55-66%
   · mano sul leggio 70% · prende fiato 74% · scatto 76% · urla 76-100% */
@keyframes arm-act {
  0% { transform: rotate(-8deg); }
  4%, 26% { transform: rotate(-110deg); }
  30%, 32.4% { transform: rotate(-8deg); }
  40.5%, 44.6% { transform: rotate(-37deg); }
  48.6% { transform: rotate(-22deg); }
  55.4% { transform: rotate(-60deg); }
  58.8% { transform: rotate(-57deg); }
  62.2% { transform: rotate(-61deg); }
  65.5% { transform: rotate(-60deg); }
  69.6% { transform: rotate(-30deg); }
  73.6% { transform: rotate(-30deg); animation-timing-function: cubic-bezier(0.5, 0, 0.1, 1); }
  76.4% { transform: rotate(-97deg); }
  80.4%, 88.5% { transform: rotate(-84deg); }
  84.5% { transform: rotate(-95deg); }
  92.6% { transform: rotate(-93deg); }
  100% { transform: rotate(-88deg); }
}
@keyframes forearm-act {
  0% { transform: rotate(-82deg); }
  4% { transform: rotate(-45deg); }
  7%, 13%, 19%, 25% { transform: rotate(-26deg); }
  10%, 16%, 22% { transform: rotate(-56deg); }
  30%, 32.4% { transform: rotate(-82deg); }
  40.5%, 44.6% { transform: rotate(-54deg); }
  48.6% { transform: rotate(-64deg); }
  55.4% { transform: rotate(-77deg); }
  58.8% { transform: rotate(-69deg); }
  62.2% { transform: rotate(-80deg); }
  65.5% { transform: rotate(-74deg); }
  69.6% { transform: rotate(-58deg); }
  73.6% { transform: rotate(-120deg); animation-timing-function: cubic-bezier(0.5, 0, 0.1, 1); }
  76.4% { transform: rotate(0deg); }
  80.4%, 88.5% { transform: rotate(-14deg); }
  84.5% { transform: rotate(-2deg); }
  92.6% { transform: rotate(-3deg); }
  100% { transform: rotate(-4deg); }
}
@keyframes upper-act {
  0%, 32.4% { transform: rotate(0deg); }
  40.5%, 44.6% { transform: rotate(5deg); }
  48.6% { transform: rotate(1deg); }
  55.4%, 65.5% { transform: rotate(3deg); }
  69.6% { transform: rotate(1deg); }
  73.6% { transform: rotate(-4deg); animation-timing-function: cubic-bezier(0.5, 0, 0.1, 1); }
  76.4% { transform: rotate(9deg); }
  80.4%, 88.5% { transform: rotate(5deg); }
  84.5%, 92.6% { transform: rotate(8deg); }
  100% { transform: rotate(6deg); }
}
@keyframes head-act {
  0%, 32.4% { transform: rotate(0deg); }
  40.5%, 44.6% { transform: rotate(11deg); }
  48.6% { transform: rotate(-2deg); }
  55.4%, 65.5% { transform: rotate(4deg); }
  69.6% { transform: rotate(-1deg); }
  73.6% { transform: rotate(-9deg); }
  76.4% { transform: rotate(3deg); }
  80.4%, 88.5% { transform: rotate(-2deg); }
  84.5%, 92.6% { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}
@keyframes jaw-act {
  0%, 73.6% { transform: rotate(0deg); }
  76.4%, 84.5% { transform: rotate(26deg); }
  80.4%, 88.5% { transform: rotate(11deg); }
  92.6% { transform: rotate(24deg); }
  100% { transform: rotate(20deg); }
}
@keyframes brow-act { 0%, 69.6% { transform: rotate(-14deg); } 76.4%, 100% { transform: rotate(7deg) translateY(0.6px); } }
@keyframes flush-act { 0%, 73.6% { opacity: 0; } 86%, 100% { opacity: 0.45; } }
@keyframes lid-act {
  0%, 46%, 48%, 67%, 69%, 100% { transform: scaleY(0); }
  47%, 68% { transform: scaleY(1); }
}
@keyframes tie-act {
  0%, 69.6% { transform: rotate(0deg); }
  73.6% { transform: rotate(4deg); }
  76.4% { transform: rotate(-11deg); }
  80.4%, 88.5% { transform: rotate(-4deg); }
  84.5%, 92.6% { transform: rotate(-9deg); }
  100% { transform: rotate(-5deg); }
}
@keyframes far-arm-act {
  0%, 69.6% { transform: rotate(-5deg); }
  73.6% { transform: rotate(-12deg); }
  76.4% { transform: rotate(18deg); }
  100% { transform: rotate(13deg); }
}
@keyframes mic-act {
  0%, 55.4% { transform: rotate(0deg); }
  58.8% { transform: rotate(4deg); }
  62.2% { transform: rotate(-2deg); }
  65.5%, 100% { transform: rotate(2deg); }
}
@keyframes finger-act { 0%, 74% { transform: scaleY(0); } 76.4%, 100% { transform: scaleY(1); } }
@keyframes wave-act {
  0%, 75% { opacity: 0; }
  76.4%, 84.5%, 92.6% { opacity: 1; }
  80.4%, 88.5% { opacity: 0.15; }
  100% { opacity: 0.9; }
}
@keyframes papers-hand { 0%, 28% { opacity: 0; } 30%, 41.2% { opacity: 1; } 41.9%, 100% { opacity: 0; } }
/* sorriso mentre saluta il pubblico */
@keyframes palm-act { 0%, 27% { opacity: 1; } 29%, 100% { opacity: 0; } }
@keyframes smile-act { 0%, 40% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes papers-desk { 0%, 41.2% { opacity: 0; } 41.9%, 100% { opacity: 1; } }

/* Logo col personaggio 3D: a intro finita il disegno lascia il posto all'ultimo fotogramma del render. */
.logo-man .man-3d { opacity: 0; transition: opacity 0.25s; }
.logo-3d .logo-man > :not(defs):not(.man-3d) { visibility: hidden; }
.logo-3d .logo-man .man-3d { opacity: 1; }
.intro-after .logo-man .man-3d { transition: none; }

/* Intro in 3D: mentre gira il video il logo resta ingrandito e fermo, l'omino disegnato è nascosto.
   A fine video (.intro-after) lo SVG compare già in posa finale e parte subito il rimpicciolimento. */
/* durante l'intro il logo ingrandito sta sopra lo sfondo: senza questo un clic aprirebbe il link del
   logo (cioè ricaricherebbe la pagina e l'intro ripartirebbe) invece di saltarla */
.intro-running .logo { pointer-events: none; }
#intro-video { position: fixed; z-index: 6; pointer-events: none; transition: opacity 0.25s; }
#intro-video.out { opacity: 0; }
.intro-video .logo { animation: none; transform: translate(var(--ix, 0px), var(--iy, 0px)) scale(var(--is, 1.6)); }
.intro-video .logo-man { visibility: hidden; }
.intro-video .logo-man *, .intro-video #intro-backdrop { animation: none; }
.intro-video .logo-argue, .intro-video .logo-oss { animation: none; opacity: 0; }
.intro-after .logo, .intro-after #intro-backdrop { animation-delay: 0.15s; }
.intro-after .logo-argue, .intro-after .logo-oss { animation-delay: 0.35s; }
.intro-after .logo-man * { animation-duration: 0.001s !important; animation-delay: 0s !important; }

/* Intro saltata (clic, Esc) o animazioni ridotte: si va subito alla posa finale. */
.intro-skip #intro-backdrop, .intro-skip .logo, .intro-skip .logo * { animation-duration: 0.001s !important; animation-delay: 0s !important; }
@media (prefers-reduced-motion: reduce) {
  #intro-backdrop, .logo, .logo * { animation-duration: 0.001s !important; animation-delay: 0s !important; }
}

#me { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
#demo-banner { background: #3a2c08; color: #ffd98a; padding: 6px 20px; font-size: 13px; text-align: center; }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }

h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }

button, .btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #1a1200; font-weight: 700; }
button.pro.on { background: var(--pro); border-color: var(--pro); color: #04210f; font-weight: 700; }
button.contro.on { background: var(--contro); border-color: var(--contro); color: #2a0408; font-weight: 700; }
button.link { background: none; border: none; color: var(--muted); padding: 4px; text-decoration: underline; }

input, select, textarea {
  font: inherit;
  width: 100%;
  background: #0b1126;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
input[type="color"] { padding: 2px; height: 40px; width: 60px; }
textarea { min-height: 84px; resize: vertical; }
label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Stanza 3D del dibattito: 2/3 dello schermo in alto, fissa; il resto scorre nel terzo basso */
#stage3d { position: fixed; top: 0; left: 0; right: 0; height: 66.667dvh; z-index: 6; background: #05070f; overflow: hidden; touch-action: none; user-select: none; }
#stage3d[hidden] { display: none; }
body.with-stage > header, body.with-stage #demo-banner, body.with-stage #float-layer { display: none; }
/* il resto del dibattito (modulo d'invio, interventi, accordo) sta in un foglio che si apre dalla barra */
body.with-stage main { position: fixed; inset: 0; z-index: 30; max-width: none; margin: 0; padding: 60px max(16px, calc(50vw - 600px)) 90px; overflow-y: auto; overscroll-behavior: contain; background: radial-gradient(1200px 700px at 30% 20%, #101a3a, var(--bg)); background-color: var(--bg); display: none; }
body.with-stage.sheet-open main { display: block; }
#sheet-close { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 31; width: auto; margin: 0; padding: 8px 16px; border-radius: 999px; background: #ffb020; color: #111; border: none; font-weight: 700; box-shadow: 0 4px 16px #0008; }
#sheet-close[hidden] { display: none; }
/* terzo basso fisso: la valutazione dell'IA */
#stage-eval { position: fixed; left: 0; right: 0; bottom: 0; height: 33.333dvh; z-index: 6; display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px #0008; }
#stage-eval[hidden] { display: none; }
.se-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.se-bar button { width: auto; margin: 0; padding: 7px 12px; font-size: 14px; white-space: nowrap; }
.se-bar .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.se-bar .pulse { animation: se-pulse 1.6s ease-in-out infinite; }
@keyframes se-pulse { 50% { box-shadow: 0 0 0 4px #ffb02055; } }
.se-body { flex: 1; overflow-y: auto; padding: 8px 12px 64px; }
.se-body .eval { margin-top: 6px; }
.se-who { font-size: 13px; color: var(--muted); }
body.with-stage.sheet-open #stage-eval { display: none; }
.st-canvas { display: block; width: 100%; height: 100%; }
.st-top { position: absolute; top: 8px; left: 8px; right: 64px; max-width: 640px; pointer-events: none; }
.st-comments { display: flex; flex-direction: column; gap: 4px; }
.st-c { align-self: flex-start; max-width: 100%; padding: 5px 10px; border-radius: 12px; background: #0b1230cc; border: 1px solid #ffffff22; color: #e8ecf8; font-size: 13px; line-height: 1.3; backdrop-filter: blur(4px); transition: opacity 0.6s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-c.pro b { color: #4ade80; }
.st-c.contro b { color: #f87171; }
.st-c.lv1 { border-color: #fbbf24aa; }
.st-c.lv2 { border-color: #f97316; font-weight: 600; }
.st-c.lv3 { border-color: #ef4444; background: #450a0acc; font-weight: 700; }
.st-c.old { opacity: 0.55; }
.st-tools { position: absolute; right: 8px; bottom: 30px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.st-nav { display: flex; gap: 8px; align-items: center; }
.st-vista { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: auto; min-width: 62px; height: 46px; margin: 0; padding: 0 8px; border: 1px solid #223041; border-radius: 14px; background: rgba(7, 11, 16, 0.78); color: #e8eef5; }
.st-vista svg { width: 20px; height: 20px; fill: none; stroke: #ffb020; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-vista small { font-size: 10.5px; color: #a9b6c6; white-space: nowrap; }
.st-bussola { flex: none; width: 46px; height: 46px; margin: 0; padding: 0; border: none; background: none; }
.st-bussola svg { width: 100%; height: 100%; }
.st-bussola text { font: 700 15px system-ui; text-anchor: middle; dominant-baseline: middle; }
.st-btn, .st-theme { width: auto; max-width: 160px; margin: 0; padding: 6px 10px; font-size: 12.5px; border-radius: 10px; background: #0b1230d9; color: #e8ecf8; border: 1px solid #ffffff33; }
.st-extra { position: absolute; left: 8px; right: 176px; bottom: 28px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-extra button, .st-link { width: auto; margin: 0; padding: 6px 10px; font-size: 13px; border-radius: 10px; background: #ffb020; color: #111; border: none; font-weight: 700; text-decoration: none; }
.st-extra span { color: #e8ecf8; font-size: 13px; background: #0b1230cc; padding: 4px 8px; border-radius: 8px; }
.st-hint { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 11px; color: #cbd5e1bb; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.st-book { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(320px, 86%); padding: 14px 16px; border-radius: 14px; background: #1c1208f2; border: 1px solid #c9a227; color: #f5ecd9; display: grid; gap: 6px; }
.st-book[hidden] { display: none; }
.st-book p { margin: 0; }
.st-x { position: absolute; top: 6px; right: 8px; width: auto; margin: 0; padding: 2px 6px; background: none; border: none; color: #f5ecd9; font-size: 16px; }
.search-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: min(100%, 380px); margin: 12px auto 0; }
.search-actions > button { width: 100%; margin: 0; }
.row > .grow { flex: 1; min-width: 140px; }

/* Home */
.home { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 18px; }
#globe { height: 620px; border-radius: 12px; overflow: hidden; cursor: grab; }
.globe-tip { background: #0b1126ee; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 13px system-ui, sans-serif; color: var(--text); }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: none; }
.rank .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; }

/* Stanza */
.room { max-width: 860px; margin: 0 auto; }
.code { font-size: 44px; font-weight: 800; letter-spacing: 10px; color: var(--accent); }
.players { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.player { flex: 1; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.player.turn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.player .offline { color: var(--contro); font-size: 12px; }

.topic { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--panel-2); }
.topic .title { font-weight: 700; }
.badge { font-size: 12px; border-radius: 999px; padding: 2px 9px; font-weight: 700; }
.badge.pro { background: #12402c; color: var(--pro); }
.badge.contro { background: #4a1820; color: var(--contro); }
.badge.neutral { background: var(--line); color: var(--text); }

.banner { border: 1px solid var(--accent); background: #2b2208; border-radius: 10px; padding: 12px; margin-bottom: 14px; }

.speech { border-left: 4px solid var(--line); padding: 4px 0 4px 14px; margin-bottom: 18px; }
.speech .who { font-weight: 700; margin-bottom: 4px; }
.speech .field { margin-bottom: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.speech .field b { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; display: block; }

.eval { background: #0b1126; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 14px; }
.eval ul { margin: 4px 0 6px; padding-left: 18px; }
.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.bar .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bar .track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); }
.warn { color: var(--contro); font-weight: 700; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.big { font-size: 34px; font-weight: 800; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #4a1820; border: 1px solid var(--contro); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 10; }

@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; }
  #globe { height: 380px; }
  .bars { grid-template-columns: 1fr; }
}

/* Scheda del sistema politico */
.politics { font-size: 14px; }
.politics p { margin: 8px 0; }
.pol-row { margin-bottom: 8px; }
.pol-row b { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.pol-now { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: #2b2208; border: 1px solid #6b5210; color: #ffd98a; font-size: 13px; }

/* Schema visivo "chi sceglie chi" */
.pol-brief { font-size: 16px; font-weight: 600; margin: 10px 0 4px; }
.pol-diagram { background: #0b1126; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 6px; margin: 8px 0; }
.pol-diagram svg { display: block; width: 100%; max-width: 440px; margin: 0 auto; }
.pol-edges line { stroke: #93a0c4; stroke-width: 1.6; }
#pol-arrow path { fill: #93a0c4; }
.pol-node circle { fill: #141d3a; stroke: #3a4775; stroke-width: 1.5; }
.pol-glyph { fill: none; stroke: #e8ecf8; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pol-node.hot circle { stroke: var(--accent); stroke-width: 3; fill: #2b2208; filter: drop-shadow(0 0 5px #ffb02088); }
.pol-node.hot .pol-glyph { stroke: var(--accent); }
.pol-node.dim { opacity: 0.45; }
.pol-title { fill: #e8ecf8; font-size: 11px; font-weight: 700; text-anchor: middle; }
.pol-sub { fill: #93a0c4; font-size: 9.5px; text-anchor: middle; }
.pol-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--muted); }
.pol-legend i { font-style: normal; }
.lg-ring { display: inline-block; width: 11px; height: 11px; border: 2.5px solid var(--accent); border-radius: 50%; vertical-align: -2px; }
.pol-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pol-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 13px; }
.pol-ico { fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pol-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pol-dot.ok { background: var(--pro); }
.pol-dot.mid { background: var(--accent); }
.pol-dot.no { background: var(--contro); }
.pol-more { margin-top: 8px; }
.pol-more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }

/* Spiegazioni a comparsa sotto etichette e indicatori */
.pol-tips { position: relative; }
.pol-tip { cursor: help; outline: none; }
.pol-tip:hover .pol-chip, .pol-tip:focus .pol-chip, .pol-tip:hover .badge, .pol-tip:focus .badge { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pol-tipbox {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: #0b1126; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 10px 28px #000a; font-size: 13.5px; font-weight: 400; line-height: 1.45; color: var(--text); cursor: default;
}
.pol-tipbox b { display: block; color: var(--accent); margin-bottom: 4px; }
.pol-tipbox p { margin: 0 0 6px; }
.pol-tipbox p:last-child { margin-bottom: 0; }
.pol-tip:hover .pol-tipbox, .pol-tip:focus .pol-tipbox { display: block; }
.pol-diagram { position: relative; }
.pol-node { cursor: help; outline: none; }
.pol-node:hover circle, .pol-node:focus circle { stroke: var(--accent); }

/* Chi viene eletto e perché */
.pol-parties { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.pol-parties h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.pol-why { font-weight: 600; margin: 0 0 8px; }
.pp-list { display: flex; flex-direction: column; gap: 4px; }
.pol-party { display: grid; grid-template-columns: 12px minmax(0, 1.2fr) minmax(60px, 1fr) 38px; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.pol-party:hover, .pol-party:focus { background: var(--panel-2); }
.pp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pp-name small { font-weight: 400; color: var(--muted); }
.pp-bar { height: 8px; background: #0b1126; border-radius: 4px; overflow: hidden; }
.pp-bar i { display: block; height: 100%; border-radius: 4px; }
.pp-pct { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.pol-area { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.a-sinistra { background: #e5484d; }
.a-centro-sinistra { background: #f29a9a; }
.a-centro { background: #cfd4df; }
.a-centro-destra { background: #8ab8f7; }
.a-destra { background: #3b82f6; }
.a-trasversale { background: #b48cf2; }
.pp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin: 6px 0 2px; }
.pp-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* Gioco online e avversario IA */
button.wide { width: 100%; padding: 12px; font-size: 16px; }
.search { text-align: center; padding: 28px 16px; }
.search .row { justify-content: center; }
.search-pulse { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--accent); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.ai-note { background: #1e1638; border: 1px solid #5b3fa8; color: #d9ccff; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.human-ready { animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 0 0 #ffb02000; } to { box-shadow: 0 0 14px 2px #ffb02066; } }
.pp-weight { display: flex; gap: 4px; }
.pp-weight i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); display: block; }
.pp-weight i.off { background: #0b1126; border: 1px solid var(--line); }

/* Moderatore e modalità rissa */
.mod-comment { background: #172042; border-left: 3px solid #5b8cff; border-radius: 6px; padding: 7px 10px; margin-bottom: 8px; font-size: 14.5px; }
.mod-comment.hot { background: #2a1410; border-left-color: #ff5d3a; }
.hook { background: #2b2208; border: 1px dashed var(--accent); border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; font-size: 14px; }
.hook button { margin-left: 6px; padding: 4px 10px; font-size: 13px; }
.mode-bar { font-size: 13.5px; color: var(--muted); margin: -4px 0 12px; }
.mode-bar.on { color: #ffb4a3; }
.rissa-banner { border-color: #ff5d3a; background: #2a1410; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.seg button { border: none; border-radius: 0; background: transparent; }
.seg button.on { background: var(--accent); color: #1a1200; font-weight: 700; }

/* Sfide */
.nav { display: flex; gap: 2px; margin-right: 8px; }
.nav .link { text-decoration: none; color: var(--text); font-size: 14px; }
.nav .link:hover { color: var(--accent); }
.count { background: var(--contro); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
button.mini { padding: 3px 9px; font-size: 12.5px; }
.challenge input[type="datetime-local"], .schedule input[type="datetime-local"], #ch-when { width: auto; color-scheme: dark; }
.schedule { margin-top: 6px; font-size: 14px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.stats-row b { color: var(--text); font-size: 18px; }
.board-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.board-row:last-child { border-bottom: none; }
@media (max-width: 860px) { .nav { flex-wrap: wrap; } }

/* Chat della stanza: colonna fissa a destra su tutta l'altezza, richiudibile */
#chat { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; z-index: 8; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 24px #0007; transition: width 0.25s ease; }
#chat-head { display: flex; align-items: center; gap: 8px; width: 100%; border: none; border-radius: 0; border-bottom: 1px solid var(--line); background: var(--panel-2); font-weight: 700; padding: 14px 14px; text-align: left; }
#chat-head .chat-title { flex: 1; }
#chat-head .chat-arrow { color: var(--muted); font-size: 18px; transition: transform 0.25s; }
#chat-unread:not(:empty) { background: var(--contro); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
#chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { background: var(--panel-2); border-radius: 10px; padding: 5px 9px; max-width: 88%; font-size: 14px; overflow-wrap: anywhere; }
.chat-msg.mine { align-self: flex-end; background: #2b2208; }
.chat-msg img.ygif-msg { max-width: 100%; max-height: 180px; border-radius: 8px; margin-top: 4px; }
#chat-picker { border-top: 1px solid var(--line); max-height: 45%; overflow-y: auto; padding: 8px; background: #0b1126; }
#chat-picker input { margin-bottom: 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { border: none; background: transparent; font-size: 20px; padding: 4px 0; }
.emoji-grid button:hover { background: var(--panel-2); }
#chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
#chat-form .chat-tool { flex: none; padding: 6px 8px; font-size: 13px; font-weight: 700; }
#chat-form button.primary { flex: none; }
/* chiusa: resta una linguetta verticale sul bordo destro */
body.with-chat:not(.chat-open) #chat { width: 46px; }
body.with-chat:not(.chat-open) #chat-body { display: none; }
body.with-chat:not(.chat-open) #chat-head { flex-direction: column; height: 100%; border-bottom: none; padding: 14px 0; align-items: center; }
body.with-chat:not(.chat-open) #chat-head .chat-title { writing-mode: vertical-rl; flex: 0; }
body.with-chat:not(.chat-open) #chat-head .chat-arrow { transform: rotate(180deg); }
/* il contenuto della pagina lascia spazio alla colonna */
body.chat-open { padding-right: 360px; }
body.with-chat:not(.chat-open) { padding-right: 46px; }
@media (max-width: 860px) {
  #chat { width: 100%; }
  body.chat-open, body.with-chat:not(.chat-open) { padding-right: 46px; }
}

/* Partite di gruppo */
.wide-link { width: 100%; margin-top: 8px; background: transparent; border-style: dashed; }
.youppy-box { border-color: #ffb02066; background: #ffb0200d; }
.wide-link .wl-title { display: block; white-space: nowrap; }
.wide-link .wl-sub { display: block; font-size: 0.86em; color: var(--muted); margin-top: 2px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
label.check input { width: auto; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.team { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.team.pro { border-top: 3px solid var(--pro); }
.team.contro { border-top: 3px solid var(--contro); }
.team h3 { margin: 0 0 6px; display: flex; justify-content: space-between; }
.member { padding: 3px 6px; border-radius: 6px; font-size: 14px; }
.member.speaking { background: #2b2208; outline: 1px solid var(--accent); font-weight: 700; }
@media (max-width: 860px) { .teams { grid-template-columns: 1fr; } }

/* l'attributo hidden deve vincere sul display della colonna */
#chat[hidden], #chat-picker[hidden] { display: none !important; }

/* Temi della lobby di gruppo */
.topic.voted { border-color: var(--accent); }
.tally { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--muted); }
.tally .t-pro { color: var(--pro); }
.tally .t-contro { color: var(--contro); }

/* Chat dell'attesa: barra al neon e messaggi sparsi sullo schermo */
#float-chat { position: fixed; right: 18px; bottom: 18px; z-index: 9; display: flex; align-items: center; gap: 6px;
  width: min(270px, calc(100% - 36px)); padding: 3px 3px 3px 12px; border-radius: 12px;
  background: rgba(8, 28, 58, 0.72); border: 1.5px solid #59c8ff;
  box-shadow: 0 0 10px #2fa8ff99, 0 0 24px #2fa8ff44, inset 0 0 12px #2fa8ff33; backdrop-filter: blur(4px); }
#float-chat input, #float-chat textarea { flex: 1; min-width: 0; border: none; background: transparent; padding: 5px 2px; font-size: 14px; color: #e8f6ff; box-shadow: none; outline: none; }
#float-chat textarea::placeholder { color: #8fc9ea; }
#float-chat button { flex: none; display: grid; place-items: center; width: 32px; height: 30px; padding: 0; border-radius: 9px; border: 1px solid #59c8ff; background: #1b6fae; color: #fff; font-weight: 700; box-shadow: 0 0 8px #2fa8ff88; }
#float-chat[hidden] { display: none !important; }
/* le GIF vengono da YouppyGif (lo mette l'hub di YouppyApps): senza, i pulsanti non si mostrano */
.no-gif [data-act="chat-gif"], .no-gif [data-act="float-gif"] { display: none !important; }
#float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.float-msg { position: absolute; max-width: min(320px, 70vw); padding: 6px 12px; border-radius: 12px; font-size: 15px; color: #e8f6ff; overflow-wrap: anywhere;
  background: rgba(8, 28, 58, 0.82); border: 1.5px solid #59c8ff; box-shadow: 0 0 10px #2fa8ff88, 0 0 22px #2fa8ff33;
  animation: float-msg 7s ease-out forwards; }
.float-msg.mine { border-color: var(--accent); box-shadow: 0 0 10px #ffb02088; }
.float-msg b { color: #8fd8ff; margin-right: 4px; }
.float-msg.mine b { color: var(--accent); }
.float-msg img { display: block; max-width: 180px; border-radius: 8px; margin-top: 4px; }
.float-msg .ygif-tolta { display: block; margin-top: 4px; }
@keyframes float-msg {
  0% { opacity: 0; transform: translateY(12px) scale(0.92); }
  8% { opacity: 1; transform: translateY(0) scale(1); }
  80% { opacity: 1; transform: translateY(-14px); }
  100% { opacity: 0; transform: translateY(-26px); }
}

@media (max-width: 900px) {
  .nav .lbl { display: none; }
  .nav .link { font-size: 18px; }
  #me { flex-wrap: wrap; justify-content: flex-end; }
}
body.with-float main { padding-bottom: 60px; }
.intro-running #float-chat, .intro-running #float-layer, .intro-running #chat { display: none !important; }
#float-chat .float-tool { width: auto; height: 28px; padding: 0 6px; background: transparent; border: none; box-shadow: none; font-size: 16px; color: #8fd8ff; }
#float-chat .float-tool.gif { font-size: 11px; font-weight: 800; border: 1px solid #59c8ff88; border-radius: 6px; height: 22px; }
#float-chat { padding-left: 4px; width: min(320px, calc(100% - 36px)); }
#float-picker { position: fixed; right: 18px; bottom: 66px; z-index: 10; width: min(320px, calc(100% - 36px)); max-height: 320px; overflow-y: auto; padding: 8px;
  border-radius: 12px; background: rgba(8, 28, 58, 0.95); border: 1.5px solid #59c8ff; box-shadow: 0 0 12px #2fa8ff77; }
#float-picker input { margin-bottom: 8px; }
#float-picker[hidden], .intro-running #float-picker { display: none !important; }
/* bottoni più piccoli nella barra d'attesa */
#float-chat .float-tool { height: 22px; padding: 0 3px; font-size: 13px; }
#float-chat .float-tool.gif { font-size: 9px; height: 16px; padding: 0 4px; border-radius: 4px; }
#float-chat button:not(.float-tool) { width: 26px; height: 24px; border-radius: 7px; }
#float-chat button:not(.float-tool) svg { width: 12px; height: 12px; }
#float-chat input, #float-chat textarea { padding: 4px 2px; font-size: 13.5px; }

/* Estrazione di chi parla: il nome compare al centro, sobrio, per qualche secondo */
#mega-slot { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: #05070fd9; backdrop-filter: blur(6px);
  animation: reveal-back var(--left, 2800ms) ease both; }
#mega-slot[hidden], .intro-running #mega-slot { display: none !important; }
@keyframes reveal-back { 0% { opacity: 0; } 10% { opacity: 1; } 86% { opacity: 1; } 100% { opacity: 0; } }
.reveal-card { text-align: center; cursor: pointer; }
.reveal-label { font-size: 14px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); animation: reveal-up 0.5s 0.1s ease both; }
.reveal-name { margin: 10px 0 14px; font-size: clamp(40px, 9vw, 96px); font-weight: 800; line-height: 1.05; letter-spacing: -1px; color: var(--text); overflow-wrap: anywhere; animation: reveal-up 0.6s 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.reveal-line { width: min(260px, 60vw); height: 3px; margin: 0 auto; border-radius: 2px; background: var(--pro); transform-origin: 50% 50%; animation: reveal-line 0.6s 0.5s ease both; }
.side-contro .reveal-line { background: var(--contro); }
.reveal-sub { margin-top: 14px; font-size: 16px; color: var(--muted); animation: reveal-up 0.5s 0.65s ease both; }
@keyframes reveal-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes reveal-line { from { transform: scaleX(0); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #mega-slot, .reveal-label, .reveal-name, .reveal-line, .reveal-sub { animation: none; } }

/* Sigla del partito accanto al nome */
.ptag { display: inline-block; min-width: 34px; margin-right: 7px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.4px; text-align: center; vertical-align: 1px; }
.ptag.ind { opacity: 0.6; }

/* barra in alto più alta: la gamba della g di «Argue» non viene più tagliata */
header { padding: 12px 20px 18px; min-height: 96px; }
.logo { padding-bottom: 8px; overflow: visible; }
.logo-argue, .logo-oss { line-height: 1.25; padding-bottom: 0; }

/* comandi a destra alla stessa altezza della scritta «Argue…oss» */
header { align-items: flex-end; }
#me { margin-top: 0; margin-bottom: 7px; align-self: flex-end; }

/* Battuta del moderatore e voti compatti */
.eval { padding: 8px 10px; }
.mod-bubble { display: flex; gap: 10px; align-items: flex-start; position: relative; margin-bottom: 8px; padding: 9px 12px; border-radius: 14px 14px 14px 4px;
  background: linear-gradient(120deg, #3a2a66, #25306b); border: 2px dashed #b48cf2; font-size: 15px; font-style: italic; transform: rotate(-0.4deg); }
.mod-bubble.hot { background: linear-gradient(120deg, #5a1c14, #3a1410); border-color: #ff7a4a; }
.mod-face { font-size: 22px; line-height: 1; font-style: normal; animation: mod-wobble 2.4s ease-in-out infinite; }
@keyframes mod-wobble { 50% { transform: rotate(-12deg) scale(1.08); } }
.mod-name { font-size: 11px; font-weight: 800; font-style: normal; letter-spacing: 0.6px; text-transform: uppercase; color: #cdb8ff; margin-bottom: 1px; }
.mod-bubble.hot .mod-name { color: #ffb4a3; }
.scores { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.score { display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.score b { font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; }
.pecca { font-size: 12.5px; color: #ffb4a3; }

/* Battuta del moderatore: riquadro dritto nei colori del sito (oro su blu scuro), niente viola */
.mod-bubble { transform: none; font-style: normal; align-items: center; background: #18213f; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 9px 12px; }
.mod-bubble.hot { background: #2a1410; border-color: #6b2a1c; border-left-color: #ff5d3a; }
.mod-face { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #2b2208; border: 1px solid var(--accent); font-size: 17px; }
.mod-bubble.hot .mod-face { background: #3a1410; border-color: #ff5d3a; }
.mod-name { color: var(--accent); }

/* Codice di accesso dell'account */
.access-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 4px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel-2); }
.access-box > div { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.access-box code { font-size: 18px; font-weight: 800; letter-spacing: 2px; color: var(--accent); }
.access-box input { flex: 1 1 160px; letter-spacing: 1px; }

/* Demo come ospite e finestra del codice di accesso */
.demo-chip { background: #3a2a66; border-color: #b48cf2; color: #e4d8ff; font-weight: 800; letter-spacing: 1px; }
.small-btn { padding: 5px 12px; font-size: 13px; }
.demo-box { border-color: #b48cf2; }
.modal-back { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: #05070fcc; backdrop-filter: blur(3px); }
.modal { width: min(460px, 100%); padding: 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 60px #000a; display: grid; gap: 12px; }
.modal h2 { margin: 0; }
.modal p { margin: 0; }
.ac-code { display: block; text-align: center; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px dashed var(--accent); font-size: 26px; font-weight: 800; letter-spacing: 3px; color: var(--accent); }
.modal .row button { flex: 1; }
.modal .check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.modal button[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Aree tematiche: riquadri fra cui scegliere prima dei temi */
.area-group { margin: 16px 0 8px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.area-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 12px 8px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; font-size: 14.5px; line-height: 1.2; text-align: center; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; }
.area-box:hover:not([disabled]) { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 6px 18px #0006, 0 0 0 1px var(--accent) inset; }
.area-icon { font-size: 30px; line-height: 1; }
.area-box.surprise { border-style: dashed; border-color: #b48cf2; }
.area-grid:has(.surprise) { margin-top: 16px; }
.area-pick { margin-bottom: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }

/* Tema del globo: riquadro unico nella home e finestra con le cartelle */
.theme-box { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: left; }
.theme-box:hover { border-color: var(--accent); }
.theme-icon { font-size: 30px; line-height: 1; }
.theme-text { display: flex; flex-direction: column; flex: 1; }
.theme-text b { font-size: 18px; }
.theme-change { color: var(--accent); font-weight: 700; font-size: 14px; }
.theme-window { max-height: min(86vh, 720px); overflow: auto; gap: 6px; }
.theme-window .folder { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; text-align: left; }
.theme-window .folder.open, .theme-window .folder:hover { border-color: var(--accent); }
.theme-window .folder.has { box-shadow: inset 3px 0 0 var(--accent); }
.folder-arrow { color: var(--muted); }
.folder-list { display: grid; gap: 2px; margin: 0 0 4px 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.folder-item { display: flex; justify-content: space-between; width: 100%; padding: 8px 10px; border: none; border-radius: 8px; background: transparent; text-align: left; font-size: 15px; }
.folder-item:hover { background: var(--panel-2); }
.folder-item.on { background: #ffb02022; color: var(--accent); font-weight: 700; }
.nation-score { margin: 6px 0 2px; font-size: 16px; }
.nation-score b { font-size: 22px; color: var(--accent); }

/* Riquadro della nazione selezionata sopra il globo: grandezza fissa, si scorre dentro */
.home { position: relative; }
#nation-card { position: absolute; left: 12px; top: 12px; z-index: 2; width: 270px; height: 330px; display: flex; flex-direction: column; border-radius: 12px; background: #0b1126f2; border: 1px solid var(--line); box-shadow: 0 10px 30px #0008; font-size: 14px; }
#nation-card[hidden] { display: none; }
.nc-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--line); }
.nc-head b { flex: 1; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-close { padding: 2px 8px; border: none; background: transparent; color: var(--muted); font-size: 15px; }
.nc-body { flex: 1; overflow-y: auto; padding: 10px 12px; }
.nc-score { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.nc-score b { font-size: 30px; line-height: 1; color: var(--accent); }
.nc-title { margin: 10px 0 4px; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.nc-party { margin-bottom: 8px; }
.nc-party-head { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.nc-user { display: flex; gap: 6px; padding: 2px 0 2px 22px; font-size: 13px; }
.nc-title + .nc-user, .nc-title ~ .nc-user { }
.nc-score ~ .nc-user { padding-left: 0; font-size: 14px; }
.nc-user b, .nc-party-head b { margin-left: auto; }
.nc-more { border: none; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: transparent; padding: 8px; color: var(--accent); font-weight: 700; font-size: 13px; }
@media (max-width: 900px) { #nation-card { width: min(250px, calc(100% - 24px)); height: 260px; } }
/* Pagina della classifica per tema */
.rank-table { overflow-x: auto; }
.rank-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rank-table th, .rank-table td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rank-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.rank-table tr.me { background: #ffb02018; }

/* Barre di scorrimento, nel sito e nei riquadri: solo la stanghetta smussata, arancione come
   «Gioca online»; niente binario bianco né frecce. Quella della pagina ha il fondo blu scuro del sito. */
html { color-scheme: dark; background: #0a1128; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background: #0a1128; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #ffc24d; border: 2px solid transparent; background-clip: padding-box; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: #ffb020 transparent; }
  html { scrollbar-color: #ffb020 #0a1128; }
}

/* Classifica mondiale: riquadro "di pregio", oro su nero, con un riflesso che scorre */
.world-rank { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; width: 100%; margin: 4px 0 14px; padding: 16px 18px; border-radius: 14px; text-align: left;
  border: 1.5px solid transparent;
  background: linear-gradient(135deg, #1a1408, #0b0d1c 45%, #1a1408) padding-box, linear-gradient(120deg, #8a6a1e, #ffe9a8 25%, #c9972b 50%, #fff3c4 75%, #8a6a1e) border-box;
  box-shadow: 0 0 0 1px #0008 inset, 0 10px 30px #000a, 0 0 26px #e2b64a26; transition: transform 0.15s, box-shadow 0.15s; }
.world-rank::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; transform: skewX(-20deg); background: linear-gradient(90deg, #0000, #ffe9a82e, #0000); animation: wr-shine 4.5s ease-in-out infinite; pointer-events: none; }
@keyframes wr-shine { 0%, 55% { left: -40%; } 100% { left: 120%; } }
.world-rank:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px #0008 inset, 0 14px 36px #000c, 0 0 36px #e2b64a55; }
.wr-medal { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; font-size: 26px;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e2b64a 45%, #8a6a1e); box-shadow: 0 0 0 2px #1a1408, 0 0 0 3px #e2b64a88, 0 6px 14px #0009; }
.wr-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.wr-title { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; line-height: 1.1;
  background: linear-gradient(180deg, #fff6d6, #e2b64a 55%, #a87a1c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wr-sub { font-size: 13px; letter-spacing: 0.5px; color: #cdbb8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-cta { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: 0.5px; color: #1a1408; background: linear-gradient(180deg, #ffe9a8, #d6a53a); box-shadow: 0 2px 8px #0008; }
.world-rank.on .wr-cta { background: transparent; color: #ffe9a8; box-shadow: inset 0 0 0 1px #e2b64a88; }
@media (max-width: 560px) { .wr-title { font-size: 16px; letter-spacing: 1.5px; } .wr-medal { width: 42px; height: 42px; font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .world-rank::after { animation: none; } }

/* Durante l'intro la barra di scorrimento della pagina sparisce. Lo spazio della barra resta
   riservato (scrollbar-gutter), così alla fine il logo non si sposta. */
html { scrollbar-gutter: stable; }
html.intro-running { overflow: hidden; }

/* Segnalazione sul moderatore, in fondo al dibattito concluso */
.feedback-box { margin-top: 18px; border-style: dashed; }
.feedback-box textarea { width: 100%; resize: vertical; }

/* Barra in alto: a sinistra navigazione ed etichetta DEMO, a destra pulsante e nome con l'icona del profilo */
.me-left, .me-right { display: flex; align-items: center; gap: 10px; }
.me-right { flex-direction: row-reverse; }
.me-name { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: none; background: transparent; color: var(--text); font-size: inherit; }
.me-avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; }
/* Schermo stretto: logo da solo in alto al centro (toccandolo si torna al globo); sotto, una riga sola:
   a sinistra chi sei (nome, percentuale, partito), a destra le icone e «Profilo» o «Crea account». */
@media (max-width: 700px) {
  header { flex-direction: column; align-items: stretch; padding: 10px 14px 12px; min-height: 0; }
  header .logo { align-self: center; }
  #me { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px 12px; width: 100%; margin: 10px 0 0; align-self: stretch; }
  .me-right { display: contents; }
  .me-name { grid-column: 1; grid-row: 1; justify-self: start; min-width: 0; flex-wrap: wrap; row-gap: 4px; }
  .me-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
  .me-left { grid-column: 2; grid-row: 1; justify-self: end; }
  .me-left .nav { margin-right: 0; }
  .me-right > button:not(.me-name) { grid-column: 3; grid-row: 1; justify-self: end; }
}
}

/* Ospite: icona del profilo dentro il riquadro DEMO, nome appena a destra */
button.demo-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.demo-avatar { font-size: 14px; line-height: 1; }
.me-guest { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .me-left:has(.me-guest) { grid-column: 1 / 3; justify-self: start; min-width: 0; flex-wrap: nowrap; }
}

/* Area scelta a voti: sotto ogni riquadro quante persone l'hanno scelta; in fondo l'avvio */
.area-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.area-box.voted { border-color: #5b8cff; }
.area-box.voted .area-count { color: #9db8ff; }
.area-box.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #ffb02012; }
.area-box.mine .area-count { color: var(--accent); }
.area-start { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.area-start p { margin: 0 0 8px; }
/* Telefono: con la tastiera aperta la chat sta appena sopra, a tutta larghezza */
#float-chat { bottom: calc(18px + var(--kb, 0px)); }
#float-picker { bottom: calc(66px + var(--kb, 0px)); }
@media (max-width: 700px) {
  .kb-open #float-chat { left: 8px; right: 8px; width: auto; bottom: calc(6px + var(--kb, 0px)); }
  .kb-open #float-picker { left: 8px; right: 8px; width: auto; bottom: calc(54px + var(--kb, 0px)); }
}
/* Telefono: aree su due colonne, così si arriva prima al pulsante «Avvia» in fondo */
@media (max-width: 700px) {
  .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .area-box { min-height: 86px; padding: 10px 6px; font-size: 13.5px; gap: 5px; }
  .area-icon { font-size: 26px; }
  body.with-float main { padding-bottom: 84px; }
}

#float-chat textarea { resize: none; height: 28px; min-height: 0; max-height: 28px; width: auto; margin: 0; line-height: 20px; white-space: nowrap; overflow: hidden; font-family: inherit; }

/* Difficoltà dell'avversario IA: etichetta a sinistra, livelli selezionabili a destra */
.level-bar { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.level-title { flex: none; font-weight: 800; padding-top: 5px; }
.level-row { display: flex; flex-wrap: wrap; gap: 6px; }
.level { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.level:hover { border-color: var(--accent); }
.level.on { background: var(--accent); border-color: var(--accent); color: #1a1408; }

/* Difficoltà: si vede solo il livello scelto; al clic l'elenco degli altri si apre sotto */
.level-bar { align-items: center; }
.level-title { padding-top: 0; }
.level-menu { position: relative; }
.level-arrow { margin-left: 4px; font-size: 11px; }
.level-list { position: absolute; left: 0; top: calc(100% + 6px); z-index: 8; display: grid; gap: 2px; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 30px #000a; }
.level-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: 8px; background: transparent; text-align: left; font-size: 14.5px; }
.level-item:hover { background: var(--panel-2); color: var(--accent); }
.level.locked { cursor: default; opacity: 0.9; }

/* Tipo di argomentazione: riquadro nella pagina di scelta dell'area e finestra con la struttura in piccolo */
.format-box { margin: 12px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff05; }
.format-title { font-weight: 800; margin-bottom: 8px; }
.format-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.format-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); text-align: left; }
.format-opt > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.format-opt:hover { border-color: var(--accent); }
.format-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #ffb02012; }
.format-icon { font-size: 24px; }
.format-check { color: var(--accent); font-weight: 800; }
.mini-form { padding: 10px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 6px; }
.mini-head { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.mini-field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.mini-field i { opacity: 0.7; }
.mini-field div { height: 22px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }

.room-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }

/* Finestra dell'organizzatore che lascia la stanza */
.leave-opt { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.leave-opt.danger { border-color: #ff5d6c66; }
.leave-opt.danger button { border-color: #ff5d6c; color: #ffb4a3; }

/* Attività e giochi */
.activity-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.activity-box { min-height: 132px; }
.activity-desc { font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.3; }
.game-room { max-width: 1000px; }
.game-main { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; align-items: start; }
.game-timer { height: 8px; margin: 10px 0 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.game-timer i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); }
.game-timer i.run { width: 100%; animation: game-timer var(--full) linear forwards; animation-delay: calc(var(--left) - var(--full)); }
@keyframes game-timer { to { width: 0; } }
.game-prompt { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.game-question { font-size: 21px; font-weight: 800; line-height: 1.25; }
.game-flag { width: 150px; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 6px 18px #0008; flex: none; }
#game-globe { height: 380px; margin-bottom: 12px; border-radius: 12px; overflow: hidden; cursor: grab; }
#game-globe[hidden] { display: none; }
.game-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-opt { padding: 14px 12px; border-radius: 12px; background: var(--panel-2); border: 2px solid var(--line); font-size: 16px; font-weight: 600; text-align: center; min-height: 58px; }
.game-opt:hover:not([disabled]) { border-color: var(--accent); }
.game-opt[disabled] { cursor: default; opacity: 0.85; }
.game-opt.picked { border-color: var(--accent); background: #ffb02018; }
.game-opt.right { border-color: #2ecc71; background: #2ecc7122; opacity: 1; }
.game-opt.wrong { border-color: #e5484d; background: #e5484d22; opacity: 1; }
.game-options.flags .game-opt { padding: 8px; }
.game-options.flags img { width: 100%; max-width: 170px; border-radius: 6px; display: block; margin: 0 auto; }
.game-reveal { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.game-explain { text-align: center; font-weight: 600; line-height: 1.5; margin: 4px auto 10px; max-width: 46ch; text-wrap: pretty; }
.game-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.game-rank li.me, .game-final li.me { background: #ffb02018; border-radius: 8px; }
.game-rank li { padding-left: 12px; padding-right: 12px; }
.game-final li { font-size: 18px; padding: 8px; }
.game-final .medal { width: 34px; font-size: 22px; }
#game-text { width: 100%; min-height: 0; }
@media (max-width: 800px) {
  .game-main { grid-template-columns: 1fr; }
  #game-globe { height: 300px; }
  .game-flag { width: 110px; }
  .game-question { font-size: 18px; }
}
/* la chat resta anche durante i giochi: sotto la schermata c'è spazio per scorrere, così non copre le risposte */
.game-room { padding-bottom: 70px; }
#game-globe { height: 320px; }
.game-options.flags img { max-width: 130px; }
@media (max-width: 800px) { #game-globe { height: 260px; } .game-options.flags img { max-width: 110px; } }
#game-globe { height: 280px; }
@media (max-width: 800px) { #game-globe { height: 240px; } }

/* Giochi: scelta del modo di risposta e campo per scrivere il nome */
.input-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.input-pick .seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.input-pick .seg button { border: none; border-radius: 0; background: transparent; padding: 7px 12px; font-size: 14px; }
.input-pick .seg button.on { background: var(--accent); color: #1a1408; font-weight: 700; }
.game-write { margin-top: 6px; }
/* la scheda del gioco non deve allargarsi oltre lo schermo */
.game-stage { min-width: 0; }
.game-write input { min-width: 0; }
@media (max-width: 800px) { .game-main { grid-template-columns: minmax(0, 1fr); } }
.game-flag.after { display: block; margin-top: 10px; }
.activity-modes { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.area-grid + .input-pick { margin: 10px 0 0; padding: 10px; border: 1px dashed var(--accent); border-radius: 12px; }

.game-paused { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: #ffb02018; border: 1px solid var(--accent); color: var(--accent); font-weight: 800; text-align: center; }

/* Cartina di una nazione con i confini delle zone */
#game-map { margin-bottom: 12px; text-align: center; }
#game-map[hidden] { display: none; }
#game-map svg { width: 100%; max-height: 420px; }
#game-map path { fill: #1c2748; stroke: #7f95c8; stroke-width: 0.8; vector-effect: non-scaling-stroke; transition: fill 0.15s; }
#game-map.clickable path { cursor: pointer; }
#game-map.clickable path:hover { fill: #33437a; }
#game-map path.lit, #game-map path.picked { fill: #ffb020; }
#game-map path.right { fill: #2ecc71; }
#game-map path.wrong { fill: #e5484d; }
.input-pick .seg button { border-right: 1px solid var(--line); }
@media (max-width: 800px) { #game-map svg { max-height: 340px; } }

/* Ingranaggi e finestra del consumo dell'IA (solo per le prove) */
.gear { padding: 2px 4px; border: none; background: transparent; font-size: 18px; line-height: 1; opacity: 0.75; }
.gear:hover { opacity: 1; }
/* Impostazioni: pagina intera al posto della schermata principale, non una finestra sopra */
.usage-page { position: fixed; inset: 0; z-index: 40; overflow-y: auto; overscroll-behavior: contain; background: radial-gradient(1200px 700px at 30% 20%, #101a3a, var(--bg)); background-color: var(--bg); }
body.page-open { overflow: hidden; }
.usage-window { width: min(760px, 100%); margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 32px; display: grid; gap: 14px; }
.usage-window p { margin: 0; }
.usage-head { display: flex; justify-content: space-between; align-items: center; }
.usage-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.usage-total div { padding: 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); text-align: center; }
.usage-total b { display: block; font-size: 20px; color: var(--accent); }
.usage-total span { font-size: 12px; color: var(--muted); }
.usage-day td { font-weight: 800; color: var(--muted); padding-top: 12px; }
.usage-sum td { font-weight: 700; }
/* sul telefono la tabella dei consumi sta nella finestra: intestazioni su due righe, celle più strette */
@media (max-width: 560px) {
  .usage-window .rank-table table { font-size: 12.5px; }
  .usage-window .rank-table th, .usage-window .rank-table td { padding: 6px 4px; }
  .usage-window .rank-table th, .usage-window .rank-table td:first-child { white-space: normal; }
  .usage-window .rank-table th { font-size: 10.5px; letter-spacing: 0; }
  .usage-window .rank-table td:first-child { max-width: 88px; }
}
@media (max-width: 700px) { .me-right > .gear { grid-column: 3; grid-row: 1; justify-self: end; } }
/* «Come si risponde»: titolo sopra e opzioni sotto, anche sugli schermi larghi */
.input-pick { flex-direction: column; align-items: flex-start; }

/* Cartine: una sola casella che apre l'elenco in una finestra */
.map-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: min(320px, 100%); padding: 9px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); text-align: left; font-weight: 600; }
.map-pick:hover { border-color: var(--accent); }
.map-list { display: grid; gap: 4px; }
.map-list .folder-item { align-items: center; padding: 11px 12px; border: 1px solid var(--line); background: var(--panel-2); }
/* «Come si risponde»: ogni opzione è un pulsante a sé, così anche andando a capo resta chiaro */
.input-pick .seg { display: flex; flex-wrap: wrap; gap: 6px; border: none; border-radius: 0; overflow: visible; }
.input-pick .seg button { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); padding: 8px 12px; }
.input-pick .seg button:hover { border-color: var(--accent); }
.input-pick .seg button.on { border-color: var(--accent); }
.area-grid + .input-pick + .input-pick { margin-top: 8px; padding: 10px; border: 1px dashed var(--accent); border-radius: 12px; }

/* finestra delle scelte del gioco: una riga di spiegazione sotto ogni voce */
.pick-hint { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; line-height: 1.35; color: var(--muted); }
.map-list .folder-item > span:last-child { flex: none; margin-left: 10px; white-space: nowrap; }

/* finestra della nazione interpretata da ArgueBot */
.bc-list { max-height: min(46vh, 380px); overflow-y: auto; margin-top: 8px; }
#bc-rows { display: grid; gap: 4px; }
#bc-search { width: 100%; }

.mod-voice { margin: 12px 0 0; }

/* finestra «quale nazione interpreta»: globo da toccare */
.role-modal { max-height: calc(100dvh - 24px); overflow-y: auto; gap: 8px; padding: 18px; }
.role-modal h2 { font-size: 18px; margin: 0; }
.role-modal > p { margin: 0; }
#role-globe { height: min(34dvh, 280px); margin: 0; border-radius: 14px; background: radial-gradient(circle at 50% 45%, #14204a 0, transparent 70%); overflow: hidden; cursor: grab; }
.role-picked { text-align: center; }
.role-found { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.role-found .chip { cursor: pointer; border: 1px solid var(--line); }
.role-found .chip:hover { border-color: var(--accent); }
.role-actions { margin-top: 4px; gap: 8px; }

/* nessuna finestra esce dallo schermo: se è più alta, scorre */
.modal { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }

/* schermata d'attesa mentre l'IA prepara domande o temi: onde che scorrono sul fondo del riquadro */
.loading-screen { position: relative; overflow: hidden; display: grid; justify-items: center; align-content: start; gap: 8px; min-height: 400px; padding: 28px 20px 170px; text-align: center; background: linear-gradient(180deg, var(--panel) 0%, #0d1836 100%); }
.loading-screen > :not(.loading-waves) { position: relative; z-index: 1; }
.loading-screen h2, .loading-screen p { margin: 0; }
.loading-icon { font-size: 48px; line-height: 1; }
.loading-tip { margin-top: 10px !important; padding: 8px 12px; border-radius: 10px; background: #0a1330cc; }
.loading-waves { position: absolute; left: 0; bottom: 14px; width: 100%; height: 150px; pointer-events: none; }

/* tempi nei risultati di una domanda: il più veloce in verde, il distacco degli altri in rosso */
.time-best { color: #2ecc71; font-weight: 700; }
.time-gap { color: #e5484d; font-weight: 700; }

.game-reveal > .primary.wide, .game-reveal > p.muted { margin-top: 12px; }

/* ritmo della domanda: prima si legge, poi le risposte compaiono una alla volta */
.game-reading { display: grid; gap: 8px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line); text-align: center; color: var(--muted); }
.game-reading i { display: block; height: 4px; border-radius: 99px; background: var(--accent); transform-origin: left; animation: game-reading linear both; }
@keyframes game-reading { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.game-opt { position: relative; }
.opt-letter { position: absolute; left: 8px; top: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #0a1330; border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--accent); }
.game-opt.staged { animation: opt-in 0.35s ease-out both; }
/* finché non è comparsa non si vede e non si può toccare */
@keyframes opt-in { from { opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.96); } to { opacity: 1; visibility: visible; transform: none; } }
@media (prefers-reduced-motion: reduce) { .game-opt.staged { animation-duration: 1ms; } }
.game-options:not(.flags) .game-opt:has(.opt-letter) { padding-left: 38px; padding-right: 14px; }

/* dettagli dell'area: sport, generi musicali */
.focus-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.focus-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 15px; }
.focus-chip:hover { border-color: var(--accent); }
.focus-chip.on { background: var(--accent); border-color: var(--accent); color: #1a1408; font-weight: 700; }

/* anagrammi: le lettere mescolate */
.game-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.game-letters span { display: grid; place-items: center; width: 38px; height: 44px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--accent); font-size: 22px; font-weight: 800; color: var(--accent); }
/* sudoku */
.sdk { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, calc(var(--n) * 52px)); margin: 4px auto 12px; border: 2px solid var(--accent); border-radius: 10px; overflow: hidden; background: var(--line); gap: 1px; }
.sdk-cell { display: grid; place-items: center; aspect-ratio: 1; width: 100%; min-width: 0; padding: 0; border: none; border-radius: 0; background: var(--panel-2); text-align: center; font-size: clamp(15px, 4.4vw, 22px); font-weight: 700; color: var(--text, #e8ecf8); }
.sdk-cell.given { background: #0a1330; color: var(--muted); }
input.sdk-cell { color: var(--accent); caret-color: var(--accent); }
input.sdk-cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #ffb02014; }
.sdk-cell.fixed { color: var(--accent); }
.sdk-cell.edge-r { box-shadow: 2px 0 0 var(--accent); z-index: 1; }
.sdk-cell.edge-b { box-shadow: 0 2px 0 var(--accent); z-index: 1; }
.sdk-cell.edge-r.edge-b { box-shadow: 2px 0 0 var(--accent), 0 2px 0 var(--accent), 2px 2px 0 var(--accent); }
/* parola nascosta */
.wd { display: grid; gap: 6px; justify-content: center; margin: 4px 0 12px; }
.wd-row { display: grid; grid-template-columns: repeat(5, 46px); gap: 6px; }
.wd-tile { display: grid; place-items: center; height: 46px; border-radius: 8px; border: 2px solid var(--line); font-size: 22px; font-weight: 800; }
.wd-tile.g { background: #2ecc71; border-color: #2ecc71; color: #06240f; }
.wd-tile.y { background: #f5c542; border-color: #f5c542; color: #2b2000; }
.wd-tile.x { background: #2a3350; border-color: #2a3350; color: #c9d2ee; }

/* attese dentro le stanze: le stesse onde della schermata prima del gioco, alla stessa altezza */
.wait-panel { position: relative; overflow: hidden; padding-top: 18px !important; padding-bottom: 172px !important; text-align: center; }
.wait-panel.tall { padding-top: 28px !important; }
canvas.loading-waves.strip { left: 0; bottom: 10px; width: 100%; height: 150px; }
div.wait-panel:not(.panel):not(.eval) { padding-left: 12px; padding-right: 12px; border-radius: 12px; border: 1px dashed var(--line); margin: 8px 0; }
/* globo nella pagina «Quale musica?» */
#focus-globe-slot { height: min(42dvh, 340px); margin: 4px 0; border-radius: 14px; background: radial-gradient(circle at 50% 45%, #14204a 0, transparent 70%); overflow: hidden; cursor: grab; }
#focus-globe { width: 100%; height: 100%; }
#fz-search { width: 100%; }

/* impiccato */
.hm-scene { display: grid; justify-items: center; margin: 0 auto 10px; }
.hm-video { width: min(100%, 420px); aspect-ratio: 1; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #1b2a5c 0, #0a1330 75%); }
.hm-caption { margin: 6px 0 0; text-align: center; }
.hm-fallback { display: grid; justify-items: center; gap: 6px; width: min(100%, 420px); padding: 22px 14px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #1b2a5c 0, #0a1330 75%); text-align: center; }
.hm-fallback span { font-size: 64px; line-height: 1; }
.hm-fallback p { margin: 0; }
.hm-word { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0; }
.hm-word span { display: grid; place-items: center; width: 34px; height: 42px; border-bottom: 3px solid var(--line); font-size: 24px; font-weight: 800; }
.hm-word span.on { border-color: var(--accent); color: var(--accent); }
.hm-errors { margin: 4px 0 10px; text-align: center; }
.hm-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.hm-key { padding: 10px 0; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 16px; font-weight: 700; }
.hm-key:hover:not([disabled]) { border-color: var(--accent); }
.hm-key.good { background: #2ecc7133; border-color: #2ecc71; color: #2ecc71; opacity: 1; }
.hm-key.bad { background: #e5484d22; border-color: #e5484d; color: #e5484d; opacity: 0.8; }
