/* ============================================================================
   06 · Rivista — enigmi come carte da sfogliare.

   Il resto dell'app è una copertina viola scura; l'enigma è la pagina chiara che
   si apre. Serif editoriale, corsivi, un magenta da inchiostro di stampa. Il
   richiamo in home è una carta con altre due sotto, pronte da girare.
   Mockup: blocco #06.
   ========================================================================= */

html[data-theme="rivista"] {
  --bg: #241a2b;
  --ink: #f6efe6;
  --ink-2: #d8cbd6;
  --ink-3: #b39ec0;
  --line: rgba(246, 239, 230, .14);
  --surface: rgba(246, 239, 230, .06);
  --surface-ink: #f6efe6;

  --accent: #c2185b;
  --accent-ink: #fff;
  --ok: rgba(246, 239, 230, .06);
  --ok-ink: #f6efe6;
  --warn: rgba(224, 184, 200, .12);
  --warn-ink: #e0b8c8;
  --locked: transparent;
  --locked-ink: #a08fac;
  --hint-locked: transparent;

  /* la pagina dell'enigma è chiara: è l'unica schermata stampata */
  --lvl-bg: #fdf7ee;
  --lvl-ink: #2b1d33;
  --right-bg: #241a2b;
  --right-ink: #f6efe6;
  --wrong-bg: #241a2b;
  --wrong-ink: #f6efe6;
  --ask-bg: #241a2b;
  --ask-ink: #f6efe6;
  --full-bg: #241a2b;
  --full-ink: #f6efe6;

  --conf-1: #c2185b;
  --conf-2: #e0b8c8;
  --conf-3: #f2e4d5;
  --conf-4: #4b3557;

  --font: 'Newsreader', Georgia, serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono: 'Newsreader', Georgia, serif;
  --tt-display: none;
  --tt-label: uppercase;
  --ls-display: 0;
  --ls-label: .22em;
  --w-display: 400;
  --w-label: 400;

  --fs-huge: 46px;
  --fs-title: 34px;
  --fs-lead: 26px;
  --fs-body: 17px;
  --fs-small: 17px;
  --fs-label: 12px;

  --r: 18px;
  --r-lg: 22px;
  --r-pill: 999px;
  --bd: 1px;
  --bd-color: rgba(246, 239, 230, .15);
  --shadow: none;

  --pad: 24px;
  --head-top: 26px;
  --gap: 12px;
  --gap-block: 22px;
  --block-pad: 18px 20px;
  --btn-pad: 16px;
  color-scheme: dark;
}

/* --- guscio --- */

/* `space-between` spingeva la prima e la quarta icona contro i bordi e lasciava
   un vuoto largo in mezzo: su quattro voci quella distribuzione fa il contrario
   di quello che serve. Raggruppate al centro con una distanza fissa. */
html[data-theme="rivista"] .app.has-tabs .tabbar {
  border-top: 1px solid rgba(246, 239, 230, .12);
  padding: 18px 14px max(26px, var(--safe-tab));
  justify-content: center;
  gap: 34px;
}

