/* Beet Jumper — styles */

:root {
  --bj-navy: #1b2245;
  --bj-navy-deep: #131836;
  --bj-panel: #232b58;
  --bj-ivory: #fdf8ee;
  --bj-teal: #099695;
  --bj-green: #6abb4a;
  --bj-gold: #ffd25b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body.jump-page {
  font-family: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1100px 600px at 50% -80px, #2a3468 0%, var(--bj-navy) 55%, var(--bj-navy-deep) 100%);
  color: var(--bj-ivory);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
}

[hidden] { display: none !important; }



.action-btn {
  appearance: none; border: none; border-radius: 14px;
  padding: 13px 26px; font-family: inherit; font-size: 17px;
  font-weight: 900; letter-spacing: 0.02em; color: #fff;
  background: var(--bj-teal);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28); cursor: pointer;
}
.action-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28); }
.action-btn.primary { background: var(--bj-green); }

/* ------------------------------------------------------------------ */
/* Mode / climb select                                                 */
/* ------------------------------------------------------------------ */
.app { max-width: 900px; margin: 0 auto; padding: 16px clamp(10px, 3vw, 24px) 40px; }
.select-screen { text-align: center; }
.app-title { margin: 40px 0 2px; font-size: clamp(30px, 6vw, 46px); font-weight: 900; }
.app-title .t-jump { color: var(--bj-gold); }
.select-sub { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: rgba(253, 248, 238, 0.75); }

.endless-hero {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px solid rgba(253, 248, 238, 0.22);
  background: var(--bj-panel);
  border-radius: 20px; padding: 18px 34px; margin-bottom: 20px;
  cursor: pointer; color: var(--bj-ivory); font-family: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.endless-hero:hover { transform: translateY(-2px); border-color: rgba(253, 248, 238, 0.5); }
.endless-hero .eh-title { font-size: 22px; font-weight: 900; color: var(--bj-gold); }
.endless-hero .eh-sub { font-size: 13px; font-weight: 800; color: rgba(253, 248, 238, 0.7); }

.section-label {
  margin: 6px 0 10px; font-size: 13px; font-weight: 900;
  letter-spacing: 0.12em; color: rgba(253, 248, 238, 0.6);
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; max-width: 740px; margin: 0 auto;
}
.level-card {
  appearance: none; border: 2px solid rgba(253, 248, 238, 0.16);
  border-radius: 16px; background: var(--bj-panel); color: var(--bj-ivory);
  padding: 14px 10px 12px; font-family: inherit; cursor: pointer;
  text-align: center; transition: transform 0.12s ease, border-color 0.12s ease;
}
.level-card:not(.locked):hover { transform: translateY(-2px); border-color: rgba(253, 248, 238, 0.45); }
.level-card .lc-num {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 999px; font-weight: 900; font-size: 15px; color: #fff; margin-bottom: 6px;
  /* --lc is the level's deskbell colour, set per card in buildSelect(). */
  background: var(--lc, var(--bj-teal));
}
/* E and High-C yellow need dark ink to stay legible. */
/* The old 4-colour nth-child cycle is gone: it was an arbitrary rotation that
   fought the per-card --lc. Level badges now run the 8 deskbell stripes so
   level 1 is C-red and level 2 is D-orange, matching the rainbow bar. */
.level-card[style*="#F1E606"] .lc-num { color: #1b2245; }   /* yellow needs dark ink */
.level-card.locked .lc-num { background: rgba(27, 34, 69, 0.28); color: rgba(253, 248, 238, 0.6); }
.level-card .lc-name { display: block; font-weight: 900; font-size: 14px; line-height: 1.25; }
.level-card .lc-stars {
  display: block; margin-top: 6px; font-size: 15px; letter-spacing: 2px;
  color: var(--bj-gold); min-height: 19px;
}
.level-card .lc-stars .off { color: rgba(253, 248, 238, 0.22); }
.level-card.locked { opacity: 0.45; cursor: default; }

/* ------------------------------------------------------------------ */
/* Game screen                                                         */
/* ------------------------------------------------------------------ */
.game-screen {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center;
  background:
    radial-gradient(1100px 600px at 50% -80px, #2a3468 0%, var(--bj-navy) 55%, var(--bj-navy-deep) 100%);
}

.stage-wrap {
  position: relative; flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 6px 0;
}
#gameCanvas {
  display: block; touch-action: none;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

/* HUD floats over the canvas — clean, per spec */
.hud-float {
  position: absolute; z-index: 5; pointer-events: none;
  font-weight: 900; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
#hudHeight { font-size: 30px; line-height: 1; }
#hudHeight .hud-label { display: block; font-size: 10px; letter-spacing: 0.14em; opacity: 0.75; }
#hudNotes { font-size: 20px; }


.toast-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.toast {
  font-weight: 900; text-align: center; color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  animation: toastIn 1.5s ease forwards; font-size: 30px;
}
.toast.big { font-size: 40px; color: var(--bj-gold); }
.toast.small { font-size: 19px; }
.toast .toast-sub { display: block; font-size: 15px; color: rgba(253, 248, 238, 0.85); }
@keyframes toastIn {
  0% { transform: scale(0.6); opacity: 0; }
  12% { transform: scale(1.08); opacity: 1; }
  22% { transform: scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation-duration: 0.01s; animation-fill-mode: forwards; opacity: 1; }
}

/* ------------------------------------------------------------------ */
/* Panels                                                              */
/* ------------------------------------------------------------------ */
.panel-veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(12, 16, 38, 0.66);
  display: grid; place-items: center; padding: 18px;
}
.panel {
  width: min(430px, 94vw);
  background: var(--bj-panel);
  border: 3px solid rgba(253, 248, 238, 0.22);
  border-radius: 22px; padding: 26px 22px 22px; text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  animation: panelIn 0.3s cubic-bezier(0.34, 1.45, 0.64, 1);
}
@keyframes panelIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.panel h2 { margin: 0 0 4px; font-size: 27px; font-weight: 900; color: var(--bj-gold); }
.panel .panel-sub { margin: 0 0 10px; font-weight: 800; font-size: 15px; color: rgba(253, 248, 238, 0.8); }

.star-row { font-size: 42px; letter-spacing: 6px; margin: 2px 0 6px; color: var(--bj-gold); }
.star-row .off { color: rgba(253, 248, 238, 0.18); }
.star-row .pop { display: inline-block; animation: starPop 0.45s cubic-bezier(0.34, 1.6, 0.64, 1) backwards; }
.star-row .pop:nth-child(2) { animation-delay: 0.18s; }
.star-row .pop:nth-child(3) { animation-delay: 0.36s; }
@keyframes starPop { from { transform: scale(0); } to { transform: scale(1); } }

.panel .big-stat { font-size: 38px; font-weight: 900; margin: 4px 0 0; }
.panel .big-stat .hud-label { display: block; font-size: 11px; letter-spacing: 0.14em; color: rgba(253,248,238,0.6); }
.panel .notes-played { font-size: 21px; font-weight: 900; margin: 10px 0 2px; }
.panel .notes-played .music-note { color: var(--bj-gold); }
.panel .stat-row { font-size: 14px; font-weight: 800; margin: 2px 0; color: rgba(253, 248, 238, 0.8); }

.panel-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
#classScoreSlot { margin-top: 12px; }
