/*
    Città del giorno — l'aspetto delle sue pagine pubbliche (README daily D49).

    Un atlante da viaggio: carta color sabbia, verde acqua dei mari, terracotta dei segnaposto; titoli con le
    grazie, come le tavole di un atlante; le linee di quota e una rotta tratteggiata nel riquadro grande; la
    mappa senza nomi come cartolina, con il francobollo «?» al posto del bollino; gli indizi come biglietti.

    Sopra le forme del foglio del modulo (dailyguess.css, importato qui sotto: il layout carica i fogli dei
    giochi accesi, e la Città non deve dipendere dal Personaggio acceso). Tutto sotto .theme-citta, la classe
    che il layout mette sul contenitore della pagina, sulla scheda e sulla card in home. Nessun font esterno:
    una richiesta a un fornitore per ogni pagina indicizzata non vale una famiglia di caratteri.
*/

@import url("dailyguess.css");

.theme-citta {
    --bg: #f7f2e8;
    --surface: #fffdf8;
    --surface-2: #f3ecdf;
    --line: #e9dfcd;
    --line-strong: #d8c9ae;
    --ink: #1f2a2c;
    --ink-soft: #4b5654;
    --ink-faint: #75807d;

    --accent: #0f766e;
    --accent-ink: #ffffff;
    --accent-soft: #dcefea;

    --dg-pin: #d9532b;
    --dg-sun: #e0a526;
    --dg-sea: #2c7fb8;
    --dg-grass: #4f9a5c;
    --dg-rose: #c2416b;
    --dg-paper: #fffdf8;
    --dg-map-paper: #f2efe9;
    --dg-ink-paper: #3a3227;
    --dg-hero: linear-gradient(135deg, #0b4f4a 0%, #0f766e 45%, #1f7fa8 100%);
    --dg-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
    .theme-citta {
        --bg: #0e1717;
        --surface: #142121;
        --surface-2: #1a2a29;
        --line: #243634;
        --line-strong: #31504c;
        --ink: #edf3f1;
        --ink-soft: #b4c4c0;
        --ink-faint: #879793;

        --accent: #5fd4c4;
        --accent-ink: #082220;
        --accent-soft: #173733;

        --dg-pin: #f07a50;
        --dg-sun: #f2bf4a;
        --dg-sea: #5aa9e0;
        --dg-grass: #79c487;
        --dg-rose: #e86f96;
        --dg-paper: #f5efe2;
        --dg-map-paper: #f2efe9;
        --dg-ink-paper: #3a3227;
        --dg-hero: linear-gradient(135deg, #062a28 0%, #0a4a45 50%, #11425e 100%);
    }
}

/* ---------- titoli da atlante ---------- */

.theme-citta h1,
.theme-citta h2,
.theme-citta .dg-snap .dg-name,
.theme-citta .dg-plate-t {
    font-family: var(--dg-serif);
    letter-spacing: -.01em;
}

.theme-citta main h1 { font-weight: 700; }
.theme-citta main h2 { font-weight: 700; }

/* La scheda del gioco nell'intestazione e la card in home: il colore del gioco, nient'altro. */
.game-tab.theme-citta.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- pulsanti ---------- */

.theme-citta .dg-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.35rem;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, var(--dg-sun), var(--dg-pin));
    color: #ffffff;
    font-weight: 800;
    font-size: 1.02rem;
    text-decoration: none;
    box-shadow: 0 10px 24px -10px var(--dg-pin);
    transition: transform .15s ease, box-shadow .15s ease;
}

.theme-citta .dg-cta:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--dg-pin); }

.theme-citta .dg-ghost {
    display: inline-flex;
    align-items: center;
    padding: .72rem 1.2rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .55);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

.theme-citta .dg-ghost:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }

/* ---------- il riquadro grande: mare, linee di quota, una rotta ---------- */

.theme-citta .dg-hero {
    background:
        repeating-radial-gradient(circle at 88% 12%, transparent 0 22px, rgba(255, 255, 255, .07) 22px 23px),
        repeating-radial-gradient(circle at 8% 100%, transparent 0 30px, rgba(255, 255, 255, .05) 30px 31px),
        var(--dg-hero);
    box-shadow: 0 24px 60px -30px #0b4f4a;
}