html[data-theme="rivista"] .tabbar__item { flex: 0 0 auto; padding: 0; color: #a08fac; }
html[data-theme="rivista"] .tabbar__item.is-on { background: none; color: #f6efe6; }
html[data-theme="rivista"] .app[data-scr="livello"] .tabbar { border-color: #e3d6c6; }

html[data-theme="rivista"] .head__title { font-family: 'DM Serif Display', serif; font-size: 28px; }
html[data-theme="rivista"] .brand__name { font-family: 'DM Serif Display', serif; font-size: 25px; letter-spacing: .01em; text-transform: none; }
html[data-theme="rivista"] .mark i { background: #f6efe6; }
html[data-theme="rivista"] .mark i:nth-child(2) { background: #e0b8c8; }

html[data-theme="rivista"] .head__back {
  font-family: 'Newsreader', serif;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: #b39ec0;
}

html[data-theme="rivista"] .app[data-scr="livello"] .head__back { color: #7a6580; }
html[data-theme="rivista"] .head__back::before { content: '← '; }
html[data-theme="rivista"] .head__back[data-racc] span { display: none; }
html[data-theme="rivista"] .head__back[data-racc]::after { content: attr(data-racc); }

html[data-theme="rivista"] .coins {
  background: none;
  color: #e0b8c8;
  border-bottom: 1px solid rgba(224, 184, 200, .4);
  border-radius: 0;
  padding: 0 0 2px;
  font-family: 'Newsreader', serif;
  font-size: 15px;
  font-weight: 400;
}

html[data-theme="rivista"] .coins::after { content: ' monete'; }
html[data-theme="rivista"] .app[data-scr="livello"] .coins { color: #c2185b; border-color: rgba(194, 24, 91, .4); }
html[data-theme="rivista"] .ico--fav[aria-pressed="true"] { color: #c2185b; }

/* --- home: la carta in cima al mazzo --- */

html[data-theme="rivista"] .tally { display: none; }

/* le due carte sotto sono ombre piene, sfalsate: nessun elemento in più */
html[data-theme="rivista"] .resume {
  background: linear-gradient(150deg, #fdf7ee, #f2e4d5);
  color: #2b1d33;
  border-radius: 22px;
  padding: 24px 22px;
  margin: 22px 8px 12px;
  gap: 14px;
  box-shadow: 0 11px 0 -8px #4b3557, 0 22px 0 -16px #3a2a43;
}

html[data-theme="rivista"] .resume__where { font-size: 12px; letter-spacing: .2em; color: #8e7a94; }
html[data-theme="rivista"] .resume__text { font-family: 'DM Serif Display', serif; font-size: 26px; line-height: 1.3; letter-spacing: 0; text-transform: none; }

/* «scorri per giocare →» al posto di «Gioca»: la parola è del tema */
html[data-theme="rivista"] .resume__cta {
  background: none;
  color: #7a6580;
  padding: 0;
  font-family: 'Newsreader', serif;
  font-size: 0;
  letter-spacing: 0;
  text-transform: none;
}

html[data-theme="rivista"] .resume__cta::before { content: 'scorri per giocare'; font-size: 15px; }
html[data-theme="rivista"] .resume__cta::after { content: ' →'; font-size: 19px; }

html[data-theme="rivista"] .colls { grid-template-columns: 1fr; gap: 11px; }

html[data-theme="rivista"] .colls::before {
  content: 'Le raccolte';
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #b39ec0;
}

html[data-theme="rivista"] .coll {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px solid rgba(246, 239, 230, .14);
  border-radius: 0;
  background: none;
  color: #f6efe6;
}

html[data-theme="rivista"] .coll:nth-child(5) { grid-column: auto; border-bottom: 0; }
html[data-theme="rivista"] .coll[data-state="locked"] { opacity: .55; }
html[data-theme="rivista"] .coll__meta { display: contents; }
html[data-theme="rivista"] .coll__name { order: 1; flex: 1; font-size: 18px; letter-spacing: 0; text-transform: none; font-weight: 400; }
html[data-theme="rivista"] .coll__name::after { content: none; }
html[data-theme="rivista"] .coll__count { order: 2; font-family: 'Newsreader', serif; font-size: 15px; color: #b39ec0; letter-spacing: 0; }
html[data-theme="rivista"] .coll__count i::before { content: ' / '; }
html[data-theme="rivista"] .coll[data-state="locked"] .coll__count { display: none; }
html[data-theme="rivista"] .coll__state { order: 3; display: none; font-size: 15px; letter-spacing: 0; text-transform: none; }
html[data-theme="rivista"] .coll[data-state="locked"] .coll__state { display: block; }

/* --- raccolta: sommario di un numero --- */

html[data-theme="rivista"] .scr__title { font-family: 'DM Serif Display', serif; font-size: 38px; line-height: 1.06; }
html[data-theme="rivista"] .scr__title[data-n] .scr__title-a,
html[data-theme="rivista"] .scr__title[data-n] .scr__title-b { display: none; }
html[data-theme="rivista"] .scr__title[data-n]::after { content: 'Raccolta ' attr(data-n); }
html[data-theme="rivista"] .scr__sub { font-family: 'Newsreader', serif; font-size: 15px; letter-spacing: 0; text-transform: none; color: #b39ec0; }

html[data-theme="rivista"] .cells { display: flex; flex-direction: column; gap: 14px; }

html[data-theme="rivista"] .cell {
  aspect-ratio: auto;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(246, 239, 230, .14);
  border-radius: 0;
  background: none;
  color: #f6efe6;
  text-align: left;
}

html[data-theme="rivista"] .cell__n {
  width: 44px;
  flex: 0 0 auto;
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: #e0b8c8;
}

html[data-theme="rivista"] .cell__title {
  display: block;
  flex: 1;
  min-width: 0;
  font-family: 'Newsreader', serif;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="rivista"] .cell::after {
  font-size: 14px;
  color: #a08fac;
  flex: 0 0 auto;
  font-style: italic;
}

html[data-theme="rivista"] .cell[data-state="solved"]::after { content: 'completato'; }
html[data-theme="rivista"] .cell[data-state="skipped"]::after { content: 'saltato · da risolvere'; }
html[data-theme="rivista"] .cell[data-state="open"]::after { content: 'da leggere'; }

html[data-theme="rivista"] .cell[data-state="current"] {
  grid-column: auto;
  background: #fdf7ee;
  color: #2b1d33;
  border: 0;
  border-radius: 18px;
  padding: 16px;
  margin: 0 -4px;
}

html[data-theme="rivista"] .cell[data-state="current"] .cell__n { color: #2b1d33; font-size: 30px; }
html[data-theme="rivista"] .cell[data-state="current"]::after { content: 'tocca a te →'; color: #7a6580; }

html[data-theme="rivista"] .cell[data-state="locked"] { opacity: .4; }
html[data-theme="rivista"] .cell[data-state="locked"]::before {
  content: 'ancora da sbloccare';
  flex: 1;
  font-family: 'Newsreader', serif;
  font-size: 18px;
  font-style: italic;
}

html[data-theme="rivista"] .cell__n { order: 0; }
html[data-theme="rivista"] .cell[data-state="locked"]::before { order: 1; }
html[data-theme="rivista"] .cell__title { order: 1; }
html[data-theme="rivista"] .cell__fav { order: 2; position: static; }
html[data-theme="rivista"] .cell__fav::before { content: '★'; color: #c2185b; }
html[data-theme="rivista"] .cell::after { order: 3; }

/* --- enigma: la pagina stampata --- */

html[data-theme="rivista"] .riddle__meta { font-size: 12px; letter-spacing: .22em; color: #8e7a94; }
html[data-theme="rivista"] .riddle__text { font-family: 'DM Serif Display', serif; line-height: 1.24; letter-spacing: 0; }

html[data-theme="rivista"] .hints { gap: 16px; padding-top: 12px; border-top: 1px solid #e3d6c6; }
html[data-theme="rivista"] .hint { background: none; color: #2b1d33; border: 0; border-radius: 0; padding: 0; gap: 5px; }
html[data-theme="rivista"] .hint__label { font-size: 12px; letter-spacing: .2em; color: #c2185b; }
html[data-theme="rivista"] .hint__text { font-family: 'Newsreader', serif; font-size: 19px; font-style: italic; line-height: 1.4; }

html[data-theme="rivista"] .hint[data-state="locked"] {
  border: 1px solid #d8c8b6;
  border-radius: 999px;
  padding: 12px;
  justify-content: center;
  gap: 6px;
  color: #7a6580;
}

html[data-theme="rivista"] .hint[data-state="locked"] .hint__label { color: #7a6580; font-size: 15px; letter-spacing: 0; text-transform: none; }
html[data-theme="rivista"] .hint[data-state="locked"] .hint__label::after { content: ' ·'; }
html[data-theme="rivista"] .hint__cost { font-family: 'Newsreader', serif; font-size: 15px; font-weight: 400; }
html[data-theme="rivista"] .option { background: #fff; border: 1px solid #d8c8b6; border-radius: 14px; color: #2b1d33; }

html[data-theme="rivista"] .app[data-scr="livello"] .scr__foot {
  background: #f8f0e4;
  border-top: 1px solid #e3d6c6;
  padding: 18px 22px max(26px, var(--safe-b));
  gap: 12px;
}

html[data-theme="rivista"] .answer { border: 0; gap: 10px; }

html[data-theme="rivista"] .answer__input {
  background: #fff;
  border: 1px solid #d8c8b6;
  border-radius: 14px;
  padding: 16px;
  font-family: 'Newsreader', serif;
  font-size: 17px;
  font-style: italic;
  color: #2b1d33;
}

html[data-theme="rivista"] .answer__input::placeholder { color: #a8998f; }
html[data-theme="rivista"] .answer__send { width: 58px; background: #c2185b; color: #fff; border-radius: 14px; font-size: 20px; }
html[data-theme="rivista"] .answer__send::before { content: '→'; }
html[data-theme="rivista"] .skip { background: none; color: #2b1d33; font-size: 16px; letter-spacing: 0; text-transform: none; padding: 0; }

/* --- esiti --- */

html[data-theme="rivista"] .verdict { gap: 10px; padding-top: 22px; }
html[data-theme="rivista"] .verdict__word { font-family: 'DM Serif Display', serif; font-size: 46px; line-height: 1.06; letter-spacing: 0; color: #f6efe6; }
html[data-theme="rivista"] .verdict__line { order: -1; font-size: 12px; letter-spacing: .22em; color: #b39ec0; }

html[data-theme="rivista"] .reward,
html[data-theme="rivista"] .solution {
  background: linear-gradient(150deg, #fdf7ee, #f2e4d5);
  color: #2b1d33;
  border: 0;
  border-radius: 18px;
  padding: 18px 20px;
}

html[data-theme="rivista"] .why,
html[data-theme="rivista"] .unlocked,
html[data-theme="rivista"] .app[data-scr="sbagliato"] .reward,
html[data-theme="rivista"] .app[data-scr="salto"] .reward {
  background: rgba(246, 239, 230, .06);
  border: 1px solid rgba(246, 239, 230, .15);
  border-radius: 18px;
  padding: 18px 20px;
  color: #f6efe6;
}

html[data-theme="rivista"] .reward__label,
html[data-theme="rivista"] .why__label,
html[data-theme="rivista"] .solution__label,
html[data-theme="rivista"] .unlocked__label,
html[data-theme="rivista"] .themerow__label,
html[data-theme="rivista"] .fav__where,
html[data-theme="rivista"] .stat__label { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #b39ec0; opacity: 1; }

html[data-theme="rivista"] .reward .reward__label,
html[data-theme="rivista"] .solution .solution__label { color: #8e7a94; }

html[data-theme="rivista"] .reward__value,
html[data-theme="rivista"] .solution__value,
html[data-theme="rivista"] .unlocked__value,
html[data-theme="rivista"] .stat__value,
html[data-theme="rivista"] .themerow__name { font-family: 'DM Serif Display', serif; font-size: 30px; line-height: 1.06; letter-spacing: 0; }

html[data-theme="rivista"] .why__text,
html[data-theme="rivista"] .reward__note,
html[data-theme="rivista"] .ask__text { font-family: 'Newsreader', serif; font-size: 17px; line-height: 1.55; color: #d8cbd6; opacity: 1; }
html[data-theme="rivista"] .reward .reward__note { color: #7a6580; }

html[data-theme="rivista"] .more {
  background: rgba(246, 239, 230, .04);
  border: 1px solid rgba(246, 239, 230, .11);
  border-radius: 18px;
  padding: 18px 20px;
  color: #b39ec0;
  font-size: 12px;
  letter-spacing: .22em;
}

html[data-theme="rivista"] .app[data-scr="fatto"] .hints,
html[data-theme="rivista"] .app[data-scr="giusto"] .hints { border: 0; padding-top: 0; gap: 12px; }

html[data-theme="rivista"] .app[data-scr="fatto"] .hint,
html[data-theme="rivista"] .app[data-scr="giusto"] .hint {
  background: rgba(246, 239, 230, .04);
  border: 1px solid rgba(246, 239, 230, .11);
  border-radius: 18px;
  padding: 18px 20px;
  color: #f6efe6;
}

html[data-theme="rivista"] .app[data-scr="fatto"] .hint__label,
html[data-theme="rivista"] .app[data-scr="giusto"] .hint__label { color: #b39ec0; letter-spacing: .22em; }
html[data-theme="rivista"] .app[data-scr="fatto"] .hint__text,
html[data-theme="rivista"] .app[data-scr="giusto"] .hint__text { font-size: 17px; font-style: normal; color: #d8cbd6; }

html[data-theme="rivista"] .ask__title,
html[data-theme="rivista"] .done__title {
  flex-direction: row;
  flex-wrap: wrap;
  gap: .28em;
  font-family: 'DM Serif Display', serif;
  font-size: 40px;
  line-height: 1.06;
  letter-spacing: 0;
}

html[data-theme="rivista"] .done__sub { font-family: 'Newsreader', serif; font-size: 17px; letter-spacing: 0; text-transform: none; color: #d8cbd6; }

/* --- preferiti, profilo, negozio --- */

html[data-theme="rivista"] .fav,
html[data-theme="rivista"] .stat,
html[data-theme="rivista"] .account,
html[data-theme="rivista"] .empty {
  background: rgba(246, 239, 230, .06);
  border: 1px solid rgba(246, 239, 230, .15);
  border-radius: 18px;
  padding: 18px 20px;
  color: #f6efe6;
}
html[data-theme="rivista"] .account { background: var(--accent); color: var(--accent-ink); }

html[data-theme="rivista"] .fav[data-state="skipped"] { background: linear-gradient(150deg, #fdf7ee, #f2e4d5); color: #2b1d33; border: 0; }
html[data-theme="rivista"] .fav[data-state="skipped"] .fav__where { color: #8e7a94; }
html[data-theme="rivista"] .fav__title { font-family: 'Newsreader', serif; font-size: 19px; line-height: 1.3; letter-spacing: 0; text-transform: none; }
html[data-theme="rivista"] .stat[data-tone="accent"] { background: linear-gradient(150deg, #fdf7ee, #f2e4d5); color: #2b1d33; border: 0; }
html[data-theme="rivista"] .stat[data-tone="accent"] .stat__label { color: #8e7a94; }
html[data-theme="rivista"] .stat__value { display: block; padding-bottom: 8px; font-size: 32px; }
html[data-theme="rivista"] .themerow { background: rgba(246, 239, 230, .04); border: 1px solid rgba(246, 239, 230, .11); border-radius: 18px; padding: 18px 20px; }
html[data-theme="rivista"] .themerow__name { font-size: 24px; }

html[data-theme="rivista"] .themerow__cta {
  background: none;
  border: 1px solid rgba(246, 239, 230, .2);
  border-radius: 14px;
  padding: 15px;
  color: #d8cbd6;
  font-family: 'Newsreader', serif;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

html[data-theme="rivista"] .account__name { font-family: 'Newsreader', serif; font-size: 17px; letter-spacing: 0; }
html[data-theme="rivista"] .shop { gap: 6px; }
html[data-theme="rivista"] .scr__eyebrow { font-size: 12px; letter-spacing: .22em; color: #b39ec0; }
html[data-theme="rivista"] .tdesc { font-family: 'Newsreader', serif; font-size: 17px; line-height: 1.55; color: #d8cbd6; }
html[data-theme="rivista"] .credits { font-size: 13px; color: #a08fac; }

html[data-theme="rivista"] .btn { border-radius: 14px; font-family: 'Newsreader', serif; font-size: 17px; font-weight: 400; letter-spacing: 0; text-transform: none; }
html[data-theme="rivista"] .btn--primary,
html[data-theme="rivista"] .btn--go { background: #c2185b; color: #fff; border-color: #c2185b; }
html[data-theme="rivista"] .btn--ghost,
html[data-theme="rivista"] .btn--inert { border: 1px solid rgba(246, 239, 230, .2); color: #d8cbd6; }
html[data-theme="rivista"] .btn--off { border: 1px solid rgba(246, 239, 230, .08); color: #6f6178; }
html[data-theme="rivista"] .btn[data-arrow="avanti"]::after { content: ' →'; }
html[data-theme="rivista"] .btn[data-arrow="indietro"]::before { content: '← '; }

/* ============================================================================
   Anteprima nel negozio — fuori dallo scope del tema: è la vetrina.
   ========================================================================= */

.tpv--rivista {
  border-radius: 14px;
  background: linear-gradient(150deg, #fdf7ee, #f2e4d5);
  border: 1px solid #e3d6c6;
  color: #2b1d33;
}

.tpv--rivista .tpv__num {
  font-family: 'Newsreader', serif;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8e7a94;
}

.tpv--rivista .tpv__name {
  font-family: 'DM Serif Display', serif;
  font-size: 21px;
  color: #2b1d33;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpv--rivista .tpv__tag {
  font-family: 'Newsreader', serif;
  font-size: 14px;
  color: #c2185b;
  border-bottom: 1px solid #c2185b;
  padding-bottom: 1px;
  white-space: nowrap;
}

/* le due carte sotto: il mazzo si vede senza aggiungere elementi */
.tpv--rivista.tpv--card {
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 9px 0 -5px #4b3557, 0 18px 0 -10px #3a2a43;
}

.tpv--rivista.tpv--card .tpv__num { font-size: 13px; letter-spacing: .24em; }
.tpv--rivista.tpv--card .tpv__num::before { content: 'Tema '; }
.tpv--rivista.tpv--card .tpv__name { font-size: 34px; line-height: 1; white-space: normal; }
.tpv--rivista.tpv--card .tpv__tag { font-size: 16px; }
