:root {
  --bg: #1d1a2b;
  --ink: #fff8ee;
  --ink-soft: #e7dccb;
  --accent: #ffb867;
  --accent-ink: #2a1c10;
  --glass: rgba(26, 22, 38, 0.55);
  --glass-line: rgba(255, 240, 220, 0.22);
  --chime: #9fe7ff;
  --glide: #b6f5a6;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; max-width: none; }

.hidden { display: none !important; }
.screen { position: fixed; inset: 0; z-index: 20; }

button { cursor: pointer; }
.primary, .ghost {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  border-radius: 999px; padding: .7rem 1.2rem; font-weight: 600; border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, filter .2s;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ghost { background: rgba(255,255,255,.08); color: var(--ink); border-color: var(--glass-line); }
.ghost:hover { background: rgba(255,255,255,.16); }
.wide { width: 100%; margin-top: 1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- MENU ---------- */
#menu { overflow-y: auto; touch-action: pan-y; }
.menu-bg {
  position: fixed; inset: 0; background-size: cover; background-position: center;
  filter: blur(18px) saturate(1.1) brightness(.55); transform: scale(1.15);
  transition: background-image .6s ease;
}
.menu-inner { position: relative; max-width: 72rem; margin: 0 auto; padding: max(1.5rem, env(safe-area-inset-top)) 1rem 2rem; }
.menu-head { text-align: center; padding: 1.5rem 0 1.25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; color: var(--accent); margin: 0 0 .4rem; font-weight: 600; }
.menu-head h1 { font-size: clamp(2.4rem, 8vw, 4.2rem); margin: 0 0 .6rem; text-shadow: 0 4px 30px rgba(0,0,0,.4); }
.lede { margin: 0 auto; color: var(--ink-soft); max-width: 46ch; }

.tracks { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.track-card {
  position: relative; text-align: left; border: 1px solid var(--glass-line); border-radius: 18px; overflow: hidden;
  background: var(--glass); color: var(--ink); padding: 0; display: flex; flex-direction: column;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.track-card:hover, .track-card:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,.35); border-color: var(--accent); }
.track-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.track-card .tc-body { padding: .8rem .95rem 1rem; }
.track-card h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.track-card p { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .55rem; line-height: 1.45; }
.tc-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tc-tags span { font-size: .72rem; padding: .15rem .5rem; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--ink-soft); }
.tc-num { position: absolute; top: .6rem; left: .6rem; background: rgba(0,0,0,.45); border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; }
.menu-foot { display: flex; justify-content: center; align-items: center; gap: 1.2rem; margin-top: 1.5rem; flex-wrap: wrap; }
.credits { color: var(--ink-soft); font-size: .85rem; }

/* ---------- LOADING ---------- */
#loading, #nogl { display: grid; place-items: center; background: rgba(20,16,30,.85); }
.load-card { text-align: center; padding: 2rem; max-width: 26rem; }
.spinner { width: 46px; height: 46px; margin: 0 auto 1rem; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- OVERLAYS ---------- */
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0;
  background: radial-gradient(ellipse 70% 62% at 50% 50%, transparent 45%, rgba(8,6,14,.55) 72%, rgba(6,4,10,.94) 100%);
  transition: opacity .25s linear;
}
#horizon { position: fixed; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; z-index: 6; }
#horizon span {
  position: absolute; left: 6%; right: 6%; top: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,250,235,.55) 12%, rgba(255,250,235,.15) 38%, transparent 44%, transparent 56%, rgba(255,250,235,.15) 62%, rgba(255,250,235,.55) 88%, transparent);
}
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 30; transition: opacity .5s ease; }
#flash.on { opacity: .85; transition: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud .hint, #toast, #cue, #viewfinder, .hud-stats { pointer-events: none; }

