/* ============================================================
   Clef — dark neumorphism, green & black, glow
   ============================================================ */

:root {
  --bg: #0b100c;
  --bg-2: #0e1410;
  --card: #121a14;
  --card-2: #0f1611;
  --shadow-dark: #050805;
  --shadow-light: #1a2b1e;
  --green: #00e676;
  --green-soft: #69f0ae;
  --green-dim: #16a75c;
  --green-glow: rgba(0, 230, 118, 0.35);
  --green-glow-soft: rgba(0, 230, 118, 0.14);
  --text: #dcf2e4;
  --text-dim: #8fb39c;
  --text-faint: #5d7a68;
  --red: #ff5470;
  --red-glow: rgba(255, 84, 112, 0.3);
  --gold: #ffd54f;
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0, 230, 118, 0.06), transparent 60%),
    radial-gradient(900px 500px at 110% 30%, rgba(0, 230, 118, 0.04), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Nunito", "SF Pro Rounded", ui-rounded, -apple-system, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select { font-family: inherit; }
.hidden { display: none !important; }

#app { max-width: 600px; margin: 0 auto; padding: 0 16px; }

/* ============ Neumorphic primitives ============ */
.neo {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border-radius: var(--radius);
  box-shadow:
    8px 8px 18px var(--shadow-dark),
    -6px -6px 14px var(--shadow-light),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.neo-btn {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border-radius: 16px;
  box-shadow:
    6px 6px 12px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light);
  color: var(--text);
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  transition: transform 0.08s, box-shadow 0.15s, color 0.15s;
}
.neo-btn:hover:not(:disabled) { color: var(--green-soft); }
.neo-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    inset 5px 5px 10px var(--shadow-dark),
    inset -3px -3px 8px var(--shadow-light);
}
.neo-btn.subtle { color: var(--text-dim); font-weight: 600; }

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, #06e97e, #00c765);
  color: #04240f;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow:
    0 5px 0 #00954b,
    0 10px 26px var(--green-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #00954b, 0 4px 14px var(--green-glow); }
.btn-primary:disabled { filter: grayscale(0.9) brightness(0.55); box-shadow: 0 5px 0 #222; }
.btn-primary.small { width: auto; padding: 10px 18px; font-size: 14px; }
.btn-primary.bad { background: linear-gradient(160deg, #ff6b84, #ef3a5c); color: #2b060f; box-shadow: 0 5px 0 #a51f3a, 0 10px 26px var(--red-glow); }
.btn-primary.skip { background: linear-gradient(160deg, #ffe082, #ffc746); color: #3a2a00; box-shadow: 0 5px 0 #b78a00; }

.btn-danger {
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(160deg, #ff6b84, #e2314f);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 0 #99182f, 0 8px 20px var(--red-glow);
}
.btn-danger:active { transform: translateY(3px); box-shadow: 0 1px 0 #99182f; }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-dim);
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 5px 5px 10px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
}
.icon-btn:active { box-shadow: inset 4px 4px 8px var(--shadow-dark); }

/* ============ HUD ============ */
#hud {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 4px 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.hud-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 5px 5px 12px var(--shadow-dark), -3px -3px 8px var(--shadow-light), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  font-size: 16px;
}
.hud-item b { color: var(--text); font-weight: 900; letter-spacing: -0.01em; transition: transform 0.18s cubic-bezier(.34,1.7,.64,1); display: inline-block; }
.hud-item b.pop { animation: hud-pop 0.42s cubic-bezier(.34,1.7,.64,1); }
@keyframes hud-pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hud-icon { display: inline-flex; }
.hud-icon .ico { width: 19px; height: 19px; filter: drop-shadow(0 0 4px rgba(0,0,0,.25)); }
#hud-streak:not(.lit) .ico-flame { filter: grayscale(1) brightness(0.7); animation: none; }

#hud-streak { box-shadow: 5px 5px 12px var(--shadow-dark), -3px -3px 8px var(--shadow-light), inset 0 0 0 1px rgba(255, 152, 0, 0.18); }
#hud-streak.lit b { color: #ffb74d; text-shadow: 0 0 10px rgba(255, 152, 0, 0.45); }
#hud-gems { box-shadow: 5px 5px 12px var(--shadow-dark), -3px -3px 8px var(--shadow-light), inset 0 0 0 1px rgba(64, 196, 255, 0.18); }
#hud-gems b { color: #6fd8ff; text-shadow: 0 0 10px rgba(64, 196, 255, 0.35); }
#hud-hearts { box-shadow: 5px 5px 12px var(--shadow-dark), -3px -3px 8px var(--shadow-light), inset 0 0 0 1px rgba(255, 59, 92, 0.18); }
#hud-hearts b { color: #ff8fa3; text-shadow: 0 0 10px rgba(255, 59, 92, 0.35); }
#hud-xp { box-shadow: 5px 5px 12px var(--shadow-dark), -3px -3px 8px var(--shadow-light), inset 0 0 0 1px rgba(255, 193, 7, 0.18); }
#hud-xp b { color: #ffd54f; text-shadow: 0 0 10px rgba(255, 193, 7, 0.35); }

/* ============ Tab bar ============ */
#tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(600px, 100%);
  display: flex;
  z-index: 40;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 26%);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px;
  border-radius: 16px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: color 0.2s, transform 0.1s;
}
.tab-icon { display: inline-flex; transition: transform 0.2s; }
.tab-icon .ico { width: 22px; height: 22px; }
.tab.active {
  color: var(--green-soft);
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow:
    inset 4px 4px 9px var(--shadow-dark),
    inset -3px -3px 7px var(--shadow-light),
    0 0 18px var(--green-glow-soft);
}
.tab.active .tab-icon { transform: scale(1.12); }
.tab:active .tab-icon { transform: scale(0.92); }

main#screen { padding-bottom: 110px; }

/* ============ Onboarding ============ */
.onboard { padding-top: 6vh; animation: fadeup 0.5s ease; }
.onboard-hero { text-align: center; margin-bottom: 26px; }
.logo-mark {
  font-size: 64px;
  filter: drop-shadow(0 0 24px var(--green-glow));
  animation: bob 3s ease-in-out infinite;
}
.logo-mark svg { width: 84px; height: 84px; display: block; margin: 0 auto; }
.logo-mark .logo-img { width: 96px; height: 96px; display: block; margin: 0 auto; object-fit: contain; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.logo-word {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--green-soft), var(--green), #7dffc9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 42px var(--green-glow);
}
.tagline { color: var(--text-dim); margin-top: 8px; line-height: 1.5; }
.onboard-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.ob-label { font-size: 13px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.avatar-pick {
  aspect-ratio: 1; border-radius: 14px; font-size: 22px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
  transition: transform 0.12s, box-shadow 0.2s;
}
.avatar-pick.sel {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px var(--green), 0 0 18px var(--green-glow);
}
.ob-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  background: var(--card-2);
  box-shadow: inset 4px 4px 9px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}
.ob-input:focus { box-shadow: inset 4px 4px 9px var(--shadow-dark), 0 0 0 2px var(--green-dim), 0 0 16px var(--green-glow-soft); }
.ob-input.slim { width: auto; padding: 8px 12px; }
.goal-row { display: flex; gap: 10px; }
.goal-pick { flex: 1; text-align: center; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.goal-pick b { color: var(--text); font-size: 15px; }
.goal-pick.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light), 0 0 16px var(--green-glow-soft);
}
.goal-pick.sel b { color: var(--green-soft); }

@keyframes fadeup { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ============ Learn path ============ */
.learn { animation: fadeup 0.35s ease; }

.daily-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  margin-bottom: 26px;
}
.daily-left { flex: 1; }
.daily-title { font-weight: 900; font-size: 16px; }
.daily-sub { color: var(--text-dim); font-size: 13px; margin: 3px 0 9px; }
.daily-track {
  height: 12px; border-radius: 8px;
  background: var(--bg-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
  overflow: hidden;
}
.daily-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  box-shadow: 0 0 12px var(--green-glow);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.daily-ring {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px;
  color: var(--green-soft);
  background: var(--card-2);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.daily-ring.done {
  color: #04240f;
  background: linear-gradient(160deg, var(--green-soft), var(--green));
  box-shadow: 0 0 22px var(--green-glow);
  font-size: 24px;
}

.chapter { margin-bottom: 34px; }
.chapter.locked { opacity: 0.45; filter: saturate(0.4); }
.chapter-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
  position: sticky;
  top: 64px;
  z-index: 5;
}
.chapter-emoji { font-size: 30px; filter: drop-shadow(0 0 10px var(--green-glow-soft)); }
.chapter-txt { flex: 1; }
.chapter-txt h2 { font-size: 17px; font-weight: 900; }
.chapter-txt p { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.chapter-prog {
  font-size: 13px; font-weight: 900; color: var(--green-soft);
  padding: 6px 11px; border-radius: 12px;
  background: var(--bg-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
}

.path { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.node-row { display: flex; flex-direction: column; align-items: center; width: 130px; }
.node {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 7px 7px 14px var(--shadow-dark), -5px -5px 12px var(--shadow-light), inset 0 0 0 1px rgba(255,255,255,0.03);
  transition: transform 0.12s;
}
.node-ico { font-size: 30px; }
.node.lock .node-ico { filter: grayscale(1) brightness(0.6); font-size: 24px; }
.node.open {
  box-shadow:
    7px 7px 14px var(--shadow-dark),
    -5px -5px 12px var(--shadow-light),
    0 0 0 3px rgba(0, 230, 118, 0.55),
    0 0 26px var(--green-glow);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 7px 7px 14px var(--shadow-dark), -5px -5px 12px var(--shadow-light), 0 0 0 3px rgba(0,230,118,0.55), 0 0 18px var(--green-glow); }
  50% { box-shadow: 7px 7px 14px var(--shadow-dark), -5px -5px 12px var(--shadow-light), 0 0 0 5px rgba(0,230,118,0.75), 0 0 38px var(--green-glow); }
}
.node.done {
  background: linear-gradient(145deg, #133a24, #0d2a1a);
  box-shadow: 6px 6px 12px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 14px var(--green-glow-soft);
}
.node.boss { width: 96px; height: 96px; }
.node.boss .node-ico { font-size: 42px; }
.node:not(:disabled):hover { transform: scale(1.06); }
.node:not(:disabled):active { transform: scale(0.95); }
.node-stars {
  position: absolute; bottom: -6px;
  font-size: 11px; letter-spacing: 1px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 213, 79, 0.6);
  background: var(--bg);
  padding: 1px 7px; border-radius: 10px;
}
.node-label {
  margin-top: 12px;
  font-size: 12.5px; font-weight: 800;
  color: var(--text-dim);
  text-align: center;
}

/* ============ Generic pages ============ */
.page { animation: fadeup 0.35s ease; }
.page-title { font-size: 26px; font-weight: 900; margin-bottom: 4px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.section-title { font-size: 17px; font-weight: 900; margin: 26px 0 12px; }
.count-chip {
  font-size: 12px; color: var(--green-soft);
  background: var(--card-2); padding: 3px 9px; border-radius: 10px;
  box-shadow: inset 2px 2px 5px var(--shadow-dark);
  vertical-align: 2px;
}
.empty-note, .sim-note { color: var(--text-faint); font-size: 13px; margin: 10px 0 16px; line-height: 1.5; }
.sim-note { text-align: center; margin-top: 26px; }
.legal-links { color: var(--text-faint); font-size: 13px; margin: 10px 0 16px; line-height: 1.5; text-align: center; margin-top: 26px; }
.legal-links a { color: var(--text-faint); text-decoration: underline; }

/* ============ Practice ============ */
.fact-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px;
  margin: 16px 0 20px;
  background: linear-gradient(145deg, #0f2618, #0a1a10);
  box-shadow: 6px 6px 16px var(--shadow-dark), -4px -4px 12px var(--shadow-light), 0 0 26px var(--green-glow-soft), inset 0 0 0 1px rgba(0, 230, 118, 0.16);
}
.fact-badge {
  align-self: flex-start;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--green-soft);
  text-shadow: 0 0 8px var(--green-glow-soft);
}
.fact-title { font-size: 16.5px; font-weight: 900; color: var(--text); }
.fact-text { font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }

.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.practice-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 18px;
  text-align: left;
  transition: transform 0.12s, box-shadow 0.2s;
}
.practice-card:not(.locked):hover { transform: translateY(-3px); box-shadow: 10px 12px 22px var(--shadow-dark), -6px -6px 14px var(--shadow-light), 0 0 20px var(--green-glow-soft); }
.practice-card:not(.locked):active { transform: scale(0.97); }
.practice-card.locked { opacity: 0.5; }
.practice-card.feature-card {
  background: linear-gradient(145deg, var(--green-dim), #0b6b38);
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 16px var(--green-glow-soft);
}
.practice-card.feature-card .pc-title, .practice-card.feature-card .pc-desc { color: #fff; }
.practice-card.feature-card .pc-desc { opacity: 0.85; }
.pc-emoji { font-size: 30px; filter: drop-shadow(0 0 8px var(--green-glow-soft)); }
.pc-title { font-size: 16px; font-weight: 900; }
.pc-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }

/* ============ League ============ */
.league-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 20px; }
.league-shield { font-size: 44px; filter: drop-shadow(0 0 16px rgba(255, 213, 79, 0.45)); animation: bob 3s ease-in-out infinite; }
.league-head .page-title { margin: 0; font-size: 22px; }
.league-head .page-sub { margin: 2px 0 0; }
.league-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.league-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
}
.league-row.me {
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 0 2px var(--green-dim), 0 0 20px var(--green-glow-soft);
}
.lr-rank { width: 30px; text-align: center; font-weight: 900; color: var(--text-dim); font-size: 15px; }
.lr-rank.medal { font-size: 20px; }
.lr-avatar { font-size: 24px; }
.lr-name { flex: 1; font-weight: 800; font-size: 14.5px; }
.lr-xp { font-weight: 900; color: var(--green-soft); font-size: 14px; }
.league-cut {
  text-align: center; font-size: 11.5px; font-weight: 900;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green-dim); padding: 4px 0;
}
.league-cut.demo { color: var(--red); opacity: 0.7; }
.follow-mini {
  width: 30px; height: 30px; border-radius: 50%;
  font-weight: 900; color: var(--green-soft);
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
  font-size: 15px;
}
.follow-mini.on { color: #04240f; background: var(--green); box-shadow: 0 0 12px var(--green-glow); }

/* ============ Clubs ============ */
.club-list { display: flex; flex-direction: column; gap: 14px; }
.club-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.club-rank { font-weight: 900; color: var(--text-faint); font-size: 13px; }
.club-emoji { font-size: 34px; filter: drop-shadow(0 0 10px var(--green-glow-soft)); }
.club-info { flex: 1; }
.club-info h3 { font-size: 16px; font-weight: 900; }
.club-info p { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }
.club-meta { color: var(--green-dim) !important; font-weight: 800; }
.club-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px; margin-bottom: 8px; }
.club-head-emoji { font-size: 44px; filter: drop-shadow(0 0 14px var(--green-glow)); }
.club-head-txt { flex: 1; }
.club-head-txt h1 { font-size: 22px; font-weight: 900; }
.club-head-txt p { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.member-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; }
.member-row.me { box-shadow: 5px 5px 10px var(--shadow-dark), -3px -3px 8px var(--shadow-light), 0 0 0 2px var(--green-dim); }

.chat-box {
  max-height: 320px; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.chat-msg { display: flex; gap: 10px; align-items: flex-end; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-avatar { font-size: 22px; }
.chat-bubble {
  max-width: 80%;
  background: var(--bg-2);
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
  box-shadow: inset 2px 2px 5px var(--shadow-dark);
}
.chat-msg.mine .chat-bubble {
  border-radius: 14px 14px 4px 14px;
  background: #10331f;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.4), 0 0 10px var(--green-glow-soft);
}
.chat-more {
  background: none; border: none; color: var(--text-faint);
  font-size: 18px; font-weight: 900; line-height: 1; padding: 6px 4px;
  cursor: pointer; align-self: center;
}
.chat-more:hover { color: var(--text-dim); }
.chat-meta { font-size: 10.5px; color: var(--text-faint); font-weight: 800; margin-bottom: 2px; }
.chat-text { font-size: 13.5px; line-height: 1.4; }
.chat-input-row { display: flex; gap: 10px; margin-top: 12px; }
.chat-input-row .ob-input { flex: 1; }

/* ============ Profile ============ */
.profile-head { display: flex; gap: 16px; padding: 20px; align-items: center; margin-bottom: 18px; }
.profile-avatar {
  width: 78px; height: 78px;
  font-size: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card-2);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light), 0 0 22px var(--green-glow-soft);
}
.profile-txt { flex: 1; }
.profile-txt h1 { font-size: 22px; font-weight: 900; }
.profile-title { color: var(--green-soft); font-weight: 800; font-size: 13.5px; margin: 2px 0 8px; }
.profile-sub { color: var(--text-faint); font-size: 12px; margin-top: 6px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 8px; }
.stat-n { font-size: 17px; font-weight: 900; }
.stat-l { font-size: 11px; color: var(--text-dim); font-weight: 700; }

.shop-row { display: flex; gap: 12px; }
.shop-item {
  flex: 1; padding: 16px; text-align: center;
  font-size: 14px; font-weight: 800; line-height: 1.6;
  transition: transform 0.12s;
}
.shop-item b { color: var(--green-soft); }
.shop-item:active { transform: scale(0.97); }
.shop-owned { display: block; font-size: 11px; color: var(--text-faint); }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge { padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.badge:not(.got) { opacity: 0.45; }
.badge.got { box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 16px var(--green-glow-soft); }
.badge-emoji { font-size: 26px; }
.badge.got .badge-emoji { filter: drop-shadow(0 0 8px var(--green-glow)); }
.badge-title { font-size: 12.5px; font-weight: 900; }
.badge-desc { font-size: 10.5px; color: var(--text-faint); line-height: 1.35; }

.friend-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.friend-meta { font-size: 12px; color: var(--text-dim); font-weight: 700; }
.follow-btn {
  padding: 7px 13px; border-radius: 12px;
  font-size: 12px; font-weight: 900;
  color: var(--green-soft);
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
}
.follow-btn.on { color: #04240f; background: var(--green); box-shadow: 0 0 12px var(--green-glow); }
.suggest-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; }
.suggest-card {
  min-width: 108px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 10px;
}
.suggest-avatar { font-size: 28px; }
.suggest-name { font-size: 12px; font-weight: 800; text-align: center; }

.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; gap: 12px; padding: 12px 14px; align-items: center; }
.feed-txt { font-size: 13.5px; line-height: 1.45; }
.feed-txt b { color: var(--green-soft); }
.feed-time { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.settings { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14.5px; }
.vol-wrap { display: flex; align-items: center; gap: 10px; }
.vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 150px; height: 8px; border-radius: 6px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
  outline: none;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(145deg, var(--green-soft), var(--green));
  box-shadow: 0 0 12px var(--green-glow); cursor: pointer;
}
.vol-slider::-moz-range-thumb {
  width: 20px; height: 20px; border: none; border-radius: 50%;
  background: linear-gradient(145deg, var(--green-soft), var(--green));
  box-shadow: 0 0 12px var(--green-glow); cursor: pointer;
}
.neo-btn.slim { padding: 8px 12px; }
.vol-test { font-size: 15px; }

/* ============ Session ============ */
.session { display: flex; flex-direction: column; min-height: calc(100vh - 20px); padding-top: calc(14px + env(safe-area-inset-top)); animation: fadeup 0.3s ease; }
.session-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.progress-track {
  flex: 1; height: 14px; border-radius: 10px;
  background: var(--card-2);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  box-shadow: 0 0 14px var(--green-glow);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.session-hearts { display: flex; gap: 2px; font-size: 15px; }
.heart.empty { opacity: 0.5; }
.session-mode-chip {
  font-size: 11px; font-weight: 900; letter-spacing: 0.06em;
  color: var(--green-soft); text-transform: uppercase;
  padding: 5px 10px; border-radius: 10px;
  background: var(--card-2); box-shadow: inset 2px 2px 5px var(--shadow-dark);
}

.session-body { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.q-prompt { font-size: 21px; font-weight: 900; line-height: 1.35; }
.q-prompt b { color: var(--green-soft); }

.play-big {
  align-self: center;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 30px;
  border-radius: 20px;
  font-size: 17px; font-weight: 900;
  color: var(--green-soft);
  box-shadow: 6px 6px 12px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 20px var(--green-glow-soft);
}
.play-ico { font-size: 24px; }

.q-visual { display: flex; justify-content: center; }
.glyph-visual {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 40px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: inset 5px 5px 12px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
}
.big-glyph { font-size: 64px; line-height: 1.1; text-align: center; text-shadow: 0 0 24px var(--green-glow-soft); }
.glyph-sub { font-size: 12px; color: var(--text-dim); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

/* Staff SVG */
.staff-svg {
  width: min(360px, 92vw);
  background: linear-gradient(145deg, #17201a, #121a15);
  border-radius: var(--radius);
  box-shadow: inset 5px 5px 12px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
  padding: 6px;
}
.staff-line { stroke: #4e6b58; stroke-width: 1.6; }
.staff-line.thick { stroke-width: 3; }
.clef { fill: #a8d8ba; }
.clef-img { opacity: 0.85; }
.notehead { fill: var(--green-soft); filter: drop-shadow(0 0 6px var(--green-glow)); }
.stem { stroke: var(--green-soft); stroke-width: 2.4; }
.accidental { fill: var(--green-soft); font-weight: bold; }
.notehead.hl { fill: var(--gold); }

/* Options */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt-grid.wide { grid-template-columns: 1fr; }
.opt { font-size: 17px; text-align: center; position: relative; }
.opt.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light), 0 0 0 2px var(--green-dim), 0 0 16px var(--green-glow-soft);
}
.opt.right {
  color: #04240f !important;
  background: linear-gradient(160deg, var(--green-soft), var(--green));
  box-shadow: 0 0 22px var(--green-glow);
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.opt.wrong {
  color: #fff !important;
  background: linear-gradient(160deg, #ff6b84, #e2314f);
  box-shadow: 0 0 18px var(--red-glow);
  animation: shake 0.4s;
}
@keyframes pop { 0% { transform: scale(0.92); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}
.shake { animation: shake 0.4s; }

/* Piano */
.piano {
  position: relative;
  display: flex;
  height: 190px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  padding: 8px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 8px 8px 16px var(--shadow-dark), -5px -5px 12px var(--shadow-light);
}
.pkey.white {
  flex: 1;
  margin: 0 2px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(#e8f5ec, #c9dcd0);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.15);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8px;
  color: #23392c;
  font-weight: 900; font-size: 13px;
  transition: transform 0.06s, background 0.15s;
}
.pkey.white:active { transform: translateY(2px); }
.pkey.black {
  position: absolute;
  top: 8px;
  width: 9%;
  height: 58%;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(#20281f, #0a0e0b);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 -5px 0 rgba(255, 255, 255, 0.05);
  z-index: 2;
}
.pkey.sel.white { background: linear-gradient(#b2ffd9, #69f0ae); box-shadow: 0 0 18px var(--green-glow); }
.pkey.sel.black { background: linear-gradient(#1d5c3a, #0e3320); box-shadow: 0 0 18px var(--green-glow); }
.pkey.right.white, .pkey.right.black { background: linear-gradient(#69f0ae, #00c765) !important; box-shadow: 0 0 24px var(--green-glow) !important; }
.pkey.wrong.white, .pkey.wrong.black { background: linear-gradient(#ff8fa3, #e2314f) !important; box-shadow: 0 0 18px var(--red-glow) !important; }

/* Tiles */
.tiles-answer {
  min-height: 62px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 10px;
  border-radius: 16px;
  background: var(--card-2);
  box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}
.tiles-hint { color: var(--text-faint); font-size: 13px; font-weight: 700; }
.tiles-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 6px; }
.tile { font-size: 17px; font-weight: 900; padding: 12px 18px; }
.tile.used { opacity: 0.25; pointer-events: none; box-shadow: inset 4px 4px 8px var(--shadow-dark); }
.tile.picked { color: var(--green-soft); animation: pop 0.25s; }

/* Singing */
.sing-box { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.sing-target { font-size: 15px; font-weight: 800; color: var(--text-dim); }
.sing-target b { color: var(--green-soft); font-size: 19px; }
.pitch-gauge { width: 100%; max-width: 380px; }
.gauge-track {
  position: relative;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(90deg, #2a1520, #131a15 35%, #10331f 47%, #10331f 53%, #131a15 65%, #2a1520);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light);
  overflow: hidden;
}
.gauge-center {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 3px; margin-left: -1.5px;
  background: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
}
.gauge-needle {
  position: absolute; top: 5px; bottom: 5px;
  left: 50%; width: 10px; margin-left: -5px;
  border-radius: 6px;
  background: #e8f5ec;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  opacity: 0.25;
  transition: left 0.09s linear, background 0.2s;
}
.gauge-needle.in-tune { background: var(--green-soft); box-shadow: 0 0 16px var(--green-glow); }
.gauge-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); font-weight: 800; margin-top: 6px; padding: 0 4px; }
.sing-note { font-size: 20px; font-weight: 900; color: var(--green-soft); min-height: 28px; }
.hold-ring {
  width: 100%; max-width: 380px; height: 10px;
  border-radius: 8px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
  overflow: hidden;
}
.hold-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green-dim), var(--green)); box-shadow: 0 0 12px var(--green-glow); border-radius: 8px; }
.sing-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sing-mic-btn.active { color: var(--green-soft); box-shadow: inset 5px 5px 10px var(--shadow-dark), 0 0 18px var(--green-glow-soft); }
.sing-status { font-size: 13px; color: var(--text-dim); font-weight: 700; text-align: center; min-height: 18px; }

/* Feedback footer */
.session-footer { padding: 18px 0 calc(26px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.feedback {
  border-radius: 18px;
  padding: 16px 18px;
  animation: slideup 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.feedback.ok { background: linear-gradient(145deg, #10331f, #0c2718); box-shadow: 0 0 24px var(--green-glow-soft), inset 0 0 0 1px rgba(0, 230, 118, 0.25); }
.feedback.bad { background: linear-gradient(145deg, #33101a, #260c13); box-shadow: 0 0 24px var(--red-glow), inset 0 0 0 1px rgba(255, 84, 112, 0.25); }
.feedback.skip { background: linear-gradient(145deg, #332b10, #26200c); box-shadow: inset 0 0 0 1px rgba(255, 213, 79, 0.25); }
.fb-head { font-size: 17px; font-weight: 900; }
.feedback.ok .fb-head { color: var(--green-soft); }
.feedback.bad .fb-head { color: #ff8fa3; }
.fb-answer { margin-top: 6px; font-size: 14.5px; }
.fb-answer b { color: var(--green-soft); }
.fb-explain { margin-top: 6px; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.fb-explain b { color: var(--text); }
@keyframes slideup { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ============ Results ============ */
.results {
  min-height: calc(100vh - 40px);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: 30px 0 40px;
  animation: fadeup 0.4s ease;
}
.results-hero { text-align: center; }
.results-emoji { font-size: 74px; animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); filter: drop-shadow(0 0 26px var(--green-glow)); }
.results-hero h1 { font-size: 30px; font-weight: 900; margin-top: 8px; }
.results-hero.failed .results-emoji { filter: none; }
.results-sub { color: var(--text-dim); margin-top: 4px; font-weight: 700; }
.stars { margin-top: 14px; font-size: 42px; letter-spacing: 8px; }
.star { color: #2a3a2f; display: inline-block; }
.star.lit {
  color: var(--gold);
  text-shadow: 0 0 22px rgba(255, 213, 79, 0.7);
  animation: starpop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes starpop { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.35) rotate(8deg); } 100% { transform: scale(1); } }
.results-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.r-card { padding: 14px 22px; text-align: center; min-width: 92px; }
.r-label { font-size: 11px; font-weight: 900; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.r-value { font-size: 22px; font-weight: 900; color: var(--green-soft); margin-top: 3px; }
.streak-card .r-value { color: var(--gold); }
.levelup, .badge-earned {
  text-align: center; padding: 13px 16px;
  font-size: 14.5px; font-weight: 800;
  animation: fadeup 0.5s ease both;
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 18px var(--green-glow-soft);
}
.levelup b, .badge-earned b { color: var(--green-soft); }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 7, 5, 0.75);
  backdrop-filter: blur(5px);
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: min(420px, 100%);
  padding: 26px;
  text-align: center;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal h3 { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.modal p { color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; justify-content: center; }
.modal-actions.column { flex-direction: column; }
.modal-hearts { font-size: 54px; }
.lesson-pop-emoji { font-size: 54px; filter: drop-shadow(0 0 18px var(--green-glow)); }
.pop-chapter { font-weight: 800; }
.pop-xp { color: var(--green-soft) !important; font-weight: 900; margin-top: 6px; }

/* ============ Toasts ============ */
#toasts {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
  width: min(400px, calc(100vw - 30px));
  pointer-events: none;
}
.toast {
  padding: 13px 18px;
  font-size: 14px; font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 8px 8px 18px var(--shadow-dark), -5px -5px 12px var(--shadow-light), 0 0 20px var(--green-glow-soft);
}
.toast.show { opacity: 1; transform: none; }

/* ============ Confetti canvas ============ */
#confetti {
  position: fixed; inset: 0;
  z-index: 80;
  pointer-events: none;
  display: none;
}

/* ============ Small screens ============ */
@media (max-width: 460px) {
  .stats-grid, .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .q-prompt { font-size: 18px; }
  .node-row { width: 110px; }
}

/* ============ Scrollbars ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #1d2b21; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

/* ============================================================
   SVG icon set — sizing & animations
   ============================================================ */
.ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }

.ico-flame { animation: ico-flicker 1.7s ease-in-out infinite; transform-origin: 50% 88%; }
@keyframes ico-flicker {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.06, 0.95) rotate(-2.5deg); }
  60% { transform: scale(0.96, 1.05) rotate(2deg); }
}
.ico-gem .glint, .ico-trophyC .glint { animation: ico-glint 3s ease-in-out infinite; }
@keyframes ico-glint {
  0%, 55%, 100% { opacity: 0; }
  65%, 82% { opacity: 1; }
}
.ico-heart { animation: ico-beat 2.2s ease-in-out infinite; transform-origin: center; }
@keyframes ico-beat {
  0%, 24%, 100% { transform: scale(1); }
  8% { transform: scale(1.14); }
  16% { transform: scale(0.98); }
}
.ico-bolt { animation: ico-bolt 2.6s ease-in-out infinite; }
@keyframes ico-bolt {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(255, 213, 79, 0.3)); }
  50% { filter: drop-shadow(0 0 6px rgba(255, 213, 79, 0.9)); }
}
.ico-note { animation: ico-bob 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes ico-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-1.5px) rotate(-4deg); }
}
.ico-flag .pennant { animation: ico-wave 2s ease-in-out infinite; transform-origin: 30% 30%; }
@keyframes ico-wave {
  0%, 100% { transform: skewY(0); }
  50% { transform: skewY(-4deg); }
}
.ico-star { filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.5)); }
.ico-speaker .arc { opacity: 0.4; }
.playing .ico-speaker .a1, .play-big:active .ico-speaker .a1 { animation: ico-arc 0.9s ease-in-out infinite; }
.playing .ico-speaker .a2, .play-big:active .ico-speaker .a2 { animation: ico-arc 0.9s ease-in-out 0.2s infinite; }
@keyframes ico-arc { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Icon sizing in specific slots */
.node-ico .ico { width: 1em; height: 1em; }
.node-ico { display: inline-flex; font-size: 32px; }
.node.boss .node-ico { font-size: 46px; }
.stat-n .ico { width: 19px; height: 19px; }
.lr-rank .ico { width: 24px; height: 24px; }
.league-shield .ico { width: 46px; height: 46px; }
.play-ico .ico { width: 24px; height: 24px; }
.shop-item .ico { width: 20px; height: 20px; }
.heart .ico { width: 17px; height: 17px; }
.session-hearts { align-items: center; }
.r-value .ico { width: 20px; height: 20px; }
.sing-mic-btn .ico, .placement-btn .ico { width: 18px; height: 18px; }

/* ============ Onboarding additions ============ */
.ob-hint { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.inst-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.inst-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px;
  font-size: 11px; font-weight: 800;
  color: var(--text-dim);
}
.inst-pick .inst-emoji { font-size: 22px; }
.inst-pick.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light),
    0 0 0 2px var(--green-dim), 0 0 16px var(--green-glow-soft);
}
.name-pick { flex: 1; text-align: center; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.name-pick b { color: var(--text); font-size: 14px; }
.name-pick.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light), 0 0 16px var(--green-glow-soft);
}
.name-pick.sel b { color: var(--green-soft); }
.placement-btn { text-align: center; color: var(--text-dim); font-size: 14px; }
.placement-btn b { color: var(--gold); }
.theme-toggle { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 5; }
.onboard { position: relative; }
.place-chip {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 20px;
  font-size: 15px; font-weight: 800;
  color: var(--text-dim);
}
.place-chip b { color: var(--green-soft); }

/* ============ Rhythm tap game ============ */
.tap-box { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.rhythm-display {
  display: flex; align-items: stretch;
  width: 100%; max-width: 460px;
  padding: 14px 18px;
  gap: 6px;
}
.r-cell {
  flex-basis: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  padding: 8px 2px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.r-glyph { display: grid; place-items: center; }
.r-note { width: 34px; height: 54px; }
.big-glyph .big-note { width: 64px; height: 84px; }
.big-note.r-note { width: 64px; height: 84px; }
.big-note .r-head.open { stroke-width: 3; }
.big-note .r-stem { stroke-width: 3; }
.guide-glyph-row { display: flex; gap: 14px; justify-content: center; align-items: flex-end; }
.guide-glyph-row .big-note { width: 40px; height: 56px; }
.r-head { fill: var(--green-soft); stroke: var(--green-soft); }
.r-head.open { fill: none; stroke-width: 2.6; }
.r-stem, .r-flag, .r-dot { stroke: var(--green-soft); fill: var(--green-soft); stroke-width: 2.4; }
.r-rest { stroke: var(--green-soft); fill: none; }
.r-rest-fill { fill: var(--green-soft); stroke: none; }
.r-cell.rest .r-rest, .r-cell.rest .r-stem { stroke: var(--text-faint); }
.r-cell.rest .r-rest-fill { fill: var(--text-faint); }
.r-cell.now { background: rgba(0, 230, 118, 0.12); box-shadow: 0 0 16px var(--green-glow-soft), inset 0 0 0 1.5px var(--green-dim); transform: scale(1.08); }
.r-cell.now .r-head, .r-cell.now .r-stem, .r-cell.now .r-flag, .r-cell.now .r-dot { stroke: var(--gold); }
.r-cell.now .r-head:not(.open), .r-cell.now .r-stem, .r-cell.now .r-flag, .r-cell.now .r-dot { fill: var(--gold); }
.count-dots { display: flex; gap: 10px; }
.cdot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card-2);
  box-shadow: inset 2px 2px 4px var(--shadow-dark);
  transition: background 0.1s, box-shadow 0.1s;
}
.cdot.on { background: var(--green); box-shadow: 0 0 10px var(--green-glow); }
.tap-pad {
  width: 158px; height: 158px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900; letter-spacing: 0.12em;
  color: var(--text-dim);
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 9px 9px 18px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
  transition: transform 0.05s, box-shadow 0.2s, color 0.2s;
  touch-action: manipulation;
  user-select: none;
}
.tap-pad.live {
  color: var(--green-soft);
  box-shadow: 9px 9px 18px var(--shadow-dark), -6px -6px 14px var(--shadow-light),
    0 0 0 3px rgba(0, 230, 118, 0.5), 0 0 30px var(--green-glow);
}
.tap-pad:disabled { cursor: default; }
.tap-pad:not(:disabled):active, .tap-pad.hit {
  transform: scale(0.93);
  box-shadow: inset 7px 7px 14px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light),
    0 0 34px var(--green-glow);
}
.tap-pad.hit { animation: padhit 0.18s ease-out; }
@keyframes padhit {
  0% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ============================================================
   Light theme
   ============================================================ */
body.theme-light {
  --bg: #e9f3ec;
  --bg-2: #dcebe1;
  --card: #f6fcf8;
  --card-2: #e9f4ed;
  --shadow-dark: #c2d5c9;
  --shadow-light: #ffffff;
  --green: #00c853;
  --green-soft: #009e4d;
  --green-dim: #0b8f4e;
  --green-glow: rgba(0, 170, 85, 0.28);
  --green-glow-soft: rgba(0, 170, 85, 0.13);
  --text: #12281a;
  --text-dim: #41634f;
  --text-faint: #6f8d7c;
  --gold: #b58900;
  --red: #d8365a;
  --red-glow: rgba(216, 54, 90, 0.22);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0, 200, 100, 0.07), transparent 60%),
    radial-gradient(900px 500px at 110% 30%, rgba(0, 200, 100, 0.05), transparent 55%),
    var(--bg);
}
body.theme-light .btn-primary { color: #03301a; }
body.theme-light .feedback.ok { background: linear-gradient(145deg, #d8f5e4, #c7eed6); box-shadow: inset 0 0 0 1px rgba(0, 170, 85, 0.3); }
body.theme-light .feedback.ok .fb-head { color: #0b8f4e; }
body.theme-light .feedback.bad { background: linear-gradient(145deg, #fbdfe6, #f6cdd8); box-shadow: inset 0 0 0 1px rgba(216, 54, 90, 0.3); }
body.theme-light .feedback.bad .fb-head { color: #b8224a; }
body.theme-light .feedback.skip { background: linear-gradient(145deg, #f7eecf, #f1e5ba); }
body.theme-light .chat-msg.mine .chat-bubble { background: #d3f2e0; box-shadow: inset 1px 1px 4px rgba(120, 160, 135, 0.5); }
body.theme-light .node.done { background: linear-gradient(145deg, #d5f1df, #c3e9d1); }
body.theme-light .staff-svg { background: linear-gradient(145deg, #ffffff, #eef7f1); }
body.theme-light .staff-line { stroke: #91ac9b; }
body.theme-light .clef { fill: #33523f; }
body.theme-light .clef-img { filter: brightness(0.55) saturate(1.3); }
body.theme-light .notehead, body.theme-light .accidental { fill: #0b8f4e; }
body.theme-light .stem { stroke: #0b8f4e; }
body.theme-light .pkey.white { background: linear-gradient(#ffffff, #e9f0ea); color: #2a4433; }
body.theme-light .pkey.black { background: linear-gradient(#37423a, #1a211c); }
body.theme-light .gauge-track { background: linear-gradient(90deg, #f0dbe0, #e9f4ed 35%, #d3f2e0 47%, #d3f2e0 53%, #e9f4ed 65%, #f0dbe0); }
body.theme-light .gauge-needle { background: #355442; box-shadow: none; }
body.theme-light .gauge-needle.in-tune { background: #00c853; }
body.theme-light .star { color: #cfe0d5; }
body.theme-light .modal-overlay { background: rgba(220, 235, 225, 0.72); }
body.theme-light .ico-heartEmpty path { stroke: #b8cbbe; }
body.theme-light ::-webkit-scrollbar-thumb { background: #b8cec0; }
body.theme-light .logo-word { text-shadow: 0 0 30px rgba(0, 170, 85, 0.35); }
body.theme-light .tiles-hint, body.theme-light .empty-note, body.theme-light .sim-note { color: #7d998a; }

/* ============================================================
   Cloud: auth, club gate, create-club, account box
   ============================================================ */
.club-loading { padding: 40px; text-align: center; font-size: 32px; opacity: 0.7; }
.club-gate { padding: 30px 24px; text-align: center; margin-top: 10px; }
.club-gate .gate-emoji { font-size: 52px; filter: drop-shadow(0 0 18px var(--green-glow)); }
.club-gate .gate-emoji .ico { width: 52px; height: 52px; }
.league-solo { text-align: center; margin: 6px 0 16px; }
.club-gate h2 { font-size: 20px; font-weight: 900; margin: 10px 0 6px; }
.club-gate p { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.club-gate .btn-primary { max-width: 320px; margin: 0 auto; }

.cc-emoji-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.cc-emoji {
  width: 44px; height: 44px; border-radius: 12px; font-size: 22px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
  transition: transform 0.12s, box-shadow 0.2s;
}
.cc-emoji.sel { transform: scale(1.1); box-shadow: 0 0 0 2px var(--green), 0 0 16px var(--green-glow); }

.account-box { gap: 12px; }
.account-row { font-weight: 800; font-size: 14px; }
.account-sync { font-size: 12.5px; color: var(--green-soft); font-weight: 700; }
.account-box .btn-primary, .account-box .neo-btn { width: 100%; }

/* ============================================================
   Guide (theory handbook)
   ============================================================ */
.guide-page { animation: fadeup 0.35s ease; }
.guide-chapter { margin-bottom: 14px; }
.guide-head {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  text-align: left;
}
.guide-emoji { font-size: 26px; filter: drop-shadow(0 0 8px var(--green-glow-soft)); }
.guide-ch-title { flex: 1; font-size: 16px; font-weight: 900; }
.guide-caret { color: var(--green-soft); font-size: 15px; transition: transform 0.25s; }
.guide-chapter.open .guide-caret { transform: rotate(180deg); }

/* Mind-map feel: cards hang off a connector line under the chapter node */
.guide-cards {
  display: none;
  flex-direction: column; gap: 12px;
  margin: 12px 0 4px 24px;
  padding-left: 20px;
  border-left: 2px dashed rgba(0, 230, 118, 0.28);
}
.guide-chapter.open .guide-cards { display: flex; animation: fadeup 0.3s ease; }
.guide-card { padding: 16px 18px; position: relative; }
.guide-card::before {
  content: ''; position: absolute; left: -22px; top: 26px;
  width: 16px; height: 2px; background: rgba(0, 230, 118, 0.28);
}
.guide-card-title { font-size: 15px; font-weight: 900; color: var(--green-soft); margin-bottom: 10px; }
.guide-visual { display: flex; justify-content: center; margin: 6px 0 12px; }
.guide-visual .staff-svg { width: min(300px, 80vw); }
.guide-points { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.guide-points li {
  position: relative; padding-left: 18px;
  font-size: 13.5px; line-height: 1.5; color: var(--text);
}
.guide-points li::before {
  content: '♪'; position: absolute; left: 0; top: 0;
  color: var(--green-dim); font-size: 12px;
}
.guide-points b { color: var(--green-soft); }
.guide-points i { color: var(--text-dim); font-style: italic; }

/* mini labelled keyboard */
.guide-kb {
  position: relative; display: flex; height: 96px;
  width: min(300px, 82vw); padding: 6px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}
.gk-white {
  flex: 1; margin: 0 1.5px; border-radius: 0 0 6px 6px;
  background: linear-gradient(#e8f5ec, #c9dcd0);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px;
  color: #23392c; font-weight: 900; font-size: 11px;
}
.gk-black {
  position: absolute; top: 6px; width: 9%; height: 56%;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(#20281f, #0a0e0b); z-index: 2;
}
body.theme-light .gk-white { background: linear-gradient(#ffffff, #e9f0ea); }

/* 6-tab bar: tighten a touch so labels fit */
#tabbar .tab { padding-left: 2px; padding-right: 2px; }
.tab-label { font-size: 10.5px; }
@media (max-width: 460px) {
  .tab-label { font-size: 9.5px; letter-spacing: 0; }
  .tab-icon .ico { width: 20px; height: 20px; }
}

.ob-signin-row { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--text-dim); }
.ob-signin-link {
  color: var(--green-soft); font-weight: 900; font-size: 13.5px;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px;
}
.ob-signin-link:hover { color: var(--green); }
#delete-account { margin-top: 4px; opacity: 0.9; }
