:root {
  color-scheme: dark;
  --white: #fff;
  --glass: rgba(10, 12, 16, .54);
  --line: rgba(255, 255, 255, .28);
  --signal: #ff4f78;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #07080a; color: var(--white); font-family: "Segoe UI Variable", "Segoe UI", sans-serif; }
button, a { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.booth, .screen { position: fixed; inset: 0; }
.screen > video, .screen > img { width: 100%; height: 100%; object-fit: cover; }
.camera-screen video { transform: scaleX(-1); }
.camera-shade, .loading-shade, .result-shade { position: absolute; inset: 0; pointer-events: none; }
.camera-shade { background: linear-gradient(180deg, rgba(0,0,0,.12), transparent 42%, rgba(0,0,0,.56)); }
.result-shade { background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.66)); }

.controls { position: absolute; z-index: 2; inset: auto 0 max(24px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding: 0 clamp(18px, 4vw, 64px); }
.scenarios { grid-column: 1; display: flex; gap: 10px; border: 0; padding: 0; margin: 0; align-items: end; }
.scenario input { position: absolute; opacity: 0; pointer-events: none; }
.scenario span { width: 74px; min-height: 74px; display: grid; place-items: center; align-content: center; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); backdrop-filter: blur(18px); cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.scenario b { font-size: 25px; line-height: 1; }
.scenario small { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.scenario input:checked + span { border-color: var(--white); background: rgba(255,255,255,.24); transform: translateY(-6px); }
.scenario input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 3px; }

.shutter { grid-column: 2; width: 110px; height: 110px; position: relative; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; background: rgba(8,10,14,.38); backdrop-filter: blur(18px); cursor: pointer; }
.shutter-core { width: 82px; height: 82px; border-radius: 50%; background: var(--white); transition: transform .16s ease, background .16s ease; }
.shutter-label { position: absolute; color: #111; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.shutter:hover .shutter-core { transform: scale(.94); background: #ffd8e1; }
.shutter:disabled { opacity: .45; cursor: wait; }
.shutter:focus-visible, .restart:focus-visible, .camera-error button:focus-visible, .qr-link:focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }

.message { position: absolute; z-index: 3; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: min(90vw, 620px); margin: 0; padding: 10px 16px; border-radius: 999px; background: rgba(130, 12, 42, .78); backdrop-filter: blur(14px); font-weight: 650; text-align: center; }
.message:empty { display: none; }
.camera-error { position: absolute; z-index: 4; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: #08090b; }
.camera-error p { margin: 0; font-size: clamp(24px, 4vw, 48px); font-weight: 750; }
.camera-error button, .restart { border: 1px solid var(--line); border-radius: 999px; padding: 16px 24px; background: var(--white); color: #111; font-weight: 750; cursor: pointer; }

.promo-carousel, .promo-slide { position: absolute; inset: 0; }
.promo-slide { opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.promo-slide.active { opacity: 1; }
.promo-slide > img { width: 100%; height: 100%; object-fit: cover; }
.promo-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,7,12,.86) 0%, rgba(4,7,12,.38) 42%, rgba(4,7,12,.06) 70%), linear-gradient(0deg, rgba(4,7,12,.52), transparent 45%); }
.promo-copy { position: absolute; z-index: 2; left: clamp(24px, 7vw, 110px); bottom: clamp(90px, 15vh, 170px); width: min(620px, calc(100% - 48px)); }
.promo-copy small { color: #ff9ab1; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.promo-copy h2 { max-width: 600px; margin: 10px 0 14px; font-size: clamp(46px, 7vw, 104px); line-height: .9; letter-spacing: -.055em; }
.promo-copy p { max-width: 460px; margin: 0; color: rgba(255,255,255,.82); font-size: clamp(17px, 2vw, 25px); }
.promo-progress { position: absolute; z-index: 3; left: clamp(24px, 7vw, 110px); bottom: clamp(34px, 6vh, 64px); display: flex; gap: 7px; }
.promo-progress span { width: 38px; height: 3px; background: rgba(255,255,255,.3); transition: background .25s, width .25s; }
.promo-progress span.active { width: 68px; background: var(--white); }
.generation-status { position: absolute; z-index: 4; top: max(24px, env(safe-area-inset-top)); right: clamp(24px, 4vw, 64px); display: flex; align-items: center; gap: 11px; padding: 10px 15px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; background: rgba(5,8,13,.5); backdrop-filter: blur(16px); }
.generation-status p { margin: 0; font-size: 13px; font-weight: 700; }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--white); border-radius: 50%; animation: spin .9s linear infinite; }

.result-screen > img { object-fit: contain; }
.result-controls { position: absolute; z-index: 2; right: clamp(20px, 4vw, 64px); bottom: max(24px, env(safe-area-inset-bottom)); display: flex; align-items: end; gap: 14px; }
.qr-link { display: grid; gap: 8px; padding: 12px; border: 1px solid rgba(255,255,255,.5); border-radius: 22px; background: rgba(255,255,255,.94); color: #111; text-decoration: none; box-shadow: 0 20px 70px rgba(0,0,0,.38); }
.qr-link img { width: clamp(150px, 18vw, 230px); height: clamp(150px, 18vw, 230px); display: block; }
.restart { background: var(--glass); color: var(--white); backdrop-filter: blur(18px); }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 760px) {
  .controls { grid-template-columns: 1fr; justify-items: center; gap: 18px; }
  .scenarios { grid-column: 1; max-width: 100%; overflow-x: auto; padding: 8px; }
  .scenario span { width: 62px; min-height: 62px; border-radius: 15px; }
  .scenario b { font-size: 21px; }
  .shutter { grid-column: 1; width: 92px; height: 92px; }
  .shutter-core { width: 68px; height: 68px; }
  .result-controls { left: 18px; right: 18px; justify-content: center; }
  .qr-link img { width: 150px; height: 150px; }
  .promo-copy { bottom: 118px; }
  .promo-copy h2 { font-size: clamp(42px, 14vw, 70px); }
  .promo-progress { bottom: 38px; }
  .generation-status { top: 14px; right: 14px; }
}