.hud-top {
  position: absolute; top: max(.6rem, env(safe-area-inset-top)); left: .6rem; right: .6rem;
  display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-title { display: flex; gap: .5rem; align-items: center; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: .25rem .9rem .25rem .25rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.title-block strong { font-family: var(--font-display); font-size: .95rem; display: block; line-height: 1.2; white-space: nowrap; }
.progress { width: 7.5rem; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); margin-top: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.hud-stats { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.stat { display: inline-flex; align-items: center; gap: .35rem; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: .3rem .65rem; font-size: .85rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.stat .icon { color: var(--accent); }
.chime-dot, .glide-dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; background: var(--chime); box-shadow: 0 0 8px var(--chime); }
.glide-dot { background: var(--glide); box-shadow: 0 0 8px var(--glide); }
.stat.pulse { animation: pulse .7s ease; }
@keyframes pulse { 40% { transform: scale(1.18); background: rgba(255,184,103,.45); } }

.hbtn {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--glass); color: var(--ink);
  display: inline-grid; place-items: center; font-size: 1.1rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s, transform .15s;
}
.hbtn:hover { background: rgba(60,50,80,.75); }
.hbtn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hbtn.dark { background: rgba(255,255,255,.08); }
.hud-tools { position: absolute; left: .6rem; top: calc(max(.6rem, env(safe-area-inset-top)) + 3.6rem); display: flex; flex-direction: column; gap: .45rem; }

#toast {
  position: absolute; top: calc(max(.6rem, env(safe-area-inset-top)) + 3.6rem); left: 50%; transform: translateX(-50%) translateY(-6px);
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: .45rem 1rem; font-size: .9rem;
  opacity: 0; transition: opacity .35s ease, transform .35s ease; white-space: nowrap; max-width: 70vw; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#cue {
  position: absolute; top: 34%; left: 50%; transform: translateX(-50%); text-align: center; font-size: .9rem; color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.7); opacity: 0; transition: opacity .3s; white-space: nowrap;
}
#cue.show { opacity: 1; }
#cue.left { left: 22%; } #cue.right { left: 78%; }

#viewfinder { position: absolute; left: 50%; top: 50%; width: min(42vw, 15rem); aspect-ratio: 4/3; transform: translate(-50%, -50%); opacity: .45; transition: opacity .25s, filter .25s; }
#viewfinder i { position: absolute; width: 18%; height: 22%; border: 2px solid #fff; }
#viewfinder i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
#viewfinder i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
#viewfinder i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
#viewfinder i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
#viewfinder span { position: absolute; left: 50%; bottom: -1.7rem; transform: translateX(-50%); font-size: .85rem; white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
#viewfinder.lock { opacity: 1; }
#viewfinder.lock i { border-color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }

#joy {
  position: absolute; left: max(1rem, env(safe-area-inset-left)); bottom: max(1.2rem, env(safe-area-inset-bottom));
  width: 7.5rem; height: 7.5rem; border-radius: 50%; background: rgba(255,255,255,.07); border: 1px solid var(--glass-line); touch-action: none;
}
#joy::after { content: "look"; position: absolute; left: 50%; bottom: -1.2rem; transform: translateX(-50%); font-size: .72rem; color: var(--ink-soft); }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 3rem; height: 3rem; margin: -1.5rem; border-radius: 50%; background: rgba(255,248,238,.35); border: 1px solid rgba(255,255,255,.5); }

