[hidden] { display: none !important; }
:root {
  --night: #0b0b2a; --indigo: #14123a; --ink: #1b1d4d; --frost: #eef3ff; --mist: #d9def7;
  --teal: #5fb5c8; --rose: #f0a0a8; --apricot: #ffc28a; --gold: #ffe6a8; --aurora: #7affc8; --violet: #b48cff;
  --sm-bg: #eef1fc; --sm-text: #1b1d4d; --sm-muted: #4a4f84; --sm-accent: #5a3fb0; --sm-hover: #dde3f8;
  --sm-up: #1f7a5a; --sm-down: #a03a4a;
  --sm-font: 'Alegreya Sans', 'Trebuchet MS', sans-serif; --sm-head: 'Cormorant Garamond', Georgia, serif; --sm-head-weight: 600; --sm-size: 17px;
  --sm-radius: 16px; --sm-border: 1px solid #b9c3e6; --sm-shadow: 0 18px 44px rgba(8, 8, 40, .5);
  --sm-top: 78px; --sm-right: calc(10px + env(safe-area-inset-right, 0px));
}
*, ::before, ::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); }
body {
  font-family: 'Alegreya Sans', 'Trebuchet MS', sans-serif; color: var(--frost);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#view { position: fixed; left: 0; top: 0; display: block; touch-action: none; outline: none; }
#view:focus-visible { outline: 3px solid var(--aurora); outline-offset: -3px; }
/* v0.6 (playtest: a 3 px aurora frame round the whole walk): the keyboard cue stays on the title, not during a walk or its card */
body.playing #view:focus-visible, body.ended #view:focus-visible { outline: none; }
.veil { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(140% 100% at 50% 40%, transparent 60%, rgba(11, 11, 42, .5)); }
.sunveil { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s linear;
  background: radial-gradient(120% 90% at 50% 55%, transparent 38%, rgba(255, 196, 130, .38) 75%, rgba(255, 226, 168, .62)); mix-blend-mode: screen; }

/* title over the live valley */
.title { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: max(16vh, calc(env(safe-area-inset-top) + 5rem)) 1.5rem 1.5rem; text-align: center; cursor: pointer;
  background: radial-gradient(90% 45% at 50% 30%, rgba(11, 11, 42, .42), transparent 75%); }
.title h1 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-weight: 300;
  font-size: clamp(3.1rem, 13vw, 6.4rem); line-height: .95; letter-spacing: .01em; color: #f6f3ff;
  text-shadow: 0 0 1.2rem rgba(180, 140, 255, .55), 0 0 2.6rem rgba(122, 255, 200, .25), 0 .1rem .3rem rgba(11, 11, 42, .8); }
.title .sub { margin: .8rem 0 0; font-size: clamp(1.05rem, 4.2vw, 1.3rem); color: var(--mist); letter-spacing: .02em; text-shadow: 0 1px 6px rgba(11, 11, 42, .9); }
.go { margin: 2.2rem 0 0; font-size: 1rem; color: var(--gold); text-shadow: 0 1px 6px rgba(11, 11, 42, .9); animation: breathe 2.6s ease-in-out infinite; }
.best { margin: .9rem 0 0; font-size: .95rem; color: var(--mist); text-shadow: 0 1px 6px rgba(11, 11, 42, .9); }
.best:empty { display: none; }
.stamp { position: fixed; left: max(.6rem, env(safe-area-inset-left)); bottom: max(.5rem, env(safe-area-inset-bottom)); margin: 0; }
#buildstamp { font: .68rem/1 ui-monospace, Menlo, monospace; color: #aeb5dc; opacity: .8; }
/* v0.5.4 (Tatum: "click to start" showed before any valley): a thin aurora thread fills while the valley loads, the
   prompt waits until the first frame is drawn */
