:root {
  --indigo-950: #05060F;
  --indigo-900: #080A1C;
  --indigo-800: #11132E;
  --indigo-700: #1E1F4B;
  --slate: #2B3263;
  --slate-2: #3A4470;
  --cream: #FFF4D6;
  --green: #7CFF6B;
  --green-hot: #B8FF9E;
  --green-mid: #4FD64A;
  --green-dark: #2E7A2A;
  --blue: #4FC3FF;
  --pink: #FF7AC8;
  --magenta: #E46BFF;
  --brown: #B8733A;
  --display: 'Bagel Fat One', 'Trebuchet MS', system-ui, sans-serif;
  --text: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--indigo-950);
  color: var(--cream);
  font-family: var(--text);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
}

[hidden] { display: none !important; }

#app { position: fixed; inset: 0; }

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

#vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 38%, rgba(4, 5, 16, .28) 72%, rgba(3, 4, 12, .78) 100%),
    linear-gradient(180deg, rgba(3, 4, 12, .62) 0%, transparent 16%, transparent 76%, rgba(3, 4, 12, .68) 100%);
}

/* ---------------------------------------------------------------- slate */

.slate,
.slate-card {
  background:
    linear-gradient(180deg, rgba(92, 104, 178, .22), rgba(18, 21, 50, .42)),
    linear-gradient(180deg, #353D75 0%, #262D5C 48%, #20264F 100%);
  border: 1.5px solid rgba(124, 255, 107, .34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 0 26px rgba(7, 9, 26, .55),
    0 14px 34px rgba(0, 0, 0, .5),
    0 0 30px rgba(124, 255, 107, .10);
}

/* ------------------------------------------------------------------ hud */

.hud {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 1180px);
  height: 68px;
  z-index: 40;
  border-radius: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 0 22px;
  pointer-events: none;
}

.hud button { pointer-events: auto; }

.hud-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 0 0 auto;
}

.hud-icon {
  height: 34px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 9px rgba(79, 195, 255, .55));
}

.star-icon { filter: drop-shadow(0 0 9px rgba(255, 220, 110, .55)); }

.hud-score {
  font-family: var(--display);
  font-size: 33px;
  line-height: 1;
  color: var(--cream);
  letter-spacing: .5px;
  text-shadow: 0 0 16px rgba(79, 195, 255, .45), 0 3px 0 rgba(0, 0, 0, .35);
  font-variant-numeric: tabular-nums;
  transition: transform .18s ease;
}

.hud-score.bump { animation: scoreBump .34s cubic-bezier(.3, 1.6, .5, 1); }

.hud-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 0 8px;
}

.meter {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 40px;
  display: flex;
  align-items: center;
}

.meter-glass {
  position: relative;
  width: 100%;
  height: 27px;
  border-radius: 15px;
  background: linear-gradient(180deg, #0A0D24 0%, #141A3D 100%);
  border: 2px solid rgba(111, 232, 95, .72);
  box-shadow:
    inset 0 2px 9px rgba(0, 0, 0, .75),
    0 0 15px rgba(111, 232, 95, .32);
  overflow: hidden;
  transition: border-color .45s ease, box-shadow .45s ease;
}

.meter-water {
  position: absolute;
  left: 3px;
  top: 3px;
  bottom: 3px;
  width: var(--hyd, 100%);
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(180deg, #B7F4FF 0%, #63D4FF 26%, #3FB4F5 62%, #1E7FDC 100%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, .35), 0 0 14px rgba(79, 195, 255, .55);
  transition: width .3s cubic-bezier(.2, .8, .2, 1), background .5s ease, box-shadow .5s ease;
}

.meter-water::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .6), transparent 48%);
  opacity: .7;
  pointer-events: none;
}

.meter-bubbles { position: absolute; inset: 0; pointer-events: none; }

.meter-bubbles i {
  position: absolute;
  bottom: -7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 0 5px rgba(255, 255, 255, .8);
  animation: bubbleUp 2.6s linear infinite;
}

