@font-face {
  font-family: "LINE Seed TW";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/assets/fonts/line-seed/LINESeedTW_OTF_Rg.woff2") format("woff2");
}

@font-face {
  font-family: "LINE Seed TW";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/assets/fonts/line-seed/LINESeedTW_OTF_Bd.woff2") format("woff2");
}

@font-face {
  font-family: "LINE Seed TW";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/static/assets/fonts/line-seed/LINESeedTW_OTF_Eb.woff2") format("woff2");
}

:root {
  --canvas: #fdfbf7;
  --ink: #2d2d2d;
  --muted: #e5e0d8;
  --red: #ff4d4d;
  --blue: #2d5da1;
  --yellow: #fff9c4;
  --white: #ffffff;
  --tape: #d6d2ca;
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-md: 7px 7px 0 var(--ink);
  --shadow-soft: 3px 3px 0 #2d2d2d1f;
  --wobbly: 255px 18px 225px 16px / 18px 225px 18px 255px;
  --wobbly-md: 34px 18px 28px 20px / 20px 30px 18px 34px;
  --wobbly-lg: 46px 24px 42px 22px / 24px 44px 22px 46px;
  --font-main: "LINE Seed TW", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-main);
}

body {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  color: var(--ink);
  background: var(--muted);
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px dashed var(--blue);
  outline-offset: 5px;
}

.booth-shell {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--canvas);
  background-image:
    radial-gradient(var(--muted) 1px, transparent 1.5px),
    linear-gradient(to bottom, transparent 31px, #e5e0d880 32px);
  background-position:
    0 0,
    0 8px;
  background-size:
    24px 24px,
    100% 32px;
}

.booth-shell::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 20% 25%, #ffffff 0 1px, transparent 2px),
    radial-gradient(circle at 70% 45%, #2d2d2d 0 0.7px, transparent 1.5px);
  background-size: 58px 58px, 43px 43px;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  min-height: 100dvh;
  overflow: hidden;
}

.screen.is-active {
  display: block;
}

.eyebrow {
  width: fit-content;
  margin: 0;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly);
  background: var(--yellow);
  box-shadow: var(--shadow-soft);
  padding: 8px 16px;
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-2deg);
}

.bau-button {
  min-height: 56px;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly);
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 700;
  transition:
    transform 100ms ease-out,
    box-shadow 100ms ease-out,
    background-color 100ms ease-out,
    color 100ms ease-out;
}

.bau-button:hover:not(:disabled) {
  color: var(--white);
  background: var(--red);
  transform: translate(2px, 2px) rotate(-1deg);
  box-shadow: 2px 2px 0 var(--ink);
}

.bau-button:active:not(:disabled) {
  transform: translate(4px, 4px) rotate(0deg);
  box-shadow: none;
}

.red-button {
  background: var(--white);
}

.blue-button {
  background: var(--yellow);
}

.yellow-button {
  background: var(--muted);
}

.white-button {
  background: var(--white);
}

.geo-mark,
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.geo-circle,
.geo-square,
.geo-triangle {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 55% 45% 52% 48% / 44% 58% 42% 56%;
  background: var(--yellow);
}

.geo-circle {
  border-radius: 48% 52% 44% 56% / 60% 38% 62% 40%;
  background: var(--red);
}

.geo-square {
  background: var(--blue);
  transform: rotate(4deg);
}

.geo-triangle {
  width: 24px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 45% 55% 38% 62% / 58% 42% 60% 40%;
  background: var(--yellow);
  transform: rotate(-8deg);
}

