/* Melo — Chord Jump (standalone climbing game). Ported from design/chord-jump-mockup-v6.html
   but using the real design tokens (melo.css vars + Fraunces/Space Mono/Inter + the feeling
   colours), the SHARED keyboard (glowkb.css), and the SHARED audio (glowaudio). The mock's
   one-off keyboard/synth styles are intentionally NOT here. Motion eased under reduced-motion.

   Feeling → colour (quality-based, from the Brain): Home=orange, Tension=cobalt, Lift=purple,
   Surprise=gold. */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
html, body { height: 100%; }
/* Cream full-bleed — matches the rest of the app: no dark void / black bars. The game sits
   in a centered ~1080px wrap on cream; the soft colour blooms fill the wide space. */
body { background: var(--cream, #FBF2E4); color: var(--ink, #2A1A0E); font-family: var(--font-ui, Inter, sans-serif); overflow: hidden; touch-action: none; }

.cj { width: 100%; max-width: 1080px; height: 100dvh; margin: 0 auto; padding: 0 14px; display: flex; flex-direction: column; position: relative; }

/* header — INSIDE the centered wrap (logo · two stats · exit), so nothing strands in corners */
.hud { flex: 0 0 auto; padding: 16px 4px 10px; display: flex; align-items: center; gap: 24px; z-index: 6; }
.brand { font-family: var(--font-serif, serif); font-weight: 700; font-size: 22px; letter-spacing: -.5px; }
.brand .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--orange, #FF5A1F); margin-left: 5px; }
.stats { display: flex; gap: 30px; align-items: flex-end; }
.stat { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.stat .num { font-family: var(--font-serif, serif); font-weight: 700; font-size: 30px; line-height: 1; }
.stat .lbl { font-family: var(--font-mono, monospace); font-size: 9px; letter-spacing: 2px; text-transform: uppercase; opacity: .5; margin-top: 4px; }
.combo { color: var(--orange, #FF5A1F); transition: transform .12s; } .combo.bump { transform: scale(1.3); }
.cj-exit { margin-left: auto; font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8a7a64); text-decoration: none; opacity: .65; }
.cj-exit:hover { opacity: 1; }

/* the climbing world */
.viewport { position: relative; flex: 1 1 auto; overflow: hidden; margin: 0; border-radius: var(--r-xl, 24px); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 18px 50px -28px rgba(120,60,10,.4); }
.bg { position: absolute; inset: 0; z-index: 0; }
.bg .warm, .bg .cool { position: absolute; inset: 0; transition: opacity .6s linear; }
.bg .warm { background: linear-gradient(180deg, #FFE9CC, var(--cream, #FBF2E4) 60%, #FFF6E8); opacity: 1; }
.bg .cool { background: linear-gradient(180deg, #1b1140, #3a1f6e 45%, #6a3fa0 80%, #b76b9a); opacity: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(34px); opacity: .5; z-index: 1; pointer-events: none; }
.orb.a { width: 200px; height: 200px; background: rgba(255,90,31,.5); left: -40px; top: 8%; animation: drift1 14s ease-in-out infinite; }
.orb.b { width: 180px; height: 180px; background: rgba(122,63,242,.5); right: -30px; top: 40%; animation: drift2 18s ease-in-out infinite; }
.orb.c { width: 160px; height: 160px; background: rgba(31,61,255,.45); left: 20%; bottom: 6%; animation: drift1 20s ease-in-out infinite reverse; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-26px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-34px,24px); } }

.world { position: absolute; left: 0; right: 0; bottom: 0; height: 9000px; will-change: transform; z-index: 2; }
.platform { position: absolute; left: 50%; transform: translateX(-50%); min-width: 200px; max-width: 340px; padding: 0 18px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif, serif); font-size: 18px; font-weight: 700; border: 2.5px solid; background: rgba(255,255,255,.82); transition: box-shadow .2s, opacity .2s, transform .2s; white-space: nowrap; backdrop-filter: blur(2px); }
.platform.home { border-color: var(--orange, #FF5A1F); color: var(--orange, #FF5A1F); }
.platform.lift { border-color: var(--purple, #7A3FF2); color: var(--purple, #7A3FF2); }
.platform.tension { border-color: var(--cobalt, #1F3DFF); color: var(--cobalt, #1F3DFF); }
.platform.surprise { border-color: var(--gold, #e8a91e); color: #9a7400; }
.platform.done { opacity: .24; }
.platform.target { animation: cjpulse 1.1s ease-in-out infinite; box-shadow: 0 0 0 4px rgba(255,90,31,.16), 0 0 30px rgba(255,90,31,.5); }
@keyframes cjpulse { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.045); } }

.blob { position: absolute; left: 50%; width: 42px; height: 42px; transform: translateX(-50%); border-radius: 14px; background: radial-gradient(circle at 35% 30%, #ff8a52, var(--orange, #FF5A1F)); box-shadow: 0 6px 16px -3px rgba(255,90,31,.8), inset 0 -4px 8px rgba(0,0,0,.12); z-index: 5; transition: bottom .2s cubic-bezier(.34,1.56,.64,1); }
.blob::before, .blob::after { content: ''; position: absolute; top: 14px; width: 5px; height: 7px; border-radius: 3px; background: var(--ink, #2A1A0E); }
.blob::before { left: 11px; } .blob::after { right: 11px; }
.blob.squash { animation: squash .24s ease; }
@keyframes squash { 0% { transform: translateX(-50%) scaleY(.7); } 40% { transform: translateX(-50%) scaleY(1.12); } 100% { transform: translateX(-50%) scaleY(1); } }

.danger { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, rgba(178,43,27,0), rgba(178,43,27,.6) 30%, rgba(120,20,10,.95)); border-top: 2px dashed rgba(255,120,100,.95); z-index: 4; }
.danger .lbl { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-family: var(--font-mono, monospace); font-size: 9px; letter-spacing: 2px; color: #fff; opacity: .9; text-transform: uppercase; }
.ring { position: absolute; left: 50%; min-width: 46%; padding: 0 16px; height: 34px; transform: translateX(-50%); border-radius: 17px; border: 3px solid var(--orange, #FF5A1F); z-index: 3; pointer-events: none; animation: cjring .5s ease-out forwards; }
@keyframes cjring { 0% { opacity: .9; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) scale(1.5); } }

/* overlay (intro + game over) */
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(251,242,228,.92); backdrop-filter: blur(4px); z-index: 20; transition: opacity .25s; }
.overlay.gone { opacity: 0; pointer-events: none; }
.overlay h1 { font-family: var(--font-serif, serif); font-weight: 700; font-size: 38px; line-height: 1.02; letter-spacing: -1px; margin-bottom: 10px; }
.overlay p { font-size: 14px; opacity: .7; max-width: 280px; line-height: 1.5; }
.overlay .big { font-family: var(--font-serif, serif); font-weight: 700; font-size: 64px; color: var(--orange, #FF5A1F); line-height: 1; }
.overlay .biglbl { font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: 3px; text-transform: uppercase; opacity: .5; margin-bottom: 14px; }
.cta { margin-top: 18px; background: var(--orange, #FF5A1F); color: #fff; border: none; font-family: var(--font-ui, sans-serif); font-weight: 600; font-size: 17px; padding: 15px 34px; border-radius: 40px; cursor: pointer; box-shadow: 0 10px 22px -8px rgba(255,90,31,.7); }
.cta:active { transform: translateY(1px); }

/* stuck hint line */
.hint { font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; text-align: center; opacity: 0; transition: opacity .3s; color: var(--cobalt, #1F3DFF); padding: 6px 0 2px; height: 20px; flex: 0 0 auto; font-weight: 700; }
.hint.show { opacity: 1; }

/* the SHARED keyboard (glowkb) sits in this band; we scale it to fill the width */
.kb-wrap { flex: 0 0 auto; display: flex; justify-content: center; align-items: flex-start; margin: 4px 0 calc(10px + env(safe-area-inset-bottom)); }
.kb-wrap .kb { transform-origin: top center; }

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