.meter-bubbles i:nth-child(1) { left: 12%; animation-delay: .1s; animation-duration: 2.4s; }
.meter-bubbles i:nth-child(2) { left: 27%; animation-delay: .9s; animation-duration: 2.9s; }
.meter-bubbles i:nth-child(3) { left: 44%; animation-delay: .45s; animation-duration: 2.2s; }
.meter-bubbles i:nth-child(4) { left: 63%; animation-delay: 1.4s; animation-duration: 3.1s; }
.meter-bubbles i:nth-child(5) { left: 81%; animation-delay: .7s; animation-duration: 2.6s; }

.meter-shine {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 2px;
  height: 7px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  pointer-events: none;
}

.meter-leaf {
  position: absolute;
  width: 34px;
  height: 30px;
  top: -4px;
  filter: drop-shadow(0 0 7px rgba(124, 255, 107, .65));
  pointer-events: none;
}

.meter-leaf-l { left: -17px; }
.meter-leaf-r { right: -17px; }

.meter.low .meter-water {
  background: linear-gradient(180deg, #A8C0D2 0%, #6E8CA6 52%, #46647E 100%);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, .16);
}

.meter.low .meter-glass {
  border-color: rgba(150, 180, 200, .42);
  box-shadow: inset 0 2px 9px rgba(0, 0, 0, .75);
}

.meter.low .meter-leaf path { fill: #7C8FA0; stroke: #A7B8C8; }

.meter.critical .meter-glass { animation: criticalPulse 1.1s ease-in-out infinite; }

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.hud-best {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}

.hud-best-label {
  font-family: var(--text);
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 1.6px;
  color: rgba(255, 244, 214, .64);
  white-space: nowrap;
}

.hud-best-value {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 0 12px rgba(255, 220, 110, .35), 0 2px 0 rgba(0, 0, 0, .3);
  font-variant-numeric: tabular-nums;
}

.hud-help {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(124, 255, 107, .6);
  background: linear-gradient(180deg, #3C4782 0%, #232A56 100%);
  color: var(--cream);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 4px 10px rgba(0, 0, 0, .35),
    0 0 16px rgba(124, 255, 107, .2);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.hud-help:hover { box-shadow: 0 0 24px rgba(124, 255, 107, .5), inset 0 1px 0 rgba(255, 255, 255, .22); }
.hud-help:active { transform: translateY(2px) scale(.96); }

/* --------------------------------------------------------------- buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .18em;
  border: 3px solid rgba(205, 255, 190, .5);
  border-radius: 999px;
  background: linear-gradient(180deg, #9BFF88 0%, #6FEA5B 40%, #4CCB41 100%);
  color: #17203F;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  letter-spacing: .5px;
  cursor: pointer;
  padding: 0 1.4em;
  box-shadow:
    0 6px 0 #2E7A2A,
    0 10px 22px rgba(0, 0, 0, .38),
    0 0 28px rgba(124, 255, 107, .35),
    inset 0 2px 0 rgba(255, 255, 255, .45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
  touch-action: manipulation;
}

.btn:hover { filter: brightness(1.08); box-shadow: 0 6px 0 #2E7A2A, 0 12px 26px rgba(0, 0, 0, .4), 0 0 42px rgba(124, 255, 107, .55), inset 0 2px 0 rgba(255, 255, 255, .45); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #2E7A2A, 0 4px 10px rgba(0, 0, 0, .35), 0 0 20px rgba(124, 255, 107, .4), inset 0 2px 0 rgba(255, 255, 255, .4); }
.btn:focus-visible { outline: 3px solid rgba(255, 244, 214, .85); outline-offset: 4px; }

.btn-ghost {
  background: linear-gradient(180deg, #3C4782 0%, #262D5C 100%);
  color: var(--cream);
  border-color: rgba(124, 255, 107, .38);
  box-shadow: 0 5px 0 #171B3C, 0 8px 18px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .16);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

.btn-ghost:hover { box-shadow: 0 5px 0 #171B3C, 0 10px 22px rgba(0, 0, 0, .4), 0 0 26px rgba(124, 255, 107, .28), inset 0 1px 0 rgba(255, 255, 255, .16); }

.btn-play {
  margin-top: 1.4vh;
  width: min(330px, 56vw);
  height: clamp(62px, 9vh, 92px);
  font-size: clamp(30px, 4.3vh, 44px);
}

.play-tri {
  width: 0;
  height: 0;
  border-top: .48em solid transparent;
  border-bottom: .48em solid transparent;
  border-left: .74em solid #17203F;
  margin-right: .18em;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .22));
}

.plaque {
  margin-top: 1.5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 22px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, #30386D 0%, #20264F 100%);
  border: 1.5px solid rgba(124, 255, 107, .3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 8px 20px rgba(0, 0, 0, .35),
    0 0 20px rgba(124, 255, 107, .08);
}

.plaque span {
  font-family: var(--text);
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: rgba(255, 244, 214, .66);
}

.plaque strong {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
  color: var(--cream);
  text-shadow: 0 0 12px rgba(255, 220, 110, .3);
}

/* ---------------------------------------------------------- title screen */

#title-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.title-hero {
  position: absolute;
  top: 9.5%;
  left: 50%;
  transform: translateX(-50%);
  width: min(66vw, 980px);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

#title-logo {
  width: 100%;
  height: auto;
  display: block;
  filter:
    drop-shadow(0 14px 28px rgba(0, 0, 0, .55))
    drop-shadow(0 0 24px rgba(124, 255, 107, .22));
  animation: logoFloat 7s ease-in-out infinite;
}

.title-help-btn {
  display: none;
  margin-top: 14px;
  height: 42px;
  font-size: 17px;
  padding: 0 22px;
}

.title-card-slot {
  position: absolute;
  right: 3.5%;
  top: clamp(288px, 31vh, 348px);
  width: min(34vw, 478px);
  pointer-events: auto;
}

.title-card-slot .howto {
  --slide-h: 244px;
  padding: 18px 20px 16px;
  gap: 11px;
  border-radius: 28px;
}

.title-card-slot .howto-title { font-size: clamp(20px, 2.4vh, 27px); }
.title-card-slot .howto-viewport { border-radius: 17px; }

.title-lumie-wrap {
  position: absolute;
  left: 3%;
  bottom: 1%;
  width: min(30vw, 455px);
  height: min(54vh, 540px);
  pointer-events: none;
}

.title-lumie-glow {
  position: absolute;
  left: 4%;
  bottom: 5%;
  width: 92%;
  height: 72%;
  background: radial-gradient(circle at 50% 58%, rgba(255, 188, 92, .3), rgba(124, 255, 107, .12) 44%, transparent 70%);
  filter: blur(20px);
}

#title-lumie {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, .58));
  animation: lumieBob 4.6s ease-in-out infinite;
}

.title-vine {
  position: absolute;
  left: -3%;
  bottom: 1%;
  width: 72%;
  height: 62%;
  overflow: visible;
  filter:
    drop-shadow(0 0 7px rgba(124, 255, 107, .9))
    drop-shadow(0 0 20px rgba(124, 255, 107, .38));
  animation: vinePulse 3.4s ease-in-out infinite;
}

.title-foot {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--text);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .3px;
  color: rgba(255, 244, 214, .72);
  text-shadow: 0 2px 10px #000;
  white-space: nowrap;
  pointer-events: none;
}

/* ------------------------------------------------------------- how to play */

.howto {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 16px;
  border-radius: 28px;
  overflow: hidden;
  --slide-h: 232px;
}

.howto.is-overlay {
  width: min(92vw, 700px);
  --slide-h: 300px;
  padding: 24px 28px 22px;
  border-radius: 32px;
}

.howto-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(21px, 2.5vh, 30px);
  line-height: 1;
  letter-spacing: .5px;
  text-align: center;
  color: var(--cream);
  text-shadow: 0 0 18px rgba(124, 255, 107, .45), 0 3px 0 rgba(0, 0, 0, .35);
}