#shutter {
  position: absolute; left: 50%; bottom: max(1.2rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: 4.6rem; height: 4.6rem; border-radius: 50%; border: 4px solid rgba(255,255,255,.85); background: rgba(255,255,255,.18);
  color: #fff; font-size: 1.6rem; display: grid; place-items: center; transition: transform .12s, background .2s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#shutter:hover { background: rgba(255,255,255,.3); }
#shutter:active { transform: translateX(-50%) scale(.92); }
#shutter.ready { background: var(--accent); color: var(--accent-ink); border-color: #fff3df; box-shadow: 0 0 0 6px rgba(255,184,103,.3); }

.throttle-wrap {
  position: absolute; right: max(.8rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
}
.speed { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 12px; padding: .2rem .6rem; text-align: center; line-height: 1.1; }
.speed b { font-size: 1.2rem; display: block; font-variant-numeric: tabular-nums; }
.speed small, .thr-label { font-size: .7rem; color: var(--ink-soft); }
#throttle { position: relative; width: 3.6rem; height: min(40vh, 15rem); touch-action: none; border-radius: 999px; }
.track-bar { position: absolute; left: 50%; top: 0; bottom: 0; width: 1rem; margin-left: -.5rem; border-radius: 999px; background: linear-gradient(to top, rgba(140,190,255,.35), rgba(255,184,103,.45)); border: 1px solid var(--glass-line); overflow: hidden; }
#band { position: absolute; left: 0; right: 0; background: rgba(182,245,166,.55); box-shadow: inset 0 0 6px var(--glide); display: none; }
#band.on { display: block; }
#speed-mark { position: absolute; left: -2px; right: -2px; height: 3px; background: #fff; border-radius: 2px; box-shadow: 0 0 6px #fff; }
#thumb { position: absolute; left: 50%; width: 3.2rem; height: 2.2rem; margin-left: -1.6rem; margin-top: -1.1rem; border-radius: 999px; background: #fff4e4; color: #3a2a1a; display: grid; place-items: center; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#throttle.inzone #thumb { box-shadow: 0 0 0 4px rgba(182,245,166,.6), 0 4px 14px rgba(0,0,0,.35); }

.hint {
  position: absolute; left: 50%; bottom: calc(max(1.2rem, env(safe-area-inset-bottom)) + 5.6rem); transform: translateX(-50%);
  font-size: .8rem; color: var(--ink-soft); text-align: center; margin: 0; width: min(90vw, 26rem); text-shadow: 0 1px 6px rgba(0,0,0,.8);
  transition: opacity 1s;
}

/* ---------- MODALS ---------- */
.modal { display: grid; place-items: center; background: rgba(14,10,22,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: 1rem; overflow-y: auto; touch-action: pan-y; z-index: 40; }
.card-m { background: rgba(32,26,46,.92); border: 1px solid var(--glass-line); border-radius: 22px; padding: 1.4rem; width: min(100%, 30rem); box-shadow: 0 30px 80px rgba(0,0,0,.5); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.card-m h2 { margin: 0 0 .5rem; }
.card-m p { color: var(--ink-soft); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.set-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.set span b { display: block; font-size: .95rem; }
.set span small { display: block; color: var(--ink-soft); font-size: .78rem; line-height: 1.35; }
.set input[type=range] { width: 9rem; accent-color: var(--accent); flex-shrink: 0; }
.set input[type=checkbox] { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); flex-shrink: 0; }
.set select { background: #2c2440; border: 1px solid var(--glass-line); border-radius: 8px; padding: .35rem .5rem; }

#freebar { position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: .8rem; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: .4rem .4rem .4rem 1rem; font-size: .85rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); width: max-content; max-width: 94vw; }

.summary-card { width: min(100%, 36rem); }
.stars { font-size: 2rem; letter-spacing: .2rem; color: var(--accent); margin-bottom: .6rem; }
.stars .off { color: rgba(255,255,255,.2); }
.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.sum-grid div { background: rgba(255,255,255,.06); border-radius: 14px; padding: .7rem .5rem; text-align: center; }
.sum-grid b { display: block; font-size: 1.35rem; }
.sum-grid small { color: var(--ink-soft); font-size: .75rem; line-height: 1.3; display: block; }
.summary-card h3 { margin: 1.1rem 0 .6rem; font-size: 1rem; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .5rem; }
.album figure { margin: 0; background: #fff8ee; padding: .3rem .3rem .2rem; border-radius: 4px; transform: rotate(var(--r, 0deg)); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.album img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.album figcaption { color: #3a2a1a; font-size: .7rem; text-align: center; padding-top: .15rem; font-family: var(--font-display); }
.album .empty { color: var(--ink-soft); font-size: .9rem; grid-column: 1 / -1; }

@media (max-height: 520px) {
  .hud-tools { flex-direction: row; top: auto; bottom: max(.8rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: none; }
  #throttle { height: 52vh; }
  #joy { width: 6rem; height: 6rem; }
  .hint { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hud-tools { display: flex; position: absolute; top: calc(max(.6rem, env(safe-area-inset-top)) + 3.2rem); left: .6rem; bottom: auto; transform: none; flex-direction: row; }
  .hbtn { width: 2.3rem; height: 2.3rem; }
}
@media (max-width: 420px) {
  .progress { width: 5rem; }
  .stat { padding: .25rem .5rem; font-size: .78rem; }
  #joy { width: 6.4rem; height: 6.4rem; }
  #shutter { width: 4.1rem; height: 4.1rem; }
}

/* ====================== v2 additions ====================== */
input, textarea { -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.muted { color: var(--ink-soft); font-size: .9rem; }
.small { font-size: .8rem; }

/* menu actions + card meta */
.menu-actions { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
.menu-actions small { background: rgba(0,0,0,.18); border-radius: 999px; padding: .05rem .45rem; font-size: .75rem; }
.tc-best { position: absolute; top: .6rem; right: .6rem; background: rgba(0,0,0,.5); color: var(--accent); border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; letter-spacing: .08em; opacity: 0; }
.tc-best.show { opacity: 1; }
.tc-meta { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: .65rem; padding-top: .55rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .74rem; color: var(--ink-soft); }
.tc-meta span:first-child { color: var(--glide); }

/* riders' wall */
.wall { margin-top: 2.2rem; }
.wall-head { text-align: center; margin-bottom: 1rem; }
.wall-head h2 { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: 1.5rem; }
.wall-head p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.wall-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.wall-list > p { grid-column: 1 / -1; text-align: center; }
.postcard {
  background: #f6efe2; color: #3b3227; border-radius: 6px; padding: .9rem 1rem .8rem; transform: rotate(var(--tilt, 0deg));
  box-shadow: 0 10px 26px rgba(0,0,0,.35); position: relative; font-family: var(--font-display);
  background-image: repeating-linear-gradient(transparent 0 1.55rem, rgba(120,100,70,.12) 1.55rem 1.6rem);
}
.postcard::after { content: ''; position: absolute; top: .6rem; right: .7rem; width: 1.6rem; height: 1.9rem; border: 2px dashed rgba(120,100,70,.4); border-radius: 3px; }
.pc-stars { color: #d98a2b; font-size: .85rem; letter-spacing: .1em; }
.pc-note { margin: .35rem 0 .5rem; font-style: italic; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; padding-right: 1.4rem; }
.pc-from { margin: 0; font-size: .8rem; color: #7a6a52; }

/* cinematic intro */
#intro { position: fixed; inset: 0; z-index: 18; pointer-events: auto; }
#intro .bar { position: absolute; left: 0; right: 0; height: 12vh; background: #000; transition: transform 1.2s cubic-bezier(.6,0,.2,1); }
#intro .bar.top { top: 0; transform: translateY(-100%); }
#intro .bar.bottom { bottom: 0; transform: translateY(100%); }
#intro.in .bar { transform: none; }
#intro.out .bar.top { transform: translateY(-100%); }
#intro.out .bar.bottom { transform: translateY(100%); }
.intro-title { position: absolute; left: 0; right: 0; bottom: calc(12vh + 1.5rem); text-align: center; padding: 0 1rem; opacity: 0; transform: translateY(14px); transition: opacity 1.6s ease .9s, transform 1.6s ease .9s; text-shadow: 0 3px 24px rgba(0,0,0,.6); }
#intro.in .intro-title { opacity: 1; transform: none; }
#intro.out .intro-title { opacity: 0; transition-delay: 0s; transition-duration: .6s; }
.intro-title h2 { font-size: clamp(2rem, 7vw, 3.8rem); margin: 0 0 .4rem; letter-spacing: .01em; }
.intro-title p:last-child { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.intro-skip { position: absolute; right: 1rem; bottom: calc(12vh - 3.1rem); padding: .4rem .9rem; font-size: .8rem; opacity: .8; }
#intro.out .intro-skip { display: none; }

/* photo grade banner */
#grade { position: fixed; left: 50%; top: 22%; transform: translate(-50%, 10px) scale(.92); z-index: 16; pointer-events: none; opacity: 0;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: .5rem 1.1rem; display: flex; gap: .6rem; align-items: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .35s ease, transform .45s cubic-bezier(.2,1.4,.4,1); max-width: 92vw; font-size: .88rem; }
#grade.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#grade b { color: var(--accent); letter-spacing: .1em; font-size: 1.05rem; white-space: nowrap; }
#grade.g3 { border-color: var(--accent); box-shadow: 0 0 30px rgba(255,184,103,.45); }

/* zen mode */
#hud > * { transition: opacity .5s ease; }
#hud.zen > *:not(.hud-tools):not(#grade) { opacity: 0 !important; pointer-events: none !important; }
#hud.zen .hud-tools .hbtn:not(#btn-zen) { display: none; }
#hud.zen #btn-zen { opacity: .55; }

/* summary extras */
.album figure.g3 { box-shadow: 0 0 0 2px var(--accent), 0 6px 16px rgba(0,0,0,.35); }
.album figcaption b { color: #d98a2b; font-weight: 400; }
.sum-note { color: var(--glide) !important; margin: .8rem 0 0; min-height: 1px; }
.badges-new { display: grid; gap: .5rem; margin-top: 1rem; }
.sign { margin-top: 1.2rem; padding-top: .4rem; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: .5rem; }
.sign h3 { display: flex; gap: .45rem; align-items: center; margin: .6rem 0 .1rem !important; }
.sign input { background: rgba(255,255,255,.07); border: 1px solid var(--glass-line); border-radius: 12px; padding: .65rem .8rem; color: var(--ink); width: 100%; }
.sign input::placeholder { color: rgba(255,248,238,.45); }
.sign .primary { justify-self: start; }
.sign .muted { margin: 0; min-height: 1.2em; }

/* badges */
.badge { display: grid; grid-template-columns: 2.4rem 1fr; grid-template-rows: auto auto; column-gap: .7rem; align-items: center; padding: .55rem .7rem; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); opacity: .55; }
.badge.earned { opacity: 1; background: linear-gradient(120deg, rgba(255,184,103,.16), rgba(255,255,255,.04)); border-color: rgba(255,184,103,.35); }
.b-icon { grid-row: 1 / 3; font-size: 1.6rem; text-align: center; }
.badge b { font-size: .9rem; }
.badge small { color: var(--ink-soft); font-size: .74rem; line-height: 1.3; }
.badge.pop { animation: badgePop .7s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes badgePop { from { opacity: 0; transform: scale(.7) translateY(10px); } to { opacity: 1; transform: none; } }
.badge-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }

/* journal */
.journal-card { width: min(100%, 46rem); }
.journal-card h3 { display: flex; align-items: center; gap: .45rem; margin: 1.3rem 0 .6rem; font-size: 1rem; }
.jr-tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; margin: .4rem 0 .8rem; touch-action: pan-x; }
.jr-tab { flex-shrink: 0; border-radius: 999px; padding: .4rem .8rem; font-size: .8rem; background: rgba(255,255,255,.07); color: var(--ink-soft); border: 1px solid transparent; }
.jr-tab.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.jr-head { margin: 0 0 .7rem; font-size: .88rem; }
.jr-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }
.jr-cell { margin: 0; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; overflow: hidden; }
.jr-cell.seen { background: #f6efe2; color: #3b3227; border-color: transparent; }
.jr-ph { aspect-ratio: 16/10; display: grid; place-items: center; font-size: 2rem; color: rgba(255,255,255,.2); background: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 10px, transparent 10px 20px); font-family: var(--font-display); }
.jr-cell.seen .jr-ph { background: #d9cdb6; }
.jr-ph img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fadeIn .6s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.jr-cell figcaption { padding: .55rem .7rem .7rem; }
.jr-cell figcaption b { display: block; font-size: .88rem; font-family: var(--font-display); }
.jr-cell.seen figcaption b { color: #3b3227; }
.jr-cell figcaption small { display: block; font-size: .76rem; line-height: 1.4; margin-top: .2rem; color: var(--ink-soft); }
.jr-cell.seen figcaption small { color: #6b5d4a; }

@media (prefers-reduced-motion: reduce) {
  #intro .bar, .intro-title, #grade { transition: none; }
  .badge.pop { animation: none; }
}