/* Al posto dei punti interrogativi del Personaggio: una rosa dei venti e una rotta tratteggiata. */
.theme-citta .dg-hero::before {
    content: "";
    right: -60px;
    top: -60px;
    width: 260px;
    height: 260px;
    transform: none;
    opacity: .16;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23fff'%3E%3Cpath d='M50 2l7 41 41 7-41 7-7 41-7-41-41-7 41-7z'/%3E%3Cpath d='M50 22l4 24 24 4-24 4-4 24-4-24-24-4 24-4z' transform='rotate(45 50 50)'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='46' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='50' cy='50' r='38' fill='none' stroke='%23fff' stroke-width='.8' stroke-dasharray='2 3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.theme-citta .dg-hero::after {
    content: "";
    left: 30%;
    bottom: 18px;
    width: 46%;
    height: 90px;
    transform: none;
    border-top: 3px dashed rgba(255, 255, 255, .22);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.theme-citta .dg-hero h1 { font-weight: 700; letter-spacing: -.02em; }

.theme-citta .dg-hero .dg-kicker {
    background: rgba(255, 255, 255, .16);
    letter-spacing: .14em;
    font-family: var(--font);
}

/* ---------- la mappa senza nomi come cartolina ---------- */

.theme-citta .dg-polaroid {
    max-width: 380px;
    padding: .7rem .7rem 2.7rem;
    background: var(--dg-paper);
    border-radius: 4px;
    box-shadow: 0 22px 44px -18px rgba(4, 30, 28, .6);
    transform: rotate(-2deg);
}

.theme-citta .dg-polaroid.tilt-right { transform: rotate(2deg); }
.theme-citta .dg-polaroid:hover { transform: rotate(0deg) scale(1.02); }

.theme-citta .dg-polaroid img {
    background: var(--dg-map-paper);
    border-radius: 2px;
    outline: 1px solid rgba(58, 50, 39, .12);
    outline-offset: -1px;
}

.theme-citta .dg-polaroid figcaption {
    font-family: var(--dg-serif);
    font-style: italic;
    font-weight: 600;
    color: var(--dg-ink-paper);
}

/* Il timbro postale sotto il francobollo: due cerchi e le onde dell'annullo. */
.theme-citta .dg-polaroid::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 10px;
    width: 70px;
    height: 26px;
    opacity: .5;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 26' fill='none' stroke='%233a3227' stroke-width='1.4'%3E%3Cpath d='M2 5c6-4 10 4 16 0s10 4 16 0 10 4 16 0 10 4 18 0M2 13c6-4 10 4 16 0s10 4 16 0 10 4 16 0 10 4 18 0M2 21c6-4 10 4 16 0s10 4 16 0 10 4 16 0 10 4 18 0'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}

/* Su un telefono la cartolina è stretta: l'annullo coprirebbe la data. */
@media (max-width: 480px) {
    .theme-citta .dg-polaroid::after { display: none; }
}

/* Il francobollo «?»: bordo dentellato, al posto del bollino giallo. */
.theme-citta .dg-sticker {
    top: -16px;
    right: -12px;
    width: 64px;
    height: 74px;
    border-radius: 0;
    background: var(--dg-pin);
    color: #ffffff;
    font-family: var(--dg-serif);
    font-size: 2.1rem;
    transform: rotate(8deg);
    box-shadow: 0 8px 16px -6px rgba(0, 0, 0, .45);
    /* I dentelli: fori su tutta la superficie, coperti al centro da un rettangolo pieno — restano sul bordo. */
    padding: 5px;
    -webkit-mask: radial-gradient(circle 3.5px, transparent 96%, #000) -5px -5px / 10px 10px round, linear-gradient(#000 0 0) content-box;
    mask: radial-gradient(circle 3.5px, transparent 96%, #000) -5px -5px / 10px 10px round, linear-gradient(#000 0 0) content-box;
}

.theme-citta .dg-sticker::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1.5px solid rgba(255, 255, 255, .6);
}

/* La foto della città, a round chiuso, è orizzontale: la cartolina la mostra intera. */
.theme-citta .dg-reveal .dg-polaroid img { aspect-ratio: 4 / 3; }
.theme-citta .dg-reveal { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }

@media (max-width: 760px) {
    .theme-citta .dg-reveal { grid-template-columns: minmax(0, 1fr); }
}

.theme-citta .dg-reveal .dg-was { background: linear-gradient(135deg, var(--dg-sun), var(--dg-pin)); }
.theme-citta .dg-reveal h1 { font-weight: 700; letter-spacing: -.02em; }

/* ---------- gli indizi come biglietti ---------- */

.theme-citta .dg-bubble {
    border-radius: 12px;
    border: 1.5px dashed var(--line-strong);
    background: var(--surface);
}

.theme-citta .dg-bubble::after { display: none; }

.theme-citta .dg-bubble .dg-label { color: var(--dg-pin); letter-spacing: .14em; }
.theme-citta .dg-hero .dg-bubble { color: var(--ink); }

/* ---------- la scala: le tappe di un viaggio ---------- */

.theme-citta .dg-ladder { position: relative; }

.theme-citta .dg-step:nth-child(1) { --c: var(--dg-pin); }
.theme-citta .dg-step:nth-child(2) { --c: var(--dg-sun); }
.theme-citta .dg-step:nth-child(3) { --c: var(--dg-rose); }
.theme-citta .dg-step:nth-child(4) { --c: var(--dg-sea); }
.theme-citta .dg-step:nth-child(5) { --c: var(--accent); }
.theme-citta .dg-step:nth-child(6) { --c: var(--dg-grass); }

.theme-citta .dg-step .dg-bar { border-radius: 10px 10px 4px 4px; }

.theme-citta .dg-move { border-top: 4px solid var(--c, var(--accent)); }
.theme-citta .dg-move:nth-child(1) { --c: var(--dg-sea); }
.theme-citta .dg-move:nth-child(2) { --c: var(--dg-sun); }
.theme-citta .dg-move:nth-child(3) { --c: var(--dg-pin); }

/* ---------- archivio: una parete di cartoline ---------- */

.theme-citta .dg-snap {
    position: relative;
    padding: .6rem .6rem .8rem;
    background: var(--dg-paper);
    border-radius: 4px;
    color: var(--dg-ink-paper);
    box-shadow: 0 14px 30px -16px rgba(4, 30, 28, .55);
}

.theme-citta .dg-snap img { aspect-ratio: 4 / 3; background: var(--dg-map-paper); border-radius: 2px; }
.theme-citta .dg-snap .dg-date { color: #8a7c66; }
.theme-citta .dg-snap .dg-name { font-weight: 700; font-size: 1.12rem; }
.theme-citta .dg-snap .dg-meter-l { color: #6c6152; }
.theme-citta .dg-snap .dg-snap-know { color: #5b5144; font-style: italic; font-family: var(--dg-serif); font-size: .86rem; }
.theme-citta .dg-meter { background: #ece3d3; }
.theme-citta .dg-meter span { background: linear-gradient(90deg, var(--accent), var(--dg-sea)); }

/* Un piccolo francobollo su ogni cartolina. */
.theme-citta .dg-snap::after {
    content: "";
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 22px;
    height: 26px;
    background: var(--dg-pin);
    opacity: .85;
    padding: 3px;
    -webkit-mask: radial-gradient(circle 1.6px, transparent 96%, #000) -2.5px -2.5px / 5px 5px round, linear-gradient(#000 0 0) content-box;
    mask: radial-gradient(circle 1.6px, transparent 96%, #000) -2.5px -2.5px / 5px 5px round, linear-gradient(#000 0 0) content-box;
}

/* ---------- il round chiuso ---------- */

.theme-citta .dg-clues li:nth-child(1) { --c: var(--dg-pin); }
.theme-citta .dg-clues li:nth-child(2) { --c: var(--dg-sun); }
.theme-citta .dg-clues li:nth-child(3) { --c: var(--dg-rose); }
.theme-citta .dg-clues li:nth-child(4) { --c: var(--dg-sea); }
.theme-citta .dg-clues li:nth-child(5) { --c: var(--accent); }
.theme-citta .dg-clues li:nth-child(6) { --c: var(--dg-grass); }

.theme-citta .dg-tile:nth-child(1) { --c: var(--dg-sea); }
.theme-citta .dg-tile:nth-child(2) { --c: var(--dg-grass); }
.theme-citta .dg-tile:nth-child(3) { --c: var(--dg-sun); }
.theme-citta .dg-tile:nth-child(4) { --c: var(--dg-pin); }

.theme-citta .dg-talk { background: linear-gradient(150deg, var(--accent-soft), var(--surface) 80%); }

/* La mappa di fine partita: una tavola d'atlante con la cornice e il segnaposto che pulsa. */
.theme-citta .dg-map-frame {
    border: 0;
    outline: 8px solid var(--dg-paper);
    outline-offset: -8px;
    box-shadow: 0 0 0 1px var(--line-strong), 0 20px 40px -24px rgba(4, 30, 28, .6);
}

.theme-citta .dg-map-frame:not(.is-live)::before {
    content: "N";
    position: absolute;
    z-index: 1;
    top: 18px;
    left: 18px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dg-paper);
    color: var(--dg-ink-paper);
    font-family: var(--dg-serif);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.theme-citta .dg-map-frame:not(.is-live)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--dg-pin) 45%, transparent);
    animation: citta-pulse 2.4s ease-out infinite;
}

.theme-citta .dg-pin { z-index: 2; }

@keyframes citta-pulse {
    0% { transform: scale(.6); opacity: .9; }
    100% { transform: scale(4.5); opacity: 0; }
}

/* Leaflet dentro la cornice: i suoi controlli con i nostri colori. */
.theme-citta .dg-map-frame.is-live { outline: 0; }
.theme-citta .leaflet-container { font: inherit; background: var(--dg-map-paper); }
.theme-citta .leaflet-control-attribution { font-size: .7rem; }

/* «Lo sapevi?»: la pagina di una guida, con l'angolo piegato. */
.theme-citta .dg-know {
    position: relative;
    background: var(--dg-know-bg, var(--surface));
    border-color: var(--line-strong);
}

.theme-citta .dg-know::after {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 34px;
    height: 34px;
    border-radius: 0 20px 0 10px;
    background: linear-gradient(225deg, var(--bg) 50%, var(--line-strong) 50%);
}

.theme-citta .dg-quote blockquote { font-family: var(--dg-serif); font-size: 1.1rem; }
.theme-citta .dg-quote blockquote::before { color: var(--dg-pin); }
.theme-citta .dg-fact-icon { background: var(--accent-soft); }

/* L'icona di ogni curiosità, dal suo tipo (CityCuriosityKinds). */
.theme-citta .dg-facts [data-kind="nickname"] .dg-fact-icon::before { content: "🏷️"; }
.theme-citta .dg-facts [data-kind="patron"] .dg-fact-icon::before { content: "⛪"; }
.theme-citta .dg-facts [data-kind="twins"] .dg-fact-icon::before { content: "🤝"; }
.theme-citta .dg-facts [data-kind="unesco"] .dg-fact-icon::before { content: "🏛️"; }
.theme-citta .dg-facts [data-kind="born"] .dg-fact-icon::before { content: "👤"; }
.theme-citta .dg-facts [data-kind="founded"] .dg-fact-icon::before { content: "📜"; }
.theme-citta .dg-facts [data-kind="distance"] .dg-fact-icon::before { content: "📏"; }
.theme-citta .dg-facts [data-kind="populous"] .dg-fact-icon::before { content: "👥"; }

/* Le immagini degli indizi: tavole con la didascalia sotto. */
.theme-citta .dg-plate { border-radius: 6px; background: var(--dg-paper); color: var(--dg-ink-paper); padding: .55rem .55rem 0; }
.theme-citta .dg-plate img { border-radius: 2px; }
.theme-citta .dg-plate figcaption { padding: .6rem .3rem .75rem; }
.theme-citta .dg-plate-n { color: var(--dg-pin); }
.theme-citta .dg-plate-c { color: #6c6152; }
.theme-citta .dg-plate-c a { color: #0f766e; }

/* ---------- classifica ---------- */

.theme-citta .dg-place.p1 { --c: var(--dg-sun); }
.theme-citta .dg-initial { background: var(--accent-soft); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .theme-citta .dg-polaroid,
    .theme-citta .dg-polaroid:hover,
    .theme-citta .dg-cta:hover { transform: none; }

    .theme-citta .dg-map-frame::after { animation: none; }
}
