@font-face {
  font-family: 'Princess Sofia';
  src: url(../fonts/princesssofia.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  font-style: italic;
  font-weight: 500;
  src: url(../fonts/cormorant-it.woff2) format('woff2');
  font-display: swap;
}

/* Chinese faces are served from the same site as the café. */
@font-face {
  font-family: 'Cafe WenKai';
  src: url('../fonts/cafe-wenkai.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Cafe Sans';
  src: url('../fonts/cafe-sans.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --aqua: #aa64e2;
  --aqua-deep: #8833cb;
  --aqua-core: #dec2f4;
  --ink: #533f63;
  --ink-soft: #816597;
  --glass: rgba(208, 167, 240, 0.5);
  --title-font: 'Princess Sofia';
  --writing: 'Cafe WenKai', 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
  --cn: 'Cafe Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body.stage {
  overflow: hidden;
  background: #100c17;
  font-family: var(--cn);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.glow-title {
  font-family: var(--title-font), 'Princess Sofia', cursive;
  color: var(--g-fill, #c28feb);
  -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.85);
  text-shadow:
    0 0 1px #fff,
    0 0 5px var(--g-a, #b678e7),
    0 0 12px var(--g-b, #9440d5),
    0 0 26px var(--g-c, rgba(136, 51, 203, 0.65)),
    0 0 48px var(--g-d, rgba(136, 51, 203, 0.35));
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

/* frosted aqua label, like the little glass tags on the cord */
.tag {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  padding: 4px 11px 5px;
  min-width: 54px;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(62, 37, 79, 0.96), rgba(22, 15, 30, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 8px rgba(172, 102, 228, 0.95),
    0 0 20px rgba(172, 102, 228, 0.45),
    inset 0 0 6px rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  font:
    italic 500 17px/1 'Cormorant',
    Georgia,
    serif;
  color: #eddbfb;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 2px #9b62bc,
    1px 1px 2px rgba(116, 91, 136, 0.35);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.6s,
    box-shadow 0.3s,
    filter 0.3s;
  z-index: 6;
}
.tag.show {
  opacity: 1;
}
.tag small {
  display: block;
  margin-top: 3px;
  font: 500 11px/1.25 var(--cn);
  font-style: normal;
  letter-spacing: 0.04em;
  color: #ead8f3;
}
.tag:hover,
.tag:focus-visible {
  box-shadow:
    0 0 10px #c492ec,
    0 0 30px rgba(172, 102, 228, 0.9),
    inset 0 0 8px #fff;
  outline: none;
}
.tag.done {
  color: #7d3bb1;
}
.tag.done::after {
  content: '✦';
  position: absolute;
  right: -9px;
  top: -9px;
  font-size: 13px;
  color: #fff;
  text-shadow:
    0 0 6px var(--aqua),
    0 0 12px var(--aqua);
  font-style: normal;
}
.tag.locked {
  filter: saturate(0.3) brightness(0.95);
  cursor: default;
}
.tag.next {
  animation: tagPulse 1.8s ease-in-out infinite;
}
@keyframes tagPulse {
  50% {
    box-shadow:
      0 0 14px #cca0ee,
      0 0 40px rgba(172, 102, 228, 1),
      inset 0 0 8px #fff;
  }
}

.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 40;
  opacity: 0.5;
  mix-blend-mode: overlay;
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3%, 2%);
  }
  40% {
    transform: translate(2%, -3%);
  }
  60% {
    transform: translate(-2%, -1%);
  }
  80% {
    transform: translate(3%, 3%);
  }
  100% {
    transform: translate(0, 0);
  }
}
.haze {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 39;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(226, 205, 243, 0.12), rgba(198, 173, 219, 0.1));
}

.hint {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(82, 59, 100, 0.85);
  background: rgba(226, 205, 243, 0.55);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.demo-badge {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 45;
  font: 600 11px/1 var(--cn);
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(136, 51, 203, 0.85);
  padding: 6px 9px;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(136, 51, 203, 0.6);
}
.demo-badge a {
  color: #fff;
  text-decoration: none;
}
