/* ==========================================================================
   Noi Due — stili dell'app sopra il design system Rediscov.
   I token --rd-* vengono da css/rediscov.css (fonte unica: non ridefinirli).
   Qui si mappano i token semantici dell'app e si definiscono i componenti.
   Leggere DESIGN.md prima di modificare.
   ========================================================================== */

:root {
  /* superfici e testo */
  --paper: var(--rd-off-white);
  --card: var(--rd-white);
  --ink: var(--rd-black);
  --ink-soft: var(--rd-gray-dark);
  --ink-subtle: var(--rd-gray-mid);
  --line: var(--rd-border);
  --line-strong: var(--rd-black);

  /* accento: verde profondo lavora, verde brillante è atmosfera */
  --accent: var(--rd-green-deep);
  --accent-hover: #086653;
  --accent-hi: var(--rd-green-bright);
  --on-accent: var(--rd-white);
  --glow: var(--rd-glow-green);
  --match-bg: rgba(11, 124, 100, 0.08);

  /* giocatori: una ramp monocromatica, nessuna terza tinta */
  --p1: var(--rd-green-deep);
  --p2: var(--rd-gray-dark);

  /* gatto: neutri del brand, guance come unica eccezione calda */
  --cat: #E8E8E5;
  --cat-ink: var(--rd-black);
  --blush: #E9B8AE;
  --heart: var(--rd-green-bright);

  --shadow: var(--rd-shadow-md);
  --shadow-soft: var(--rd-shadow-sm);

  --display: var(--rd-font-display);
  --sans: var(--rd-font-body);

  --t-micro: var(--rd-dur-fast);
  --t-norm: var(--rd-dur-base);
  --t-reveal: var(--rd-dur-slow);
  --ease: var(--rd-ease);

  color-scheme: light;
}

/* mondo scuro: quasi nero con il bagliore verde in alto, bordi a velo bianco */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: var(--rd-black);
    --card: #262624;
    --ink: var(--rd-white);
    --ink-soft: rgba(255, 255, 255, 0.72);
    --ink-subtle: var(--rd-gray-mid);
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.6);
    --accent-hover: #0E9478;
    --match-bg: rgba(21, 235, 188, 0.10);
    --p2: var(--rd-gray-mid);
    --cat: #3A3A37;
    --cat-ink: #F4F4F2;
    --shadow: none;
    --shadow-soft: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: var(--rd-black);
  --card: #262624;
  --ink: var(--rd-white);
  --ink-soft: rgba(255, 255, 255, 0.72);
  --ink-subtle: var(--rd-gray-mid);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.6);
  --accent-hover: #0E9478;
  --match-bg: rgba(21, 235, 188, 0.10);
  --p2: var(--rd-gray-mid);
  --cat: #3A3A37;
  --cat-ink: #F4F4F2;
  --shadow: none;
  --shadow-soft: none;
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: var(--rd-w-light);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background: var(--rd-gradient-atmos); background-attachment: fixed; }
}
:root[data-theme="dark"] body { background: var(--rd-gradient-atmos); background-attachment: fixed; }

h1, h2, h3, .q { font-family: var(--display); margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-weight: var(--rd-w-bold); font-size: 32px; line-height: 1.02; letter-spacing: -0.018em; }
h2 { font-weight: var(--rd-w-bold); font-size: 24px; line-height: 1.1; letter-spacing: -0.012em; }
h3 { font-weight: var(--rd-w-medium); font-size: 20px; line-height: 1.2; letter-spacing: -0.005em; }
p { margin: 0 0 .75em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
strong { font-weight: var(--rd-w-medium); }
.q { font-weight: var(--rd-w-medium); font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 20px; }
.meta {
  font-family: var(--display); font-weight: var(--rd-w-medium);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-subtle);
}
.soft { color: var(--ink-soft); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: var(--glow); border-radius: 8px; }

