:root {
  --text: #2e1712;
  --muted: #8c6457;
  --accent: #ff5a36;
  --accent-strong: #ff3d6e;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-border: rgba(83, 35, 16, 0.06);
  --shadow: 0 26px 70px rgba(116, 49, 25, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at top center, rgba(255, 120, 62, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 61, 110, 0.12), transparent 18%),
    linear-gradient(180deg, #fffaf6 0%, #fff1e8 100%);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.24;
}

.page {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px 14px 56px;
}

.loading-state,
.error-state,
.page-expired {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-state,
.error-state {
  min-height: calc(100vh - 74px);
  padding: 32px 24px;
  border-radius: 30px;
  backdrop-filter: blur(24px);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}

.page-expired {
  min-height: 100vh;
  width: 100%;
  padding: 24px;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 4px solid rgba(255, 90, 54, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.loading-title,
.error-title {
  margin-top: 18px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.loading-text,
.error-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.expired-state {
  color: #5a2a1f;
  font-size: clamp(32px, 9vw, 56px);
  font-weight: 900;
  letter-spacing: -0.06em;
  text-align: center;
}

.hero-card,
.block {
  backdrop-filter: blur(24px);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  padding: 20px;
  border-radius: 30px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.hero-pill {
  background: rgba(255, 90, 54, 0.1);
  color: var(--accent);
}

h1 {
  margin: 16px 0 8px;
  font-size: clamp(24px, 6.2vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  text-align: center;
}

.story {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.block {
  border-radius: 28px;
  overflow: hidden;
}

.image-shell {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.image-shell img,
.lightbox img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.image-caption {
  padding: 12px 16px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.text-block {
  padding: 18px;
}

.text-block-body {
  white-space: pre-line;
  font-size: 16px;
  line-height: 1.85;
  color: #55372f;
  text-align: center;
}

.copy-block {
  padding: 18px;
}

.copy-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.copy-head small {
  color: var(--muted);
  font-weight: 600;
}

.copy-shell {
  margin-top: 14px;
  padding: 18px 16px 16px;
  border: 1px dashed rgba(255, 90, 54, 0.24);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 247, 0.95), rgba(255, 242, 234, 0.9));
}

.copy-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-all;
  text-align: center;
}

.copy-chip {
  display: inline-flex;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 122, 50, 0.14), rgba(255, 61, 110, 0.12));
  color: #d24623;
  font-size: 13px;
  font-weight: 800;
}

.copy-button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a32 0%, #ff3d6e 100%);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.copy-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.button-block {
  padding: 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.action-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 0 22px;
  border-radius: 999px;
  overflow: hidden;
  color: white;
  text-decoration: none;
  font-weight: 800;
  background: linear-gradient(135deg, #ff7a32 0%, #ff5a36 42%, #ff3d6e 100%);
  box-shadow: 0 18px 36px rgba(255, 90, 54, 0.22);
  text-align: center;
}

.action-link::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%);
  pointer-events: none;
}

.action-link strong {
  font-size: 14px;
  opacity: 0.92;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(24px);
  min-width: 150px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(45, 23, 18, 0.92);
  color: white;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(45, 23, 18, 0.86);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(100%, 720px);
  max-height: 80vh;
  border-radius: 26px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.16);
  color: white;
  font: inherit;
  cursor: pointer;
}

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