.shape,
.sticker {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.shape {
  border: 3px dashed var(--ink);
  box-shadow: var(--shadow-soft);
}

.shape.circle {
  width: 26vmin;
  height: 24vmin;
  border-radius: 48% 52% 42% 58% / 56% 40% 60% 44%;
  left: 5vw;
  bottom: 7vh;
}

.shape.square {
  width: 20vmin;
  height: 18vmin;
  right: 10vw;
  top: 10vh;
  border-radius: 34px 18px 28px 16px / 18px 30px 16px 34px;
  transform: rotate(8deg);
}

.shape.triangle {
  width: 28vmin;
  height: 18vmin;
  right: 24vw;
  bottom: 9vh;
  border-radius: 40% 60% 45% 55% / 50% 46% 54% 50%;
  background: var(--yellow);
  transform: rotate(-7deg);
}

.red {
  background: #ff4d4d26;
}

.violet {
  background: #e5e0d8;
}

.yellow {
  background: var(--yellow);
}

.sticker {
  border: 3px solid var(--ink);
  border-radius: var(--wobbly);
  box-shadow: var(--shadow-soft);
  background: var(--white);
  font-family: var(--font-main);
  font-weight: 800;
  line-height: 1;
}

.sticker-pop {
  z-index: 4;
  top: 78px;
  right: auto;
  bottom: auto;
  left: 50%;
  display: grid;
  width: auto;
  height: auto;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 0;
  font-size: 2.65rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-shadow: 3px 3px 0 var(--yellow);
  transform: translateX(-50%) rotate(-2deg);
  animation: text-float 3s ease-in-out infinite;
}

.start-screen {
  padding: clamp(26px, 4vw, 44px) clamp(24px, 5vw, 58px)
    calc(clamp(116px, 15vh, 154px) + env(safe-area-inset-bottom));
}

.home-logo {
  position: absolute;
  top: 30px;
  left: 34px;
  right: auto;
  bottom: auto;
  z-index: 3;
  width: min(162px, 22vw);
  height: auto;
  filter: drop-shadow(3px 3px 0 #ffffff);
}

.system-menu {
  position: absolute;
  top: 24px;
  right: 34px;
  z-index: 5;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.system-menu-button {
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly);
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  padding: 0 18px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  transform: rotate(1deg);
}

.system-menu-button::after {
  content: " +";
}

.system-menu.is-open .system-menu-button::after {
  content: " -";
}

.system-menu-panel {
  display: grid;
  width: min(360px, calc(100vw - 34px));
  gap: 12px;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 14px;
  transform: rotate(-1deg);
}

.system-menu-section {
  display: grid;
  gap: 10px;
  border: 2px dashed var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--canvas);
  padding: 12px;
}

.system-menu-section h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

.printer-status {
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.printer-status[data-state="connected"] {
  background: var(--yellow);
}

.printer-status[data-state="connecting"],
.printer-status[data-state="checking"] {
  background: #f1ece4;
}

.printer-status[data-state="error"] {
  background: #ffd7d7;
}

.printer-connect-button {
  min-height: 40px;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--yellow);
  box-shadow: var(--shadow-soft);
  padding: 0 14px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.printer-connect-button.is-connected {
  background: var(--muted);
}

.printer-diagnostics-button {
  min-height: 36px;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 0 14px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.bluetooth-diagnostics {
  max-height: min(34vh, 260px);
  margin: 0;
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: #fffef7;
  padding: 10px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.auth-panel {
  display: grid;
  gap: 10px;
}

.auth-panel[data-state="disabled"] {
  display: none;
}

.auth-status {
  max-width: 100%;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.auth-panel[data-state="authenticated"] .auth-status {
  background: var(--yellow);
}

.auth-panel[data-state="error"] .auth-status {
  background: #ffd7d7;
}

.pin-login-form {
  display: grid;
  gap: 10px;
}

.pin-login-form label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

.pin-login-form input {
  width: 100%;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--white);
  padding: 0 12px;
  color: var(--ink);
}

.pin-input {
  -webkit-text-security: disc;
}

.auth-login-button,
.auth-logout-button {
  min-height: 38px;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--yellow);
  box-shadow: var(--shadow-soft);
  padding: 0 14px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.auth-logout-button {
  background: var(--white);
}

.start-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(300px, 0.82fr);
  gap: clamp(24px, 4vw, 54px);
  min-height: calc(100dvh - clamp(170px, 21vh, 226px));
  padding-top: clamp(48px, 8vh, 88px);
  align-items: center;
}

.poster-copy {
  position: relative;
  display: grid;
  max-width: 780px;
  gap: 14px;
  justify-items: center;
}

.poster-copy::after {
  display: none;
}

.poster-copy h1,
.complete-band h2 {
  font-family: var(--font-main);
  font-weight: 800;
}

.poster-copy h1 {
  margin: 0;
  width: 100%;
  max-width: 100%;
  justify-self: center;
  color: var(--ink);
  font-size: calc(clamp(6.8rem, 10vw, 10.8rem) + 20px);
  line-height: 0.9;
  text-align: center;
  white-space: nowrap;
  text-shadow: 4px 4px 0 var(--yellow);
  transform: rotate(-1deg);
}

.title-orange {
  color: #d76e37;
}

.start-copy {
  position: relative;
  width: fit-content;
  max-width: 620px;
  margin: 0;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 14px 22px;
  font-size: 1.8rem;
  transform: rotate(-1.5deg);
}

.start-copy::before {
  position: absolute;
  top: -15px;
  left: 42%;
  width: 92px;
  height: 22px;
  content: "";
  border: 1px solid #c8c2b8;
  background: #d6d2caa8;
  transform: rotate(2deg);
}

.start-cta {
  position: absolute;
  right: 0;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 0;
  z-index: 6;
  display: grid;
  justify-items: center;
  padding: 0 clamp(20px, 5vw, 58px);
  pointer-events: none;
}

#startButton {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: min(640px, 100%);
  min-height: clamp(86px, 11vh, 116px);
  place-items: center;
  border-width: 4px;
  background: #d76e37;
  color: var(--white);
  box-shadow:
    7px 7px 0 var(--ink),
    14px 14px 0 var(--yellow);
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-1deg);
  isolation: isolate;
  pointer-events: auto;
}

#startButton::after {
  display: none;
}

