/* Mimica (tema Classica, condivide token e componenti con tombola.css) */

.mimica { max-width: 560px; margin: 0 auto; padding: 0 16px 28px; padding-top: env(safe-area-inset-top); min-height: 100svh; }
.mimica .barra { gap: 8px; }
.fase { display: grid; gap: 16px; }
.fase[hidden] { display: none; }

.titolo-fase {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-weight: 850; font-stretch: 105%;
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  line-height: 1.05;
}
.sotto-fase { margin: 0; color: var(--testo-tenue); }

/* Pannello impostazioni */
.pannello {
  display: grid; gap: 20px;
  background: #FFFCF4; color: #2A1A12;
  border-radius: 18px; padding: 18px;
  box-shadow: 0 12px 26px rgba(0,0,0,.25);
  color-scheme: light;
}
.pannello fieldset { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.pannello legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.squadre { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.squadre li { display: flex; align-items: center; gap: 10px; }
.squadre .colore { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.squadre input {
  flex: 1; min-width: 0; min-height: 46px;
  padding: 0 14px; border-radius: 12px;
  border: 2px solid #E2D5BC; background: #FFFFFF; color: inherit;
  font: inherit; font-weight: 600;
}
.squadre input:focus { outline: none; border-color: #C62828; }
.togli { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #6B5A4E; font-size: 1.4rem; line-height: 1; }
.aggiungi { justify-self: start; min-height: 44px; padding: 0 4px; border: 0; background: none; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; color: #2A1A12; }
.aggiungi[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  min-height: 40px; padding: 0 14px;
  border-radius: 999px;
  border: 2px solid #E2D5BC; background: #FFFFFF; color: #2A1A12;
  font-weight: 600; font-size: .95rem;
}
.chips button[aria-pressed="true"] { background: #1E7A4E; border-color: #1E7A4E; color: #FFFFFF; }
.scelte.cinque { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scelte.tre { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scelte.cinque label { font-size: .85rem; padding: 0 2px; text-align: center; }
.due-colonne { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.errore { margin: 0; color: #C62828; font-weight: 700; }

.grande-rosso {
  min-height: 62px; width: 100%;
  border: 0; border-radius: 16px;
  background: #C62828; color: #FFF6E6;
  font-family: var(--font-display);
  font-weight: 800; font-stretch: 115%;
  font-size: 1.4rem;
  box-shadow: 0 5px 0 #8E1B16;
}
.grande-rosso:active { transform: translateY(3px); box-shadow: 0 2px 0 #8E1B16; }
.link-sobrio {
  justify-self: center;
  min-height: 44px; padding: 0 8px;
  border: 0; background: none;
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  color: #2A1A12;
}
.fase > .link-sobrio, .pausa .link-sobrio.chiaro { color: var(--testo-tenue); }

/* Prima del turno */
.etichetta-turno { margin: 24px 0 0; font-weight: 700; color: var(--testo-tenue); }
.tocca-a {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 850; font-stretch: 100%;
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  line-height: 1;
}
.tocca-a span { display: block; color: #FFF6E6; text-decoration: underline; text-decoration-color: var(--colore-squadra, #C62828); text-decoration-thickness: .16em; text-underline-offset: .12em; text-decoration-skip-ink: none; }
.classifica { display: grid; gap: 8px; }
.classifica .riga {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(0,0,0,.14);
}
.classifica .riga.attiva { background: rgba(255,246,230,.18); outline: 2px solid rgba(255,246,230,.5); }
.classifica .pallino { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,246,230,.7); }
.classifica .nome { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.classifica .punti { font-family: var(--font-display); font-weight: 850; font-stretch: 80%; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.classifica .barra-punti { height: 6px; border-radius: 3px; background: rgba(255,246,230,.25); grid-column: 1 / -1; }

/* Turno in corso */
.testa-gioco { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "chip punti" "timer timer"; align-items: center; gap: 10px 8px; margin-top: 4px; }
.testa-gioco .squadra-chip { grid-area: chip; }
.testa-gioco .punti-turno { grid-area: punti; }
.testa-gioco .timer { grid-area: timer; justify-self: center; }
.squadra-chip { justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--colore-squadra, #C62828); color: #FFFFFF; font-weight: 700; font-size: .9rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punti-turno { justify-self: end; font-weight: 700; }
.timer {
  --resto: 1;
  width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(#FFF6E6 calc(var(--resto) * 360deg), rgba(0,0,0,.2) 0);
  position: relative;
}
.timer::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--sfondo); }
.timer span { position: relative; font-family: var(--font-display); font-weight: 850; font-stretch: 80%; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; text-box: trim-both cap alphabetic; }
.timer.ultimi { background: conic-gradient(#FFB4A8 calc(var(--resto) * 360deg), rgba(0,0,0,.2) 0); animation: batti 1s ease-in-out infinite; }
@keyframes batti { 50% { transform: scale(1.06); } }

.cartellino {
  position: relative;
  min-height: 260px;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 28px 20px;
  background: #FBF1DC; color: #2A1A12;
  border-radius: 20px;
  border: 3px solid #C62828;
  box-shadow: 0 0 0 6px #FBF1DC, 0 20px 36px rgba(0,0,0,.35);
  text-align: center;
  perspective: 800px;
}
.cartellino .cat {
  padding: 4px 12px; border-radius: 999px;
  background: #F1E3C6; color: #6B3A1E;
  font-size: .85rem; font-weight: 700;
}
.cartellino .parola {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 850; font-stretch: 95%;
  font-size: clamp(2.2rem, 11vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.cartellino .parola.lunga { font-size: clamp(1.6rem, 7.5vw, 2.5rem); }
.entra { animation: entra .45s cubic-bezier(.2,.8,.3,1.1); }
@keyframes entra { 0% { transform: rotateX(-80deg) translateY(-20px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.esce-si { animation: esce-si .25s ease-in forwards; }
@keyframes esce-si { to { transform: translateX(60px) rotate(6deg); opacity: 0; } }
.esce-no { animation: esce-no .25s ease-in forwards; }
@keyframes esce-no { to { transform: translateX(-60px) rotate(-6deg); opacity: 0; } }

.azioni-gioco { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
.passo, .indovinata {
  min-height: 76px; border-radius: 18px;
  font-family: var(--font-display); font-weight: 800; font-stretch: 110%;
  font-size: 1.35rem; touch-action: manipulation;
}
.passo { border: 2px solid rgba(255,246,230,.6); background: transparent; color: #FFF6E6; }
.indovinata { border: 0; background: #FFF6E6; color: #1E5A3A; box-shadow: 0 5px 0 #C9B48E; }
.indovinata:active, .passo:active { transform: translateY(3px); }

/* Riepilogo */
.aiuto-riepilogo { margin: -6px 0 0; font-size: .9rem; color: var(--testo-tenue); }
.parole-turno { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.parole-turno button {
  width: 100%; min-height: 52px;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border-radius: 14px;
  border: 0; background: #FFFCF4; color: #2A1A12;
  text-align: left; font-weight: 600;
}
.parole-turno .segno { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; }
.parole-turno button[aria-pressed="true"] .segno { background: #1E7A4E; color: #FFFFFF; }
.parole-turno button[aria-pressed="false"] { opacity: .75; }
.parole-turno button[aria-pressed="false"] .segno { background: #E2D5BC; color: #6B5A4E; }
.parole-turno button[aria-pressed="false"] .testo-parola { text-decoration: line-through; }
.parole-turno .vuoto { color: var(--testo-tenue); }

.classifica.grande .punti { font-size: 2rem; }
.vince span { color: #FFE08A; text-decoration-color: #FFE08A; }

/* Pausa */
.pausa {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-content: center; gap: 14px; padding: 24px;
  background: rgba(10,30,20,.92); color: #FFF6E6; text-align: center;
}
.pausa[hidden] { display: none; }
.pausa p { margin: 0; font-family: var(--font-display); font-weight: 850; font-size: 2.6rem; }
.pausa .grande-rosso { min-width: 260px; }

@media (min-width: 900px) {
  .mimica { max-width: 760px; }
  .cartellino { min-height: 340px; }
  .cartellino .parola { font-size: 4.4rem; }
  .cartellino .parola.lunga { font-size: 3rem; }
}
@media (prefers-reduced-motion: reduce) { .entra, .esce-si, .esce-no, .timer.ultimi { animation: none; } }

/* Link alle istruzioni nella barra */
.come-si-gioca {
  margin-left: auto;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 2px solid rgba(255,246,230,.45);
  color: #FFF6E6; font-weight: 700; font-size: .9rem; text-decoration: none; white-space: nowrap;
}
.mimica .barra .marchio { flex-grow: 0; margin-right: auto; }
.sotto-azioni { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; }
.sotto-azioni .link-sobrio { color: var(--testo-tenue); }

@media (max-width: 420px) { .come-si-gioca { padding: 0 10px; font-size: .8rem; } .mimica .barra { gap: 6px; } .mimica .barra .marchio { font-size: 1rem; } }
