:root {
  --blush: #f4b6c2;
  --rose: #c43b5a;
  --wine: #7a1f3a;
  --cream: #fff7f4;
  --ink: #2a1220;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: #1a0b12;
  color: var(--cream);
  font-family: Outfit, system-ui, sans-serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#wrap {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  overflow: hidden;
}
canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: none;
}
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) 16px 0;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.brand {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 16px rgba(0,0,0,.55);
}
.brand span { color: var(--blush); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  background: rgba(26, 8, 16, 0.62);
  border: 1px solid rgba(255, 210, 220, 0.28);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.hint {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  opacity: 0.85;
  text-shadow: 0 2px 10px #000;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(20,6,12,.55), rgba(20,6,12,.78));
  pointer-events: auto;
  padding: 16px;
}
.card {
  width: min(440px, calc(100% - 24px));
  background: rgba(255,247,244,.94);
  color: var(--ink);
  border-radius: 22px;
  padding: 26px 22px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  text-align: center;
}
.card h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(26px, 6vw, 32px);
  margin-bottom: 8px;
}
.card p { font-size: 15px; line-height: 1.5; opacity: .82; margin-bottom: 16px; }
.legend { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
button.play {
  appearance: none;
  border: 0;
  background: var(--rose);
  color: white;
  font: 700 15px Outfit, sans-serif;
  letter-spacing: .04em;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
}
.hidden { display: none !important; }

.controls {
  display: none;
  position: absolute;
  left: 0; right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  padding: 0 18px 6px;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}
body.mobile .controls { display: flex; }
body.mobile .hint { bottom: calc(112px + env(safe-area-inset-bottom)); }
body.mobile canvas { cursor: default; }
.ctrl {
  pointer-events: auto;
  width: 84px;
  height: 84px;
  border: 1px solid rgba(255,210,220,.35);
  border-radius: 50%;
  background: rgba(26, 8, 16, 0.62);
  color: #ff4da6;
  -webkit-text-fill-color: #ff4da6;
  font: 700 32px/1 Outfit, system-ui, sans-serif;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  -webkit-tap-highlight-color: transparent;
}
.ctrl::before {
  /* force non-emoji glyphs if OS swaps ◀▶ to blue symbols */
  content: none;
}
.ctrl:active, .ctrl.is-down {
  background: rgba(196, 59, 90, 0.85);
  transform: scale(0.96);
}

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.kc-toast {
  position: fixed;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18,8,20,.92);
  color: #f4f0ea;
  font: 600 14px/1.2 Outfit, system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  max-width: min(92vw, 420px);
  text-align: center;
}
.kc-toast.is-on { opacity: 1; }

/* Embedded in Shopify parlor launcher: theme owns ← Parlor; hide in-game brand so it is not covered */
body.embedded .brand { display: none !important; }
body.embedded .hud {
  padding-top: max(12px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
}
body.embedded .top { justify-content: flex-end; }

.ctrl-arrow {
  display: block;
  color: #ff4da6;
  -webkit-text-fill-color: #ff4da6;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-2px);
}
