:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  background: #eeeae6;
  color: #2c2929;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #eeeae6;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

#app {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.page-frame {
  position: relative;
  width: min(100%, 600px);
  flex: 0 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #eeeae6;
}

.page-background,
.art-layer,
.art-element {
  position: absolute;
  display: block;
}

.page-background {
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.art-layer {
  z-index: 2;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.stamp-layer {
  z-index: 3;
}

.exchange-button {
  z-index: 5;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  height: auto;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.exchange-button-image {
  display: block;
  width: 100%;
  height: auto;
}

.exchange-button:disabled {
  cursor: default;
  filter: saturate(0.72);
}

.exchange-button:not(:disabled):active {
  transform: translateY(1px);
}

.state-overlay {
  z-index: 20;
}

.qr-slot {
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 1.4%;
  overflow: hidden;
  background: #fff;
}

.qr-slot svg {
  display: block;
  width: 100%;
  height: 100%;
}

.redeemed-overlay {
  z-index: 30;
}

[hidden] {
  display: none !important;
}

.page-loading {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgb(44 38 44 / 84%);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 18%);
}

.inline-spinner,
.boot-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgb(255 255 255 / 36%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.page-status {
  position: absolute;
  z-index: 60;
  left: 7%;
  right: 7%;
  bottom: 3.2%;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgb(55 48 57 / 88%);
  color: #fff;
  text-align: center;
  font-size: clamp(13px, 3.4vw, 17px);
  line-height: 1.4;
  box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
}

.page-status.is-error {
  background: rgb(136 45 49 / 92%);
}

.boot-shell,
.fatal-error {
  width: min(100%, 600px);
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
  background: #eeeae6;
  color: #756775;
}

.boot-shell p {
  margin: 0;
}

.boot-shell .boot-spinner {
  width: 28px;
  height: 28px;
  border-color: rgb(162 137 163 / 28%);
  border-top-color: #a289a3;
}

.fatal-error strong {
  font-size: 20px;
}

.fatal-error span {
  color: #6d6469;
}

.fatal-error button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: #a289a3;
  color: #fff;
}

.show-hotspots [data-contract-element-id],
.show-hotspots [data-contract-layer-id] {
  outline: 2px dashed #ff2f72;
  outline-offset: -2px;
}

noscript {
  display: block;
  padding: 24px;
  text-align: center;
}

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

@media (min-width: 601px) {
  body {
    padding-block: 20px;
  }

  .page-frame {
    border-radius: 18px;
    box-shadow: 0 16px 54px rgb(78 65 78 / 18%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