#startButton:hover:not(:disabled) {
  background: var(--blue);
  color: var(--white);
  transform: translate(2px, 2px) rotate(1deg);
  box-shadow: 3px 3px 0 var(--ink);
}

#startButton:active:not(:disabled) {
  transform: translate(7px, 7px) rotate(0deg);
  box-shadow: none;
}

.mascot-panel {
  position: relative;
  display: grid;
  justify-items: center;
  transform: translateY(-18px) rotate(1.5deg);
}

.image-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: min(480px, 36vw);
  overflow: visible;
}

.image-frame img {
  position: relative;
  z-index: 2;
  width: 112%;
  height: 112%;
  object-fit: contain;
  filter: drop-shadow(8px 10px 0 #2d2d2d30);
}

.capture-screen {
  --capture-frame-size: min(82vmin, calc(100dvh - 260px), 600px);
  --capture-frame-half: min(41vmin, calc(50dvh - 130px), 300px);
  --capture-frame-center-y: 43%;
  --capture-frame-return-gap: 18px;
  background: var(--ink);
}

#camera {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  object-fit: contain;
  transform: scaleX(-1);
  transition: opacity 180ms ease;
}

.capture-screen.is-generating #camera {
  opacity: 0;
}

.generating-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.01);
  transition: opacity 180ms ease;
}

.capture-screen.is-generating .generating-video {
  opacity: 1;
}

