/* ==========================================================================
   Title screen (round 7). Full-viewport illustration, logo, start button,
   particles, and the start transition. Uses the theme-v4 motion tokens.
   ========================================================================== */
.title-screen { display: none; }
html.title-active .title-screen,
html.title-reveal .title-screen { display: block; }
html.title-active, html.title-active body { overflow: hidden; }
html.title-active .app { visibility: hidden; }
html.title-reveal .app { animation: ah-app-reveal .6s var(--ease-out, ease) both; }
@keyframes ah-app-reveal { from { opacity: 0; transform: translateY(14px) scale(.995); } }

.title-screen {
  position: fixed; inset: 0; z-index: 9000;
  overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 0%, #2c3f78 0%, #151d3a 55%, #0b1022 100%);
  color: #fff;
  font-family: var(--font);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}

/* ---- art: blurred extension + the main illustration placed by title.js ---- */
.title-art { position: absolute; inset: 0; z-index: 0; }
.title-art-blur {
  position: absolute; inset: -60px;
  background: center / cover no-repeat;
  filter: blur(34px) saturate(1.25) brightness(.8);
  transform: scale(1.1);
  opacity: 0; transition: opacity .9s var(--ease-out);
}
.title-art-main {
  position: absolute; max-width: none;
  opacity: 0; transform: scale(1.035);
  transition: opacity 1s var(--ease-out), transform 1.6s var(--ease-out);
  will-change: transform;
}
.title-screen.art-ready .title-art-blur { opacity: 1; }
.title-screen.art-ready .title-art-main { opacity: 1; transform: scale(1); animation: title-drift 26s ease-in-out 1.6s infinite alternate; }
@keyframes title-drift { to { transform: scale(1.04) translate3d(-.6%, -.4%, 0); } }
/* band mode: soft edges where the illustration meets its blurred extension */
.title-screen[data-fit="band"] .title-art-main {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  border-radius: 24px;
}

/* light: soft top glow + a gentle vignette; the title side gets a little extra backing */
.title-light {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% -12%, rgba(255, 255, 255, .26), transparent 70%),
    radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(6, 10, 26, .45) 100%),
    linear-gradient(0deg, rgba(8, 12, 30, .55) 0%, transparent 32%);
}
.title-screen[data-side="left"] .title-light { background-image: radial-gradient(70% 55% at 50% -12%, rgba(255,255,255,.26), transparent 70%), linear-gradient(90deg, rgba(10, 14, 36, .52) 0%, rgba(10, 14, 36, .18) 34%, transparent 52%), linear-gradient(0deg, rgba(8,12,30,.5) 0%, transparent 30%); }
.title-screen[data-side="right"] .title-light { background-image: radial-gradient(70% 55% at 50% -12%, rgba(255,255,255,.26), transparent 70%), linear-gradient(270deg, rgba(10, 14, 36, .52) 0%, rgba(10, 14, 36, .18) 34%, transparent 52%), linear-gradient(0deg, rgba(8,12,30,.5) 0%, transparent 30%); }
.title-screen[data-side="top"] .title-light { background-image: linear-gradient(180deg, rgba(10, 14, 36, .5) 0%, rgba(10,14,36,.12) 30%, transparent 46%), linear-gradient(0deg, rgba(8,12,30,.5) 0%, transparent 28%); }