@media (min-width: 720px) {
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }
  .q { font-size: 32px; }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px 4px;
  background: linear-gradient(var(--paper) 70%, transparent);
}
.cat-wrap { height: 96px; transition: height var(--t-norm) var(--ease); }
.cat-wrap.is-small { height: 56px; }
@media (min-width: 720px) { .cat-wrap { height: 128px; } }

.app {
  width: 100%;
  max-width: 36em;
  margin: 0 auto;
  padding: 8px 16px 32px;
  flex: 1;
}
@media (min-width: 720px) { .app { padding: 12px 24px 48px; } }

.foot { display: flex; justify-content: center; padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); opacity: .55; }
.foot-logo { height: 22px; width: auto; }
.dark-only { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .light-only { display: none; }
  :root:not([data-theme="light"]) .dark-only { display: block; }
}
:root[data-theme="dark"] .light-only { display: none; }
:root[data-theme="dark"] .dark-only { display: block; }

.screen { animation: screen-in var(--t-norm) var(--ease) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rd-radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  overflow: hidden;
}
@media (min-width: 720px) { .card { padding: 28px; } }
.card.by-player::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--player, var(--accent));
}

.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Controlli
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border-radius: var(--rd-radius-pill); border: 1px solid transparent;
  font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.005em; line-height: 1;
  color: var(--on-accent); background: var(--accent); cursor: pointer;
  transition: background var(--t-norm) var(--ease), transform 80ms var(--ease), opacity var(--t-micro);
  width: 100%;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--glow), 0 0 0 2px var(--accent); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.secondary { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn.secondary:hover { background: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); min-height: 44px; }
.btn.ghost:hover { background: var(--paper); }
.btn.small { min-height: 36px; padding: 8px 14px; font-size: 13px; width: auto; white-space: nowrap; flex: none; }
.btn.good { background: var(--accent); }
@media (min-width: 720px) { .btn { width: auto; min-width: 160px; } .btn.block { width: 100%; } }

.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
@media (min-width: 720px) { .btn-row { flex-direction: row; justify-content: flex-end; } }

.field { display: block; margin-bottom: 20px; }
.field .label {
  display: block; font-family: var(--display); font-weight: var(--rd-w-medium);
  font-size: 17px; letter-spacing: -0.005em; line-height: 1.3; margin-bottom: 4px;
}
.field .hint { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--rd-radius-md);
  background: var(--card); color: var(--ink);
  font-family: var(--sans); font-weight: var(--rd-w-light); font-size: 16px; line-height: 1.4;
  transition: border-color var(--t-norm) var(--ease), box-shadow var(--t-norm) var(--ease);
}
.input::placeholder { color: var(--ink-subtle); }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: var(--glow); outline: none; }
.field.missing .input { border-color: var(--accent); }
.field.missing .label::after {
  content: " · qui manca qualcosa"; font-family: var(--sans); font-weight: var(--rd-w-light);
  font-size: 13px; letter-spacing: 0; color: var(--accent);
}

/* scelte a chip (choice) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: var(--rd-radius-pill);
  background: var(--card); color: var(--ink); cursor: pointer;
  font-family: var(--display); font-weight: var(--rd-w-medium); font-size: 14px; letter-spacing: 0.02em;
  transition: background var(--t-norm) var(--ease), border-color var(--t-norm) var(--ease), color var(--t-norm) var(--ease);
}
.chip:hover { background: var(--paper); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.tiny {
  min-height: 24px; padding: 4px 10px; font-size: 11px; letter-spacing: 0.04em;
  background: var(--paper); color: var(--ink-soft); cursor: default;
}

/* scelte binarie a carte grandi */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .choice-grid { grid-template-columns: 1fr; } }
.choice {
  min-height: 120px; padding: 20px 16px;
  border: 1px solid var(--line); border-radius: var(--rd-radius-lg);
  background: var(--card); color: var(--ink); cursor: pointer;
  font-family: var(--display); font-weight: var(--rd-w-medium); font-size: 20px; line-height: 1.2; text-align: center;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--t-norm) var(--ease), box-shadow var(--t-norm) var(--ease), transform 80ms var(--ease);
}
.choice:active { transform: scale(.98); }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--glow); }

