:root {
  color-scheme: light;
  --ink: #5a2636;
  --rose: #f47eaa;
  --rose-deep: #cc4d7d;
  --rose-soft: #ffd6e5;
  --blush: #fff6fa;
  --paper: #fffdf9;
  --cream: #fff3d7;
  --line: rgba(204, 77, 125, 0.18);
  --shadow: 0 18px 45px rgba(196, 82, 125, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(204, 77, 125, 0.04) 0,
      rgba(204, 77, 125, 0.04) 1px,
      transparent 1px,
      transparent 8px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.72) 0,
      rgba(255, 255, 255, 0.72) 1px,
      transparent 1px,
      transparent 10px
    ),
    linear-gradient(135deg, #fffafd 0%, #ffdbe9 48%, #fff3d9 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.app-shell {
  position: relative;
  display: flex;
  min-height: 100svh;
  width: min(100%, 560px);
  margin: 0 auto;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 246, 250, 0.76) 42%),
    rgba(255, 246, 250, 0.74);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.stage-section {
  display: flex;
  min-height: 100svh;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 0;
}

.topbar {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(204, 77, 125, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(255, 186, 211, 0.94)),
    var(--rose-soft);
  box-shadow: 0 12px 24px rgba(196, 82, 125, 0.18);
  color: var(--rose-deep);
  font-size: 21px;
  font-weight: 800;
}

.brand-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-text strong {
  overflow: hidden;
  font-size: 19px;
  letter-spacing: 0;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-text small {
  color: rgba(90, 38, 54, 0.54);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(204, 77, 125, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 220, 233, 0.62)),
    rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 20px rgba(196, 82, 125, 0.12);
  cursor: pointer;
  font-size: 22px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.icon-button:active {
  transform: scale(0.96);
}

.stage-wrap {
  position: relative;
  min-height: 100svh;
  flex: 1 1 auto;
  margin: 0;
  overflow: hidden;
}

.stage-wrap::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0) 58%),
    repeating-linear-gradient(
      115deg,
      rgba(244, 126, 170, 0.18) 0,
      rgba(244, 126, 170, 0.18) 2px,
      transparent 2px,
      transparent 18px
    ),
    repeating-linear-gradient(
      64deg,
      rgba(255, 255, 255, 0.62) 0,
      rgba(255, 255, 255, 0.62) 1px,
      transparent 1px,
      transparent 16px
    ),
    linear-gradient(180deg, #fff7fb 0%, #ffd6e5 100%);
  content: "";
  mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
}

#badge-stage {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  cursor: grab;
  touch-action: pan-y;
}

#badge-stage:active {
  cursor: grabbing;
}

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 9px 12px;
  border: 1px solid rgba(204, 77, 125, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.88);
  color: rgba(90, 38, 54, 0.7);
  font-size: 13px;
  transform: translate(-50%, -50%);
  transition: opacity 220ms ease;
}

.loading.is-hidden {
  pointer-events: none;
  opacity: 0;
}

@media (min-width: 760px) {
  body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
  }

  .app-shell {
    min-height: min(920px, calc(100vh - 48px));
    border: 1px solid rgba(204, 77, 125, 0.14);
    border-radius: 18px;
    overflow: hidden;
  }

  .stage-section {
    min-height: min(920px, calc(100vh - 48px));
  }

  .stage-wrap {
    min-height: min(920px, calc(100vh - 48px));
  }

  #badge-stage {
    min-height: min(920px, calc(100vh - 48px));
  }
}

@media (max-height: 720px) {
  .stage-wrap,
  #badge-stage {
    min-height: 100svh;
  }
}
