/* =============================================
   GALLERIA DEGLI INVITATI - stile "galleria del telefono"
   Stessi colori e caratteri del sito (style.css).
   Colori scritti per esteso: il sito forza lo stile chiaro anche col tema scuro del telefono.
   ============================================= */

.g-page { background: #fff; color: rgb(18, 38, 84); min-height: 100vh; font-size: 17px; }
.g-ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Barra in alto (sempre visibile) ---------- */
.g-bar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid rgb(220, 224, 228); }
.g-bar-in { max-width: 1400px; margin: 0 auto; height: 60px; padding: 0 12px; display: flex; align-items: center; gap: 12px; }
/* Menu: solo icona blu del tema, a sinistra, centrata come il titolo. */
.g-bar-menu { width: 44px; height: 44px; margin-left: -8px; padding: 0; flex-shrink: 0; border: 0; background: transparent; color: rgb(24, 51, 112); display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.g-bar-menu .g-ico { width: 28px; height: 28px; stroke-width: 2.2; }
.g-bar-menu:active { opacity: 0.6; }
.g-bar-menu:focus-visible { outline: 3px solid rgb(186, 192, 198); outline-offset: 2px; }
.g-bar-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: rgb(24, 51, 112); line-height: 1; }
.g-bar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.g-seg { display: flex; margin-left: auto; border: 1px solid rgb(24, 51, 112); border-radius: 999px; overflow: hidden; }
.g-seg-btn { height: 26px; padding: 0 9px; border: 0; background: #fff; color: rgb(24, 51, 112); display: flex; align-items: center; gap: 4px; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.g-seg-btn + .g-seg-btn { border-left: 1px solid rgb(24, 51, 112); }
.g-seg-btn.is-icon { padding: 0 11px; }
.g-seg-btn .g-ico { width: 13px; height: 13px; stroke-width: 2.2; }
.g-seg-btn.is-on { background: rgb(24, 51, 112); color: #fff; }
.g-bar-note { margin: 0; padding: 7px 14px; text-align: center; font-size: 14px; color: rgb(24, 51, 112); background: rgb(240, 242, 245); }
.g-bar-note[hidden] { display: none; }
.g-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.g-file:focus-visible + .g-bar-note { margin: 0; padding: 7px 14px; text-align: center; font-size: 14px; color: rgb(24, 51, 112); background: rgb(240, 242, 245); }
.g-bar-note[hidden] { display: none; }
.g-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.g-file:focus-visible + .g-fab { outline: 3px solid rgb(186, 192, 198); outline-offset: 3px; }
.g-fab { position: fixed; left: 50%; bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); z-index: 40; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 28px; border-radius: 999px; background: linear-gradient(135deg, rgb(24, 51, 112), rgb(18, 38, 84)); color: #fff; font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: 0.5px; box-shadow: 0 1px 6px rgba(18, 38, 84, 0.16); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 0.15s ease; }
.g-fab:active { transform: translateX(-50%) scale(0.95); }
.g-fab .g-ico { width: 22px; height: 22px; }
.g-seg-btn:focus-visible, .g-v-btn:focus-visible, .g-v-act:focus-visible, .g-v-nav:focus-visible, .g-tile:focus-visible, .g-btn:focus-visible, .g-x:focus-visible { outline: 3px solid rgb(186, 192, 198); outline-offset: -3px; }

.g-main { max-width: 1400px; margin: 0 auto; padding: 0 0 110px; }
.g-wait { padding: 90px 24px; text-align: center; background: linear-gradient(135deg, rgb(24, 51, 112), rgb(18, 38, 84)); color: #fff; min-height: calc(100vh - 60px); }
.g-wait p { color: rgb(220, 224, 228); font-weight: 300; }

/* ---------- Griglia ---------- */
.g-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
.g-grid-single { display: none; }
.g-tile { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 3px; padding: 0; border: 0; background: rgb(220, 224, 228); overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 0.15s ease; }
.g-tile:active { transform: scale(0.96); }
.g-tile img, .g-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.g-tile img { opacity: 0; transition: opacity 0.45s ease; }
.g-tile img.is-loaded { opacity: 1; }
.g-tile video { background: rgb(18, 38, 84); }
.g-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(to top, rgba(0, 0, 0, 0.28), transparent); pointer-events: none; }
.g-tile-likes { position: absolute; left: 5px; bottom: 4px; z-index: 1; display: flex; align-items: center; gap: 3px; color: #fff; font-size: 12px; font-weight: 600; line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); pointer-events: none; }
.g-tile-comments { position: absolute; right: 5px; bottom: 4px; z-index: 1; display: flex; align-items: center; gap: 3px; color: #fff; font-size: 12px; font-weight: 600; line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); pointer-events: none; }
.g-tile-likes .g-ico, .g-tile-comments .g-ico { width: 15px; height: 15px; stroke-width: 2; fill: none; stroke: #fff; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.g-tile-play { position: absolute; top: 6px; right: 6px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.g-tile-play .g-ico { width: 14px; height: 14px; fill: #fff; stroke: #fff; }
.g-tile-na { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgb(160, 168, 176); }
.g-tile-na .g-ico { width: 34px; height: 34px; }

.g-status { text-align: center; font-size: 16px; line-height: 1.7; color: #555; padding: 26px 20px; }
.g-status .g-btn { margin-top: 14px; }
.g-sentinel { height: 1px; }
.g-more { display: flex; margin: 10px auto 0; }
.g-more[hidden] { display: none; }

.g-new-pill { position: sticky; top: 72px; z-index: 20; display: block; margin: 10px auto; padding: 11px 20px; border: 0; background: rgb(24, 51, 112); color: #fff; font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600; border-radius: 999px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); cursor: pointer; }
.g-new-pill[hidden] { display: none; }

/* ---------- Bottoni ---------- */
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 14px 24px; border: 2px solid rgb(24, 51, 112); background: #fff; color: rgb(24, 51, 112); font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; text-align: center; text-decoration: none; cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s; -webkit-tap-highlight-color: transparent; }
.g-btn:hover { background: rgb(24, 51, 112); color: #fff; }
.g-btn-primary { background: linear-gradient(135deg, rgb(24, 51, 112), rgb(18, 38, 84)); color: #fff; }
.g-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(24, 51, 112, 0.4); }
.g-btn[hidden] { display: none; }
.g-btn-danger { border-color: #c82333; background: #c82333; color: #fff; }
.g-btn-danger:hover { background: #a71d2a; border-color: #a71d2a; color: #fff; }
.g-btn[disabled] { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

/* ---------- Visualizzatore a schermo intero ---------- */
.g-viewer { position: fixed; inset: 0; z-index: 10001; background: #000; color: #fff; }
.g-viewer[hidden] { display: none; }
.g-v-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: max(8px, env(safe-area-inset-top)) 8px 26px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent); }
.g-v-btn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.g-v-btn[hidden] { display: none; }
.g-v-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.g-v-who .g-avatar { background: rgba(255, 255, 255, 0.2); }
.g-v-who-text { display: flex; flex-direction: column; min-width: 0; }
.g-v-who-text strong { font-size: 16px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-v-who-text span { font-size: 13px; color: rgba(255, 255, 255, 0.75); }
.g-v-stage { position: absolute; inset: 0; padding: 64px 0 84px; display: flex; align-items: center; justify-content: center; }
.g-v-stage img, .g-v-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.g-v-stage video { width: 100%; background: #000; }
.g-v-msg { padding: 0 30px; text-align: center; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, 0.9); }
.g-v-nav { position: absolute; top: 50%; z-index: 3; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer; }
.g-v-prev { left: 10px; }
.g-v-next { right: 10px; }
.g-v-nav[hidden] { display: none !important; }
@media (hover: hover) and (pointer: fine) { .g-v-nav { display: flex; } }
.g-v-actions { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: space-around; align-items: center; padding: 22px 10px max(10px, env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); }
.g-v-act { min-width: 64px; height: 52px; padding: 0 10px; border: 0; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; gap: 7px; font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.g-v-act .g-ico { width: 28px; height: 28px; }
.g-like.is-on .g-ico { fill: #ff4d5e; stroke: #ff4d5e; }

.g-avatar { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, rgb(24, 51, 112), rgb(18, 38, 84)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.g-avatar-sm { width: 36px; height: 36px; font-size: 13px; }

/* ---------- Finestre ---------- */
.g-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(10, 22, 54, 0.8); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.g-overlay[hidden] { display: none; }
.g-welcome { width: 100%; max-width: 480px; margin: auto; background: #fff; color: rgb(18, 38, 84); box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45); }
.g-welcome-head { padding: 34px 26px 26px; text-align: center; color: #fff; background: linear-gradient(135deg, rgb(24, 51, 112), rgb(18, 38, 84)); }
.g-welcome-head h2 { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 600; line-height: 1.15; margin-bottom: 14px; color: #fff; }
.g-wd { display: block; font-size: 22px; font-style: italic; font-weight: 400; color: rgb(186, 192, 198); margin: 2px 0; }
.g-wn { display: block; letter-spacing: 1px; }
.g-welcome-head p { font-size: 18px; line-height: 1.6; font-weight: 300; color: rgb(220, 224, 228); }
.g-welcome-form { padding: 24px 26px 28px; }
.g-welcome-text { font-size: 17px; line-height: 1.6; margin-bottom: 20px; color: rgb(18, 38, 84); }
.g-welcome-form label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 6px; color: rgb(18, 38, 84); }
.g-welcome-form input { display: block; width: 100%; min-height: 56px; margin-bottom: 18px; padding: 12px 14px; border: 2px solid rgb(186, 192, 198); background: #fff; color: rgb(18, 38, 84); font-family: 'Montserrat', sans-serif; font-size: 20px; border-radius: 0; -webkit-appearance: none; appearance: none; }
.g-welcome-form input:focus { outline: none; border-color: rgb(24, 51, 112); box-shadow: 0 0 0 3px rgba(24, 51, 112, 0.15); }
.g-welcome-form .g-btn { width: 100%; min-height: 60px; font-size: 18px; }
.g-welcome-note { margin-top: 14px; font-size: 14px; line-height: 1.5; color: #6b7280; text-align: center; }
.g-form-error { margin: -4px 0 16px; padding: 12px 14px; background: #fdecee; color: #a71d2a; font-size: 16px; line-height: 1.5; border-left: 4px solid #dc3545; }
.g-form-error[hidden] { display: none; }

.g-overlay.g-sheet { align-items: flex-end; padding: 0; }
.g-sheet-top { z-index: 10003; }
.g-sheet-box { width: 100%; max-width: 560px; margin: 0 auto; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; background: #fff; color: rgb(18, 38, 84); box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.4); animation: gUp 0.25s ease-out; }
@keyframes gUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.g-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 6px 16px; border-bottom: 1px solid rgb(220, 224, 228); }
.g-sheet-head h2 { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: rgb(24, 51, 112); }
.g-x { width: 48px; height: 48px; border: 0; background: transparent; color: rgb(24, 51, 112); font-size: 34px; line-height: 1; cursor: pointer; }
.g-x[hidden] { display: none; }

.g-comments-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 14px; min-height: 100px; }
.g-comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgb(240, 242, 245); }
.g-comment-body { flex: 1; min-width: 0; }
.g-comment-meta strong { font-size: 15px; color: rgb(18, 38, 84); }
.g-comment-meta span { margin-left: 8px; font-size: 12px; color: #6b7280; }
.g-comment-body p { margin-top: 4px; font-size: 16px; line-height: 1.5; color: rgb(18, 38, 84); word-wrap: break-word; overflow-wrap: anywhere; }
.g-comment-del { margin-top: 4px; padding: 6px 0; border: 0; background: none; color: #a71d2a; font-size: 14px; text-decoration: underline; cursor: pointer; }
.g-empty-small { padding: 18px 0; text-align: center; color: #555; font-size: 16px; }
.g-comment-form { padding: 8px 12px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid rgb(220, 224, 228); background: #fff; }
.g-comment-form textarea { display: block; width: 100%; min-width: 0; min-height: 72px; max-height: 160px; padding: 12px; resize: none; border: 2px solid rgb(186, 192, 198); background: #fff; color: rgb(18, 38, 84); font-family: 'Montserrat', sans-serif; font-size: 17px; line-height: 1.4; border-radius: 0; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.g-comment-form textarea:focus { outline: none; border-color: rgb(24, 51, 112); }
.g-comment-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.g-comment-count { font-size: 14px; color: #6b7280; }
.g-comment-count.is-warn { color: #b26a00; font-weight: 600; }
.g-comment-form .g-btn { min-height: 48px; padding: 10px 28px; }
.g-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Caricamento ---------- */
.g-upload-warn { margin: 0; padding: 12px 20px; background: #fff8e1; color: #6b4f00; font-size: 15px; line-height: 1.5; border-bottom: 1px solid #f1e1a6; }
.g-upload-warn[hidden] { display: none; }
.g-upload-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 20px; }
.g-up-row { padding: 12px 0; border-bottom: 1px solid rgb(240, 242, 245); }
.g-up-name { font-size: 15px; font-weight: 600; color: rgb(18, 38, 84); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-up-bar { height: 10px; margin: 8px 0 6px; background: rgb(220, 224, 228); overflow: hidden; }
.g-up-bar span { display: block; height: 100%; width: 0; background: rgb(24, 51, 112); transition: width 0.2s; }
.g-up-row.is-done .g-up-bar span { background: #28a745; }
.g-up-row.is-error .g-up-bar span { background: #dc3545; }
.g-up-state { font-size: 14px; color: #555; line-height: 1.5; }
.g-up-row.is-error .g-up-state { color: #a71d2a; }
.g-up-retry { margin-left: 8px; padding: 4px 0; border: 0; background: none; color: rgb(24, 51, 112); font-weight: 600; font-size: 14px; text-decoration: underline; cursor: pointer; }
.g-upload-summary { padding: 12px 20px 0; font-size: 16px; line-height: 1.5; font-weight: 600; color: rgb(18, 38, 84); text-align: center; }
.g-upload-summary:empty { display: none; }
.g-upload-end { display: grid; gap: 10px; padding: 14px 20px max(18px, env(safe-area-inset-bottom)); }
.g-upload-end[hidden] { display: none; }

/* ---------- Altezza reale dello schermo (iPhone: la barra di Safari si muove) ----------
   Con inset:0 il bordo basso puo finire sotto la barra e il contenuto viene tagliato:
   dvh e l'altezza della parte realmente visibile. */
.g-overlay, .g-viewer { bottom: auto; height: 100%; height: 100vh; height: 100dvh; }

/* Pannello di caricamento: una scheda staccata dai bordi, centrata in basso, mai tagliata */
.g-overlay.g-upload-sheet { padding: 0 12px max(24px, calc(env(safe-area-inset-bottom, 0px) + 18px)); }
.g-upload-sheet .g-sheet-box { max-width: 440px; max-height: 78vh; max-height: 78dvh; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 50px rgba(0, 0, 0, 0.5); }
.g-upload-sheet .g-upload-end { padding: 14px 18px 18px; }

/* ---------- Conferma ---------- */
.g-confirm { z-index: 10004; }
.g-confirm-box { width: 100%; max-width: 380px; margin: auto; padding: 26px 22px 22px; background: #fff; color: rgb(18, 38, 84); text-align: center; box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5); animation: gPopIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.g-confirm-box h2 { font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 600; color: rgb(24, 51, 112); margin-bottom: 8px; }
.g-confirm-box p { font-size: 16px; line-height: 1.6; color: #555; margin-bottom: 22px; }
.g-confirm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-confirm-btns .g-btn { padding: 12px 8px; letter-spacing: 0.5px; }

/* ---------- Telefoni: il benvenuto deve stare tutto a schermo, senza scorrere ---------- */
@media (max-width: 600px), (max-height: 760px) {
    .g-overlay { padding: 10px; }
    .g-welcome-head { padding: 20px 20px 16px; }
    .g-welcome-head h2 { font-size: 27px; margin-bottom: 8px; }
    .g-wd { font-size: 17px; margin: 0; }
    .g-welcome-head p { font-size: 15px; line-height: 1.45; }
    .g-welcome-form { padding: 14px 20px 16px; }
    .g-welcome-text { font-size: 15px; line-height: 1.45; margin-bottom: 12px; }
    .g-welcome-form label { font-size: 14px; margin-bottom: 4px; }
    .g-welcome-form input { min-height: 48px; margin-bottom: 10px; font-size: 18px; }
    .g-welcome-form .g-btn { min-height: 52px; }
    .g-welcome-note { margin-top: 10px; font-size: 13px; }
}

/* ---------- Avviso ---------- */
.g-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); z-index: 10005; width: max-content; max-width: calc(100vw - 32px); transform: translate(-50%, 250%); opacity: 0; pointer-events: none; padding: 16px 26px; background: linear-gradient(135deg, rgb(24, 51, 112), rgb(18, 38, 84)); color: #fff; font-size: 16px; font-weight: 600; text-align: center; border: 1px solid rgba(186, 192, 198, 0.3); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); transition: transform 0.35s ease, opacity 0.25s ease; }
.g-toast.is-on { transform: translate(-50%, 0); opacity: 1; }

body.g-lock { overflow: hidden; }

/* ---------- Animazioni ---------- */
@keyframes gFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes gPopIn { from { opacity: 0; transform: translateY(18px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes gPopOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes gSlideDown { from { transform: none; opacity: 1; } to { transform: translateY(40px); opacity: 0; } }
@keyframes gViewerIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes gViewerOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.97); } }
@keyframes gHeart { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }

.g-overlay { animation: gFade 0.22s ease-out; }
.g-overlay.is-out { animation: gFadeOut 0.2s ease-in forwards; }
.g-welcome { animation: gPopIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.g-sheet.is-out .g-sheet-box { animation: gSlideDown 0.2s ease-in forwards; }
.g-confirm.is-out .g-confirm-box { animation: gPopOut 0.2s ease-in forwards; }
.g-viewer { animation: gViewerIn 0.25s ease-out; }
.g-viewer.is-out { animation: gViewerOut 0.2s ease-in forwards; }
.g-v-stage img, .g-v-stage video { animation: gFade 0.3s ease; }
.g-v-act, .g-v-btn, .g-v-nav { transition: transform 0.15s ease, background 0.2s; }
.g-v-act:active, .g-v-btn:active { transform: scale(0.88); }
.g-like.is-on .g-ico { animation: gHeart 0.4s ease; }
.g-new-pill { animation: gPopIn 0.3s ease-out; }
.g-seg-btn { transition: background 0.2s, color 0.2s; }
.g-comment { animation: gFade 0.3s ease; }
.g-up-row { animation: gFade 0.3s ease; }

@media (min-width: 700px) { .g-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; } }
@media (min-width: 1025px) {
    .g-bar { top: 65px; }
    .g-bar-in { padding: 0 40px; }
    .g-bar-menu { display: none; }
    .g-main { padding: 0 40px 70px; }
    .g-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 4px 0; }
    .g-new-pill { top: 140px; }
}
@media (prefers-reduced-motion: reduce) {
    .g-overlay, .g-welcome, .g-sheet-box, .g-confirm-box, .g-viewer, .g-v-stage img, .g-v-stage video, .g-like.is-on .g-ico, .g-new-pill, .g-comment, .g-up-row { animation: none !important; }
    .g-toast, .g-up-bar span, .g-tile, .g-tile img, .g-v-act, .g-bar-menu { transition: none !important; }
    .g-tile img { opacity: 1; }
}

/* Telefoni molto stretti (320 px): la barra deve restare su una riga */
@media (max-width: 360px) {
    .g-bar-in { gap: 8px; }
    .g-bar-title { font-size: 22px; }
    .g-seg-btn { padding: 0 7px; }
    .g-seg-btn.is-icon { padding: 0 9px; }
}