.load { width: 9rem; height: 2px; margin: 2.9rem 0 0; border-radius: 2px; background: rgba(233, 238, 252, .16); overflow: hidden; transition: opacity .6s ease; }
.load span { display: block; height: 100%; width: 10%; border-radius: 2px; background: linear-gradient(90deg, #b48cff, #7affc8); box-shadow: 0 0 8px #7affc8; transition: width .8s ease; }
body.loading .load span { animation: creep 14s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes creep { to { width: 45%; } }
body.loading .go { visibility: hidden; opacity: 0; }
body:not(.loading) .load { opacity: 0; height: 0; margin: 0; }
.go { transition: opacity .6s ease; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* one quiet line at a time */
.hint { position: fixed; left: 50%; top: min(84%, calc(100% - 3.5rem - env(safe-area-inset-bottom))); transform: translate(-50%, -50%);   /* v0.2.1 (after brenry's playtest): just under the elf, where your eyes are, not up at the top */
  max-width: min(30rem, calc(100vw - 8.5rem)); margin: 0; padding: .5rem 1rem; border-radius: 1.4rem; text-align: center;
  font-size: 1rem; line-height: 1.3; color: var(--frost); background: rgba(20, 18, 58, .72); pointer-events: none;
  box-shadow: 0 0 1.4rem rgba(20, 18, 58, .5); transition: opacity .9s ease; animation: hintIn .5s ease; }
.hint.out { opacity: 0; }   /* v0.6 a line fades away instead of vanishing */
@keyframes hintIn { from { opacity: 0; } }

/* end of a walk */
.card, .pause { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; padding: 1.5rem; }
.card { background: radial-gradient(75% 55% at 50% 50%, rgba(11, 11, 42, .7), rgba(11, 11, 42, .2) 85%); }
.card[data-kind="won"] { background: radial-gradient(75% 55% at 50% 48%, rgba(52, 28, 60, .66), rgba(52, 28, 60, .08) 88%); }
.cardin { max-width: 26rem; padding: 1.1rem 1.3rem; border-radius: 2rem; background: rgba(20, 18, 58, .42); box-shadow: 0 0 3rem 1.4rem rgba(20, 18, 58, .42); }
/* v0.6 (playtest at 1280: "The light found / you."): a wider box on desktop so the heading keeps to one line; the lines under it keep their measure */
@media (min-width: 600px) { .cardin { max-width: 34rem; } .card .cardin p { max-width: 26rem; margin-left: auto; margin-right: auto; } }
.card[data-kind="won"] .cardin { background: rgba(48, 26, 58, .5); box-shadow: 0 0 3rem 1.4rem rgba(48, 26, 58, .5); }
.card h2, .pause h2 { margin: 0; text-wrap: balance; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-weight: 600; font-size: clamp(2.3rem, 9vw, 3.4rem); line-height: 1.05; color: #f6f3ff;
  text-shadow: 0 0 1rem rgba(180, 140, 255, .5), 0 .1rem .3rem rgba(11, 11, 42, .8); }
.card[data-kind="won"] h2 { text-shadow: 0 0 1.2rem rgba(255, 194, 138, .7), 0 .1rem .3rem rgba(40, 20, 30, .8); }
.card p { margin: .9rem 0 0; text-wrap: balance; font-size: 1.15rem; line-height: 1.4; color: var(--frost); text-shadow: 0 1px 6px rgba(11, 11, 42, .95); }
.card .best { font-size: 1rem; color: var(--mist); }
/* v0.5.1 (Tatum: '... of 760. 4 glimmers' read as 760.4): the glimmer count on its own line, small and quiet; it is not a score */
.card .glims { margin-top: .45rem; font-size: .82rem; letter-spacing: .04em; color: var(--mist); opacity: .62; }
.card .glims:empty { display: none; }
.card .go { margin-top: 1.8rem; color: var(--gold); }
.pause { background: rgba(11, 11, 42, .55); flex-direction: column; }
.cup { display: block; width: 6.5rem; height: 6.5rem; margin: 0 auto .5rem; filter: drop-shadow(0 0 1.4rem rgba(255, 184, 102, .55)); }
.cup .steam path { animation: steam 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; }
.cup .steam path:nth-child(2) { animation-delay: .9s; } .cup .steam path:nth-child(3) { animation-delay: 1.8s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px) scaleY(.7); } 35% { opacity: .85; } 100% { opacity: 0; transform: translateY(-9px) scaleY(1.1); } }
.pause p { margin: .6rem 0 0; color: var(--gold); }

/* the Sloppy menu: a frosted lantern hanging from the top edge */
.lantern { position: fixed; z-index: 6; top: env(safe-area-inset-top, 0px); right: max(.6rem, env(safe-area-inset-right)); width: 3rem; height: 4.4rem; padding: 0; border: 0; background: none; cursor: pointer; }
.lantern svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 0; filter: drop-shadow(0 0 .5rem rgba(122, 255, 200, .45)) drop-shadow(0 3px 4px rgba(11, 11, 42, .5)); }
.lantern .eyes > *, .lantern .lines > * { transform-box: fill-box; transition: transform .22s ease; }
.lantern .eyes > * { transform-origin: center; }
.lantern .lines > * { transform-origin: left center; transform: scaleX(0); }
.lantern .lines > :nth-child(2) { transition-delay: .05s; } .lantern .lines > :nth-child(3) { transition-delay: .1s; }
.lantern:hover .eyes > *, .lantern:focus-visible .eyes > *, .lantern.cue .eyes > *, .sm-open .lantern .eyes > * { transform: scaleY(0); }
.lantern:hover .lines > *, .lantern:focus-visible .lines > *, .lantern.cue .lines > *, .sm-open .lantern .lines > * { transform: scaleX(1); }
.lantern:hover svg, .lantern.cue svg { animation: swing 1.9s ease-out; }
.lantern:focus-visible { outline: 3px solid var(--aurora); outline-offset: 2px; border-radius: 12px; }
@keyframes swing { 0% { transform: rotate(0); } 22% { transform: rotate(8deg); } 50% { transform: rotate(-5deg); } 76% { transform: rotate(2deg); } 100% { transform: rotate(0); } }

.err { position: fixed; inset: 0; display: grid; place-items: center; padding: 2rem; background: var(--indigo); text-align: center; }
.err h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 2.2rem; margin: 0 0 .6rem; }
.err p { max-width: 26rem; color: var(--mist); }

@media (prefers-reduced-motion: reduce) {
  .go, .lantern:hover svg, .lantern.cue svg { animation: none; }
  .cup .steam path { animation: none; opacity: .7; }
  .sunveil { transition: none; }
  .hint { animation: none; }
}
