:root {
  --paper: #f7f3ed;
  --paper-2: #fbf8f3;
  --black: #111111;
  --brown: #4b392f;
  --brown-soft: #8a7568;
  --line: #cfc3b8;
  --accent: #a94d36;
  --max: 540px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--brown);
  font-family: Tahoma, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0 17px;
  background: rgba(247,243,237,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  color: var(--black);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}

.top-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.top-actions a,
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--brown);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
}

main {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.cover {
  padding: 55px 19px 48px;
  border-bottom: 1px solid var(--line);
}

.edition,
.number {
  margin: 0 0 12px;
  color: var(--brown-soft);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.cover h1 {
  margin: 0;
  color: var(--black);
  font-size: clamp(48px, 15vw, 72px);
  font-weight: 700;
  line-height: .88;
  letter-spacing: -.065em;
}

.cover-copy {
  max-width: 320px;
  margin: 22px 0 0;
  font-size: 15px;
}

.pigeon {
  float: right;
  margin: 2px 5px 0 15px;
  font-size: 30px;
}

.down {
  display: inline-block;
  margin-top: 28px;
  color: var(--black);
  font-size: 22px;
  text-decoration: none;
}

.card {
  min-height: 0;
  padding: 38px 19px 42px;
  border-bottom: 1px solid var(--line);
}

.card h2 {
  max-width: 470px;
  margin: 0 0 16px;
  color: var(--black);
  font-size: clamp(27px, 8vw, 38px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.04em;
}

.card p {
  margin: 10px 0;
  font-size: 14px;
}

.card em {
  font-weight: 400;
}

.tiny,
.card .tiny {
  color: var(--brown-soft);
  font-size: 10px;
}

.aside {
  margin-top: -7px !important;
  font-style: italic;
}

.rule {
  width: 28px;
  height: 1px;
  margin: 18px 0;
  background: var(--brown);
}

.hidden {
  display: none !important;
}


/* REVEAL EDITORIALE */

.reveal,
.small,
.mini-reveal {
  display: inline-block;
  margin: 10px 0 0;
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: var(--brown);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}

.reveal-box {
  margin-top: 18px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--brown);
}

.reveal-box p:first-child {
  margin-top: 0;
}

details {
  margin-top: 18px;
}

summary {
  color: var(--brown-soft);
  font-size: 9px;
  letter-spacing: .08em;
  cursor: pointer;
}

.sources {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  font-size: 10px;
}


/* WORDSEARCH */

.wordsearch-intro {
  max-width: 430px;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  margin: 18px 0;
}

.word-list span {
  position: relative;
  color: var(--black);
  font-size: 10px;
  letter-spacing: .07em;
}

.word-list span.found {
  color: var(--brown-soft);
  text-decoration: line-through;
}

.wordsearch-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  width: 100%;
  margin: 22px 0 12px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ws-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--brown);
  font-family: Tahoma, sans-serif;
  font-size: clamp(11px, 3.6vw, 17px);
  font-weight: 400;
  cursor: pointer;
}

.ws-cell.selecting {
  background: #e7ddd3;
}

.ws-cell.found {
  background: var(--brown);
  color: var(--paper);
}

.wordsearch-status {
  min-height: 18px;
  color: var(--brown-soft);
  font-size: 10px;
}


/* HISTORY */

.stamp {
  display: inline-block;
  margin: 2px 0 7px;
  padding: 7px 9px;
  border: 1px solid var(--brown);
  color: var(--brown);
  font-size: 17px;
  line-height: 1.05;
  transform: rotate(-1deg);
}


/* WORD */

.word h2 {
  font-size: clamp(42px, 14vw, 68px);
}


/* VOTING */

.question {
  margin-top: 21px !important;
  color: var(--black);
  font-size: 11px !important;
}

.vote-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin: 10px 0;
}

.vote-row button,
.save {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid var(--brown-soft);
  background: none;
  color: var(--brown);
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
}

.vote-row button.selected,
.save.saved {
  color: var(--black);
  border-color: var(--black);
  font-weight: 700;
}


/* LANGUAGES */

.language-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.language-list > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 2px 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.language-list span {
  grid-row: 1 / 3;
}

.language-list strong {
  color: var(--black);
  font-size: 16px;
  font-weight: 400;
}

.language-list small {
  color: var(--brown-soft);
  font-size: 9px;
}


/* QUIZ */

.statement {
  width: 100%;
  margin: 0;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--brown);
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.statement.correct {
  color: var(--black);
  font-weight: 700;
}