.howto-viewport {
  overflow: hidden;
  height: var(--slide-h);
  border-radius: 18px;
  background: rgba(9, 11, 29, .34);
  border: 1px solid rgba(124, 255, 107, .14);
  box-shadow: inset 0 2px 16px rgba(0, 0, 0, .45);
}

.slides {
  display: flex;
  height: 100%;
  transition: transform .48s cubic-bezier(.34, 1.5, .64, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 14px;
  text-align: center;
}

.slide p {
  margin: 0;
  max-width: 94%;
  font-family: var(--text);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.35;
  color: var(--cream);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .55);
}

.touch-note {
  font-family: var(--text);
  font-weight: 700;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(255, 244, 214, .54);
}

.slide1-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 60%;
}

.slide-lumie {
  width: 42%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(255, 188, 92, .35));
}

.keys {
  width: 56%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
}

.keys img {
  width: 100%;
  max-height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(124, 255, 107, .32));
}

.collect-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12%;
  width: 100%;
  height: 64%;
}

.collect-row figure {
  margin: 0;
  width: 36%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.collect-row img {
  width: 100%;
  height: calc(100% - 16px);
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(79, 195, 255, .4));
}

.collect-row figure:nth-child(2) img { filter: drop-shadow(0 0 16px rgba(228, 107, 255, .5)); }

