@font-face { font-family: "Instrument Sans"; src: url("vendor/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("vendor/fonts/instrument-sans-latin-wght-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

@property --tint { syntax: "<color>"; inherits: true; initial-value: #f9f97f; }

:root {
  --ink: #f2efe8; --ink-2: rgba(242, 239, 232, .66); --ink-3: rgba(242, 239, 232, .42);
  --ease: cubic-bezier(.22, 1, .36, 1); --tint: #f9f97f;
  --gutter: clamp(20px, 4vw, 56px);
  transition: --tint 1.4s var(--ease);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #06070a; color: var(--ink); overflow: hidden; }
body { font-family: "Instrument Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

#tint { position: fixed; inset: 0; background: radial-gradient(70% 60% at 62% 45%, color-mix(in oklab, var(--tint) 13%, transparent), transparent 75%), radial-gradient(120% 100% at 50% 110%, #10131c, #06070a 62%); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#say { position: fixed; left: var(--gutter); top: 50%; transform: translateY(-52%); width: min(32vw, 30rem); pointer-events: none; }
#say > * { margin: 0; transition: opacity .32s var(--ease), transform .5s var(--ease); }
#say > .leaving { opacity: 0; transform: translateY(8px); }
.big { font-size: clamp(1.9rem, 3vw, 3.4rem); line-height: 1.04; letter-spacing: -.022em; font-weight: 500; text-wrap: balance; }
.news { font-size: 1.05rem; line-height: 1.35; color: #ffcf96; margin-bottom: 1.1rem !important; max-width: 26rem; }
.body { font-size: clamp(1.15rem, 1.5vw, 1.5rem); line-height: 1.32; color: var(--ink-2); margin-top: 1.1rem !important; text-wrap: pretty; }
.hint { font-size: clamp(1.05rem, 1.25vw, 1.25rem); color: #ffcf96; margin-top: 1.5rem !important; }
.small { font-size: .95rem; line-height: 1.4; color: var(--ink-3); margin-top: 1.1rem !important; max-width: 28rem; }

body[data-phase="descend"] #say, body[data-phase="predict"] #say, body[data-phase="placed"] #say, body[data-phase="ascend"] #say { top: clamp(64px, 9vh, 104px); transform: none; }
body[data-phase="descend"] .big, body[data-phase="predict"] .big, body[data-phase="placed"] .big, body[data-phase="ascend"] .big { font-size: clamp(1.6rem, 2.4vw, 2.7rem); }

#chrome { position: fixed; top: calc(var(--gutter) * .7 + env(safe-area-inset-top, 0px)); right: var(--gutter); display: flex; gap: 1.6rem; align-items: center; font-size: .98rem; }
#levels { display: flex; gap: 1rem; }
#levels button { color: var(--ink-3); transition: color .3s var(--ease); padding: 6px 2px; }
#levels button[aria-pressed="true"] { color: var(--ink); }
#sound { color: var(--ink-3); padding: 6px 2px; }
#sound[aria-pressed="true"] { color: var(--ink); }

#ribbon { position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); height: 92px; opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); pointer-events: none; cursor: grab; touch-action: none; }
#ribbon.shown { opacity: 1; transform: none; pointer-events: auto; }
#ribbon.locked { cursor: default; }
#ribbon.dragging { cursor: grabbing; }
.ribbon-track { position: absolute; left: 0; right: 0; bottom: 20px; height: 0; }
.ribbon-line { position: absolute; left: 0; right: 0; top: -1px; height: 2px; border-radius: 2px; box-shadow: 0 0 18px rgba(255, 255, 255, .28); transition: opacity .6s var(--ease), box-shadow .4s var(--ease); }
#ribbon.locked .ribbon-line { opacity: .45; }
.ribbon-mark { position: absolute; top: -5px; width: 2px; height: 10px; margin-left: -1px; background: var(--ink); opacity: .8; border-radius: 1px; }
.ribbon-bead { position: absolute; top: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 22px 6px rgba(255, 255, 255, .55); transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease); }
#ribbon.dragging .ribbon-bead { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
#ribbon.locked .ribbon-bead { box-shadow: 0 0 8px 1px rgba(255, 255, 255, .4); }
.ribbon-readout { position: absolute; left: 0; bottom: 44px; will-change: transform; white-space: nowrap; font-size: 1.02rem; font-variant-numeric: tabular-nums; color: var(--ink); text-shadow: 0 0 14px rgba(0, 0, 0, .8); }

.ear-touch { position: fixed; left: 0; top: 0; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .6s var(--ease); }
.ear-touch.shown { opacity: 1; pointer-events: auto; }
.ear-touch::before, .ear-touch::after { content: ""; position: absolute; inset: 26px; border-radius: 50%; border: 1px solid rgba(255, 228, 190, .8); animation: pulse 2.4s var(--ease) infinite; }
.ear-touch::after { animation-delay: 1.2s; }
@keyframes pulse { from { transform: scale(.55); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }

#labels { position: fixed; inset: 0; pointer-events: none; }
.bone-label { position: absolute; left: 0; top: 0; font-size: 1rem; font-weight: 500; white-space: nowrap; text-shadow: 0 0 10px rgba(0, 0, 0, .9); opacity: 0; transition: opacity .5s var(--ease); will-change: transform; }
.bone-label.shown { opacity: 1; }

#zones { position: fixed; inset: 0; pointer-events: none; }
.zone { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease), color .3s var(--ease); color: var(--ink-2); font-size: 1.02rem; font-weight: 500; text-align: center; max-width: 11rem; padding: 10px 6px; line-height: 1.15; will-change: transform; text-shadow: 0 0 10px rgba(0, 0, 0, .9); }
.zone.shown { opacity: 1; pointer-events: auto; }
.zone.near { color: var(--ink); }

#map { position: fixed; inset: 0; pointer-events: none; }
#map[hidden] { display: none; }
#map-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
#map-lines path { fill: none; stroke: rgba(255, 224, 180, .85); stroke-width: 1.4; stroke-linecap: round; }
.map-q { position: absolute; left: var(--gutter); max-width: min(38vw, 30rem); text-align: left; display: flex; gap: .7rem; align-items: flex-start; margin: 0; }
.map-q p, .map-q span:last-child { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2.6rem); line-height: 1.08; letter-spacing: -.018em; font-weight: 500; text-wrap: balance; }
.map-done { top: 21%; }
.map-new { top: 62%; color: #ffcf96; pointer-events: auto; opacity: 0; transition: opacity 1s var(--ease) .5s; }
.map-new.shown { opacity: 1; }
.map-dot { flex: none; width: 13px; height: 13px; border-radius: 50%; margin-top: .55rem; background: #ffe7c4; box-shadow: 0 0 22px 7px rgba(255, 214, 160, .7); }
.map-new .map-dot { background: transparent; border: 1.5px solid #ffcf96; box-shadow: 0 0 18px 3px rgba(255, 207, 150, .5); }
.map-title { position: absolute; left: var(--gutter); top: 48%; margin: 0; color: var(--ink-2); font-size: clamp(1.05rem, 1.3vw, 1.3rem); max-width: 26rem; }
.map-note { position: absolute; left: var(--gutter); top: 79%; margin: 0; color: var(--ink-3); font-size: .98rem; max-width: 24rem; }

#notice { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; max-width: 24rem; font-size: 1.2rem; line-height: 1.35; }

@media (max-aspect-ratio: 9/10) {
  #say, body[data-phase] #say { top: calc(var(--gutter) * .7 + 44px + env(safe-area-inset-top, 0px)); transform: none; left: var(--gutter); right: var(--gutter); width: auto; }
  .big { font-size: clamp(1.75rem, 7.6vw, 3rem); }
  .body { font-size: 1.05rem; margin-top: .6rem !important; }
  .hint { font-size: 1rem; margin-top: .75rem !important; }
  .small { font-size: .85rem; margin-top: .6rem !important; }
  #chrome { gap: 1rem; font-size: .92rem; left: var(--gutter); justify-content: space-between; }
  .ribbon-readout { font-size: .95rem; }
  .map-q { max-width: calc(100vw - var(--gutter) * 2); }
  .map-done { top: 14%; }
  .map-title { top: 30%; max-width: 15rem; }
  .map-new { top: 39%; }
  .map-note { top: 53%; }
  .bone-label, .zone { font-size: .92rem; }
  .zone { max-width: 8rem; }
}

@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .ear-touch::before { opacity: .9; transform: scale(1); }
}
