:root {
  --black: #000000;
  --white: #ffffff;
  --soft-white: rgba(255, 255, 255, 0.75);
  --muted: #949494;
  --gold: #ffd640;
  --deep-gold: #b5982d;
  --brown: #673a19;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--white);
  font-family: Montserrat, Gotham, Arial, Helvetica, sans-serif;
}

button,
input,
a {
  font: inherit;
}

.stage_frame {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1080px;
  height: 1920px;
  transform: translate(-50%, -50%);
  overflow: visible;
}

.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1080px;
  height: 1920px;
  overflow: hidden;
  border-radius: 0;
  background: var(--black);
  transform-origin: top left;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 720ms ease;
  will-change: opacity;
}

.screen.active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.screen.exiting {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.screen_black {
  background: #000;
}

.screen_gold {
  background: radial-gradient(circle at 58% 32%, #ffdf46 0, #f7cf2f 38%, #d0a91e 100%);
}

.brand_logo {
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.top_logo {
  position: absolute;
  top: 48px;
  left: 389px;
  width: 303px;
  height: 141px;
}

.copy_block {
  text-align: center;
}

h1,
p {
  margin: 0;
}

.qr_copy {
  position: absolute;
  left: 96px;
  top: 278px;
  width: 888px;
}

.qr_copy h1 {
  font-size: 90px;
  line-height: 0.96;
  font-weight: 800;
}

.qr_copy p {
  margin: 26px auto 0;
  width: 844px;
  color: var(--soft-white);
  font-size: 40px;
  line-height: 1.12;
  font-weight: 400;
}

.qr_card {
  position: absolute;
  left: 152px;
  top: 671px;
  width: 770px;
  height: 864px;
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  display: grid;
  grid-template-rows: 622px auto;
  justify-items: center;
  padding-top: 60px;
}

.qr_code {
  width: 622px;
  height: 622px;
  display: grid;
  place-items: center;
}

.qr_code svg {
  width: 622px;
  height: 622px;
  display: block;
}

.qr_card strong {
  width: 670px;
  margin-top: 50px;
  text-align: center;
  font-size: 40px;
  line-height: 1.05;
  font-weight: 800;
}

.chevron_bottom {
  position: absolute;
  left: -340px;
  bottom: -47px;
  width: 1760px;
  height: 267px;
  opacity: 0.32;
}

.chevron_bottom::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 72%, 50% 22%, 100% 72%, 100% 100%, 50% 52%, 0 100%);
  background: #ffffff;
}

.mobile_start_copy {
  position: absolute;
  left: 96px;
  top: 238px;
  width: 888px;
}

.mobile_start_copy h1 {
  width: 888px;
  font-size: 78px;
  line-height: 1.03;
  font-weight: 800;
}

.mobile_start_copy p {
  margin-top: 34px;
  width: 844px;
  color: var(--soft-white);
  font-size: 34px;
  line-height: 1.18;
}

.upload_stack {
  position: absolute;
  left: 72px;
  top: 642px;
  width: 936px;
  display: grid;
  gap: 28px;
}

.photo_slot {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr 190px;
  grid-template-rows: 52px 62px;
  align-items: center;
  min-height: 190px;
  padding: 30px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.photo_slot.ready {
  border-color: var(--gold);
  background: rgba(255, 214, 64, 0.12);
}

.photo_slot input {
  display: none;
}

.slot_number {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--brown);
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  grid-row: 1 / 3;
}

.slot_title {
  color: #fff;
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
}

.slot_hint {
  color: var(--soft-white);
  font-size: 26px;
  line-height: 1.18;
}

.photo_slot img {
  grid-row: 1 / 3;
  grid-column: 3;
  width: 164px;
  height: 130px;
  border-radius: 24px;
  object-fit: cover;
  background: rgba(255,255,255,0.14);
  opacity: 0;
}

.photo_slot.ready img {
  opacity: 1;
}

.primary_button,
.home_button,
.ghost_button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary_button {
  height: 160px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--brown);
  font-size: 50px;
  font-weight: 800;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.1);
}