.collect-row figcaption {
  font-family: var(--display);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: .9px;
  color: var(--green);
  text-shadow: 0 0 8px rgba(124, 255, 107, .45);
}

.avoid-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 62%;
  padding: 7px 10px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(255, 70, 90, .05), rgba(255, 70, 90, .17) 50%, rgba(255, 70, 90, .05));
  border: 1px solid rgba(255, 120, 140, .3);
}

.avoid-strip img {
  width: 30%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 120, 140, .25));
}

.howto-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.round-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(124, 255, 107, .55);
  background: linear-gradient(180deg, #3C4782 0%, #232A56 100%);
  color: var(--green);
  font-family: var(--display);
  font-size: 25px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(124, 255, 107, .18), inset 0 1px 0 rgba(255, 255, 255, .16);
  transition: transform .15s ease, box-shadow .2s ease;
  touch-action: manipulation;
}

.round-btn:hover { box-shadow: 0 0 24px rgba(124, 255, 107, .45), inset 0 1px 0 rgba(255, 255, 255, .16); }
.round-btn:active { transform: scale(.92); }
.round-btn:focus-visible { outline: 3px solid rgba(255, 244, 214, .85); outline-offset: 3px; }

.dots { display: flex; align-items: center; gap: 8px; }

.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4A5480;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.dots i.on {
  background: var(--green);
  box-shadow: 0 0 11px rgba(124, 255, 107, .85);
  transform: scale(1.18);
}

.start-btn {
  display: none;
  width: 100%;
  height: 52px;
  font-size: 24px;
}

.howto.is-overlay .start-btn { display: flex; }

.card-vine {
  position: absolute;
  width: 58px;
  height: 58px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M6 58 C6 38 18 20 40 12 C52 8 58 14 54 22 C50 30 40 28 42 20' stroke='%237CFF6B' stroke-width='4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M22 34 C18 26 20 18 28 14 C30 22 28 30 22 34Z' fill='%237CFF6B'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0 5px rgba(124, 255, 107, .65));
  opacity: .82;
  pointer-events: none;
}

.card-vine-tl { top: 7px; left: 7px; }
.card-vine-br { right: 7px; bottom: 7px; transform: rotate(180deg); }

/* --------------------------------------------------------------- overlays */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

#end-overlay { z-index: 70; }

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(10, 12, 30, .56), rgba(3, 4, 12, .9) 76%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.overlay-card-slot {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}

