@font-face {
  font-family: Syne;
  src: url("letters/syne_variable.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: Sora;
  src: url("letters/sora_variable.ttf") format("truetype");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --ink: #05030B;
  --night: #090611;
  --violet: #171027;
  --plum: #221536;
  --deep: #38205B;
  --cyan: #39F3E2;
  --aqua: #62E7CF;
  --orchid: #B74CFF;
  --lilac: #D9B8FF;
  --pink: #FF4FB8;
  --fire: #D8FF8F;
  --snow: #F5F3FF;
  --mist: #C9C2E0;
  --mute: #9A90B8;
  --warn: #F2A6FF;
  --err: #FF6B8F;
  --glass: rgba(20, 13, 34, 0.85);
  --glass-high: rgba(30, 20, 48, 0.9);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--snow); }
body {
  font-family: Sora, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; }
h1, h2, .dew-display, .dew-headline, .dew-figure { font-family: Syne, sans-serif; font-weight: 800; margin: 0; }
p { margin: 0; }

#night-root { position: relative; height: 100%; isolation: isolate; }
#scene-wash, #dust-veil {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
#scene-wash { object-fit: cover; z-index: 0; }
#dust-veil { z-index: 1; pointer-events: none; }
#scene-wash + .dew-scrim,
#night-root::after {
  content: "";
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(9,6,17,.45), rgba(9,6,17,.78) 55%, rgba(9,6,17,.94));
}

#wake-layer, #notice-layer, #lane-host, #veil-host, #sheet-host {
  position: absolute; inset: 0; z-index: 3;
}
#wake-layer[hidden], #notice-layer[hidden], #lane-host[hidden], #veil-host[hidden],
#sheet-host:empty {
  display: none;
}
#sheet-host, #veil-host { z-index: 6; pointer-events: none; }
#sheet-host:not(:empty), #veil-host:not([hidden]) { pointer-events: auto; }
#lane-host {
  top: var(--safe-t);
  bottom: calc(72px + var(--safe-b));
  overflow: auto;
  padding: 8px 18px 24px;
  max-width: 640px;
  left: 50%;
  right: auto;
  width: min(100%, 640px);
  transform: translateX(-50%);
}
#petal-dock {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center;
  height: calc(72px + var(--safe-b));
  padding: 0 6px var(--safe-b);
  background: linear-gradient(180deg, rgba(5,3,11,.78), var(--ink));
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), var(--orchid), var(--pink)) 1;
}

.dew-wake, .dew-notice {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(22px + var(--safe-t)) 22px calc(22px + var(--safe-b));
}
.dew-notice { overflow: auto; }
.dew-crest {
  width: var(--crest); height: var(--crest);
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  box-shadow: 0 0 28px rgba(183, 76, 255, .35);
  overflow: hidden;
  margin-bottom: 16px;
}
.dew-crest img { width: 100%; height: 100%; object-fit: cover; }

.dew-display { font-size: 30px; line-height: 36px; text-align: center; }
.dew-headline { font-size: 27px; line-height: 33px; }
.dew-figure { font-size: 20px; }
.dew-title { font-family: Syne, sans-serif; font-weight: 700; font-size: 16px; }
.dew-lede { font-size: 16px; line-height: 24px; color: var(--mist); text-align: center; }
.dew-lede-bright { color: var(--snow); text-shadow: 0 2px 14px var(--ink); }
.dew-mute { font-size: 13px; line-height: 18px; color: var(--mute); text-align: center; margin-top: 8px; }
.dew-kicker {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); font-weight: 600;
}
.dew-section { color: var(--cyan); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; margin: 10px 0 6px; }
.dew-cyan { color: var(--cyan); }
.dew-pink { color: var(--pink); }
.dew-fire { color: var(--fire); }
.dew-centre { text-align: center; }
.dew-end { text-align: right; }
.dew-grow { flex: 1; min-width: 0; }
.dew-hide { display: none !important; }

.dew-badge {
  display: inline-block; margin: 12px auto;
  padding: 5px 16px; border-radius: 50px;
  background: linear-gradient(90deg, var(--pink), var(--orchid));
  font-weight: 700; letter-spacing: .06em;
}
.dew-bullets { list-style: none; padding: 0; margin: 14px 0 0; text-align: left; }
.dew-bullets li { display: flex; gap: 12px; align-items: center; padding: 5px 0; color: var(--mist); }
.dew-bullets svg { width: 20px; height: 20px; color: var(--cyan); flex: none; }

.dew-pane {
  background: linear-gradient(180deg, var(--glass), rgba(9,6,17,.88));
  border: 1px solid rgba(57,243,226,.28);
  border-radius: 22px;
  padding: 16px;
  margin: 14px 0;
}
.dew-pane-lit { border-color: rgba(183,76,255,.45); background: linear-gradient(180deg, var(--glass-high), rgba(9,6,17,.88)); }
.dew-hero { text-align: center; padding: 8px 0 4px; }
.dew-pagehead { display: flex; align-items: center; gap: 14px; padding: 8px 0 4px; }
.dew-pagehead h1 { font-size: 27px; }
.dew-pagehead p { color: var(--mist); font-size: 15px; }