.primary_button:disabled,
.home_button:disabled,
.ghost_button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.button_icon {
  width: 60px;
  height: 60px;
  margin-right: 18px;
  display: grid;
  place-items: center;
  border: 4px solid currentColor;
  border-radius: 14px;
  line-height: 1;
}

.waiting_title {
  position: absolute;
  left: 123px;
  top: 380px;
  width: 834px;
  text-align: center;
  font-size: 70px;
  line-height: 0.96;
  font-weight: 800;
}

.person_dog_icon {
  position: absolute;
  left: 237px;
  top: 666px;
  width: 606px;
  height: 587px;
  object-fit: contain;
}

.waiting_text {
  position: absolute;
  left: 118px;
  top: 1374px;
  width: 844px;
  text-align: center;
  color: var(--soft-white);
  font-size: 40px;
  line-height: 1.1;
}

.paw_icon {
  position: absolute;
  left: 277px;
  top: 562px;
  width: 551px;
  height: 440px;
  object-fit: contain;
}

.processing_title {
  position: absolute;
  left: 96px;
  top: 1159px;
  width: 888px;
  text-align: center;
  color: var(--gold);
  font-size: 70px;
  line-height: 0.96;
  font-weight: 800;
}

.processing_text {
  position: absolute;
  left: 118px;
  top: 1312px;
  width: 844px;
  text-align: center;
  color: var(--soft-white);
  font-size: 40px;
  line-height: 1.1;
}

.loader_line {
  position: absolute;
  left: 220px;
  top: 1445px;
  width: 640px;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}

.loader_line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  border-radius: inherit;
  background: var(--gold);
  animation: loadslide 1.6s ease-in-out infinite;
}

@keyframes loadslide {
  0% { left: -45%; }
  100% { left: 105%; }
}

.result_logo {
  position: absolute;
  left: 404px;
  bottom: 75px;
  width: 263px;
  height: 122px;
}

.result_heading {
  position: absolute;
  left: 96px;
  top: 243px;
  width: 888px;
  text-align: center;
}

.result_heading h1 {
  font-size: 90px;
  line-height: 0.9;
  font-weight: 800;
}

.result_heading p {
  margin-top: 10px;
  color: var(--gold);
  font-size: 64px;
  line-height: 0.95;
  font-weight: 800;
}

.photo_preview_shell {
  position: absolute;
  left: 213px;
  top: 496px;
  width: 654px;
  height: 955px;
  border: 30px solid #3f3f3f;
  border-radius: 44px;
  overflow: hidden;
  background: #222;
}

.photo_preview_shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.totem_print_status {
  position: absolute;
  left: 140px;
  top: 1498px;
  width: 800px;
  text-align: center;
  color: rgba(255,255,255,0.62);
  font-size: 30px;
  line-height: 1.2;
}

.result_actions {
  position: absolute;
  left: 52px;
  top: 1579px;
  width: 984px;
  height: 124px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 110px;
}

.download_button {
  width: 541px;
  height: 124px;
  font-size: 40px;
}

.download_arrow {
  margin-left: 28px;
  font-size: 60px;
  line-height: 1;
}