/* ---- floating notes and stars ---- */
.title-particles { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.title-particles i {
  position: absolute; left: var(--x); bottom: -40px;
  font-style: normal; font-size: calc(18px * var(--s)); color: #fff;
  text-shadow: 0 0 12px var(--c), 0 0 2px var(--c);
  opacity: 0;
  animation: title-float var(--d) linear var(--delay) infinite;
}
@keyframes title-float {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  12% { opacity: .9; }
  80% { opacity: .65; }
  100% { transform: translate3d(28px, -110vh, 0) rotate(160deg); opacity: 0; }
}

/* ---- top bar ---- */
.title-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}
.title-credit { font-size: 11px; letter-spacing: .08em; color: rgba(255, 255, 255, .72); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-tools { display: flex; gap: 8px; }
.title-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--r-pill, 999px);
  border: 1px solid rgba(255, 255, 255, .38);
  background: rgba(14, 20, 44, .36); color: #fff;
  font: 600 13px/1 var(--font); letter-spacing: .04em;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background var(--fast), transform var(--fast), border-color var(--fast);
}
.title-chip.icon { width: 40px; padding: 0; justify-content: center; font-size: 17px; }
.title-chip:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .7); }
.title-chip:active { transform: scale(.94); }
.title-chip i { font-style: normal; font-size: 15px; }
.title-chip.off i { opacity: .45; text-decoration: line-through; }
.title-chip:focus-visible, .title-start:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---- logo + start ---- */
.title-center {
  position: absolute; z-index: 4;
  display: flex; flex-direction: column; gap: clamp(18px, 3.2vh, 34px);
  left: clamp(28px, 6vw, 96px); bottom: clamp(56px, 12vh, 130px);
  align-items: flex-start;
  max-width: min(640px, 88vw);
}
.title-screen[data-side="right"] .title-center { left: auto; right: clamp(28px, 6vw, 96px); align-items: flex-end; text-align: right; }
.title-screen[data-side="top"] .title-center { left: 50%; transform: translateX(-50%); bottom: auto; top: clamp(70px, 11vh, 120px); align-items: center; text-align: center; }
.title-screen[data-side="top"] .title-start { position: fixed; left: 50%; bottom: clamp(48px, 9vh, 96px); transform: translateX(-50%); }
.title-screen[data-side="top"] .title-hint { position: fixed; left: 50%; bottom: clamp(18px, 4vh, 44px); transform: translateX(-50%); }
.title-screen[data-side="center"] .title-center { left: 50%; bottom: clamp(48px, 10vh, 110px); transform: translateX(-50%); align-items: center; text-align: center; }