.dew-split { display: flex; gap: 12px; }
.dew-split-mid { align-items: center; }
.dew-pair { display: flex; gap: 12px; }
.dew-pair > * { flex: 1; }
.dew-tile { margin: 0; }
.dew-thumb { width: 78px; height: 78px; object-fit: contain; flex: none; }
.dew-thumb-lg { width: 112px; height: 112px; }
.dew-pulse { animation: dew-breathe 1.6s ease-in-out infinite; }

.dew-key {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 10px 22px; border-radius: 50px;
  letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
}
.dew-key svg { width: 20px; height: 20px; }
.dew-key-wide { width: 100%; margin-top: 14px; }
.dew-key-neon {
  background: linear-gradient(90deg, #5CFFE9, #8FE3FF, #E2B5FF);
  color: var(--ink);
  box-shadow: 0 0 18px rgba(57,243,226,.28);
}
.dew-key-glass {
  background: linear-gradient(90deg, rgba(57,243,226,.2), rgba(183,76,255,.15));
  border: 1px solid rgba(57,243,226,.45);
}
.dew-key-danger { background: rgba(255,107,143,.18); color: var(--err); border: 1px solid var(--err); }
.dew-key-orb {
  width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--plum), var(--ink));
  border: 1px solid rgba(57,243,226,.45);
}
.dew-key:disabled { opacity: .45; }
.dew-key:active { transform: scale(.96); }

.dew-orb, .dew-orb-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--plum);
  border: 1px solid rgba(57,243,226,.22);
  flex: none;
}
.dew-orb svg, .dew-orb-btn svg { width: 18px; height: 18px; color: var(--cyan); }
.dew-orb-lg { width: 56px; height: 56px; margin: 0 auto 14px; }
.dew-orb-lg svg { width: 28px; height: 28px; }

.dew-lever, .dew-nav {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 60px; padding: 8px 0; text-align: left;
}
.dew-lever b, .dew-nav b { display: block; font-size: 16px; font-weight: 600; }
.dew-lever small, .dew-nav small { display: block; color: var(--mist); font-size: 13px; }
.dew-switch {
  width: 54px; height: 32px; border-radius: 16px; flex: none;
  background: var(--plum); border: 1px solid var(--mute); position: relative;
}
.dew-switch::after {
  content: ""; position: absolute; top: 5px; left: 5px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--mute);
}
.dew-switch.dew-on { background: rgba(57,243,226,.38); border-color: var(--cyan); }
.dew-switch.dew-on::after { background: var(--pink); transform: translateX(22px); }

.dew-vine { border: 0; height: 1px; margin: 8px 0; background: linear-gradient(90deg, transparent, var(--orchid), var(--cyan), transparent); }
.dew-stat { display: flex; justify-content: space-between; align-items: center; min-height: 44px; color: var(--mist); }
.dew-stat b { color: var(--snow); font-family: Syne, sans-serif; font-size: 19px; }
.dew-chart { width: 100%; height: 132px; margin-top: 12px; }
.dew-legend { display: flex; gap: 16px; align-items: center; color: var(--mist); font-size: 13px; margin-top: 10px; }
.dew-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dew-cyan-fill { background: var(--cyan); }
.dew-pink-fill { background: var(--pink); }

.dew-payhead, .dew-payrow {
  display: grid; grid-template-columns: 52px 1fr 58px 58px 58px;
  align-items: center; gap: 8px;
}
.dew-payhead { color: var(--mist); font-size: 11px; letter-spacing: .05em; }
.dew-payrow img { width: 52px; height: 52px; }
.dew-payrow span { text-align: center; font-family: Syne, sans-serif; }
.dew-minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dew-mini {
  background: var(--glass); border: 1px solid rgba(57,243,226,.22); border-radius: 14px; padding: 8px; text-align: center;
}
.dew-mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-flow: column; gap: 2px; height: 36px; }
.dew-mini-grid i { background: var(--plum); border-radius: 3px; }
.dew-mini-grid i.dew-on { background: var(--cyan); }

.dew-dock-leaf {
  flex: 1; height: 68px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--mist); font-size: 11px; font-weight: 600;
}
.dew-dock-leaf svg { width: 22px; height: 22px; }
.dew-dock-leaf.dew-on { color: var(--snow); }
.dew-dock-leaf.dew-on svg { color: var(--cyan); }

