/* =========================================================
   Shruti's Spa — design tokens + shared Y2K UI kit
   Every level uses these. Level-specific styles live in
   css/levels/levelN.css and must be scoped under .lvl-N
   ========================================================= */

:root {
  /* ink + paper */
  --ink: #2b1531;
  --ink-2: #5d3f66;
  --ink-3: #8f7597;
  --pearl: #fffafd;
  --paper: #fff4f9;

  /* candy palette */
  --blush: #ffe1ee;
  --blush-2: #ffc7de;
  --pink: #ff5fa8;
  --pink-2: #ff8cc4;
  --pink-deep: #d63384;
  --lilac: #b79cff;
  --lilac-2: #dcd0ff;
  --sky: #8fd3ff;
  --sky-2: #cfeeff;
  --mint: #9ff0d4;
  --butter: #fff1a8;
  --gold: #c39a3f;
  --gold-2: #f2dc9b;

  /* finishes */
  --chrome: linear-gradient(180deg, #ffffff 0%, #eee9f5 36%, #bdb4cd 50%, #f6f2fb 64%, #dcd4e8 100%);
  --pearl-sheen: linear-gradient(135deg, #fff 0%, #ffe9f4 30%, #efe6ff 55%, #e3f6ff 80%, #fff 100%);
  --holo: linear-gradient(120deg, #ffd1ea, #d9cbff, #c4ecff, #d2ffe9, #fff3b8, #ffd1ea);

  /* shape + depth */
  --r-xl: 32px;
  --r-l: 24px;
  --r-m: 16px;
  --r-s: 10px;
  --shadow-soft: 0 10px 30px rgba(120, 40, 110, .16);
  --shadow-card: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 12px 28px rgba(120, 40, 110, .16);
  --glow-pink: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 24px rgba(255, 95, 168, .45);

  /* type */
  --font-display: 'Playfair Display', 'Didot', 'Bodoni 72', Georgia, serif;
  --font-body: 'Quicksand', 'Nunito', 'Avenir Next', system-ui, sans-serif;
  --font-pixel: 'Silkscreen', 'Courier New', ui-monospace, monospace;
  --font-script: 'Parisienne', 'Snell Roundhand', 'Brush Script MT', cursive;

  /* motion */
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  background: #ffe6f2;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }

:focus-visible {
  outline: 3px dashed var(--pink-deep);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- typography helpers ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.02;
}
.display--italic { font-style: italic; }

.script { font-family: var(--font-script); font-weight: 400; }

.pixel {
  font-family: var(--font-pixel);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}

/* glossy chrome-pink headline text */
.chrome-text {
  background: linear-gradient(180deg, #fff 0%, #ffd3e8 26%, #ff66ad 50%, #ff9ccb 66%, #fff4fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(160, 30, 100, .38);
  filter: drop-shadow(0 3px 0 rgba(160, 30, 100, .22)) drop-shadow(0 8px 16px rgba(255, 95, 168, .25));
}
.chrome-text--silver {
  background: linear-gradient(180deg, #fff 0%, #f1edf7 30%, #9a90ad 50%, #e9e3f3 68%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px rgba(80, 60, 110, .3);
  filter: drop-shadow(0 2px 0 rgba(80, 60, 110, .18));
}

.ink-soft { color: var(--ink-2); }

/* ---------- gel buttons (Y2K candy) ---------- */

.btn {
  --b1: #ffa6d0;
  --b2: #ff5fa8;
  --b3: #e33b8a;
  --bs: #b8246b;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: .85em 1.7em;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--b1) 0%, var(--b2) 55%, var(--b3) 100%);
  color: #fff;
  font: 700 1.02rem/1 var(--font-body);
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(120, 10, 70, .35);
  box-shadow: 0 4px 0 var(--bs), 0 10px 22px rgba(160, 30, 100, .28), inset 0 -4px 8px rgba(0, 0, 0, .08);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform .16s var(--ease-pop), box-shadow .16s var(--ease-out), filter .16s;
  isolation: isolate;
}
.btn::before { /* glossy highlight */
  content: '';
  position: absolute;
  left: 12%; right: 12%; top: 3px;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .08));
  pointer-events: none;
  z-index: -1;
}
.btn:hover { transform: translateY(-2px) scale(1.03); filter: saturate(1.08); }
.btn:active { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 var(--bs), 0 4px 10px rgba(160, 30, 100, .25); }
.btn[disabled] { filter: grayscale(.6) opacity(.55); pointer-events: none; }

.btn--lilac { --b1: #e2d6ff; --b2: #a98bff; --b3: #8565f0; --bs: #5e40c4; text-shadow: 0 1px 0 rgba(60, 20, 140, .35); }
.btn--sky { --b1: #d7f2ff; --b2: #6cc4ff; --b3: #3fa3ec; --bs: #2277bf; text-shadow: 0 1px 0 rgba(10, 60, 120, .35); }
.btn--mint { --b1: #dcfff1; --b2: #5fdcae; --b3: #34bb8b; --bs: #1f8b64; text-shadow: 0 1px 0 rgba(10, 80, 60, .35); }
.btn--gold { --b1: #fff0bf; --b2: #e8c066; --b3: #c99a36; --bs: #94701f; text-shadow: 0 1px 0 rgba(100, 70, 10, .35); }
.btn--chrome {
  color: var(--ink);
  text-shadow: 0 1px 0 #fff;
  background: var(--chrome);
  box-shadow: 0 4px 0 #9d93b1, 0 10px 22px rgba(80, 60, 110, .22);
}
.btn--ghost {
  color: var(--ink);
  text-shadow: none;
  background: rgba(255, 255, 255, .55);
  border: 2px solid rgba(255, 255, 255, .95);
  box-shadow: 0 3px 0 rgba(160, 110, 170, .35);
  backdrop-filter: blur(6px);
}
.btn--ghost::before { display: none; }
.btn--sm { min-height: 38px; padding: .55em 1.1em; font-size: .88rem; }
.btn--lg { min-height: 58px; padding: 1em 2.2em; font-size: 1.18rem; }

/* round chrome icon button */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--chrome);
  box-shadow: 0 3px 0 #a79dbb, 0 6px 14px rgba(80, 60, 110, .2);
  cursor: pointer;
  transition: transform .15s var(--ease-pop);
  touch-action: manipulation;
}
.icon-btn:hover { transform: scale(1.08) rotate(-4deg); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }

/* plain text link-button */
.link-btn {
  background: none;
  border: 0;
  padding: .4em .6em;
  color: var(--ink-2);
  font: 700 .85rem var(--font-body);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--pink-2);
  text-underline-offset: 4px;
  cursor: pointer;
}
.link-btn:hover { color: var(--pink-deep); }

/* ---------- Y2K OS window ---------- */

.win {
  position: relative;
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, .88);
  border: 2px solid #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.win__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #ffd9ec 0%, #ffb6d8 48%, #ff9ccb 52%, #ffc9e2 100%);
  border-bottom: 2px solid rgba(255, 255, 255, .9);
  font-family: var(--font-pixel);
  font-size: .7rem;
  letter-spacing: .06em;
  color: #7a1f55;
  text-transform: uppercase;
}
.win__bar--lilac { background: linear-gradient(180deg, #ece5ff 0%, #cfc0ff 48%, #bba7ff 52%, #e0d6ff 100%); color: #3f2a8a; }
.win__bar--sky { background: linear-gradient(180deg, #e3f6ff 0%, #b6e3ff 48%, #9ad6ff 52%, #d2efff 100%); color: #134a78; }
.win__dots { display: inline-flex; gap: 5px; margin-right: 4px; }
.win__dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--c, #ff6fae) 45%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}
.win__dots i:nth-child(2) { --c: #ffcc4d; }
.win__dots i:nth-child(3) { --c: #7fd8a8; }
.win__body { padding: 16px; }

/* ---------- cards, bubbles, stickers, chips ---------- */

.card {
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, .9);
  border: 2px solid #fff;
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.bubble {
  position: relative;
  display: inline-block;
  max-width: 28ch;
  padding: .7em 1em;
  border-radius: 18px;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: .92rem;
  line-height: 1.35;
  color: var(--ink);
}
.bubble::after {
  content: '';
  position: absolute;
  left: 22px; bottom: -11px;
  width: 16px; height: 16px;
  background: #fff;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: skewX(-25deg) rotate(45deg);
}

.sticker {
  display: inline-block;
  padding: .35em .75em;
  border-radius: 8px;
  background: var(--butter);
  border: 2px dashed rgba(120, 80, 20, .35);
  font-family: var(--font-pixel);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b4a12;
  transform: rotate(-3deg);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .35em .8em;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  border: 1.5px solid #fff;
  box-shadow: 0 2px 6px rgba(120, 40, 110, .12);
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-2);
}

/* ---------- clearly-marked content placeholders ---------- */

.ph {
  display: inline;
  padding: .05em .4em;
  border-radius: 6px;
  background: repeating-linear-gradient(-45deg, #fff6c9 0 8px, #ffeea0 8px 16px);
  outline: 2px dashed #c79a1f;
  outline-offset: 1px;
  color: #6b4a00;
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 700;
  font-size: .9em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.ph::before { content: '✎ '; }

/* ---------- motion utilities ---------- */

@keyframes spa-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-1deg); }
  40% { transform: translateX(6px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
@keyframes spa-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes spa-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes spa-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}
@keyframes spa-pop-in {
  0% { opacity: 0; transform: scale(.6); }
  70% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes spa-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes spa-glint {
  0% { transform: translateX(-120%) skewX(-20deg); }
  100% { transform: translateX(220%) skewX(-20deg); }
}
@keyframes spa-blink { 50% { opacity: 0; } }
@keyframes spa-spin { to { transform: rotate(360deg); } }

.is-shaking { animation: spa-shake .42s var(--ease-out); }
.is-pulsing { animation: spa-pulse .38s var(--ease-pop); }
.float { animation: spa-float 3.2s ease-in-out infinite; }
.pop-in { animation: spa-pop-in .5s var(--ease-pop) both; }
.fade-up { animation: spa-fade-up .5s var(--ease-out) both; }

/* shiny sweep for "tap me" affordances */
.glint { position: relative; overflow: hidden; }
.glint::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: spa-glint 2.6s ease-in-out infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

/* gel buttons get a soft glow ring instead of the dashed outline */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 4px 0 var(--bs), 0 0 0 4px #fff, 0 0 0 7px var(--pink-2), 0 10px 26px rgba(255, 95, 168, .45);
}
.btn--chrome:focus-visible { box-shadow: 0 4px 0 #9d93b1, 0 0 0 4px #fff, 0 0 0 7px var(--lilac), 0 10px 22px rgba(80, 60, 110, .25); }
