:root {
  color-scheme: light;
  --ink: #211743;
  --paper: #f6f1fa;
  --cream: #fffcff;
  --lavender: #c9bdf2;
  --pink: #f5cadd;
  --violet: #e4d8ff;
  --mono: "Space Mono", monospace;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; }
button, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #6b42a5; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1110px, calc(100% - 48px)); margin-inline: auto; }
.bar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font: 700 12px var(--mono); }
.brand { text-decoration: none; display: flex; align-items: center; gap: 9px; }
.brand span { font-size: 24px; }
.hero { background: var(--lavender); border-block: 2px solid var(--ink); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; min-height: 475px; padding-block: 50px; }
.eyebrow, .edition { letter-spacing: .045em; font: 700 12px var(--mono); }
h1 { font-size: clamp(56px, 8vw, 104px); letter-spacing: -.035em; word-spacing: .09em; line-height: 1.08; margin: 20px 0 25px; }
h1 em { font-style: normal; color: #43286d; }
.intro > p:not(.eyebrow) { font-size: clamp(17px, 2vw, 21px); max-width: 420px; line-height: 1.4; margin: 0 0 24px; }
.action { display: inline-flex; align-items: center; gap: 28px; font-weight: 800; background: var(--ink); color: white; padding: 13px 17px; text-decoration: none; border-radius: 8px; }
.art { position: relative; display: grid; place-items: center; min-height: 340px; }
.paper { position: relative; width: min(75%, 275px); aspect-ratio: 1 / 1.05; padding: 18% 12% 10%; background: var(--violet); border: 2px solid var(--ink); transform: rotate(-10deg); box-shadow: 9px 10px 0 var(--ink); display: grid; align-content: center; gap: 23px; }
.eye { width: 100%; aspect-ratio: 1.7; border: 2px solid var(--ink); background: var(--cream); border-radius: 85% 15% 85% 15%; transform: rotate(22deg); display: grid; place-items: center; }
.eye i { display: block; width: 41%; aspect-ratio: 1; background: var(--ink); border-radius: 50%; box-shadow: inset 5px -4px 0 #7253a1; }
.eye i::after { content: ""; display: block; background: white; width: 25%; aspect-ratio: 1; margin: 17% 24%; border-radius: 50%; }
.art-text { font: 700 clamp(12px, 2.3vw, 25px)/1.05 var(--mono); letter-spacing: -.07em; }
.stamp { position: absolute; right: 2%; bottom: 8%; width: 93px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--ink); background: var(--pink); display: grid; place-content: center; text-align: center; font: 700 12px/1.18 var(--mono); transform: rotate(12deg); }
.star { position: absolute; font-size: 37px; }
.star-one { top: 5%; right: 3%; }
.star-two { top: 20%; left: 1%; }
.star-three { bottom: 5%; left: 7%; font-size: 24px; }
.explorer { padding-block: 38px 58px; scroll-margin-top: 14px; }
.tabs { display: flex; gap: 9px; flex-wrap: wrap; }
.tabs button { display: flex; gap: 16px; align-items: center; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 8px; padding: 11px 15px; font-weight: 800; }
.tabs button span { font: 700 11px var(--mono); }
.tabs [aria-selected="true"] { background: var(--ink); color: white; }
.route-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 26px 0 19px; }
h2 { font-size: clamp(31px, 5vw, 48px); line-height: 1; letter-spacing: -.055em; margin: 0; }
.route-head p { margin: 9px 0 0; line-height: 1.4; }
.map { white-space: nowrap; font-weight: 750; text-underline-offset: 4px; }
.progress-wrap { margin-bottom: 25px; }
.progress-wrap p { margin: 0 0 7px; font: 700 12px var(--mono); }
progress { appearance: none; display: block; width: 100%; height: 10px; border: 1px solid var(--ink); border-radius: 20px; overflow: hidden; background: var(--cream); }
progress::-webkit-progress-bar { background: var(--cream); }
progress::-webkit-progress-value { background: #5c4394; }
progress::-moz-progress-bar { background: #5c4394; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 15px; }
.card { display: flex; flex-direction: column; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 13px; padding: 17px; min-height: 236px; box-shadow: 3px 3px 0 var(--ink); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.place { font: 700 11px var(--mono); }
.tag { font: 700 10px var(--mono); background: var(--lavender); border-radius: 5px; padding: 4px 7px; }
.card[data-type="Suono"] .tag { background: var(--violet); }
.card[data-type="Disegno"] .tag { background: var(--pink); }
.card h3 { font-size: 26px; letter-spacing: -.045em; line-height: 1.05; margin: 15px 0 5px; }
.artist { margin: 0 0 12px; font-size: 14px; }
details { margin-bottom: 9px; }
summary { font-weight: 800; cursor: pointer; padding: 7px 0; }
.prompt { line-height: 1.48; margin: 8px 0 12px; }
.note-label, .sketch p { display: block; font-weight: 750; font-size: 14px; margin-block: 10px 5px; }
textarea { box-sizing: border-box; display: block; margin: 5px 0 8px; width: 100%; resize: vertical; background: var(--paper); border: 1px solid var(--ink); border-radius: 6px; padding: 8px; font-size: 16px; }
.complete { width: 100%; margin-top: auto; min-height: 43px; padding: 7px; border: 1px solid var(--ink); background: var(--paper); border-radius: 7px; font-weight: 750; }
.complete[aria-pressed="true"] { background: var(--lavender); }
.timer, .sketch-actions button, .download { display: inline-block; border: 1px solid var(--ink); border-radius: 5px; background: var(--violet); font-weight: 750; padding: 7px 9px; font-size: 13px; }
.timer-status { font-size: 14px; }
canvas { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--ink); border-radius: 6px; touch-action: none; background: white; cursor: crosshair; }
.sketch-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
footer { padding-block: 13px 25px; border-top: 1px solid var(--ink); display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
@media (max-width: 840px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .hero-inner { grid-template-columns: 1fr; padding-block: 32px 17px; }
  .art { min-height: 175px; width: 205px; justify-self: end; margin-top: -7px; }
  .paper { width: 126px; padding: 23px; gap: 10px; box-shadow: 5px 5px 0 var(--ink); }
  .stamp { width: 58px; font-size: 8px; }
  .star { font-size: 24px; }
  .route-head { display: block; }
  .map { display: inline-block; margin-top: 10px; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: auto; }
  footer { display: block; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.card[data-type="Foto"] .tag { background: var(--pink); }
.photo { margin-top: 12px; }
.photo p { font-size: 14px; line-height: 1.4; }
.photo label { font-size: 14px; font-weight: 750; }
.photo input { display: block; width: 100%; margin: 6px 0; font: inherit; }
.photo img { display: block; width: 100%; max-height: 260px; object-fit: contain; margin: 12px 0; border-radius: 6px; background: var(--paper); }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-actions button { border: 1px solid var(--ink); border-radius: 5px; background: var(--paper); font-size: 13px; padding: 7px 9px; }
.photo-status:empty { display: none; }

.map-panel { background: var(--cream); border: 1.5px solid var(--ink); border-radius: 12px; margin: 0 0 20px; padding: 8px 16px; }
.map-content { padding: 0 0 10px; }
.map-content p { margin: 6px 0 12px; }
.map-links, .map-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.map-links { margin-bottom: 12px; font-weight: 750; }
.map-content label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 750; }
.map-jump select, .map-jump button { font: inherit; border: 1px solid var(--ink); border-radius: 6px; padding: 8px 10px; min-height: 42px; }
.map-jump select { flex: 1 1 180px; min-width: 0; color: var(--ink); background: var(--paper); }
.map-jump button { color: white; background: var(--ink); font-weight: 750; }
.guide-facts { border-left: 3px solid var(--lavender); margin: 10px 0 12px; padding-left: 10px; font-size: 14px; line-height: 1.4; }
.guide-facts div + div { margin-top: 7px; }
.guide-facts dt { font-weight: 800; }
.guide-facts dd { margin: 0; }
.card { scroll-margin-top: 16px; }
.card:focus-within { border-color: #654299; }
.map-preview iframe { display: block; width: 100%; height: clamp(320px, 65vh, 650px); border: 1px solid var(--ink); border-radius: 6px; background: white; }

.card.is-map-selected{border-color:#28734b;outline:3px solid #28734b;outline-offset:3px;box-shadow:3px 3px 0 #28734b;background:#f2faf3;scroll-margin-top:24px}
.pavilion-content{display:grid;gap:14px;padding-top:12px}
.pavilion-content p{margin:0;line-height:1.6}
.pavilion-facts{display:grid;gap:10px;margin:0}
.pavilion-facts dt{font:700 11px var(--mono);text-transform:uppercase;margin-bottom:3px}
.pavilion-facts dd{margin:0;line-height:1.5;overflow-wrap:anywhere}
.pavilion-source,.pavilion-back{font-size:12px;line-height:1.5;justify-self:start}
.pavilion-back{font-weight:650}

/* Missione sempre visibile, risposta e descrizione a scomparsa */
.mission-box { border-left: 3px solid var(--ink); padding: 2px 0 2px 12px; margin: 12px 0 10px; }
.mission-title { font-weight: 800; margin: 0 0 4px; }
.mission-box .prompt { margin: 0; }
.mission-box .timer { margin-top: 10px; }
.card .complete + .pavilion-description { margin: 12px 0 0; }

.ludo-text { font-size: 1.05em; line-height: 1.5; }
.for-grownups { margin-top: 8px; font-size: .92em; }
.for-grownups summary { font-weight: 700; opacity: .8; }

/* Foto: pulsanti al posto dei campi file */
.photo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo > p, .photo > img, .photo > .photo-actions, .photo > .photo-status { flex-basis: 100%; }
.photo > label { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--violet); font-weight: 800; cursor: pointer; }
.photo > label:first-of-type::before { content: "📷"; }
.photo > label:last-of-type { background: var(--cream); }
.photo > label input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.photo > label:focus-within { outline: 3px solid #6b42a5; outline-offset: 3px; }
.photo .photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo .photo-actions[hidden] { display: none; }

/* Missioni stella e note per i grandi */
.card.is-star { border-color: #c98a12; box-shadow: 3px 3px 0 #c98a12; }
.card.is-star .mission-title { color: #8a5a00; }
.cards.only-stars .card:not(.is-star) { display: none; }
.star-filter { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 750; cursor: pointer; }
.star-filter input { width: 20px; height: 20px; accent-color: #c98a12; }
.grown-note { margin: 12px 0 0; padding: 8px 10px; border-radius: 8px; background: #fff3d6; color: #4a3400; font-size: .92em; line-height: 1.4; }

/* Telefono: più grande e più arioso */
@media (max-width: 600px) {
  :root { font-size: 17px; }
  body { line-height: 1.55; }
  .wrap { width: calc(100% - 32px); }
  .cards { gap: 22px; }
  .card { padding: 20px 18px; border-radius: 16px; }
  .card h3 { font-size: 27px; margin-top: 16px; }
  .place, .tag { font-size: 12.5px !important; }
  .tag { padding: 4px 9px; }
  .mission-box { margin: 16px 0 14px; padding-left: 14px; }
  .mission-box .prompt { font-size: 18px; line-height: 1.55; }
  .mission-title { font-size: 17px; margin-bottom: 6px; }
  .grown-note { margin-top: 16px; padding: 12px 14px; }
  summary { padding: 12px 0; }
  .complete { min-height: 50px; margin-block: 6px; }
  .map-panel { padding: 8px 10px; }
  .progress-wrap { margin-block: 26px 18px; }
  .star-filter { padding: 10px 0; }
  .photo > label, .sketch-actions button, .photo-actions a, .photo-actions button { min-height: 46px; }
  #biennale-stage, #ars-stage { margin-inline: -10px; border-radius: 0; }
}

/* "La mia risposta" come pulsante */
.answer { margin: 4px 0 14px; }
.answer > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--violet); box-shadow: 2px 2px 0 var(--ink); }
.answer > summary::-webkit-details-marker { display: none; }
.answer > summary:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.answer-main { display: grid; gap: 2px; min-width: 0; }
.answer-label { font-size: 19px; font-weight: 800; }
.answer-hint { font-size: 14.5px; font-weight: 500; opacity: .85; }
.answer-action { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 14px; font-weight: 800; }
.answer-action::after { content: "Apri ▾"; }
.answer[open] > summary { border-radius: 12px 12px 0 0; box-shadow: none; }
.answer[open] .answer-action::after { content: "Chiudi ▴"; }
.answer[open] > .mission { border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 12px 12px; padding: 14px 14px 16px; background: var(--cream); }
.answer .note-label { font-size: 17px; font-weight: 800; }
.answer textarea { font-size: 17px; min-height: 90px; }
.answer .photo > p, .answer .sketch > p, .answer .photo-status { font-size: 16px; }
.answer .sketch > p { font-weight: 800; }

/* "La mostra raccontata a Ludo e Anna": su computer resta una riga, su telefono diventa un pulsante */
.story-hint, .story-action { display: none; }
@media (max-width: 600px) {
  .story { margin-top: 14px; }
  .story > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--pink); box-shadow: 2px 2px 0 var(--ink); }
  .story > summary::-webkit-details-marker { display: none; }
  .story > summary:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
  .story-main { display: grid; gap: 2px; min-width: 0; }
  .story-label { font-size: 18px; font-weight: 800; }
  .story-hint { display: block; font-size: 14.5px; font-weight: 500; opacity: .85; }
  .story-action { display: block; flex: none; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 14px; font-weight: 800; }
  .story-action::after { content: "Leggi ▾"; }
  .story[open] > summary { border-radius: 12px 12px 0 0; box-shadow: none; }
  .story[open] .story-action::after { content: "Chiudi ▴"; }
  .story[open] > .pavilion-content { border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 12px 12px; padding: 14px 14px 16px; background: var(--cream); }
}

.album-tip { font-size: 15px; line-height: 1.45; background: var(--paper); border-radius: 8px; padding: 10px 12px; margin: 4px 0 0; }
.album-tip a { font-weight: 800; }
.album-link { display: inline-flex; align-items: center; min-height: 46px; margin-top: 12px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--cream); font-weight: 800; text-decoration: none; box-shadow: 2px 2px 0 var(--ink); }

.photo > img, img.sketch-copy { -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
img.sketch-copy { display: block; width: 100%; max-width: 480px; margin-top: 10px; border: 1px solid var(--ink); border-radius: 8px; background: white; }
.longpress-tip { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff3d6; color: #4a3400; font-size: 16px; font-weight: 700; line-height: 1.4; }

/* Fino a 4 foto per tappa */
.photo > .photo-count, .photo > .photo-gallery { flex-basis: 100%; }
.photo-count { margin: 4px 0 0; font: 700 13px var(--mono); }
.photo-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .photo-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.photo-gallery:empty { display: none; }
.photo-item { margin: 0; display: grid; gap: 8px; align-content: start; }
.photo-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; border-radius: 6px; border: 1px solid var(--ink); background: var(--paper); -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
.photo-item .photo-actions { display: grid; grid-template-columns: 1fr; gap: 6px; }
.photo-item .photo-actions a, .photo-item .photo-actions button { text-align: center; padding: 8px 6px; }
.photo-item .photo-actions a, .photo-item .photo-actions button { font-size: 13px; }
.photo-item .longpress-tip { font-size: 14px; }