.dew-play {
  height: 100%;
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 4px;
}
.dew-topstrip { display: flex; align-items: center; gap: 8px; height: 48px; }
.dew-balance {
  flex: 1; height: 46px; border-radius: 50px;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: linear-gradient(90deg, var(--glass-high), var(--glass));
  border: 1px solid rgba(57,243,226,.22);
}
.dew-balance svg { width: 18px; height: 18px; color: var(--cyan); }
.dew-balance span { color: var(--mist); font-size: 11px; letter-spacing: .08em; }
.dew-balance b { flex: 1; font-family: Syne, sans-serif; font-size: 19px; }
.dew-free {
  height: 46px; border-radius: 50px; padding: 0 14px;
  background: linear-gradient(90deg, var(--pink), var(--orchid));
  display: grid; place-content: center; text-align: center;
}
.dew-free small { font-size: 10px; letter-spacing: .06em; }
.dew-meter {
  display: flex; gap: 3px; align-items: end;
  height: 52px; padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(90deg, var(--glass-high), var(--glass));
  border: 1px solid rgba(57,243,226,.22);
}
.dew-pod {
  flex: 1; height: 70%;
  border: 1px solid var(--mute); border-radius: 40% 40% 45% 45%;
  background: rgba(56,32,91,.55);
}
.dew-pod.dew-lit { background: linear-gradient(180deg, #fff, var(--cyan), var(--orchid)); border-color: #fff; }
.dew-pod-last { height: 92%; }
.dew-pod-last.dew-lit { background: linear-gradient(180deg, #fff, var(--pink), var(--orchid)); }

.dew-cabinet { flex: 1; position: relative; min-height: 180px; }
.dew-frame, .dew-reels { position: absolute; inset: 0; width: 100%; height: 100%; }
.dew-frame { object-fit: fill; }
.dew-reels { padding: 7% 8%; }

.dew-winstrip {
  min-height: 56px; border-radius: 18px; padding: 8px 14px;
  display: grid; place-content: center; text-align: center;
  background: linear-gradient(90deg, var(--glass), var(--glass-high), var(--glass));
  border: 1px solid rgba(57,243,226,.22);
}
.dew-winstrip b { display: block; font-family: Syne, sans-serif; font-size: 20px; }
.dew-winstrip small { color: var(--mist); font-size: 12px; }

.dew-deck { display: flex; align-items: center; height: 112px; }
.dew-stake { flex: 1; text-align: center; }
.dew-stake small { color: var(--mist); font-size: 11px; letter-spacing: .06em; }
.dew-step { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }
.dew-step b { min-width: 54px; font-family: Syne, sans-serif; font-size: 19px; }
.dew-bloom {
  width: 104px; height: 104px; border-radius: 50%; position: relative; flex: none;
}
.dew-bloom img { width: 100%; height: 100%; }
.dew-bloom i {
  position: absolute; inset: 35%;
  border-radius: 50%; background: rgba(255,255,255,.22);
  display: grid; place-items: center;
}
.dew-bloom svg { width: 22px; height: 22px; color: var(--ink); }
.dew-chips { flex: 1; display: grid; gap: 8px; padding-left: 8px; }
.dew-chip {
  height: 40px; border-radius: 50px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(90deg, var(--glass), var(--glass-high));
  border: 1px solid rgba(57,243,226,.45);
  font-size: 13px; font-weight: 600;
}
.dew-chip svg { width: 16px; height: 16px; }
.dew-chip.dew-on { background: linear-gradient(90deg, #5CFFE9, #E2B5FF); color: var(--ink); }

.dew-sheet, .dew-veil {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(5,3,11,.72);
}
.dew-sheet .dew-pane, .dew-veil .dew-pane { width: min(420px, 100%); }
.dew-auto-row { display: flex; gap: 10px; margin: 18px 0 16px; }
.dew-auto-pick {
  flex: 1; height: 58px; border-radius: 18px;
  background: linear-gradient(180deg, var(--plum), var(--ink));
  border: 1px solid rgba(57,243,226,.45);
  font-family: Syne, sans-serif; font-size: 23px; color: var(--cyan);
}
.dew-spotlight { text-align: center; background: rgba(5,3,11,.84); }
.dew-spotlight img { width: 170px; margin: 0 auto 14px; }
.dew-night { text-align: center; background: rgba(5,3,11,.82); overflow: auto; align-content: center; }
.dew-buds { display: flex; justify-content: space-evenly; gap: 8px; width: min(600px, 100%); margin: 16px 0; }
.dew-bud { flex: 1; max-width: 180px; }
.dew-bud img { width: 100%; }
.dew-bud span { display: block; margin-top: 10px; font-size: 13px; }
.dew-dim { opacity: .38; }

@keyframes dew-breathe {
  50% { transform: scale(1.04); }
}

@media (max-height: 600px) {
  .dew-deck { height: 92px; }
  .dew-bloom { width: 86px; height: 86px; }
  .dew-meter { height: 44px; }
}