/* --------------------------------------------------------------------------
   Componenti
   -------------------------------------------------------------------------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--player, var(--accent)); color: #fff;
  font-family: var(--display); font-weight: 600; font-size: 15px; text-transform: uppercase;
}
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.avatar.xs { width: 20px; height: 20px; font-size: 10px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 4px 0 12px; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width var(--t-reveal) var(--ease); }

.answer-card {
  border: 1px solid var(--line); border-radius: var(--rd-radius-md); padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--paper);
  transition: border-color var(--t-norm) var(--ease), background var(--t-norm) var(--ease);
}
.answer-card.match { border-color: var(--accent); background: var(--match-bg); }
.answer-card .who { font-size: 12px; color: var(--ink-subtle); margin-bottom: 2px; }
.answer-card .what { font-family: var(--display); font-weight: var(--rd-w-medium); font-size: 18px; line-height: 1.25; }

.reveal { animation: reveal var(--t-reveal) var(--ease) both; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.qlist { list-style: none; margin: 0; padding: 0; }
.qlist li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.qlist li:first-child { border-top: 0; }
.qlist .text { flex: 1; font-family: var(--display); font-weight: var(--rd-w-medium); font-size: 16px; line-height: 1.3; }
.qlist .del { background: none; border: 0; color: var(--ink-subtle); cursor: pointer; font-size: 20px; min-width: 44px; min-height: 44px; border-radius: 50%; }
.qlist .del:hover { background: var(--paper); color: var(--ink); }

.level {
  display: flex; gap: 14px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.level:hover { text-decoration: none; }
.level:first-child { border-top: 0; }
.level .n {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: var(--rd-w-medium); font-size: 14px;
}
.level.done .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.level.locked { opacity: .5; }
.level h3 { font-size: 18px; }
.level .meta { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-weight: var(--rd-w-light); font-size: 14px; color: var(--ink-soft); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--rd-black); color: var(--rd-white);
  padding: 12px 18px; border-radius: var(--rd-radius-md); font-size: 14px;
  box-shadow: var(--rd-shadow-lg); z-index: 30; max-width: calc(100% - 32px);
  animation: screen-in var(--t-norm) var(--ease) both;
}

/* barra indietro */
.backbar {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 12px 8px 6px; margin: 0 0 8px -6px;
  border: 0; border-radius: var(--rd-radius-pill); background: transparent; color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background var(--t-norm) var(--ease);
}
.backbar:hover { background: var(--card); }