.end-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 460px);
  padding: 28px 26px 24px;
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  text-align: center;
  overflow: hidden;
}

.end-spark {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 220px;
  background: radial-gradient(circle, rgba(228, 107, 255, .3), rgba(124, 255, 107, .08) 46%, transparent 70%);
  filter: blur(14px);
  pointer-events: none;
}

.end-card h2 {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 5.2vh, 46px);
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 0 26px rgba(124, 255, 107, .45), 0 4px 0 rgba(0, 0, 0, .35);
}

.end-card p {
  position: relative;
  margin: 0;
  font-family: var(--text);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 244, 214, .78);
}

.end-stats {
  position: relative;
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 5px 0 4px;
}

.end-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 18px;
  background: rgba(9, 11, 29, .36);
  border: 1px solid rgba(124, 255, 107, .2);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .35);
}

.end-stat span {
  font-family: var(--text);
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 1.6px;
  color: rgba(255, 244, 214, .6);
}

.end-stat strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.end-card .btn { position: relative; width: 100%; height: 52px; font-size: 23px; }
.end-card .btn-ghost { height: 44px; font-size: 17px; }

/* ---------------------------------------------------------------- game ui */

#game-ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; }

.dpad {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: none;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 5px;
  pointer-events: none;
}

body.touch .dpad { display: grid; }