.title-logo { margin: 0; display: flex; flex-direction: column; gap: 2px; position: relative; line-height: 1; }
.title-screen[data-side="right"] .title-logo { align-items: flex-end; }
.title-screen[data-side="top"] .title-logo, .title-screen[data-side="center"] .title-logo { align-items: center; }
.title-eyebrow { font-size: clamp(10px, 1vw, 12px); font-weight: 800; letter-spacing: .36em; color: rgba(255, 255, 255, .86); text-shadow: 0 2px 10px rgba(0, 0, 0, .55); margin-bottom: 10px; }
.title-main, .title-sub {
  position: relative; display: inline-block;
  font-family: var(--font-display); font-weight: 900; letter-spacing: .04em;
  color: #fff;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, .95);
  paint-order: stroke fill;
}
.title-main {
  font-size: clamp(48px, 7.4vw, 104px);
  background: linear-gradient(100deg, #fff 0%, #fff 35%, #d7f7ff 50%, #ffe3f2 66%, #fff 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(68, 85, 221, .55)) drop-shadow(0 10px 26px rgba(10, 14, 40, .55));
  animation: title-shine 6s ease-in-out infinite;
}
.title-sub {
  font-size: clamp(30px, 4.4vw, 62px);
  letter-spacing: .22em;
  margin-top: 4px;
  color: #fff;
  filter: drop-shadow(0 3px 0 rgba(238, 17, 102, .5)) drop-shadow(0 8px 22px rgba(10, 14, 40, .6));
}
@keyframes title-shine { 0%, 60% { background-position: 120% 0; } 100% { background-position: -100% 0; } }
.title-ribbon { display: flex; gap: 6px; margin-top: 16px; }
.title-ribbon i { width: clamp(22px, 3vw, 40px); height: 5px; border-radius: 99px; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .6); }
.title-ribbon i:nth-child(1) { background: #4455dd; } .title-ribbon i:nth-child(2) { background: #88dd44; }
.title-ribbon i:nth-child(3) { background: #ee1166; } .title-ribbon i:nth-child(4) { background: #ff9900; }
.title-ribbon i:nth-child(5) { background: #884499; } .title-ribbon i:nth-child(6) { background: #33ccbb; }

.title-start {
  position: relative; overflow: hidden;
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 248px; padding: 16px 40px 13px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: var(--r-pill, 999px);
  background: linear-gradient(120deg, rgba(51, 204, 187, .92), rgba(68, 85, 221, .92) 55%, rgba(238, 17, 102, .9));
  color: #fff; cursor: pointer;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .14), 0 18px 40px -14px rgba(20, 30, 90, .8), 0 0 40px rgba(110, 180, 255, .45);
  transition: transform .18s var(--ease), box-shadow .3s var(--ease), filter .2s;
  animation: title-breathe 2.8s ease-in-out infinite;
}
.title-start span { font: 900 clamp(20px, 2vw, 24px)/1.1 var(--font-display); letter-spacing: .32em; padding-left: .32em; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.title-start em { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .42em; opacity: .85; }
.title-start::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: title-glint 3.6s ease-in-out 1.2s infinite;
}
.title-start:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.08); }
.title-start:active { transform: scale(.95); }
.title-start:disabled { cursor: default; }
@keyframes title-breathe { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, .08), 0 18px 40px -14px rgba(20, 30, 90, .8), 0 0 60px rgba(150, 210, 255, .6); } }
@keyframes title-glint { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.title-hint { margin: 0; font-size: 12px; letter-spacing: .12em; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 8px rgba(0, 0, 0, .7); opacity: 0; transition: opacity .4s; }
.title-screen.needs-gesture .title-hint { opacity: 1; animation: title-blink 2.4s ease-in-out infinite; }
@keyframes title-blink { 50% { opacity: .45; } }

/* ---- settings panel ---- */
.title-panel {
  position: absolute; z-index: 8; top: calc(max(16px, env(safe-area-inset-top)) + 52px); right: max(20px, env(safe-area-inset-right));
  width: min(320px, calc(100vw - 40px));
  padding: 16px 18px 18px; border-radius: var(--r-xl, 24px);
  background: rgba(16, 22, 48, .78); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  display: grid; gap: 12px;
  animation: ah-pop .24s var(--ease-out) both;
}
.title-panel[hidden] { display: none; }
.title-panel header { display: flex; align-items: center; justify-content: space-between; }
.title-panel header .title-chip.icon { width: 32px; min-height: 32px; }
.title-panel label { display: grid; grid-template-columns: 70px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .9); }
.title-panel label.check { display: flex; gap: 10px; cursor: pointer; }
.title-panel input[type=range] { width: 100%; accent-color: #6fe0d2; }
.title-panel input[type=checkbox] { width: 18px; height: 18px; accent-color: #6fe0d2; }
.title-panel output { font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; opacity: .8; }

/* ---- transition ---- */
.title-sweep { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.title-sweep b { position: absolute; left: 0; width: 70vw; height: 13vh; background: linear-gradient(90deg, transparent, var(--c) 30%, #fff 50%, var(--c) 70%, transparent); filter: blur(1px); opacity: 0; mix-blend-mode: screen; border-radius: 99px; }
.title-sweep i { position: absolute; left: 0; font-style: normal; font-size: 30px; text-shadow: 0 0 14px currentColor; opacity: 0; }
.title-wash { position: absolute; inset: 0; z-index: 7; pointer-events: none; background: radial-gradient(circle at 50% 55%, #fff 0%, #f3f8ff 45%, #e8f1ff 100%); opacity: 0; transition: opacity .32s var(--ease); }

.title-screen.pressed .title-start { animation: title-press .42s var(--ease-out) both; }
@keyframes title-press { 0% { transform: scale(1); } 35% { transform: scale(.93); } 70% { transform: scale(1.07); box-shadow: 0 0 0 16px rgba(255,255,255,.18), 0 0 90px rgba(190, 230, 255, .95); } 100% { transform: scale(1.04); } }
.title-screen.entering .title-art-main { transition: transform 1s var(--ease-out); transform: scale(1.09) !important; animation: none; }
.title-screen.entering .title-logo { animation: title-logo-glow .7s var(--ease-out) both; }
@keyframes title-logo-glow { 50% { filter: drop-shadow(0 0 26px rgba(255, 255, 255, .95)); } 100% { filter: drop-shadow(0 0 0 transparent); transform: translateY(-6px); } }
.title-screen.entering .title-tools, .title-screen.entering .title-hint, .title-screen.entering .title-credit { opacity: 0; transition: opacity .25s; }
.title-screen.leaving .title-wash { opacity: 1; }
html.title-reveal .title-screen { pointer-events: none; background: transparent; }
html.title-reveal .title-screen .title-wash { opacity: 0; transition: opacity .5s var(--ease-out); }
html.title-reveal .title-screen > :not(.title-wash) { opacity: 0; }

/* ---- phone ---- */
@media (max-width: 700px), (max-aspect-ratio: 9/10) {
  .title-credit { font-size: 10px; max-width: 46vw; }
  .title-chip { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .title-chip.icon { width: 36px; }
  .title-center,
  .title-screen[data-side] .title-center {
    left: 50%; right: auto; top: auto; transform: translateX(-50%);
    bottom: max(36px, calc(env(safe-area-inset-bottom) + 24px));
    width: calc(100vw - 40px); align-items: center; text-align: center;
  }
  .title-screen[data-side] .title-logo { align-items: center; }
  .title-screen[data-side="top"] .title-start, .title-screen[data-side="top"] .title-hint { position: static; transform: none; }
  .title-main { font-size: clamp(40px, 13vw, 60px); }
  .title-sub { font-size: clamp(24px, 7.6vw, 34px); letter-spacing: .16em; }
  .title-eyebrow { letter-spacing: .2em; font-size: 9px; }
  .title-start { min-width: 220px; padding: 14px 30px 12px; }
  .title-light, .title-screen[data-side] .title-light {
    background-image: linear-gradient(0deg, rgba(10, 14, 36, .82) 0%, rgba(10, 14, 36, .45) 30%, transparent 52%), linear-gradient(180deg, rgba(10, 14, 36, .4) 0%, transparent 16%);
  }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .title-screen *, .title-screen *::after { animation: none !important; }
  .title-art-main { transition: opacity .4s !important; transform: none !important; }
}
html.low-effects .title-screen *, html.low-effects .title-screen *::after { animation: none !important; }
html.low-effects .title-art-main { transform: none !important; }
html.low-effects .title-particles { display: none; }

/* ==========================================================================
   Mascot guide (points at the start button; a tap starts the music)
   ========================================================================== */
.title-cta { display: flex; align-items: center; gap: 18px; }
.title-screen[data-side="right"] .title-cta { flex-direction: row-reverse; }
.title-screen[data-side="right"] .mascot-hand { transform: scaleX(-1); }
.title-mascot {
  position: relative; flex: 0 0 auto;
  width: 112px; height: 104px; padding: 0; border: 0; background: none; cursor: pointer;
  opacity: 0; transform: translateY(16px) scale(.8);
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-spring, cubic-bezier(.34,1.4,.64,1));
}
.title-screen.mascot-ready .title-mascot { opacity: 1; transform: none; }
.title-mascot img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(10, 14, 40, .45)) drop-shadow(0 0 2px #fff);
  animation: mascot-bob 1.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes mascot-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-9px) rotate(3deg); } }
.title-mascot.hop img { animation: mascot-hop .55s cubic-bezier(.3,1.6,.5,1), mascot-bob 1.6s ease-in-out .55s infinite; }
@keyframes mascot-hop { 0% { transform: scale(1, 1); } 25% { transform: scale(1.15, .85); } 55% { transform: translateY(-26px) scale(.95, 1.08); } 100% { transform: none; } }
.mascot-bubble {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 7px 13px;
  border-radius: 999px; background: #fff; color: #273152;
  font: 800 12.5px/1.2 var(--font); letter-spacing: .02em;
  box-shadow: 0 8px 20px -8px rgba(10, 14, 40, .55);
  animation: bubble-in .5s var(--ease-out) .4s both, bubble-wiggle 3s ease-in-out 1.2s infinite;
}
.mascot-bubble::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
@keyframes bubble-in { from { opacity: 0; transform: translate(-50%, 8px) scale(.8); } }
@keyframes bubble-wiggle { 0%, 88%, 100% { rotate: 0deg; } 92% { rotate: -4deg; } 96% { rotate: 4deg; } }
.mascot-hand {
  position: absolute; left: -26px; top: 44%; font-style: normal; font-size: 26px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .4));
  animation: hand-poke 1s ease-in-out infinite;
}
.title-screen[data-side="right"] .mascot-hand { left: auto; right: -26px; }
@keyframes hand-poke { 50% { translate: -8px 0; } }
.title-screen[data-side="right"] .mascot-hand { animation-name: hand-poke-r; }
@keyframes hand-poke-r { 50% { translate: 8px 0; } }
.title-screen.entering .title-mascot, .title-screen.loading .title-mascot { opacity: 0; transform: translateY(10px) scale(.9); }

/* ==========================================================================
   Loading screen (~7 s, BGM keeps playing)
   ========================================================================== */
.title-loader {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(160deg, rgba(196, 232, 255, .82), rgba(255, 214, 236, .8) 55%, rgba(220, 255, 236, .8));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #2a3258;
  animation: loader-in .45s var(--ease-out) both;
}
.title-loader[hidden] { display: none; }
@keyframes loader-in { from { opacity: 0; } }
.title-screen.loading .title-center, .title-screen.loading .title-bar { opacity: 0; transition: opacity .3s; }
.title-screen.loading .title-art-main { transform: scale(1.08) !important; filter: blur(3px) saturate(1.2); transition: filter .6s; }

.loader-cheer { display: flex; gap: clamp(4px, 1.2vw, 16px); align-items: flex-end; height: clamp(84px, 13vh, 128px); }
.loader-cheer img {
  height: 100%; width: auto; object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(40, 50, 100, .28));
  transform-origin: 50% 100%;
  animation: cheer-in .5s var(--ease-spring, cubic-bezier(.34,1.4,.64,1)) calc(var(--i) * 90ms) both, cheer-hop 1.2s ease-in-out calc(.6s + var(--i) * 140ms) infinite;
}
@keyframes cheer-in { from { opacity: 0; transform: translateY(40px) scale(.4); } }
@keyframes cheer-hop { 0%, 60%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-16px) scale(1.04, .96); } }