/* attesa dell'altra persona */
.pulse { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.btn-row .btn.secondary[href] { text-decoration: none; }

/* --------------------------------------------------------------------------
   Il gatto
   -------------------------------------------------------------------------- */
.cat { height: 100%; width: auto; overflow: visible; }
.cat path, .cat line, .cat circle, .cat ellipse, .cat rect {
  stroke: var(--cat-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  fill: none;
  transition: transform var(--t-norm) var(--ease), opacity var(--t-norm), d var(--t-norm) var(--ease);
}
.cat #torso, .cat #face, .cat #ear-l, .cat #ear-r,
.cat #haunch-l, .cat #haunch-r, .cat #paw-l, .cat #paw-r { fill: var(--cat); }
.cat #ear-l-in, .cat #ear-r-in { fill: var(--blush); stroke: none; opacity: .7; }
.cat #brow, .cat .toes, .cat #chest { stroke-width: 2; opacity: .55; }
.cat #whiskers path { stroke-width: 2; }
.cat #nose { fill: var(--cat-ink); stroke-width: 1; }
.cat .eyeball { fill: var(--cat-ink); stroke: none; }
.cat .shine { fill: var(--cat); stroke: none; }
.cat .lid { opacity: 0; }
.cat #blush ellipse { fill: var(--blush); stroke: none; opacity: 0; }
.cat #mouth-open { fill: var(--cat-ink); stroke: none; opacity: 0; transform-origin: 80px 86px; transform: scale(.3); }
.cat #hearts .heart { fill: var(--heart); stroke: none; opacity: 0; }

/* punti di rotazione (tutti in coordinate del viewBox) */
.cat #head   { transform-origin: 80px 96px; }
.cat #ear-l  { transform-origin: 60px 50px; }
.cat #ear-r  { transform-origin: 100px 50px; }
.cat #ear-l-in { transform-origin: 60px 50px; }
.cat #ear-r-in { transform-origin: 100px 50px; }
.cat #tail   { transform-origin: 116px 136px; }
.cat #body   { transform-origin: 80px 150px; }
.cat #paws   { transform-origin: 80px 150px; }
.cat .eye    { transition: transform var(--t-norm) var(--ease); }
.cat .eyeball, .cat .lid, .cat .shine { transform-box: fill-box; transform-origin: center; transition: transform var(--t-norm) var(--ease), opacity var(--t-micro); }
.cat #whiskers { transform-origin: 80px 78px; }

/* -- idle: respiro e coda ------------------------------------------------ */
.cat.is-idle #body { animation: breathe 3s ease-in-out infinite; }
.cat.is-idle #head { animation: breathe-head 3s ease-in-out infinite; }
.cat.is-idle #tail { animation: tail-sway 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scaleY(1.02); } }
@keyframes breathe-head { 50% { transform: translateY(-1.5px); } }
@keyframes tail-sway { 50% { transform: rotate(-8deg); } }

/* battito di ciglia: classe momentanea aggiunta da cat.js */
.cat.blink .eyeball, .cat.blink .shine { transform: scaleY(.1); transition-duration: 80ms; }

/* -- curious ------------------------------------------------------------- */
.cat.is-curious #head { transform: rotate(-8deg); }
.cat.is-curious #ear-r, .cat.is-curious #ear-r-in { transform: rotate(16deg); }
.cat.is-curious .eyeball { transform: scale(1.12) translateY(1px); }
.cat.is-curious #tail { transform: rotate(-18deg); }

/* -- happy --------------------------------------------------------------- */
.cat.is-happy .eyeball, .cat.is-happy .shine { opacity: 0; }
.cat.is-happy .lid { opacity: 1; }
.cat.is-happy #tail { animation: tail-wag .5s ease-in-out infinite; }
.cat.is-happy #body, .cat.is-happy #head { animation: bounce .6s var(--ease) 1; }
.cat.is-happy #mouth { d: path("M80 79 v3 M70 80 Q 80 92 90 80"); }
@keyframes tail-wag { 50% { transform: rotate(-26deg); } }
@keyframes bounce { 30% { transform: translateY(-6px); } }

/* -- shy ----------------------------------------------------------------- */
.cat.is-shy #head { transform: rotate(5deg) translateY(3px); }
.cat.is-shy #ear-l, .cat.is-shy #ear-l-in { transform: rotate(-26deg); }
.cat.is-shy #ear-r, .cat.is-shy #ear-r-in { transform: rotate(26deg); }
.cat.is-shy .eyeball { transform: scaleY(.55) translateY(3px); }
.cat.is-shy .shine { transform: translateY(3px) scaleY(.6); }
.cat.is-shy #blush ellipse { opacity: .9; }
.cat.is-shy #tail { d: path("M116 136 C 100 152, 60 152, 44 140 C 40 136, 46 132, 50 136"); }
.cat.is-shy #paws { transform: translateX(-2px); }

/* -- surprised ----------------------------------------------------------- */
.cat.is-surprised .eyeball { transform: scale(1.4); }
.cat.is-surprised #ear-l, .cat.is-surprised #ear-l-in { transform: rotate(6deg) translateY(-3px); }
.cat.is-surprised #ear-r, .cat.is-surprised #ear-r-in { transform: rotate(-6deg) translateY(-3px); }
.cat.is-surprised #tail { d: path("M116 136 C 144 136, 154 100, 150 70 C 149 64, 144 64, 144 70"); }
.cat.is-surprised #whiskers { transform: scaleX(1.1); }
.cat.is-surprised #mouth { opacity: 0; }
.cat.is-surprised #mouth-open { opacity: 1; transform: scale(.8); }
.cat.is-surprised #head { transform: translateY(-3px); }

/* -- thinking ------------------------------------------------------------ */
.cat.is-thinking .eyeball, .cat.is-thinking .shine { transform: translate(3px, -4px); }
.cat.is-thinking #ear-l, .cat.is-thinking #ear-l-in { transform: rotate(-18deg); }
.cat.is-thinking #tail { animation: tail-tap 1.6s ease-in-out infinite; }
@keyframes tail-tap { 50% { transform: rotate(-8deg); } }

/* -- sleepy -------------------------------------------------------------- */
.cat.is-sleepy .eyeball { transform: scaleY(.15) translateY(2px); }
.cat.is-sleepy .shine { opacity: 0; }
.cat.is-sleepy #ear-l, .cat.is-sleepy #ear-l-in { transform: rotate(-20deg); }
.cat.is-sleepy #ear-r, .cat.is-sleepy #ear-r-in { transform: rotate(20deg); }
.cat.is-sleepy #head { transform: rotate(3deg) translateY(5px); }
.cat.is-sleepy #body { transform: scaleY(.96); }
.cat.yawn #mouth { opacity: 0; }
.cat.yawn #mouth-open { opacity: 1; transform: scale(1.2); }

/* -- love ---------------------------------------------------------------- */
.cat.is-love .eyeball, .cat.is-love .shine { opacity: 0; }
.cat.is-love .lid { opacity: 1; }
.cat.is-love #blush ellipse { opacity: .9; }
.cat.is-love #mouth { d: path("M80 79 v3 M70 80 Q 80 92 90 80"); }
.cat.is-love #tail { d: path("M116 136 C 146 140, 158 110, 142 96 C 132 88, 124 100, 134 106 C 140 110, 148 104, 146 96"); }
.cat.is-love #hearts .heart { animation: heart-up 2.4s ease-out infinite; }
.cat.is-love #hearts .h2 { animation-delay: 1.1s; }
@keyframes heart-up {
  0%   { opacity: 0; transform: translate(var(--hx, 40px), 44px) scale(.6); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--hx, 40px), 4px) scale(1); }
}
.cat #hearts .h1 { --hx: 36px; }
.cat #hearts .h2 { --hx: 126px; }