.dpad-btn {
  pointer-events: auto;
  border-radius: 50%;
  border: 2px solid rgba(124, 255, 107, .5);
  background: linear-gradient(180deg, rgba(58, 68, 122, .86), rgba(28, 33, 72, .92));
  color: var(--green);
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 0 14px rgba(124, 255, 107, .12);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.dpad-btn:active {
  transform: translateY(2px) scale(.95);
  background: rgba(124, 255, 107, .22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35), 0 0 22px rgba(124, 255, 107, .4);
}

.dpad-up { grid-area: 1 / 2; }
.dpad-left { grid-area: 2 / 1; }
.dpad-right { grid-area: 2 / 3; }
.dpad-down { grid-area: 3 / 2; }

.hint {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(18, 21, 48, .72);
  border: 1px solid rgba(124, 255, 107, .25);
  color: rgba(255, 244, 214, .75);
  font-family: var(--text);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 1.4px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

body.touch .hint { display: none; }

#popups {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.popup {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 0 16px currentColor, 0 2px 0 rgba(0, 0, 0, .45);
  white-space: nowrap;
  animation: popRise 1.15s cubic-bezier(.2, .8, .2, 1) forwards;
}

.popup.blue { color: #8FE7FF; }
.popup.pink { color: #FF9ADF; }
.popup.gold { color: #FFE38A; }
.popup.combo { font-size: 30px; }

/* -------------------------------------------------------------- animations */

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes lumieBob {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50% { transform: translateY(-11px) rotate(.7deg); }
}

@keyframes vinePulse {
  0%, 100% { opacity: .82; }
  50% { opacity: 1; }
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

@keyframes bubbleUp {
  0% { transform: translateY(0) scale(.7); opacity: 0; }
  12% { opacity: .85; }
  70% { opacity: .7; }
  100% { transform: translateY(-27px) scale(1.15); opacity: 0; }
}

@keyframes criticalPulse {
  0%, 100% { box-shadow: inset 0 2px 9px rgba(0, 0, 0, .75), 0 0 10px rgba(150, 180, 200, .15); }
  50% { box-shadow: inset 0 2px 9px rgba(0, 0, 0, .75), 0 0 22px rgba(190, 220, 240, .5); }
}

@keyframes popRise {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
  14% { opacity: 1; transform: translate(-50%, -60%) scale(1.18); }
  28% { transform: translate(-50%, -68%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -185%) scale(.92); }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1100px), (orientation: portrait) {
  .title-card-slot { display: none; }
  .title-help-btn { display: inline-flex; }
}

@media (max-width: 900px) {
  .title-hero { top: 70px; width: 94vw; }
  #title-logo { width: 94vw; }
  .btn-play { width: min(262px, 64vw); height: 62px; font-size: 30px; margin-top: 10px; }
  .title-plaque { margin-top: 10px; }
  .title-lumie-wrap {
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(66vw, 320px);
    height: min(34vh, 270px);
  }
  #title-lumie { object-position: center bottom; }
  .title-vine { left: 2%; width: 62%; height: 54%; }
  .title-foot { display: none; }
  .howto.is-overlay { --slide-h: 280px; padding: 20px 20px 18px; }
}

@media (max-width: 620px) {
  .hud {
    width: 96vw;
    height: 54px;
    border-radius: 28px;
    padding: 0 9px 0 12px;
    gap: 6px;
  }
  .hud-icon { height: 23px; }
  .hud-score { font-size: 24px; }
  .hud-left { gap: 6px; }
  .hud-center { padding: 0 3px; }
  .meter { height: 34px; }
  .meter-glass { height: 23px; }
  .meter-leaf { width: 25px; height: 24px; top: -2px; }
  .meter-leaf-l { left: -12px; }
  .meter-leaf-r { right: -12px; }
  .hud-best-label { font-size: 7px; letter-spacing: 1.1px; }
  .hud-best-value { font-size: 17px; }
  .hud-help { width: 34px; height: 34px; font-size: 19px; }
  .hud-right { gap: 5px; }

  .title-hero { top: 66px; }
  .title-help-btn { height: 40px; font-size: 16px; margin-top: 12px; }
  .btn-play { height: 58px; font-size: 28px; }
  .plaque { padding: 6px 18px 7px; }
  .plaque strong { font-size: 21px; }

  .howto.is-overlay { width: 94vw; --slide-h: 262px; padding: 17px 15px 15px; gap: 9px; border-radius: 26px; }
  .howto.is-overlay .howto-title { font-size: 23px; }
  .slide p { font-size: 13px; }
  .slide1-grid { height: 58%; }
  .collect-row { height: 60%; }
  .avoid-strip { height: 58%; }
  .start-btn { height: 48px; font-size: 21px; }
  .end-card { padding: 24px 20px 20px; }
  .end-card .btn { height: 48px; font-size: 21px; }
}

@media (max-width: 390px) {
  .hud-best-label { display: none; }
  .hud-help { width: 31px; height: 31px; font-size: 17px; }
  .hud-score { font-size: 22px; }
  .hud-icon { height: 21px; }
  .meter-leaf { width: 22px; height: 21px; }
}

@media (max-height: 660px) and (min-width: 1101px) {
  .title-hero { top: 3.5%; width: min(58vw, 820px); }
  .btn-play { height: 58px; font-size: 28px; margin-top: 6px; }
  .title-plaque { margin-top: 6px; }
  .title-card-slot { top: 276px; width: min(32vw, 430px); }
  .title-card-slot .howto { --slide-h: 186px; padding: 13px 16px 12px; gap: 8px; }
  .title-card-slot .howto-title { font-size: 19px; }
  .title-card-slot .round-btn { width: 31px; height: 31px; font-size: 20px; }
  .title-lumie-wrap { width: 24vw; height: 52vh; }
}

@media (max-height: 700px) {
  .howto.is-overlay { --slide-h: 238px; padding: 17px 20px 15px; gap: 8px; }
  .howto.is-overlay .howto-title { font-size: 24px; }
  .howto.is-overlay .start-btn { height: 46px; font-size: 20px; }
  .howto.is-overlay .round-btn { width: 34px; height: 34px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  #title-logo, #title-lumie, .title-vine, .hud-score.bump, .meter.critical .meter-glass { animation: none !important; }
  .meter-bubbles i { animation: none; opacity: .55; }
  .slides { transition-duration: .01ms; }
  .popup { animation-duration: .7s; }
}
