:root {
  color-scheme: light;
  --paper: #f6f4ed;
  --ink: #1c2119;
  --muted: #545b50;
  --line: #d5d8c9;
  --accent: #ddfa79;
  font: 100%/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(1160px, calc(100% - clamp(2rem, 8vw, 7rem))); margin-inline: auto; }
.masthead { min-height: 72px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { font-size: 1.5rem; font-weight: 850; letter-spacing: -.055em; }
.brand span { background: var(--accent); padding: 0 .17em; margin-left: .08em; }
.label { font-size: .875rem; font-weight: 700; color: var(--muted); }
main { padding-block: clamp(1.6rem, 6vw, 5rem); }
.layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.panel { grid-column: 2; padding-top: clamp(0rem, 2vw, 2rem); min-width: 0; }
.stage[hidden] + .panel { grid-column: 1 / -1; }
.stage { display: grid; place-items: center; position: relative; overflow: hidden; background: #22291f; border-radius: 20px; aspect-ratio: 4 / 3; }
#photo-stage { aspect-ratio: auto; min-height: 12rem; }
.stage > img, video { display: block; width: 100%; height: 100%; object-fit: contain; }
video { position: absolute; inset: 0; object-fit: cover; transform: scaleX(-1); }
#capture { position: absolute; inset: 0; }
.stage:has(#capture:not([hidden])) .camera-idle { visibility: hidden; }
.camera-idle { width: min(45%, 170px); aspect-ratio: 4 / 3; position: relative; display: grid; place-items: center; color: var(--accent); }
.camera-idle span { position: absolute; width: 24%; height: 32%; border: 2px solid currentColor; }
.camera-idle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.camera-idle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.camera-idle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.camera-idle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.camera-idle b { width: 13%; aspect-ratio: 1; border: 2px solid currentColor; border-radius: 50%; }
#countdown { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); background: #1c211966; font-size: clamp(5rem, 16vw, 12rem); line-height: 1; font-weight: 850; }
h1, h2, p { margin: 0 0 1rem; }
h1 { font-size: clamp(2.6rem, 5.7vw, 5.1rem); line-height: .98; letter-spacing: -.055em; font-weight: 850; margin-bottom: 1.5rem; }
h2 { font-size: 1.4rem; line-height: 1.15; letter-spacing: -.035em; }
p { max-width: 44ch; }
form { display: grid; gap: .8rem; max-width: 32rem; }
form p { margin: 0; }
label { font-weight: 650; }
input:not([type=checkbox]), select { display: block; width: 100%; min-height: 48px; padding: .65rem .85rem; border: 1px solid #797e73; border-radius: 9px; background: white; color: var(--ink); font: inherit; }
#handle { margin-top: .45rem; }
.check { display: flex; align-items: flex-start; gap: .65rem; padding-block: .5rem; }
.check input { width: 1.25rem; height: 1.25rem; flex: none; margin: .13rem 0 0; accent-color: #324417; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .65rem 1.1rem; border: 1px solid var(--ink); border-radius: 9px; font: inherit; font-weight: 730; text-align: center; text-decoration: none; cursor: pointer; background: var(--accent); color: var(--ink); transition: transform .15s ease, background .15s ease; }
.secondary { background: transparent; }
button:hover:not(:disabled), .button:hover { transform: translateY(-2px); background: #e9f5bd; }
button:active:not(:disabled), .button:active { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #3c600b; outline-offset: 4px; }
.skip { position: absolute; z-index: 1; top: .5rem; left: 1rem; padding: .65rem; background: white; transform: translateY(-200%); }
.skip:focus { transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.status:not(:empty) { margin-block: .8rem; color: var(--muted); }
.status:empty, .muted:empty { display: none; }
.muted { margin-top: 1.25rem; color: var(--muted); font-size: .9rem; }
#consent { border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: 1.6rem; }
#consent h2 { margin-bottom: 0; }
#ticket canvas { display: block; width: min(100%, 300px) !important; height: auto !important; margin-bottom: .75rem; border-radius: 10px; }
#entries { padding: 0; list-style: none; display: grid; gap: .8rem; max-width: 46rem; }
#entries li { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
#entries img { display: block; width: min(100%, 380px); margin-block: 1rem; border-radius: 9px; }
[data-enter] { animation: enter .26s ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 740px) {
  .layout { grid-template-columns: 1fr; }
  .panel { grid-column: auto; }
  .masthead { min-height: 60px; }
}
@media (max-width: 440px) {
  .actions > *, .panel > button, #controls > button, #ticket button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

#camera-picker { margin-top: 1rem; max-width: 24rem; }
#camera-picker select { margin-top: .35rem; }