.ghost_button {
  width: 332px;
  height: 124px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 32px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.thanks_logo {
  position: absolute;
  top: 49px;
  left: 413px;
  width: 263px;
  height: 122px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

.thanks_title {
  position: absolute;
  left: 101px;
  top: 380px;
  width: 888px;
  text-align: center;
  color: #fff;
  font-size: 90px;
  line-height: 0.96;
  font-weight: 800;
}

.thanks_icon {
  position: absolute;
  left: 319px;
  top: 694px;
  width: 443px;
  height: 388px;
  object-fit: contain;
}

.thanks_message {
  position: absolute;
  left: 96px;
  top: 1225px;
  width: 888px;
  text-align: center;
  color: rgba(255,255,255,0.78);
  font-size: 40px;
  line-height: 1.05;
  font-weight: 700;
}

.home_button {
  position: absolute;
  left: 177px;
  top: 1445px;
  width: 727px;
  height: 164px;
  border-radius: 999px;
  background: rgba(80, 60, 12, 0.45);
  color: #fff;
  font-size: 50px;
  font-weight: 700;
}

.timer_badge {
  position: absolute;
  left: 96px;
  top: 48px;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  color: rgba(0,0,0,0.5);
}

.timer_badge strong {
  font-size: 35px;
}

.timer_dots {
  width: 33px;
  height: 86px;
  margin-right: 0;
  background:
    radial-gradient(circle, currentColor 0 5px, transparent 6px) 14px 0 / 18px 18px,
    radial-gradient(circle, currentColor 0 5px, transparent 6px) 4px 18px / 18px 18px,
    radial-gradient(circle, currentColor 0 5px, transparent 6px) 14px 36px / 18px 18px,
    radial-gradient(circle, currentColor 0 5px, transparent 6px) 4px 54px / 18px 18px;
  background-repeat: no-repeat;
}

.gold_chevron::before {
  background: rgba(255, 255, 255, 0.34);
}

.error_panel {
  position: absolute;
  left: 90px;
  top: 410px;
  width: 900px;
  padding: 70px 56px;
  border-radius: 60px;
  background: #fff;
  color: #222;
  text-align: center;
}

.error_panel h1 {
  color: var(--deep-gold);
  font-size: 64px;
  line-height: 1;
  font-weight: 800;
}

.error_panel p {
  margin: 42px 0 58px;
  color: rgba(0,0,0,0.45);
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
}

.error_panel .primary_button {
  width: 720px;
  height: 125px;
}

.loader_ring {
  position: absolute;
  left: 490px;
  top: 885px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 12px solid rgba(255,255,255,0.16);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.connection_badge {
  position: fixed;
  z-index: 20;
  right: 16px;
  top: 16px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 214, 64, 0.94);
  color: #3d2608;
  font: 700 14px Arial, sans-serif;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}

.connection_badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.admin_hotspot {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
}

.admin_panel {
  position: fixed;
  z-index: 40;
  top: 18px;
  right: 18px;
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(10,10,10,0.94);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.admin_panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.admin_panel_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin_panel_head strong {
  font-size: 22px;
}

.admin_panel button {
  min-height: 44px;
  border: 0;
  padding: 0 16px;
  background: var(--gold);
  color: var(--brown);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.admin_panel button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin_status {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  line-height: 1.35;
}

.admin_status b {
  color: #fff;
}

.admin_actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin_logs {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
  font: 13px/1.4 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

body[data-mode="totem"] .result_actions,
body[data-mode="totem"] .mobile_start_copy,
body[data-mode="totem"] .upload_stack {
  display: none;
}

body[data-mode="mobile"] .admin_hotspot,
body[data-mode="mobile"] .admin_panel {
  display: none;
}

body[data-mode="mobile"] .totem_print_status {
  display: none;
}

body[data-mode="mobile"] .result_logo {
  top: 48px;
  bottom: auto;
  left: 412px;
}

body[data-mode="mobile"] .result_heading {
  top: 261px;
}

body[data-mode="mobile"] .result_heading p {
  font-size: 50px;
}

body[data-mode="mobile"] .photo_preview_shell {
  top: 496px;
}

body[data-mode="mobile"] .download_button {
  width: 620px;
  font-size: 34px;
}

body[data-mode="mobile"] .download_arrow {
  margin-left: 16px;
  font-size: 48px;
}

body[data-mode="mobile"] .result_actions {
  left: 96px;
  width: 888px;
  justify-content: center;
}

body[data-mode="mobile"] .upload_stack {
  left: 160px;
  width: 720px;
}

body[data-mode="mobile"] .photo_slot {
  grid-template-columns: 78px 1fr 132px;
  grid-template-rows: 58px 58px;
  min-height: 168px;
  padding: 26px 28px;
}

body[data-mode="mobile"] .slot_number {
  width: 58px;
  height: 58px;
  font-size: 34px;
}

body[data-mode="mobile"] .slot_title {
  font-size: 38px;
  line-height: 1.05;
}

body[data-mode="mobile"] .slot_hint {
  font-size: 23px;
  line-height: 1.12;
}

body[data-mode="mobile"] .photo_slot img {
  width: 118px;
  height: 100px;
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .loader_line::before,
  .loader_ring {
    transition: none;
    animation: none;
  }
}