/* -- movimento ridotto --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --------------------------------------------------------------------------
   Tab (segmented control) e riepiloghi compatti
   -------------------------------------------------------------------------- */
.tabs {
  display: flex; gap: 4px; padding: 4px; margin: 12px 0 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--rd-radius-pill);
}
.tab {
  flex: 1; min-height: 40px; padding: 8px 12px;
  border: 0; border-radius: var(--rd-radius-pill); background: transparent; color: var(--ink-soft);
  font-family: var(--display); font-weight: 600; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--t-norm) var(--ease), color var(--t-norm) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-soft); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--rd-radius-pill);
  background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center;
}
.badge.done { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.review {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--rd-radius-md); background: var(--paper);
  display: grid; gap: 6px;
}
.review.match { border-color: var(--accent); background: var(--match-bg); }
.review .meta { margin-bottom: 2px; }
.review-row { display: flex; gap: 10px; align-items: flex-start; font-family: var(--display); font-weight: var(--rd-w-medium); font-size: 16px; line-height: 1.3; }
.review .chip.tiny { justify-self: start; margin-top: 2px; }

/* scelta fra tre: carte a tutta larghezza, testo a sinistra, segni a destra */
.choice.wide {
  min-height: 56px; width: 100%; padding: 12px 14px 12px 18px;
  justify-content: space-between; text-align: left; gap: 12px;
  font-size: 17px; line-height: 1.3;
}
.choice.wide .choice-text { flex: 1; }
.choice.wide .marks { display: inline-flex; gap: -6px; flex: none; min-width: 28px; justify-content: flex-end; }
.choice.wide .marks .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.choice.wide:disabled { cursor: default; }
/* in attesa della risposta del server: solo la scelta resta piena */
.choice.wide:disabled:not([aria-pressed="true"]):not(.is-truth):not(.is-mine) { opacity: .5; }
/* dopo la rivelazione */
.choice.wide.is-truth { border-color: var(--accent); background: var(--match-bg); box-shadow: none; opacity: 1; }
.choice.wide.is-mine:not(.is-truth) { border-color: var(--line-strong); box-shadow: none; opacity: 1; }
.choice.wide.is-picked { opacity: 1; box-shadow: none; border-color: var(--line-strong); }
.choice.wide.is-other { opacity: .45; }

