/* ANTI Photo Experience. Nessun font o foglio di stile esterno. */
:root {
  color-scheme: dark;
  --bg: #111014;
  --panel: #1b191f;
  --line: rgba(255, 255, 255, .12);
  --text: #fbfaf7;
  --muted: #b5b0bd;
  --lime: #d3fb62;
  --pink: #f784db;
  --cyan: #8de9e4;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 4% 38%, rgba(216, 73, 202, .10), transparent 43%),
              radial-gradient(ellipse at 95% 14%, rgba(72, 227, 199, .08), transparent 40%), var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, .button { touch-action: manipulation; }
button, a { color: inherit; }
button { cursor: pointer; }
a { text-underline-offset: 4px; }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, canvas:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 4px;
}
.page-shell { max-width: 1160px; margin: 0 auto; padding: 28px 42px 20px; }
.brand-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.brand { display: block; line-height: 0; }
.brand img { display: block; width: 110px; height: auto; }
.experience-label { font-size: 10px; letter-spacing: .18em; font-weight: 750; color: var(--muted); white-space: nowrap; }
.tiny-star { font-size: 20px; color: var(--pink); margin-right: 8px; vertical-align: -2px; }
.experience-layout { display: grid; grid-template-columns: 1fr 424px; align-items: center; gap: 50px; padding: 34px 0 28px; }
.intro { padding-bottom: 40px; }
.eyebrow { color: var(--cyan); font-size: 10px; letter-spacing: .14em; font-weight: 700; line-height: 1.9; margin: 0 0 26px; }
h1 { font-size: clamp(46px, 5.2vw, 70px); line-height: 1.01; letter-spacing: -.065em; font-weight: 850; margin: 0 0 28px; }
h1 span { color: var(--lime); }
.intro-copy { color: var(--muted); line-height: 1.7; max-width: 300px; font-size: 16px; }
.steps { display: flex; flex-wrap: wrap; gap: 20px; padding: 23px 0 27px; margin-top: 20px; border-top: 1px solid var(--line); max-width: 340px; }
.steps span { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.steps b { font-size: 11px; color: var(--pink); font-weight: 600; }
.social-signature { font-size: 17px; font-weight: 750; letter-spacing: -.03em; }
.social-signature span { display: inline-block; color: var(--muted); font-weight: 400; margin-left: 15px; }
.camera-app { padding: 18px 22px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 26px 80px rgba(0, 0, 0, .22); }
.app-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 0 13px; }
.state-label { display: inline-flex; gap: 7px; align-items: center; font-size: 9px; letter-spacing: .1em; font-weight: 700; }
.state-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }
.state-dot.is-live { background: var(--lime); box-shadow: 0 0 9px rgba(211,251,98,.35); }
.format-label { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.stage { position: relative; aspect-ratio: 9 / 16; width: min(100%, 318px); margin: 0 auto; background: #25212d; overflow: hidden; border-radius: 14px; isolation: isolate; }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-bottom: 55px; background: radial-gradient(ellipse at 70% 38%, #403050 0%, #242329 62%, #282532 100%); }
.placeholder-star { font-size: 25px; color: var(--pink); margin-bottom: 13px; }
.placeholder p { margin: 0 0 14px; font-size: 37px; letter-spacing: -.055em; font-weight: 750; line-height: 1.03; }
.placeholder > span:last-child { color: #d0c7d7; line-height: 1.6; font-size: 10px; }
.camera-video, #editorCanvas, .result-image, .overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Il video conserva tutto il campo ricevuto. L'export usa la stessa geometria.
   42% lascia un po' più di spazio sotto, dove si trova il serpente della cornice. */
.camera-video { object-fit: contain; object-position: 50% 42%; z-index: 1; }
.stage[data-mode="live"] { background: linear-gradient(to bottom, #253e40 0%, #24212f 48%, #432644 100%); }
.stage[data-camera-framing="fill"] .camera-video { object-fit: cover; object-position: 50% 50%; }
.camera-video.is-mirrored { transform: scaleX(-1); }
#editorCanvas { z-index: 1; cursor: grab; touch-action: none; }
#editorCanvas:active { cursor: grabbing; }
.overlay { z-index: 2; object-fit: fill; pointer-events: none; user-select: none; -webkit-user-select: none; }
.result-image { z-index: 3; object-fit: contain; }
.busy-layer { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; background: rgba(20,17,26,.84); padding: 25px; text-align: center; }
.busy-layer p { font-size: 13px; line-height: 1.5; margin: 0; }
.spinner { width: 28px; height: 28px; border: 2px solid #ffffff30; border-top-color: var(--lime); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.countdown { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; font-size: 110px; font-weight: 850; color: white; background: #0003; text-shadow: 0 3px 30px #0008; pointer-events: none; }
.flash { position: absolute; inset: 0; z-index: 7; pointer-events: none; background: white; opacity: 0; }
.flash.is-flashing { animation: flash .28s ease-out; }
@keyframes flash { 0% { opacity: .8; } 100% { opacity: 0; } }
.status { font-size: 11px; color: var(--muted); line-height: 1.45; min-height: 32px; margin: 11px 0 7px; text-align: center; }
.status[data-kind="error"] { color: #ffc9d5; }
.status[data-kind="success"] { color: var(--lime); }
.controls { display: flex; flex-direction: column; gap: 8px; }
.button { min-height: 46px; width: 100%; padding: 12px 14px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; border-radius: 12px; font-weight: 750; font-size: 13px; border: 1px solid transparent; transition: background .15s, transform .15s; text-decoration: none; }
.button-primary { color: #1b2210; background: var(--lime); }
.button-primary:enabled:hover { background: #defd90; }
.button-secondary { background: rgba(255,255,255,.025); color: var(--text); border-color: var(--line); }
.button-secondary:enabled:hover { background: rgba(255,255,255,.065); }
.button:enabled:active { transform: translateY(1px); }
button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.text-button { background: none; border: 0; font-size: 11px; color: var(--muted); padding: 12px 9px; min-height: 40px; text-align: center; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: underline; text-decoration-color: #ffffff30; }
.text-button:hover { color: var(--text); }
.framing-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #111014; border: 1px solid var(--line); border-radius: 12px; }
.framing-button { min-height: 37px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; }
.framing-button[aria-pressed="true"] { background: #d3fb6216; border-color: #d3fb6245; color: var(--lime); }
.framing-hint { margin: 0 0 2px; min-height: 15px; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.5; }
.camera-details { color: var(--muted); font-size: 9px; line-height: 1.6; text-align: center; }
.camera-details summary { cursor: pointer; min-height: 30px; padding: 6px; }
.camera-details p { text-align: left; margin: 4px 0 8px; overflow-wrap: anywhere; }
.version-label { font-size: 8px; opacity: .65; letter-spacing: 0; margin-left: 4px; }
.tools-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 1px; }
.tool-button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px; min-height: 44px; background: #ffffff04; border: 1px solid var(--line); color: var(--text); border-radius: 10px; font-size: 10px; }
.tool-button svg { width: 15px; height: 15px; }
.tool-button[aria-pressed="true"] { border-color: #d3fb6265; background: #d3fb6210; color: var(--lime); }
.capture-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; }
.result-actions { display: flex; gap: 8px; }
.result-actions .button { flex: 1 1 0; }
.result-links { display: flex; justify-content: center; gap: 22px; }
.save-help, .editor-help { font-size: 10px; color: var(--muted); line-height: 1.5; text-align: center; margin: 3px 0; }
.delete-button { font-size: 10px; opacity: .85; margin-top: -8px; }
.zoom-control { display: flex; gap: 12px; align-items: center; font-size: 11px; min-height: 36px; }
.zoom-control input { flex: 1; accent-color: var(--lime); min-width: 80px; min-height: 30px; }
.zoom-control output { min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.device-note { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 9px; color: #aba4b2; margin: 12px 0 2px; }
.device-note span { color: var(--cyan); font-size: 15px; }
.browser-hint { font-size: 11px; line-height: 1.5; color: #ffdfad; border: 1px solid #ffe4b52e; border-radius: 10px; padding: 12px; margin: 0 0 12px; }
.page-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.page-footer > span { white-space: nowrap; padding-top: 8px; }
.page-footer > span > span { color: var(--pink); padding: 0 5px; }
.page-footer details { max-width: 610px; font-size: 11px; letter-spacing: normal; line-height: 1.65; text-align: right; }
.page-footer summary { padding: 8px 0; cursor: pointer; }
.help-content { text-align: left; background: #ffffff04; padding: 6px 16px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; }
.help-content strong, .help-content b { color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 12px; background: var(--lime); color: #141414; }
.skip-link:focus { top: 16px; }
.noscript-message { padding: 20px; color: #111; background: var(--lime); position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; }
@media (max-width: 900px) {
  .page-shell { padding: 23px 27px 20px; }
  .experience-layout { grid-template-columns: 1fr 370px; gap: 25px; }
  h1 { font-size: 49px; }
  .intro-copy { font-size: 14px; }
}
@media (max-width: 700px) {
  .page-shell { max-width: 458px; padding: max(14px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .brand-header { border-bottom: 0; padding-bottom: 13px; gap: 10px; }
  .brand img { width: 75px; }
  .experience-label { font-size: 8px; letter-spacing: .12em; }
  .tiny-star { font-size: 16px; margin-right: 5px; }
  .experience-layout { display: block; padding: 0 0 18px; }
  .intro { padding-bottom: 11px; }
  .eyebrow, .intro-copy, .steps, .social-signature { display: none; }
  h1 { font-size: 22px; line-height: 1.12; letter-spacing: -.04em; margin: 0; }
  h1 br { display: none; }
  h1 span { margin-left: 3px; }
  .camera-app { border-radius: 19px; padding: 13px 13px 11px; }
  .app-topline { padding-bottom: 10px; }
  .stage { width: min(100%, 326px); width: min(100%, max(203px, calc((100svh - 303px) * .5625))); border-radius: 10px; }
  .stage[data-mode="live"] { width: min(100%, max(186px, calc((100svh - 414px) * .5625))); }
  .placeholder p { font-size: 32px; }
  .placeholder > span:last-child { font-size: 9px; }
  .placeholder { padding-bottom: 36px; }
  .status { font-size: 10px; min-height: 29px; margin: 9px 0 6px; }
  .button { min-height: 45px; font-size: 12px; padding: 11px 12px; }
  .text-button { min-height: 36px; padding: 10px 7px; }
  .device-note { font-size: 8px; margin-top: 9px; }
  .page-footer { padding-top: 8px; font-size: 8px; gap: 14px; }
  .page-footer details { font-size: 10px; }
  .page-footer:has(details[open]) { flex-direction: column; gap: 0; }
  .page-footer:has(details[open]) details { width: 100%; text-align: left; }
  .save-help, .editor-help { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}


/* v1.2: inquadratura fissa Riempi */
.framing-control[hidden], .framing-hint[hidden] { display: none !important; }

/* v1.3: Foto + Video */
.capture-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 0 7px; padding: 4px; background: #111014; border: 1px solid var(--line); border-radius: 12px; }
.capture-mode-button { min-height: 38px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.capture-mode-button[aria-pressed="true"] { background: #d3fb6216; border-color: #d3fb6245; color: var(--lime); }
.button-record { color: white; background: #e72c59; border-color: #ff6484; }
.button-record:enabled:hover { background: #f23a66; }
.button-record.is-recording { background: #b51e41; }
.record-dot { width: 15px; height: 15px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px #ffffff22; }
.button-record.is-recording .record-dot { border-radius: 3px; width: 13px; height: 13px; }
.result-video { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; object-fit: contain; background: #000; }
.rec-badge { position: absolute; z-index: 8; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; background: rgba(10,8,12,.72); color: #fff; font-size: 10px; letter-spacing: .05em; backdrop-filter: blur(8px); }
.rec-badge > span { width: 8px; height: 8px; border-radius: 50%; background: #ff315d; box-shadow: 0 0 10px #ff315d; }
.rec-badge time { font-variant-numeric: tabular-nums; opacity: .8; min-width: 31px; }
body.video-mode #uploadIdle { display: none; }
body.video-mode #timerToggle { display: none; }
body.video-mode #capture { display: none; }
body.video-mode #recordVideo { display: inline-flex !important; }
body.video-mode .save-help.photo-only { display: none; }
body.video-result #captureMode { display: none; }
@media (max-width:700px){
  .capture-mode { margin-top: 8px; }
  .capture-mode-button { min-height: 36px; font-size: 11px; }
}