.camera-flash {
  position: absolute;
  inset: 0;
  z-index: 9;
  background:
    radial-gradient(circle at 50% 48%, #ffffff 0 16%, #fffffff0 30%, #ffffffa8 48%, #ffffff00 72%),
    linear-gradient(120deg, #ffffff00 0 28%, #ffffffcc 42%, #ffffff00 60%),
    #ffffff;
  opacity: 0;
  pointer-events: none;
}

.camera-flash.is-flashing {
  animation: camera-flash-pop 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.camera-frame {
  position: absolute;
  z-index: 3;
  top: var(--capture-frame-center-y);
  left: 50%;
  width: var(--capture-frame-size);
  aspect-ratio: 1;
  border: 4px dashed var(--yellow);
  border-radius: 42px 18px 38px 22px / 22px 40px 20px 42px;
  box-shadow: 0 0 0 999vmax #00000040;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.capture-screen.is-generating .camera-frame {
  opacity: 0;
}

.capture-topbar {
  position: absolute;
  z-index: 5;
  top: 22px;
  right: 22px;
  left: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

.brand-lockup {
  min-height: 58px;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 0 16px;
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 800;
  transform: rotate(-1deg);
}

.capture-brand {
  gap: 12px;
  padding: 0 16px 0 12px;
  flex-wrap: nowrap;
  pointer-events: auto;
}

.capture-brand-logo {
  display: block;
  width: clamp(92px, 14vw, 132px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(2px 2px 0 var(--white));
}

.capture-brand-title {
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1;
  white-space: nowrap;
}

.camera-switch-button {
  min-height: 46px;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly);
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  padding: 0 14px;
  color: var(--ink);
  font-family: var(--font-main);
  font-size: clamp(0.92rem, 2.4vw, 1.05rem);
  font-weight: 800;
  pointer-events: auto;
  transform: rotate(1deg);
}

.camera-switch-button:disabled {
  opacity: 0.55;
}

.capture-return-button {
  position: absolute;
  z-index: 6;
  top: calc(var(--capture-frame-center-y) + var(--capture-frame-half) + var(--capture-frame-return-gap));
  left: 50%;
  min-height: 52px;
  padding: 0 24px;
  transform: translateX(-50%) rotate(1deg);
}

.capture-tap {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  transform: translateY(-7dvh);
}

.capture-tap span,
.capture-tap strong {
  display: block;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-md);
  font-family: var(--font-main);
  font-weight: 800;
}

.capture-tap span {
  justify-self: start;
  border-radius: var(--wobbly);
  background: var(--yellow);
  padding: 8px 18px;
  font-size: 1.8rem;
  transform: rotate(-4deg);
}

.capture-tap strong {
  margin-top: -1px;
  border-radius: var(--wobbly-lg);
  background: var(--white);
  padding: 14px 22px;
  color: var(--blue);
  font-size: 5.4rem;
  line-height: 0.95;
  transform: rotate(1deg);
}

.countdown {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--yellow);
  font-family: var(--font-main);
  font-size: 14rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  text-shadow:
    5px 5px 0 var(--ink),
    -2px -2px 0 var(--ink),
    2px -2px 0 var(--ink),
    -2px 2px 0 var(--ink);
  -webkit-text-stroke: 3px var(--ink);
}

.camera-status {
  position: absolute;
  z-index: 5;
  right: 24px;
  bottom: 24px;
  left: 24px;
  max-width: 760px;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  padding: 12px 18px;
  color: var(--ink);
  font-size: 1.25rem;
  transform: rotate(1deg);
}

.camera-status.is-centered {
  z-index: 7;
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(76vw, 540px);
  max-width: none;
  border-width: 4px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 22px 28px;
  font-size: clamp(1.7rem, 4.2vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  transform: translate(-50%, -50%) rotate(-1deg);
}

.capture-screen.is-generating .camera-status.is-centered {
  top: auto;
  bottom: max(42px, calc(env(safe-area-inset-bottom) + 34px));
  width: max-content;
  max-width: calc(100vw - 36px);
  padding: 18px 22px;
  font-size: clamp(1.25rem, 5.6vw, 2.35rem);
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-1deg);
}

.complete-screen {
  padding: 34px;
  background-color: var(--canvas);
  background-image:
    radial-gradient(var(--muted) 1px, transparent 1.5px),
    linear-gradient(to bottom, transparent 31px, #e5e0d880 32px);
  background-size:
    24px 24px,
    100% 32px;
}

.complete-sticker {
  top: 20px;
  right: 28px;
  z-index: 2;
  background: var(--red);
  color: var(--white);
  padding: 14px 18px;
  font-size: 1.25rem;
  transform: rotate(8deg);
}

.complete-band {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 16px 24px;
  border: 3px solid var(--ink);
  border-radius: var(--wobbly-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transform: rotate(-1deg);
}

.complete-band::before {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 128px;
  height: 26px;
  content: "";
  border: 1px solid #c8c2b8;
  background: #d6d2cab8;
  transform: translateX(-50%) rotate(1deg);
}

.complete-band .eyebrow {
  grid-column: 1 / -1;
}

.complete-band h2 {
  margin: 0;
  color: var(--blue);
  font-size: 7rem;
  line-height: 0.88;
  text-shadow: 4px 4px 0 var(--yellow);
}

.complete-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(240px, 390px) minmax(0, 1fr);
  gap: 32px;
  margin-top: 34px;
  align-items: start;
}

.preview-card,
.action-card {
  border: 3px solid var(--ink);
  border-radius: var(--wobbly-lg);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  transition:
    transform 120ms ease-out,
    box-shadow 120ms ease-out;
}

.preview-card:hover,
.action-card:hover {
  transform: rotate(1deg);
  box-shadow: var(--shadow-sm);
}

.preview-card {
  position: relative;
  transform: rotate(1deg);
}

.preview-card::before {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 24px;
  content: "";
  border: 1px solid #c8c2b8;
  background: #d6d2cab8;
  transform: translateX(-50%) rotate(-2deg);
}

.action-card {
  display: grid;
  gap: 14px;
  transform: rotate(-1deg);
}

.job-status {
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly);
  padding: 12px 14px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.preview-card:hover {
  transform: rotate(2deg);
}

.action-card:hover {
  transform: rotate(-2deg);
}

.preview-wrap {
  position: relative;
  aspect-ratio: 72 / 100;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly-md);
  background-color: var(--yellow);
  background-image: radial-gradient(#2d2d2d26 1px, transparent 1.5px);
  background-size: 16px 16px;
  overflow: hidden;
}

#labelPreview {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 1.45rem;
  font-weight: 800;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  font-size: 1.05rem;
}

progress {
  width: 100%;
  height: 18px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly);
  background: var(--white);
}

progress::-webkit-progress-bar {
  background: var(--white);
}

progress::-webkit-progress-value {
  background: var(--blue);
}

progress::-moz-progress-bar {
  background: var(--blue);
}

.calibration-panel,
.debug-panel {
  border: 2px dashed var(--ink);
  border-radius: var(--wobbly-md);
  background: var(--canvas);
}

.calibration-panel summary,
.debug-panel summary {
  cursor: pointer;
  padding: 12px 14px;
  border-radius: var(--wobbly-md);
  background: var(--yellow);
  font-family: var(--font-main);
  font-weight: 800;
}

.debug-panel summary {
  background: var(--muted);
}

.print-controls {
  display: grid;
  gap: 16px;
  border-top: 2px dashed var(--ink);
  padding: 14px;
  background: var(--white);
}

.chunk-control,
.offset-control {
  display: grid;
  gap: 8px;
  font-size: 1.05rem;
}

.chunk-control input {
  width: 100%;
  min-height: 54px;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly);
  padding: 0 14px;
  background: var(--white);
}