/* "Io o te?": due carte-persona affiancate, segni in alto a destra */
.choice.person {
  position: relative;
  flex-direction: column; gap: 10px; min-height: 140px;
  font-size: 18px;
}
.choice.person .marks { position: absolute; top: 8px; right: 8px; display: inline-flex; }
.choice.person .marks .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.choice.person[aria-pressed="true"] { border-color: var(--player, var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--player, var(--accent)) 18%, transparent); }
.choice.person:disabled:not(.is-picked) { opacity: .45; }
.choice.person.is-picked { opacity: 1; box-shadow: none; border-color: var(--line-strong); }
.choice.person.is-agree { border-color: var(--accent); background: var(--match-bg); }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 4px 0; }

/* "Il nostro futuro": il testo dello scenario */
.story { font-family: var(--display); font-weight: var(--rd-w-regular); font-size: 18px; line-height: 1.45; margin: 6px 0 0; }
.story b { font-weight: var(--rd-w-medium); }
.story .alt b { text-decoration: underline; text-decoration-color: var(--accent-hi); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Telefoni stretti (iPhone e simili, ≤ 480px): meno aria ai bordi, più al contenuto
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .app { padding: 6px 12px 24px; }
  .card { padding: 16px 14px; border-radius: 16px; margin-bottom: 12px; }
  .cat-wrap { height: 84px; }
  .top { padding-bottom: 0; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .q { font-size: 22px; margin-bottom: 16px; }
  .tabs { margin: 10px 0 14px; }
  .tab { font-size: 13px; padding: 8px 4px; gap: 6px; min-height: 38px; white-space: nowrap; }
  .badge { min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .review { padding: 10px 12px; }
  .review .meta, .answer-card .who { letter-spacing: .06em; }
  .answer-card { padding: 12px 12px; }
  .answer-card .what { font-size: 17px; }
  .choice.wide { padding: 12px 12px 12px 14px; font-size: 16px; min-height: 52px; }
  .choice.person { min-height: 124px; }
  .level { gap: 12px; padding: 14px 0; }
  .level h3 { font-size: 17px; }
  .level .meta { font-size: 13px; }
  .btn { min-height: 46px; }
  .btn-row { gap: 8px; margin-top: 16px; }
  .backbar { margin-bottom: 4px; }
  .field { margin-bottom: 16px; }
  .home-actions { margin-top: 16px; }
}
.home-actions { margin-top: 20px; }
.names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* risposte a testo libero nei riepiloghi: peso normale, a capo libero */
.review-row .prose { font-family: var(--sans); font-weight: var(--rd-w-light); font-size: 16px; white-space: pre-wrap; }
