:root { --ink: #f3e9dc; --dim: rgba(243, 233, 220, 0.62); --gold: #e8c48a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #120c08; color: var(--ink); font-family: 'Cormorant Garamond', Georgia, serif; -webkit-user-select: none; user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }

#strain { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 38%, rgba(90, 10, 4, 0.75) 100%); }

#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #120c08; font-style: italic; font-size: 22px; color: var(--dim); z-index: 30; transition: opacity 1.2s; }
#loading.gone { opacity: 0; pointer-events: none; }

#title { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; text-align: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 55%, rgba(10, 6, 4, 0.1), rgba(10, 6, 4, 0.72) 80%); transition: opacity 1.4s ease; }
#title.gone { opacity: 0; pointer-events: none; }
#title .inner { max-width: 720px; animation: rise 2.4s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
h1 { font-weight: 300; font-size: clamp(46px, 9vw, 104px); letter-spacing: 0.02em; margin: 0; line-height: 1; text-shadow: 0 4px 40px rgba(0, 0, 0, 0.6); }
.sub { font-style: italic; font-size: clamp(18px, 2.4vw, 24px); color: var(--dim); margin: 14px 0 34px; }
#begin { font-family: 'Cinzel', serif; font-size: 18px; letter-spacing: 0.3em; text-indent: 0.3em; padding: 14px 44px; color: var(--ink); background: rgba(20, 12, 8, 0.35);
  border: 1px solid rgba(243, 233, 220, 0.5); cursor: pointer; transition: background 0.3s, border-color 0.3s; }
#begin:hover { background: rgba(243, 233, 220, 0.12); border-color: var(--ink); }
.controls { margin-top: 36px; font-size: 18px; line-height: 1.5; color: var(--dim); }
.controls b { color: var(--ink); font-weight: 500; }
.controls .hint { font-style: italic; margin-top: 10px; }
.tap { display: none; }
body.touch .tap { display: block; }
body.touch .desk { display: none; }
.stats { font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: 0.18em; color: var(--gold); margin-top: 26px; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.meter { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 22px; display: flex; gap: 18px; align-items: baseline; font-family: 'Cinzel', serif; letter-spacing: 0.12em; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7); }
#h-height { font-size: 22px; }
#breath { position: absolute; top: calc(max(18px, env(safe-area-inset-top)) + 34px); left: 22px; width: 132px; height: 6px; border-radius: 3px;
  background: rgba(243, 233, 220, 0.18); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
#breath i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 3px; background: var(--ink); transition: background 0.4s; }
#breath span { position: absolute; left: 0; top: 10px; font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 0.2em; color: var(--dim); }
#breath.low i { background: #e0553a; }
#breath.low { animation: gasp 0.9s ease-in-out infinite; }
@keyframes gasp { 50% { opacity: 0.45; } }
#h-best, #h-summits { font-size: 13px; color: var(--dim); }
#h-summits { color: var(--gold); }
#look, #mute { pointer-events: auto; position: absolute; top: max(14px, env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(243, 233, 220, 0.35);
  background: rgba(12, 8, 6, 0.3); color: var(--ink); font-size: 18px; cursor: pointer; backdrop-filter: blur(4px); touch-action: none; }
#look { right: 74px; }
#mute { right: 20px; }
#mute.off { color: rgba(243, 233, 220, 0.3); text-decoration: line-through; }
.thumb { display: none; position: absolute; bottom: max(30px, env(safe-area-inset-bottom)); width: 86px; height: 86px; border-radius: 50%; border: 1px solid rgba(243, 233, 220, 0.18); }
body.touch .thumb { display: block; }
.thumb.left { left: 28px; }
.thumb.right { right: 28px; }

#line { position: fixed; left: 50%; bottom: 13%; transform: translate(-50%, 8px); max-width: min(760px, 88vw); text-align: center; font-style: italic; font-size: clamp(20px, 2.6vw, 28px);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 1.2s, transform 1.2s; pointer-events: none; z-index: 6; }
#line.show { opacity: 1; transform: translate(-50%, 0); }
#prompt { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); font-family: 'Cinzel', serif; letter-spacing: 0.2em; font-size: 14px; color: var(--gold);
  opacity: 0; transition: opacity 0.8s; pointer-events: none; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); z-index: 6; }
#prompt.show { opacity: 1; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }
#big { position: fixed; inset: 0; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 0 0.28em; padding: 0 6vw; text-align: center; font-weight: 300;
  font-size: clamp(40px, 7vw, 92px); pointer-events: none; opacity: 0; transition: opacity 2.5s; text-shadow: 0 4px 40px rgba(0, 0, 0, 0.7); z-index: 7; }
#big.show { opacity: 1; }
#big-b { font-style: italic; color: var(--gold); opacity: 0; transition: opacity 3s; }
#big-b.show { opacity: 1; }
