/* D&D On Site — stili del portale (si aggiungono ad app.css). Pensati da 320px (Z Fold chiuso) a desktop. */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1; width: 100%; }

/* barra superiore */
.top .session { flex-wrap: wrap; }
.top .session .who { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { color: var(--bar-ink); text-decoration: none; border: 1px solid #3A3A3A; border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: 12px; line-height: 1; }
.pill:hover { border-color: var(--bar-ink); color: var(--bar-ink); }
@media (max-width: 560px) {
  .top .wrap { gap: 8px 10px; }
  .top .partners { order: 2; }
  .top .session { order: 3; width: 100%; justify-content: flex-end; }
  .top .session .who { margin-right: auto; }
  .chip-logo { height: 42px; padding: 3px 6px; }
  .chip-logo img { height: 34px; }
}

/* pulsanti */
.btn { min-height: 40px; justify-content: center; }
.btn.big { min-height: 46px; padding-inline: 18px; font-size: 15px; }
.btn.red { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn.red:hover { filter: brightness(.94); }

/* accesso */
.login .panel { padding: 24px; }
.login h1 { font-size: 34px; }
.oauth { display: grid; gap: 10px; }
.oauth-btn { background: var(--surface); color: var(--ink); border-color: var(--line); min-height: 48px; font-size: 15px; gap: 10px; }
.oauth-btn svg { width: 20px; height: 20px; flex: none; }
.oauth-btn:hover { border-color: var(--ink); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login input[name=code] { font: inherit; font-family: var(--mono); font-size: 24px; letter-spacing: .3em; text-align: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); }
.login input { font-size: 16px !important; } /* niente zoom automatico su iPhone */
@media (max-width: 480px) { .login { margin-top: 3vh; } .login .panel { padding: 18px; } .login h1 { font-size: 28px; } }

/* elenco eventi */
.events-page { display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .ttl { display: flex; flex-direction: column; gap: 6px; }
.seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--surface); max-width: 100%; }
.seg a { text-decoration: none; padding: 9px 14px; font-weight: 650; font-size: 13px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.seg a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.seg .n { font-family: var(--mono); font-size: 11.5px; opacity: .7; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.ev-card { text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.ev-card:hover { border-color: var(--ink); color: var(--ink); }
.ev-top { background: var(--bar); color: var(--bar-ink); padding: 16px; display: flex; flex-direction: column; gap: 6px; min-height: 104px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.bdg { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; line-height: 1.2; }
.bdg.ok { background: var(--ok-bg); color: var(--ok); }
.bdg.warn { background: var(--warn-bg); color: var(--warn); }
.bdg.live, .bdg.soon { background: #FF3B40; color: #FFFFFF; }
.bdg.later { background: #2A2A2A; color: var(--bar-ink); }
.bdg.done, .bdg.muted { background: #2A2A2A; color: var(--bar-muted); }
.ev-name { font-family: var(--display); font-size: 24px; font-weight: 800; text-transform: uppercase; line-height: 1.02; font-variation-settings: "wdth" 80; overflow-wrap: anywhere; }
.ev-sub { color: var(--bar-muted); font-size: 13px; }
.ev-info { margin: 0; padding: 12px 16px 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; }
.ev-info dt { color: var(--muted); }
.ev-info dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); }
.empty { color: var(--muted); }
.note { margin: 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 420px) {
  .page-head .btn.big { width: 100%; }
  .seg { align-self: stretch; } .seg a { flex: 1; justify-content: center; padding-inline: 8px; }
  .ev-info { grid-template-columns: 1fr; gap: 0; } .ev-info dd { margin-bottom: 6px; }
}

/* gestione evento */
nav.tabs a.soon { opacity: .55; cursor: default; }
nav.tabs a small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-left: 4px; color: var(--bar-muted); }
.admin { display: flex; flex-direction: column; gap: 16px; }
.evform { display: flex; flex-direction: column; gap: 16px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.card .note { margin-top: -6px; }
.g2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.dates { display: flex; flex-direction: column; gap: 12px; }
.f { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; min-width: 0; border: 0; padding: 0; margin: 0; }
.f legend { padding: 0; margin-bottom: 6px; }
.f.wide { grid-column: 1 / -1; }
.f input, .f select, .f textarea { font: inherit; font-size: 16px; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); width: 100%; min-height: 44px; }
.f input.mono, .f textarea { font-family: var(--mono); font-size: 14px; }
.f input[aria-invalid], .f textarea[aria-invalid] { border-color: var(--crit); background: var(--crit-bg); }
.f small { font-weight: 400; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ferr { color: var(--crit); font-weight: 600; font-size: 12.5px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; font-weight: 650; background: var(--surface); min-height: 38px; display: inline-flex; align-items: center; }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input:checked + span::before { content: "✓ "; white-space: pre; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14.5px; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.flash { padding: 10px 14px; border-radius: 4px; font-weight: 600; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--crit-bg); color: var(--crit); }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.publish { align-items: flex-start; }
@media (max-width: 480px) {
  .card { padding: 14px; }
  .head-actions, .head-actions .btn, .form-foot .btn { width: 100%; }
  .form-foot { flex-direction: column-reverse; }
  .publish .btn { width: 100%; }
}
@media (min-width: 560px) { .dates .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* scheda File */
.drop { position: relative; border: 2px dashed #B9B6B0; border-radius: var(--r); background: var(--surface); padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--crit-bg); }
.drop.busy { opacity: .6; pointer-events: none; }
.drop.busy::after { content: "Caricamento in corso…"; font-weight: 700; }
.drop-in { display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; width: 100%; }
.drop-in input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-in b { font-size: 18px; } .drop-in u { color: var(--accent); }
.drop-in span { font-size: 13px; color: var(--muted); } .drop-in .small { font-size: 12px; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.locs { display: flex; flex-direction: column; gap: 10px; }
.loc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: end; }
.loc-row .del { min-height: 44px; font-size: 13px; }
.file.old { opacity: .6; }
.fhead { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.type { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--ink); color: var(--bg); white-space: nowrap; }
.fn { font-family: var(--mono); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.fhead .meta { font-size: 12px; color: var(--muted); }
.factions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.sel { font: inherit; font-size: 14px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); min-height: 38px; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.sub { display: block; font-size: 13px; margin: 2px 0 6px; }
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--sunk); vertical-align: top; }
.tbl .r { text-align: right; } .nw { white-space: nowrap; } .small { font-size: 12px; }
details summary { cursor: pointer; font-weight: 700; font-size: 13.5px; padding: 6px 0; color: var(--ink); }
details[open] summary { margin-bottom: 6px; }
.ok-line { margin: 0; font-weight: 700; color: var(--ok); font-size: 13.5px; }
.warnline { font-weight: 700; color: var(--warn); font-size: 13px; }
.vis { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; font-size: 13px; padding-top: 10px; border-top: 1px solid var(--sunk); }
.vis label { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; flex-wrap: wrap; }
.vis .note { flex-basis: 100%; }
.plan { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 14px; align-items: start; }
.plan img, .plan .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--sunk); border-radius: 4px; border: 1px solid var(--line); }
.plan .ph { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 600; color: var(--muted); }
@media (max-width: 560px) {
  .loc-row { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--sunk); }
  .factions { margin-left: 0; width: 100%; } .factions .inline:first-child { flex: 1; } .factions select { width: 100%; }
  .plan { grid-template-columns: 1fr; }
  .vis label, .vis select { width: 100%; }
  /* tabelle → righe impilate sul Fold chiuso */
  .tbl table, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr:first-child { display: none; }
  .tbl tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 1px 0; } .tbl td:empty { display: none; }
  .tbl .r { text-align: left; } .tbl .r::before { content: "Q.tà "; color: var(--muted); font-family: var(--body); }
  .tbl .nw { font-weight: 700; }
}
.stack { display: flex; flex-direction: column; gap: 12px; } .prog td:nth-child(4) { white-space: nowrap; }

/* scheda Partecipanti */
.flash.warnbox { background: var(--warn-bg); color: var(--warn); }
.addp { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; align-items: end; }
.imp { display: flex; flex-direction: column; gap: 8px; }
.imp-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--sunk); }
.imp-row .check { align-items: flex-start; flex: 1; min-width: 220px; }
.people { display: flex; flex-direction: column; }
.person { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.person .who { display: flex; flex-direction: column; min-width: 0; } .person .who > * { overflow-wrap: anywhere; }
.person .pgrp select { width: 100%; }
.pinv { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.warnt { color: var(--warn); font-weight: 700; }
.pedit { grid-column: 1 / -1; } .pedit summary { font-size: 12.5px; color: var(--muted); padding: 0; }
.pedit[open] { padding: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.tg { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 0; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink); min-height: 40px; }
.tg i { width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.tg i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; transition: left .15s; }
.tg.on i { background: var(--ok); } .tg.on i::after { left: 19px; }
.matrix { display: flex; flex-direction: column; }
.mrow { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--sunk); }
.mrow > span:first-child { display: flex; flex-direction: column; } .mrow small { color: var(--muted); font-size: 12px; }
.mhead { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.mhead span:not(:first-child) { text-align: center; }
.sw { display: flex; justify-content: center; position: relative; cursor: pointer; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw span { width: 40px; height: 34px; border-radius: 4px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #B9B6B0; background: var(--surface); }
.sw span::before { content: "—"; }
.sw input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sw input:checked + span::before { content: "✓"; }
.sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw em { display: none; }
@media (max-width: 760px) {
  .person { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .person .who { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .person { grid-template-columns: 1fr; }
  .pinv { flex-direction: row; align-items: center; justify-content: space-between; }
  .mhead { display: none; }
  .mrow { grid-template-columns: 1fr; gap: 6px; padding: 12px 0; }
  .sw { justify-content: flex-start; gap: 10px; align-items: center; }
  .sw em { display: inline; font-style: normal; font-size: 13.5px; font-weight: 600; }
  .page-head form, .page-head form .btn { width: 100%; }
}

/* dashboard evento */
nav.tabs a[aria-current] { color: var(--bar-ink); border-bottom-color: var(--accent); }
.top .lang a { color: var(--bar-muted); text-decoration: none; padding: 5px 9px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.top .lang a[aria-current] { background: var(--accent); color: #FFFFFF; }
.draft-banner { background: var(--warn-bg); color: var(--warn); text-align: center; font-weight: 700; font-size: 13px; padding: 8px 16px; }
.dash section[data-view] { display: grid; gap: 18px; }
.dhero { background: var(--bar); color: var(--bar-ink); border-radius: var(--r); padding: 22px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: end; }
.dtitle { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dtitle .eyebrow { color: #FF3B40; }
.dtitle h1 { overflow-wrap: anywhere; }
.dsub { color: var(--bar-muted); font-size: 14px; }
.dboxes { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.dbox { border: 1px solid #3A3A3A; border-radius: var(--r); padding: 12px 16px; min-width: 130px; display: flex; flex-direction: column; gap: 4px; }
.dbox .k { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--bar-muted); }
.dbox b { font-size: 38px; line-height: 1; font-weight: 600; }
.dbox b small { font-size: 16px; color: var(--bar-muted); }
.dbox.live { border-color: #FF3B40; } .dbox.live .live-dot { color: #FF3B40; font-size: 28px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.row.now { background: var(--crit-bg); margin-inline: -10px; padding-inline: 10px; border-left: 3px solid var(--accent); }
.row.past .a, .row.past .t { opacity: .55; }
.tag.nx { background: var(--ink); color: var(--bg); }
.dlocs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.dloc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; }
.dloc:hover { border-color: var(--ink); }
.dloc .ph { height: 140px; background: var(--sunk); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dloc .ph img, .dloc .ph canvas { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; background: #FFFFFF; }
.dloc .ph.empty { background: var(--bar); color: var(--bar-muted); font-family: var(--display); font-weight: 800; font-size: 34px; }
.dloc .b { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.dloc .b b { font-weight: 750; font-size: 16px; } .dloc .b span { font-size: 13px; color: var(--muted); }
.dloc .wx:empty { display: none; }
.locv { display: grid; gap: 16px; }
.lochead h1 { font-size: clamp(28px, 6vw, 44px); }
.gallery canvas { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #FFFFFF; display: block; }
.fx { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; font-style: normal; font-family: var(--mono); font-weight: 600; color: var(--muted); background: var(--sunk); width: 100%; }
.wxdays { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.wxd { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.wxd span:first-child { font-weight: 700; text-transform: capitalize; } .wxd b { font-size: 24px; line-height: 1.1; }
.daysel { flex-wrap: wrap; border-radius: 12px; }
.lb .pages canvas { display: block; margin: 0 auto; box-shadow: 0 1px 6px rgba(0,0,0,.4); max-width: 100%; height: auto; }
.lb .pages img { margin: 0 auto; display: block; }
@media (max-width: 760px) {
  .dhero { grid-template-columns: 1fr; padding: 18px; }
  .dboxes { justify-content: flex-start; } .dbox { flex: 1; min-width: 120px; }
}
@media (max-width: 560px) {
  .top .lang { margin-left: 0; }
  .dbox b { font-size: 30px; }
  .contact .act .btn { flex: 1; justify-content: center; min-height: 42px; }
}
nav.tabs .wrap { flex-wrap: nowrap; }
.dtitle h1 { font-size: clamp(26px, 8.5vw, 52px); overflow-wrap: break-word; word-break: normal; hyphens: auto; }
details.eq summary > span { display: inline-flex; gap: 6px; align-items: baseline; }
.dtitle h1 { font-size: clamp(24px, 7.5vw, 52px); overflow-wrap: normal; }
.dbox { min-width: 0; } .dbox .k { letter-spacing: .06em; overflow-wrap: anywhere; }
.morning-prev { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