.chunk-control input:focus-visible {
  border-color: var(--blue);
  background: var(--yellow);
}

.offset-header,
.offset-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offset-control input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: var(--red);
}

.text-button {
  min-height: 38px;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly);
  padding: 0 12px;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
}

.text-button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.debug-panel p {
  margin: 0;
  border-top: 2px dashed var(--ink);
  padding: 12px;
  overflow-wrap: anywhere;
  background: var(--white);
  font-size: 1rem;
}

@keyframes gentle-bounce {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

@keyframes text-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateX(-50%) translateY(-8px) rotate(2deg);
  }
}

@keyframes camera-flash-pop {
  0% {
    opacity: 0;
    filter: brightness(1);
  }

  8% {
    opacity: 1;
    filter: brightness(1.5);
  }

  24% {
    opacity: 0.92;
  }

  58% {
    opacity: 0.28;
  }

  100% {
    opacity: 0;
    filter: brightness(1);
  }
}

@media (max-width: 920px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .booth-shell {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }

  .screen {
    height: 100svh;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .start-screen.is-active {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: clamp(10px, 1.8svh, 18px);
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }

  .capture-screen {
    height: 100dvh;
    overflow: hidden;
  }

  .start-screen,
  .complete-screen {
    padding: 22px;
  }

  .start-screen {
    padding: 20px 22px calc(18px + env(safe-area-inset-bottom));
  }

  .complete-screen {
    height: 100dvh;
    overflow-y: auto;
  }

  .start-grid,
  .complete-grid {
    grid-template-columns: 1fr;
  }

  .start-grid {
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    gap: 10px;
    padding-top: clamp(68px, 9svh, 92px);
    align-items: center;
    align-content: center;
    justify-items: center;
    overflow: hidden;
  }

  .poster-copy h1 {
    font-size: min(calc(clamp(5.2rem, 13vw, 7rem) + 12px), 17svh);
  }

  .poster-copy::after {
    display: none;
  }

  .start-copy {
    max-width: min(620px, 92vw);
    font-size: clamp(1.05rem, 3vw, 1.45rem);
    text-align: center;
  }

  .start-cta {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    align-self: end;
    width: 100%;
    padding: 0;
  }

  #startButton {
    width: min(480px, 100%);
    min-height: clamp(70px, 9svh, 82px);
    font-size: clamp(1.9rem, 5.8vw, 2.35rem);
  }

  .mascot-panel {
    max-width: min(540px, 94vw);
    max-height: 100%;
    justify-self: center;
    align-self: end;
    transform: translateY(-2px) rotate(1.5deg);
  }

  .image-frame {
    width: min(500px, 86vw, 46svh);
  }

  .image-frame img {
    width: 113%;
    height: 113%;
  }

  .shape.square {
    top: 5vh;
    right: -10vmin;
  }

  .shape.triangle {
    right: 16vw;
    bottom: 7vh;
  }

  .sticker-pop {
    top: 52px;
    right: auto;
    bottom: auto;
    left: 50%;
    width: auto;
    height: auto;
    padding: 0;
    font-size: 2.05rem;
  }

  .home-logo {
    top: 20px;
    left: 22px;
    right: auto;
    bottom: auto;
    width: 132px;
  }

  .system-menu {
    top: 18px;
    right: 20px;
  }

  .system-menu-button {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.92rem;
  }

  .system-menu-panel {
    width: min(320px, calc(100vw - 40px));
    padding: 12px;
    gap: 8px;
  }

  .printer-status {
    font-size: 0.8rem;
  }

  .printer-connect-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .printer-diagnostics-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .bluetooth-diagnostics {
    max-height: min(30vh, 220px);
    font-size: 0.62rem;
  }

  .auth-panel {
    gap: 8px;
  }

  .auth-status {
    font-size: 0.78rem;
  }

  .pin-login-form input {
    min-height: 40px;
  }

  .auth-login-button,
  .auth-logout-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .complete-band {
    grid-template-columns: 1fr;
  }

  .complete-band h2 {
    font-size: 5.6rem;
  }

  .preview-card,
  .action-card,
  .preview-card:hover,
  .action-card:hover {
    transform: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 18px;
  }

  .capture-screen {
    --capture-frame-size: min(84vw, calc(100dvh - 330px));
    --capture-frame-half: min(42vw, calc(50dvh - 165px));
    --capture-frame-center-y: 40.5%;
    --capture-frame-return-gap: 16px;
  }

  .start-screen,
  .complete-screen {
    padding: 14px;
  }

  .start-screen {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .start-screen.is-active {
    gap: clamp(8px, 1.4svh, 14px);
  }

  .start-grid {
    gap: 6px;
    padding-top: clamp(74px, 11svh, 92px);
  }

  .poster-copy {
    gap: 6px;
  }

  .poster-copy h1 {
    font-size: min(calc(clamp(4rem, 16vw, 5.35rem) + 10px), 19.5vw, 14svh);
    text-shadow: 3px 3px 0 var(--yellow);
  }

  .start-copy {
    max-width: min(360px, 92vw);
    padding: 10px 14px;
    font-size: clamp(1rem, 4.4vw, 1.2rem);
    line-height: 1.18;
  }

  .action-card .bau-button {
    width: 100%;
  }

  #startButton {
    min-height: clamp(64px, 9svh, 74px);
    font-size: clamp(1.75rem, 8vw, 2.05rem);
  }

  #startButton::after {
    display: none;
  }

  .mascot-panel {
    margin-top: 0;
    transform: translateY(0) rotate(1.5deg);
  }

  .sticker-pop {
    top: 38px;
    right: auto;
    bottom: auto;
    left: 50%;
    width: auto;
    height: auto;
    padding: 0;
    font-size: 1.55rem;
  }

  .home-logo {
    top: 16px;
    left: 16px;
    right: auto;
    bottom: auto;
    width: 118px;
  }

  .system-menu {
    top: 14px;
    right: 14px;
  }

  .system-menu-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .system-menu-panel {
    width: min(286px, calc(100vw - 28px));
    gap: 8px;
    padding: 10px;
  }

  .system-menu-section {
    padding: 10px;
    gap: 8px;
  }

  .system-menu-section h2 {
    font-size: 0.92rem;
  }

  .printer-status {
    padding: 7px 9px;
    font-size: 0.68rem;
  }

  .printer-connect-button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .printer-diagnostics-button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .bluetooth-diagnostics {
    max-height: min(28vh, 190px);
    padding: 8px;
    font-size: 0.58rem;
  }

  .auth-panel {
    gap: 6px;
  }

  .auth-status {
    padding: 7px 9px;
    font-size: 0.68rem;
  }

  .pin-login-form label {
    font-size: 0.76rem;
  }

  .pin-login-form input {
    min-height: 38px;
    padding: 0 9px;
    font-size: 0.82rem;
  }

  .image-frame {
    width: min(420px, 92vw, 43svh);
  }

  .image-frame img {
    width: 113%;
    height: 113%;
  }

  .capture-topbar {
    top: 16px;
    right: 16px;
    left: 16px;
    justify-content: center;
  }

  .brand-lockup {
    max-width: min(88vw, 360px);
  }

  .capture-brand {
    max-width: min(88vw, 360px);
    gap: 7px;
    padding: 0 10px;
  }

  .capture-brand-logo {
    width: 86px;
  }

  .capture-brand-title {
    font-size: 0.9rem;
  }

  .capture-return-button {
    min-height: 48px;
    padding: 0 14px;
  }

  .capture-tap strong {
    max-width: 7ch;
    justify-self: center;
    font-size: 3.2rem;
  }

  .capture-tap span {
    font-size: 1.3rem;
  }

  .countdown {
    font-size: 9rem;
  }

  .camera-frame {
    width: var(--capture-frame-size);
  }

  .camera-status {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }

  .camera-status.is-centered {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(82vw, 420px);
    padding: 18px 20px;
    font-size: 1.85rem;
  }

  .complete-band {
    padding: 16px;
  }

  .complete-band h2 {
    font-size: 4.5rem;
  }

  .complete-sticker {
    top: 8px;
    right: 8px;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
