/* pdtools v2.1: shared pieces for the scene pages (each page paints its own world on top) */
:root {
  --ink: #fff7ec; --soft: #f1d9c2; --mute: #c9ab93;
  --gold: #ffcd6e; --gold2: #ff9d5c; --rose: #ff86b4; --mint: #8ff0c8;
  --glass: rgba(255, 244, 230, .07); --glass2: rgba(255, 244, 230, .12); --line: rgba(255, 236, 214, .14);
  --disp: "Fredoka", "Trebuchet MS", system-ui, sans-serif; --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.3, 1.5, .5, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body { color: var(--ink); font: 600 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: rgba(255, 205, 110, .35); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.v-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 8px; }
.v-brand { flex: none; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 18px/1 var(--disp); text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.v-brand img { flex: none; width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 0 0 2px rgba(255,255,255,.2), 0 8px 20px -8px #000; }
.v-brand small { display: block; font: 800 11px/1 var(--body); letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.v-tools { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(30, 14, 8, .35); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-decoration: none; font-weight: 800; font-size: 14px;
  transition: background .25s, transform .25s var(--spring); cursor: pointer; }
.pill:hover { background: rgba(30, 14, 8, .55); transform: translateY(-1px); }
.pill svg { width: 18px; height: 18px; }
.pill select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; outline: 0; font-weight: 800; font-size: 16px; cursor: pointer; }
.pill select option { color: #2a160c; }
@media (max-width: 560px) { .pill .wide { display: none; } .v-brand span { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; font: 700 16px/1 var(--disp); letter-spacing: .2px; white-space: nowrap;
  transition: transform .3s var(--spring), box-shadow .3s, background .3s, opacity .3s; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.go { color: #3a1a06; background: linear-gradient(180deg, #ffe08f, #ffb85c); box-shadow: 0 10px 24px -10px rgba(255, 170, 70, .9), inset 0 1px 0 rgba(255,255,255,.7); }
.btn.go:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 30px -10px rgba(255, 170, 70, 1), inset 0 1px 0 rgba(255,255,255,.7); }
.btn.ghost { color: var(--ink); background: var(--glass); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--glass2); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .pill:focus-visible, .tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* avatars */
.ava { position: relative; display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
  background: radial-gradient(circle at 30% 30%, #ffd9a0, #c27a3e); font: 700 20px/1 var(--disp); color: #fff3e0; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* reveal on scroll */
.rise { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rise.in { opacity: 1; transform: none; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 50; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 16px; background: rgba(36, 16, 8, .92); border: 1px solid var(--line); box-shadow: 0 20px 40px -18px #000;
  font-weight: 800; font-size: 14.5px; max-width: min(92vw, 460px); text-align: center; transition: transform .45s var(--spring), opacity .3s; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* footer with the Creator Kit credit */
.v21-foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px;
  width: min(1180px, 100%); margin: 0 auto; padding: 30px clamp(16px, 4vw, 40px) calc(30px + env(safe-area-inset-bottom)); color: var(--mute); font-size: 13px; }
.v21-credit { display: grid; gap: 4px; max-width: 46em; }
.v21-credit b { color: var(--soft); font-weight: 800; }
.v21-credit a { color: var(--gold); }
.v21-by { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; font: 700 15px/1 var(--disp); color: var(--ink); }

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

/* small phones: the logo alone, so the scene switch and the language pill always fit */
@media (max-width: 400px) {
  .v-bar { gap: 8px; }
  .v-brand span { display: none; }
  .v-tools { gap: 6px; min-width: 0; }
  .pill { padding: 0 10px; }
  .pill select { max-width: 5em; text-overflow: ellipsis; }
  .v-tools .scene-pick button { padding: 0 7px; font-size: 12px; }
  .v-tools .pill svg { display: none; }
}