.loader-word { display: flex; font: 900 clamp(22px, 3.2vw, 36px)/1 var(--font-display); letter-spacing: .12em; color: #fff;
  -webkit-text-stroke: 1.5px #4455dd; paint-order: stroke fill; filter: drop-shadow(0 4px 0 rgba(68, 85, 221, .35)); }
.loader-word b { display: inline-block; animation: letter-hop 1.4s ease-in-out calc(var(--i) * 80ms) infinite; }
.loader-word b:nth-child(6n+1) { -webkit-text-stroke-color: #4455dd; } .loader-word b:nth-child(6n+2) { -webkit-text-stroke-color: #6cb63f; }
.loader-word b:nth-child(6n+3) { -webkit-text-stroke-color: #ee1166; } .loader-word b:nth-child(6n+4) { -webkit-text-stroke-color: #ff9900; }
.loader-word b:nth-child(6n+5) { -webkit-text-stroke-color: #884499; } .loader-word b:nth-child(6n) { -webkit-text-stroke-color: #1fa8a0; }
@keyframes letter-hop { 0%, 70%, 100% { transform: translateY(0); } 35% { transform: translateY(-10px); } }

.loader-track {
  position: relative; width: min(760px, 86vw); height: 26px;
  border-radius: 999px; background: rgba(255, 255, 255, .85);
  box-shadow: inset 0 2px 6px rgba(40, 50, 100, .18), 0 0 0 4px rgba(255, 255, 255, .55), 0 14px 30px -16px rgba(40, 50, 100, .6);
  margin-top: 46px;
}
.loader-fill {
  position: absolute; left: 4px; top: 4px; bottom: 4px; width: 0; max-width: calc(100% - 8px);
  border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, #4455dd, #88dd44, #ee1166, #ff9900, #884499, #33ccbb);
  background-size: min(760px, 86vw) 100%;
}
.loader-stripes { position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .35) 0 10px, transparent 10px 20px); animation: stripes .7s linear infinite; }
@keyframes stripes { to { background-position: 28px 0; } }
.loader-head { position: absolute; left: 0; bottom: 14px; width: 74px; height: 64px; transform: translateX(-50%); pointer-events: none; }
.loader-head img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(40, 50, 100, .35)); animation: runner-hop .42s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes runner-hop { from { transform: translateY(0) rotate(-6deg) scale(1.02, .98); } to { transform: translateY(-12px) rotate(6deg); } }
.loader-head.pop img { animation: runner-pop .35s var(--ease-spring, cubic-bezier(.34,1.4,.64,1)), runner-hop .42s ease-in-out .35s infinite alternate; }
@keyframes runner-pop { from { transform: scale(.3) rotate(-30deg); opacity: 0; } }
.loader-head.done img { animation: runner-cheer .5s ease-out 2; }
@keyframes runner-cheer { 50% { transform: translateY(-26px) scale(1.15) rotate(10deg); } }
.loader-sparks { position: absolute; inset: 0; pointer-events: none; }
.loader-sparks i { position: absolute; top: -10px; font-style: normal; font-size: 18px; font-weight: 900; text-shadow: 0 0 8px #fff; }
.loader-meta { display: flex; align-items: baseline; gap: 14px; width: min(760px, 86vw); justify-content: space-between; }
.loader-meta b { font: 900 22px/1 var(--font-display); color: #4455dd; font-variant-numeric: tabular-nums; min-width: 64px; }
.loader-meta span { font-size: 13px; color: #4a5378; text-align: right; }
.loader-skip { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); font-size: 11.5px; color: rgba(42, 50, 88, .55); letter-spacing: .1em; }

@media (max-width: 700px), (max-aspect-ratio: 9/10) {
  .title-cta { flex-direction: column-reverse !important; gap: 6px; }
  .title-mascot { width: 84px; height: 78px; }
  .mascot-bubble { font-size: 11.5px; padding: 6px 12px; }
  .mascot-hand { display: none; }
  .loader-cheer { flex-wrap: wrap; justify-content: center; height: auto; width: 300px; row-gap: 6px; }
  .loader-cheer img { height: 72px; }
  .loader-meta { flex-direction: column; align-items: center; gap: 8px; }
  .loader-meta span { text-align: center; }
}

/* reduced motion: same 7 s bar, no hopping */
html.low-effects .loader-cheer img, html.low-effects .loader-word b, html.low-effects .loader-head img,
html.low-effects .loader-stripes, html.low-effects .title-mascot img, html.low-effects .mascot-hand { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .loader-cheer img, .loader-word b, .loader-head img, .loader-stripes, .title-mascot img, .mascot-hand, .mascot-bubble { animation: none !important; }
}
.title-screen.mascot-ready .title-hint { display: none; }