.statement.wrong {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.quiz-result {
  margin-top: 18px;
  padding-left: 15px;
  border-left: 2px solid var(--brown);
  font-size: 13px;
}


/* BOOKS */

.book {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.book-emoji {
  margin-bottom: 5px;
  font-size: 24px;
}


/* WINDOW */

.fake-window {
  position: relative;
  width: 72%;
  aspect-ratio: 4 / 3;
  margin: 7px auto 26px;
  border: 4px solid var(--brown);
}

.fake-window::before,
.fake-window::after {
  content: "";
  position: absolute;
  background: var(--brown);
}

.fake-window::before {
  width: 3px;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
}

.fake-window::after {
  height: 3px;
  left: 0;
  right: 0;
  top: calc(50% - 1px);
}


/* MATEMATICA */

.equations {
  margin-top: 18px;
}

.equations button {
  display: block;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--black);
  font-size: 25px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}


/* BROCCOLI */

.broccoli-art {
  margin: 20px 0;
}

.broccoli-art img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.broccoli-fallback {
  display: grid;
  min-height: 210px;
  place-items: center;
  border: 1px solid var(--line);
  font-size: 70px;
}

.broccoli-rating {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.broccoli-rating button {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}


/* PIAZZETTA */

form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--brown-soft);
  font-size: 9px;
  letter-spacing: .07em;
}

input,
textarea {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--brown);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--brown);
  font-size: 13px;
}

textarea {
  min-height: 85px;
  resize: vertical;
}

.primary {
  justify-self: start;
  padding: 7px 11px;
  border: 1px solid var(--brown);
  background: transparent;
  color: var(--brown);
  font-size: 10px;
  cursor: pointer;
}

.comments {
  margin-top: 26px;
}

.comment {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.comment-meta {
  color: var(--black);
  font-size: 10px;
  font-weight: 700;
}

.comment p {
  font-size: 12px;
}

.comment-actions {
  display: flex;
  gap: 14px;
}

.comment-actions button,
.reply button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brown-soft);
  font-size: 9px;
}

.reply {
  margin: 13px 0 0 17px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}


/* FLIRT */

.flirt {
  padding-top: 48px;
  padding-bottom: 48px;
  text-align: center;
}

.editor-cow {
  margin-bottom: 9px;
  font-size: 38px;
}

.flirt h2 {
  margin-left: auto;
  margin-right: auto;
  font-size: 26px;
}

.flirt p {
  max-width: 370px;
  margin-left: auto;
  margin-right: auto;
}

.instagram-link {
  display: inline-block;
  margin-top: 13px;
  color: var(--black);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}


/* END */

.finish {
  padding: 52px 19px 70px;
  text-align: center;
}

.finish p {
  margin: 0;
  color: var(--black);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

.finish span {
  display: block;
  margin: 18px;
  font-size: 28px;
}

.finish a {
  color: var(--brown);
  font-size: 10px;
}


/* ACCOUNT */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17,17,17,.42);
}

.modal-card {
  position: relative;
  width: min(100%, 540px);
  max-height: 90svh;
  overflow-y: auto;
  padding: 43px 19px 28px;
  border-top: 1px solid var(--black);
  background: var(--paper);
}

.modal-card h2 {
  color: var(--black);
  font-size: 28px;
}

.modal-close {
  position: absolute;
  top: 9px;
  right: 15px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 25px;
}

.auth-buttons {
  display: flex;
  gap: 8px;
}

.saved-item {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.saved-item strong {
  color: var(--black);
  font-size: 12px;
}

.saved-item small {
  display: block;
  color: var(--brown-soft);
  font-size: 9px;
}

hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}


/* DESKTOP: non trasformarlo in un sito desktop */

@media (min-width: 700px) {
  body {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    width: 540px;
    margin: auto;
  }

  .topbar {
    width: 538px;
  }
}

/* Micro-rifinitura #002 — archivio volutamente secondario */
.top-actions a[href*="archivio"] {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .03em;
  opacity: .68;
  text-transform: lowercase;
}


/* CORE FIX #002 */
.setenil-art {
  margin: 0 0 18px;
  width: 100%;
  overflow: hidden;
}

.setenil-art img {
  display: block;
  width: 100%;
  height: auto;
}

.setenil-clues {
  margin: 16px 0;
}

.setenil-clues p {
  margin: 7px 0;
}

.ws-cell {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.ws-cell.selecting {
  transform: scale(.92);
}

.ws-cell.found {
  text-decoration: line-through;
  font-weight: 700;
}

.word-list .found {
  text-decoration: line-through;
  opacity: .45;
}

.quiz-result {
  margin-top: 14px;
}

.statement.correct {
  font-weight: 700;
}

.statement.wrong {
  opacity: .58;
}

.equations button.solved {
  font-size: 28px;
}

.reply-form {
  margin: 12px 0 16px;
  padding-left: 14px;
  border-left: 1px solid currentColor;
}

.reply-form input,
.reply-form textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 5px 0;
}

.reply-form textarea {
  min-height: 90px;
}

/* NAVIGATION UNIFIED 2026 */
.topbar .brand,
.topbar .top-actions a,
.topbar .top-actions button {
  font-size: clamp(9px,2.5vw,11px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
}
.topbar .top-actions {
  display: flex;
  align-items: center;
  gap: clamp(5px,1.5vw,10px);
}
.topbar { gap: 6px; }
