/* Gli stili restano confinati al documento: il pannello e il sito non cambiano. */
.miniatore-theme {
    color: var(--ink);
    overflow-wrap: anywhere;
}
.miniatore-theme [hidden] { display: none !important; }
.miniatore-theme[data-template="modern"],
.miniatore-theme[data-template="modern-minimal"] {
    --parchment: #f4f6fb; --parchment-dark: #dce3ee;
    --ink: #202e42; --ink-soft: #52647b;
    --accent: #4255b5; --accent-dark: #273675; --gold: #b58934;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.65;
}
.miniatore-theme[data-template="modern"] {
    background: radial-gradient(ellipse at top right, #e9e8ff, transparent 60%), #f4f6fb;
    border: 1px solid #dce3ee;
    border-radius: 20px;
    padding: clamp(1rem, 4vw, 2.5rem);
    box-shadow: 0 12px 36px #202e4210;
}
.miniatore-theme[data-template="modern"] .chat-bubble {
    border-radius: 14px; padding: .85rem 1.1rem; box-shadow: 0 3px 12px #202e4209;
}
.miniatore-theme[data-template="modern"] .chat-line { margin-top: 1rem; }
.miniatore-theme[data-template="modern"] .chat-line--continued { margin-top: .25rem; }
.miniatore-theme[data-template="modern"] .fato-box {
    border-radius: 14px; background: linear-gradient(120deg, #273675, #4255b5);
    padding: 1.1rem;
}
.miniatore-theme[data-template="modern"] .sussurro-box,
.miniatore-theme[data-template="modern"] .equip-box { border-radius: 12px; }
.miniatore-theme[data-template="modern"] .chat-character,
.miniatore-theme[data-template="modern"] h1,
.miniatore-theme[data-template="modern-minimal"] .chat-character,
.miniatore-theme[data-template="modern-minimal"] h1 { font-family: inherit; letter-spacing: -.02em; }
.miniatore-theme[data-template="modern-minimal"] {
    background: #fff; padding: clamp(.75rem, 3vw, 2rem); border-radius: 0; box-shadow: none;
}
.miniatore-theme[data-template="modern-minimal"] .chat-bubble {
    border-width: 0 0 1px 3px; border-radius: 0; box-shadow: none;
    padding: .7rem 1rem 1rem;
}
.miniatore-theme[data-template="modern-minimal"] .chat-bubble--highlight { border-width: 1px 1px 1px 3px; }
.miniatore-theme[data-template="modern-minimal"] .fato-box {
    background: #f4f6fb; color: var(--accent-dark); border-block: 1px solid var(--parchment-dark);
    border-radius: 0; font-weight: 600;
}
.miniatore-theme[data-template="modern-minimal"] .fato-box em { color: var(--ink-soft); }
.miniatore-theme[data-template="modern-minimal"] .sussurro-box { background: transparent; border-left: 2px solid var(--parchment-dark); border-radius: 0; }
.miniatore-theme[data-template="modern-minimal"] .equip-box { background: #f4f6fb; border-radius: 0; }
.miniatore-theme[data-template="fantasy"],
.miniatore-theme[data-template="fantasy-minimal"] {
    --parchment: #faf3e4; --parchment-dark: #e5d6b5;
    --ink: #392d25; --ink-soft: #76604b;
    --accent: #806031; --accent-dark: #533b22; --gold: #a88239;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    line-height: 1.7;
}
.miniatore-theme[data-template="fantasy"] {
    background:
        radial-gradient(ellipse at 0 0, #bd955a30, transparent 50%),
        radial-gradient(ellipse at 100% 100%, #bd955a25, transparent 50%),
        repeating-linear-gradient(0deg, #80603104 0 1px, transparent 1px 4px), #faf3e4;
    border: 1px solid #b89961; outline: 1px solid #e5d6b5; outline-offset: -7px;
    border-radius: 3px; padding: clamp(1rem, 4vw, 2.5rem);
    box-shadow: 0 8px 28px #533b221a;
}
.miniatore-theme[data-template="fantasy"] h1,
.miniatore-theme[data-template="fantasy"] .giocata-full__title {
    font-family: "Palatino Linotype", Palatino, Georgia, serif;
    font-variant: small-caps; letter-spacing: .06em; text-align: center;
    border-bottom: 3px double #b89961; padding-bottom: .6rem;
}
.miniatore-theme[data-template="fantasy"] .chat-bubble {
    background: #fffdf7; border-radius: 2px; padding: .8rem 1rem;
}
.miniatore-theme[data-template="fantasy"] .fato-box {
    background: #533b22; border: 3px double #b89961; border-radius: 2px; padding: 1rem;
}
.miniatore-theme[data-template="fantasy"] .chat-character { font-variant: small-caps; letter-spacing: .03em; }
.miniatore-theme[data-template="fantasy"] .sussurro-box { background: #e5d6b580; border-radius: 2px; }
.miniatore-theme[data-template="fantasy-minimal"] {
    background: #fffdf7; padding: clamp(.75rem, 3vw, 2rem); border-radius: 0; box-shadow: none;
    border-top: 2px solid #b89961;
}
.miniatore-theme[data-template="fantasy-minimal"] h1,
.miniatore-theme[data-template="fantasy-minimal"] .giocata-full__title { font-family: inherit; font-variant: small-caps; }
.miniatore-theme[data-template="fantasy-minimal"] .chat-bubble {
    background: #fffdf7; border-width: 0 0 1px 3px; border-radius: 0; padding: .7rem 1rem 1rem; box-shadow: none;
}
.miniatore-theme[data-template="fantasy-minimal"] .chat-bubble--highlight { border-width: 1px 1px 1px 3px; }
.miniatore-theme[data-template="fantasy-minimal"] .fato-box {
    background: transparent; color: var(--accent-dark); border-block: 3px double var(--parchment-dark); border-radius: 0;
}
.miniatore-theme[data-template="fantasy-minimal"] .fato-box em { color: var(--ink-soft); }
.miniatore-theme[data-template="fantasy-minimal"] .sussurro-box { background: transparent; border-left: 2px solid var(--gold); border-radius: 0; }
.miniatore-theme[data-template="fantasy-minimal"] .equip-box { background: #faf3e4; border-radius: 0; }
.miniatore-theme:not([data-template="default"]) .chat-text { line-height: 1.7; }
.miniatore-theme:not([data-template="default"]) .giocata-full__header { border-color: var(--parchment-dark); }
.miniatore-theme:not([data-template="default"]) .participant-chip { color: var(--ink); }
@media (max-width: 480px) {
    .miniatore-doc { padding: 1rem .75rem; }
    .miniatore-theme .chat-meta { flex-wrap: wrap; gap: .2rem .6rem; }
    .miniatore-theme .chat-line { gap: .5rem; }
    .miniatore-theme .chat-line--hidden, .miniatore-theme .equip-box { margin-left: 0; }
}
@media print {
    .miniatore-theme { box-shadow: none !important; outline: none !important; }
    .miniatore-theme .chat-hidden-content[hidden] { display: block !important; }
    .miniatore-theme .chat-hidden-row__hint { display: none; }
}
