* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:     #0a0a14;
  --bg2:    #12121f;
  --bg3:    #1a1a2e;
  --border: #252540;
  --text:   #e2e8f0;
  --dim:    #64748b;
  --gold:   #f59e0b;
  --cyan:   #06b6d4;
  --green:  #10b981;
  --purple: #7c3aed;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ─────────────────────────────────────────────────────────────────── */
.app-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0f0f22 0%, var(--bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.app-header > div { text-align: center; }

.app-header .notif-bell-btn {
  position: absolute;
  right: 20px;
}

h1 {
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 3px;
  text-shadow: 0 0 24px #f59e0b55;
}

.edition-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 400;
  color: #e2e8f0;
  letter-spacing: 1px;
  text-shadow: none;
  margin-left: -4px;
}

.subtitle {
  color: var(--dim);
  font-size: 0.85rem;
  margin-top: 4px;
  letter-spacing: 1px;
}

/* ── LAYOUT ──────────────────────────────────────────────────────────────────── */
.app-body {
  display: flex;
  min-height: calc(100vh - 88px);
}

/* ── LEFT PANEL ──────────────────────────────────────────────────────────────── */
.player-panel {
  width: 280px;
  min-width: 280px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: calc(100vh - 88px);
  overflow-y: auto;
}

/* ── RIGHT PANEL ─────────────────────────────────────────────────────────────── */
.quest-panel {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}

/* ── AVATAR BLOCK ─────────────────────────────────────────────────────────────── */
.avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
}

.avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 24px #7c3aed55;
  border: 2px solid #7c3aed66;
}

.player-name {
  font-size: 1rem;
  font-weight: bold;
  color: var(--text);
}

.level-title {
  font-size: 0.72rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ── BLOCK SHARED ─────────────────────────────────────────────────────────────── */
.panel-block {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.block-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dim);
  margin-bottom: 10px;
}

/* ── XP BLOCK ─────────────────────────────────────────────────────────────────── */
.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.level-badge {
  background: linear-gradient(135deg, var(--gold), #f97316);
  color: #0a0a14;
  font-weight: bold;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 20px;
}

.xp-numbers {
  font-size: 0.72rem;
  color: var(--dim);
}

.xp-bar-container {
  background: var(--bg);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #f97316);
  border-radius: 10px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px #f59e0b66;
}

/* ── STAGE BLOCK ──────────────────────────────────────────────────────────────── */
.stage-name-label {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--cyan);
  margin-bottom: 8px;
}

.stage-prog-bg {
  background: var(--bg);
  border-radius: 6px;
  height: 7px;
  overflow: hidden;
  margin-bottom: 5px;
}

.stage-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 6px;
  transition: width 0.5s ease;
}

.stage-prog-label {
  font-size: 0.7rem;
  color: var(--dim);
}

/* ── ACHIEVEMENTS BLOCK ───────────────────────────────────────────────────────── */
.achievements-block {
  flex: 1;
}

.achievement-tier {
  margin-bottom: 12px;
}

.achievement-tier:last-child { margin-bottom: 0; }

.tier-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: bold;
  margin-bottom: 6px;
}

.tier-label.common    { color: #94a3b8; }
.tier-label.rare      { color: #818cf8; }
.tier-label.legendary { color: var(--gold); }

.achievement-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  opacity: 0.25;
  transition: opacity 0.3s;
}

.achievement-item.earned { opacity: 1; }

.ach-icon { font-size: 1rem; width: 20px; text-align: center; }

.ach-name {
  font-size: 0.76rem;
  color: var(--dim);
}

.achievement-item.earned .ach-name { color: var(--text); }

/* ── QUEST PANEL TABS ─────────────────────────────────────────────────────────── */
.qp-tab-bar {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
}
.qp-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 20px;
  color: var(--dim);
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: color 0.15s, border-color 0.15s;
}
.qp-tab:hover { color: #aaa; }
.qp-tab-active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── LEADERBOARD ──────────────────────────────────────────────────────────────── */
.lb-container { display: flex; flex-direction: column; gap: 8px; max-width: 600px; }
.lb-loading { text-align: center; color: var(--dim); font-size: 0.88rem; padding: 40px 20px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  transition: border-color 0.15s;
}
.lb-row-me { border-color: var(--gold); background: #f59e0b08; }
.lb-medal { font-size: 1.4rem; min-width: 32px; text-align: center; flex-shrink: 0; }
.lb-rank-num { font-size: 0.85rem; font-weight: bold; color: var(--dim); }
.lb-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0; overflow: hidden;
}
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 0.92rem; font-weight: bold; color: var(--text); display: flex; align-items: center; gap: 6px; }
.lb-you {
  font-size: 0.65rem; background: #f59e0b22; color: var(--gold);
  border: 1px solid #f59e0b44; border-radius: 10px;
  padding: 1px 7px; font-weight: bold; letter-spacing: 0.5px;
}
.lb-meta { font-size: 0.76rem; color: var(--dim); margin-top: 2px; }
.lb-xp { font-size: 1rem; font-weight: bold; color: var(--gold); white-space: nowrap; flex-shrink: 0; }
.lb-xp-label { font-size: 0.65rem; color: var(--dim); font-weight: normal; }

/* ── STAGE SECTION ────────────────────────────────────────────────────────────── */
.stage-section {
  margin-bottom: 48px;
}

.stage-graduated {
  margin-bottom: 16px;
}

.stage-header {
  margin-bottom: 40px;
}

.stage-header-collapsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #10b98108;
  border: 1px solid #10b98128;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background 0.15s;
}
.stage-header-collapsible:hover { background: #10b98115; }

.stage-header-main { display: flex; flex-direction: column; gap: 2px; }
.stage-header-collapsible .stage-title-big { font-size: 1.1rem; margin-bottom: 0; }

.stage-grad-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.stage-grad-badge {
  font-size: 0.78rem;
  background: #10b98120;
  color: #10b981;
  border: 1px solid #10b98140;
  border-radius: 20px;
  padding: 3px 10px;
  font-weight: bold;
  white-space: nowrap;
}

.stage-quest-summary {
  font-size: 0.75rem;
  color: var(--dim);
  white-space: nowrap;
}

.stage-collapse-toggle {
  font-size: 0.72rem;
  color: var(--dim);
  white-space: nowrap;
  opacity: 0.7;
}

.stage-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--dim);
  margin-bottom: 6px;
}

.stage-title-big {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 8px;
}
.locked-blur { filter: blur(4px); user-select: none; }

.stage-goal {
  font-size: 0.85rem;
  color: var(--cyan);
  border-left: 3px solid var(--cyan);
  padding-left: 10px;
}

/* ── QUEST GRID ───────────────────────────────────────────────────────────────── */
.quests-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ── QUEST CARD ───────────────────────────────────────────────────────────────── */
.quest-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 4px solid var(--area-color, #444);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s;
}

.quest-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}

.quest-card.completed {
  border-left-color: var(--green) !important;
  opacity: 0.7;
}

.quest-card.completed:hover { opacity: 1; }

.quest-header {
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.quest-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.quest-icon { font-size: 1.3rem; line-height: 1; }

.quest-area-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--area-color, #888);
  font-weight: bold;
}

.quest-card.completed .quest-area-label { color: var(--green); }

.quest-xp-badge {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--gold);
  background: #f59e0b14;
  border: 1px solid #f59e0b33;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.quest-card.completed .quest-xp-badge {
  color: var(--green);
  background: #10b98114;
  border-color: #10b98133;
}

.quest-constraint {
  font-size: 0.76rem;
  color: var(--dim);
  font-style: italic;
  margin-bottom: 5px;
}

.quest-action {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

.quest-card.completed .quest-action {
  text-decoration: line-through;
  color: var(--dim);
}

.quest-card-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.quest-prog-wrap { flex: 1; }

.quest-prog-bg {
  background: var(--bg);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
  margin-bottom: 4px;
}

.quest-prog-fill {
  height: 100%;
  background: var(--area-color, #555);
  border-radius: 4px;
  transition: width 0.4s;
}

.quest-card.completed .quest-prog-fill { background: var(--green); }

.quest-prog-label {
  font-size: 0.67rem;
  color: var(--dim);
}

.quest-expand-btn {
  font-size: 0.7rem;
  color: var(--dim);
  white-space: nowrap;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
}

/* ── SUB-QUEST PANEL ─────────────────────────────────────────────────────────── */
.subquest-panel {
  display: none;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 16px 14px;
}

.subquest-panel.open { display: block; }

.subquest-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 4px;
}

.subquest-item:last-child { border-bottom: none; }

.subquest-item:hover { background: #ffffff07; padding-left: 6px; padding-right: 6px; margin: 0 -6px; }

.sub-check {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid #3a3a5a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--green);
  margin-top: 1px;
  transition: all 0.2s;
}

.subquest-item.done .sub-check {
  background: #10b98120;
  border-color: var(--green);
}

.sub-text {
  font-size: 0.84rem;
  color: #b0b8cc;
  line-height: 1.4;
}

.subquest-item.done .sub-text {
  text-decoration: line-through;
  color: var(--dim);
}

/* ── GRADUATE SECTION ─────────────────────────────────────────────────────────── */
.graduate-section { margin-top: 20px; }

.graduate-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--gold), #f97316);
  color: #0a0a14;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 0 20px #f59e0b33;
}

.graduate-btn:disabled {
  background: var(--bg3);
  color: #333;
  cursor: not-allowed;
  box-shadow: none;
}

.graduate-btn:not(:disabled):hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.graduate-btn.graduated {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  box-shadow: none;
  cursor: default;
}

/* ── LOCKED STAGE ─────────────────────────────────────────────────────────────── */
.locked-overlay {
  position: relative;
}

.locked-overlay .quests-grid {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.35;
}

.lock-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 32px;
  text-align: center;
  z-index: 10;
  min-width: 220px;
}

.lock-icon { font-size: 2rem; margin-bottom: 8px; }
.lock-text strong { display: block; font-size: 1rem; color: var(--gold); margin-bottom: 4px; }
.lock-text { font-size: 0.84rem; color: var(--dim); }

/* ── LEVEL UP OVERLAY ─────────────────────────────────────────────────────────── */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.levelup-overlay.show { display: flex; animation: bgflash 0.5s ease; }

@keyframes bgflash {
  0%   { background: rgba(245,158,11,0.25); }
  100% { background: rgba(0,0,0,0.88); }
}

.levelup-big {
  font-size: 3.2rem;
  font-weight: bold;
  color: var(--gold);
  letter-spacing: 5px;
  text-shadow: 0 0 40px var(--gold);
  animation: levelpulse 0.7s ease infinite alternate;
}

@keyframes levelpulse {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

.levelup-num  { font-size: 1.5rem; color: var(--text); }
.levelup-name { font-size: 1rem; color: var(--cyan); letter-spacing: 2px; text-transform: uppercase; }

/* ── ACHIEVEMENT TOAST ────────────────────────────────────────────────────────── */
.achievement-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  max-width: 270px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
  z-index: 999;
}

.achievement-toast.show { transform: translateX(0); }

.toast-tier {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: bold;
  margin-bottom: 4px;
}

.toast-tier.common    { color: #94a3b8; }
.toast-tier.rare      { color: #818cf8; }
.toast-tier.legendary { color: var(--gold); }

.toast-name { font-size: 0.95rem; font-weight: bold; margin-bottom: 2px; }
.toast-desc { font-size: 0.78rem; color: var(--dim); }

/* ── PENDING REVIEW ───────────────────────────────────────────────────────────── */
.pending-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pending-badge {
  background: #f59e0b14;
  border: 1px solid #f59e0b44;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--gold);
  text-align: center;
  line-height: 1.5;
}

/* ── QUEST NOTE (on card) ─────────────────────────────────────────────────────── */
.quest-note-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
}

.quest-note {
  flex: 1;
  font-size: 0.76rem;
  color: var(--green);
  font-style: italic;
  padding: 5px 8px;
  background: #10b98110;
  border-left: 2px solid var(--green);
  border-radius: 0 4px 4px 0;
}

.quest-note-edit-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s;
  line-height: 1;
  margin-top: 2px;
}

.quest-note-edit-btn:hover {
  opacity: 1;
  background: #ffffff10;
}

/* ── PENDING CARD ─────────────────────────────────────────────────────────────── */
.pending-card {
  background: #f59e0b0d;
  border: 1px solid #f59e0b44;
  border-radius: 12px;
  padding: 20px 22px;
  text-align: center;
}

.pending-card-icon { font-size: 2rem; margin-bottom: 8px; }

.pending-card-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 10px;
}

.pending-card-body {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.7;
}

/* ── DECLINE CARD ────────────────────────────────────────────────────────────── */
.decline-card {
  background: #f59e0b0d;
  border-color: #f59e0b44;
  text-align: left;
}
.decline-card .pending-card-title { color: #f59e0b; }
.pending-card-subtitle {
  font-size: 0.83rem; color: var(--dim); margin: -4px 0 12px; line-height: 1.5;
}
.decline-reason {
  background: var(--bg3);
  border-left: 3px solid #ef4444;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 14px;
  white-space: pre-wrap;
}
.decline-redo-label {
  font-size: 0.8rem;
  color: var(--dim);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.decline-quest-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.decline-quest-list li {
  font-size: 0.85rem;
  color: #f87171;
  padding: 4px 10px;
  background: #ef44441a;
  border-radius: 6px;
}
.decline-quest-list li::before { content: '↩ '; }
.decline-tip {
  font-size: 0.82rem;
  color: var(--dim);
  margin-bottom: 16px;
  font-style: italic;
}
.decline-ack-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(90deg, #374151, #1f2937);
  border: 1px solid #4b5563;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.decline-ack-btn:hover { background: linear-gradient(90deg, #4b5563, #374151); }

/* ── QUEST NOTE MODAL ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

@media (max-width: 600px) {
  .modal-overlay {
    align-items: flex-start;
    padding-top: 24px;
  }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-icon  { font-size: 2.4rem; margin-bottom: 10px; }
.modal-title { font-size: 1.3rem; font-weight: bold; color: var(--gold); margin-bottom: 4px; }
.modal-area  { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--dim); margin-bottom: 10px; }

.admin-msg-body {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  text-align: left;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.modal-goal {
  font-size: 0.88rem;
  color: var(--cyan);
  background: #06b6d414;
  border: 1px solid #06b6d433;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.modal-wide { max-width: 520px; }

.submit-notes-preview {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  max-height: 240px;
  overflow-y: auto;
  text-align: left;
  margin-top: 14px;
}

.submit-note-row {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.submit-note-row:last-child { border-bottom: none; }

.submit-note-area {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dim);
  margin-bottom: 3px;
}

.submit-note-text {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.4;
}

.modal-prompt {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.5;
}

.modal-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 12px;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.modal-textarea:focus { outline: none; border-color: var(--gold); }
.modal-textarea.modal-error { border-color: #ef4444; }

.modal-chars {
  font-size: 0.7rem;
  color: var(--dim);
  text-align: right;
  margin-top: 4px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-btn-cancel {
  flex: 1;
  padding: 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.modal-btn-cancel:hover { border-color: #555; color: var(--text); }

.modal-btn-confirm {
  flex: 2;
  padding: 11px;
  background: linear-gradient(90deg, var(--gold), #f97316);
  border: none;
  border-radius: 8px;
  color: #0a0a14;
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-btn-confirm:hover { opacity: 0.88; }

/* ── PLAYER PANEL FOOTER ──────────────────────────────────────────────────────── */
.panel-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.panel-signout-btn {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.panel-signout-btn:hover {
  border-color: #555;
  color: var(--text);
}

.panel-admin-link {
  display: block;
  text-align: center;
  padding: 9px;
  background: #7c3aed18;
  border: 1px solid #7c3aed44;
  border-radius: 8px;
  color: var(--purple);
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.panel-admin-link:hover { background: #7c3aed28; }

/* ── ACHIEVEMENTS COMPACT ────────────────────────────────────────────────────── */
.ach-compact-block { padding-top: 14px; }

.ach-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ach-count-pill {
  background: #f59e0b22;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 2px 8px;
  border: 1px solid #f59e0b44;
}

.ach-pip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.ach-pip {
  font-size: 1rem;
  opacity: 0.2;
  filter: grayscale(1);
  cursor: default;
  transition: opacity 0.2s;
}
.ach-pip.earned {
  opacity: 1;
  filter: none;
}
.ach-pip.pip-common    { text-shadow: 0 0 6px #10b98188; }
.ach-pip.pip-rare      { text-shadow: 0 0 6px #3b82f688; }
.ach-pip.pip-legendary { text-shadow: 0 0 8px #f9731688; }

.ach-view-all-btn {
  width: 100%;
  padding: 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ach-view-all-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── ACHIEVEMENTS MODAL ──────────────────────────────────────────────────────── */
.modal-wide { max-width: 540px !important; }

.ach-modal-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dim);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.ach-section-earned { color: var(--green); }

.ach-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.ach-earned   { background: #10b98112; border: 1px solid #10b98122; }
.ach-available { background: #ffffff06; border: 1px solid var(--border); opacity: 0.7; }
.ach-locked   { background: #ffffff04; border: 1px solid var(--border); filter: blur(2px); opacity: 0.4; pointer-events: none; }

/* Tier colours (earned state) */
.ach-tier-common    { background: #10b98118; border-color: #10b98140; }
.ach-tier-rare      { background: #3b82f618; border-color: #3b82f640; }
.ach-tier-legendary { background: #f9731618; border-color: #f9731640; }

.ach-modal-tier {
  margin-left: auto;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}
.ach-tier-label-common    { background: #10b98122; color: #10b981; }
.ach-tier-label-rare      { background: #3b82f622; color: #93c5fd; }
.ach-tier-label-legendary { background: #f9731622; color: #fb923c; }

.ach-locked-wrap { pointer-events: none; }

.ach-modal-icon { font-size: 1.5rem; flex-shrink: 0; }
.ach-modal-name { font-size: 0.88rem; font-weight: bold; color: var(--text); }
.ach-modal-desc { font-size: 0.76rem; color: var(--dim); margin-top: 2px; }
.ach-modal-check { margin-left: auto; color: var(--green); font-weight: bold; font-size: 1rem; flex-shrink: 0; }

/* ── INBOX BUTTON ────────────────────────────────────────────────────────────── */
.inbox-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  background: #06b6d410;
  border: 1px solid #06b6d433;
  border-radius: 8px;
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.3px;
}
.inbox-btn:hover { background: #06b6d420; }

.inbox-unread {
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.5;
}

/* ── INBOX MODAL ─────────────────────────────────────────────────────────────── */
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.inbox-messages {
  max-height: 340px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-bubble-wrap { display: flex; }
.from-coach  { justify-content: flex-start; }
.from-player { justify-content: flex-end; }

.inbox-bubble {
  max-width: 78%;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.bubble-coach  { background: #06b6d415; border: 1px solid #06b6d433; border-bottom-left-radius: 4px; }
.bubble-player { background: #7c3aed20; border: 1px solid #7c3aed44; border-bottom-right-radius: 4px; }

.bubble-sender { font-size: 0.68rem; font-weight: bold; color: var(--dim); margin-bottom: 4px; letter-spacing: 0.5px; }
.bubble-text   { color: var(--text); }
.bubble-time   { font-size: 0.65rem; color: var(--dim); margin-top: 5px; text-align: right; }

.inbox-compose {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}

.inbox-textarea {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 8px 10px;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.inbox-textarea:focus { outline: none; border-color: var(--cyan); }

.inbox-send-btn {
  padding: 8px 16px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.inbox-send-btn:hover:not(:disabled) { opacity: 0.88; }
.inbox-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── MOBILE MINI BAR ──────────────────────────────────────────────────────────── */
.mobile-mini-bar {
  display: none; /* shown only on mobile via media query */
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  gap: 12px;
}
.mmb-left {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.mmb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.mmb-info { flex: 1; min-width: 0; }
.mmb-name {
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mmb-xp-bar-wrap {
  height: 4px; background: var(--bg3); border-radius: 2px; margin-top: 4px;
}
.mmb-xp-bar {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--purple), #a78bfa);
  transition: width 0.4s ease;
}
.mmb-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.mmb-level {
  font-size: 0.72rem; font-weight: 700; color: var(--purple);
  background: #7c3aed18; border: 1px solid #7c3aed44;
  border-radius: 6px; padding: 2px 8px;
}
.mmb-inbox-btn {
  background: none; border: none; font-size: 1.1rem;
  cursor: pointer; padding: 4px; position: relative;
}

/* Profile tab hidden on desktop */
.qp-tab-profile { display: none; }
.mobile-profile-tab { padding: 8px 0; display: flex; flex-direction: column; gap: 14px; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hide full player panel, show mini bar + profile tab instead */
  .player-panel { display: none !important; }
  .qp-tab-profile { display: inline-flex; }
  .mobile-mini-bar { display: flex; }

  .app-body { flex-direction: column; }
  .quest-panel { padding: 16px; }
  .quests-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .quests-grid { grid-template-columns: 1fr; }
}

/* ── GRADUATION CELEBRATION ───────────────────────────────────────── */
.grad-celebration-box {
  position: relative;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--gold);
  box-shadow: 0 0 60px #f59e0b33, 0 0 120px #7c3aed22;
  animation: gradGlow 2s ease-in-out infinite alternate;
}
@keyframes gradGlow {
  from { box-shadow: 0 0 40px #f59e0b22, 0 0 80px #7c3aed11; }
  to   { box-shadow: 0 0 80px #f59e0b55, 0 0 140px #7c3aed33; }
}

.grad-confetti {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  opacity: 0.9;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(420px) rotate(720deg); opacity: 0; }
}

.grad-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
  position: relative;
}
.grad-congrats {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.grad-stage-done {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 10px;
}
.grad-message {
  font-size: 0.88rem;
  color: var(--dim);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.grad-next-stage {
  background: #12121f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}
.grad-next-label {
  font-size: 0.8rem;
  color: var(--dim);
  margin-bottom: 4px;
}
.grad-next-label strong { color: var(--cyan); font-size: 0.95rem; }
.grad-next-goal {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
}
.grad-next-quests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.grad-next-quest-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  color: var(--dim);
}

.grad-cta-btn {
  width: 100%;
  font-size: 1rem;
  padding: 14px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #000;
  font-weight: 700;
  border: none;
  margin-bottom: 10px;
}
.grad-cta-btn:hover { opacity: 0.9; }

.grad-inbox-hint {
  font-size: 0.75rem;
  color: var(--dim);
}

/* ── SUBMIT WARNING ────────────────────────────────────────────────────────── */
.modal-warning {
  background: #f59e0b11;
  border: 1px solid #f59e0b44;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #f59e0b;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ── NOTIFICATION BELL (player header) ─────────────────────────────────────── */
.notif-bell-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f59e0b18;
  border: 1px solid #f59e0b55;
  border-radius: 20px;
  padding: 7px 14px;
  color: var(--gold);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s;
  animation: bellPulse 2s ease-in-out infinite;
}
.notif-bell-btn:hover { background: #f59e0b28; }
.notif-bell-count {
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
@keyframes bellPulse {
  0%, 100% { box-shadow: 0 0 0 0 #f59e0b33; }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

/* ── AVATAR NOTIFICATION BADGE ──────────────────────────────────────────────── */
.avatar-wrap {
  position: relative;
  display: inline-block;
}
.avatar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  border: 2px solid var(--bg2);
  cursor: pointer;
  line-height: 1.4;
}

.avatar-inbox-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #06b6d408;
  border: 1px solid #06b6d433;
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--cyan);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.avatar-inbox-btn:hover { background: #06b6d420; }
.inbox-red-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.4;
}

/* ── ACCOUNT BUTTON ──────────────────────────────────────────────────────────── */
.panel-account-btn {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-align: center;
}
.panel-account-btn:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── MY ACCOUNT MODAL ───────────────────────────────────────────────────────── */
.acct-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--dim);
  font-weight: bold;
  margin-bottom: 8px;
}
.acct-avatar-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.acct-class-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 64px;
  transition: border-color 0.2s, background 0.2s;
}
.acct-class-btn:hover { border-color: var(--cls-color, var(--cyan)); background: #ffffff08; }
.acct-class-btn.selected { border-color: var(--cls-color, var(--cyan)); background: #ffffff10; }
.acct-class-emoji { font-size: 1.6rem; }
.acct-class-name  { font-size: 0.68rem; color: var(--dim); }
.acct-class-btn.selected .acct-class-name { color: var(--text); }

.acct-divider {
  text-align: center;
  font-size: 0.72rem;
  color: var(--dim);
  margin: 0 0 12px;
}
.acct-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  overflow: hidden;
}
.acct-upload-btn {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: block;
  margin-bottom: 6px;
}
.acct-upload-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.acct-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 0;
}

/* ── ONBOARDING ─────────────────────────────────────────────────────────────── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.ob-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px 24px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 80px #7c3aed22, 0 20px 60px rgba(0,0,0,0.6);
  animation: obSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes obSlideIn {
  from { opacity:0; transform: translateY(24px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.ob-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
}
.ob-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}
.ob-dot.active { background: var(--purple); transform: scale(1.3); }
.ob-dot.done   { background: var(--cyan); }

.ob-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  line-height: 1;
}
.ob-avatar-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 16px;
  box-shadow: 0 0 28px #7c3aed55;
  overflow: hidden;
}

.ob-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.ob-body {
  font-size: 0.9rem;
  color: var(--dim);
  line-height: 1.7;
  margin-bottom: 20px;
}
.ob-body strong { color: var(--text); }

/* ── Onboarding visuals ── */
.ob-visual {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}
.ob-vis-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.84rem;
  color: var(--dim);
}
.ob-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
  color: var(--dim);
}
.ob-check.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: bold;
}
.ob-vis-label { flex: 1; }
.ob-vis-arrow { text-align: center; color: var(--dim); margin: 4px 0; font-size: 1.1rem; }
.ob-vis-reward {
  text-align: center;
  font-size: 0.84rem;
  color: var(--gold);
  padding: 8px 0 2px;
}
.ob-vis-reward strong { color: var(--gold); }

.ob-stages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}
.ob-stage-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  border: 1px solid var(--border);
  color: var(--dim);
}
.ob-stage-chip.done   { border-color: var(--green); color: var(--green); background: #10b98110; }
.ob-stage-chip.review { border-color: var(--gold);  color: var(--gold);  background: #f59e0b10; }
.ob-stage-chip.locked { border-color: var(--border); color: var(--dim); }
.ob-stage-arrow { color: var(--dim); font-size: 1rem; }

.ob-messages { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.ob-msg { max-width: 85%; padding: 8px 12px; border-radius: 10px; font-size: 0.8rem; line-height: 1.4; }
.ob-msg-sender { font-size: 0.65rem; font-weight: bold; color: #64748b; margin-bottom: 3px; }
.ob-msg-text { color: var(--text); }
.from-admin-demo { align-self: flex-start; background: #06b6d415; border: 1px solid #06b6d433; border-bottom-left-radius: 3px; }
.from-player-demo { align-self: flex-end; background: #7c3aed18; border: 1px solid #7c3aed44; border-bottom-right-radius: 3px; }

/* ── Onboarding buttons ── */
.ob-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.ob-btn-back {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 0.88rem;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ob-btn-back:hover { border-color: #555; color: var(--text); }

.ob-btn-next {
  flex: 1;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: bold;
  padding: 11px 24px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.ob-btn-next:hover { opacity: 0.88; }

.ob-btn-go {
  flex: 1;
  background: linear-gradient(135deg, var(--gold), #d97706);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 1rem;
  font-weight: 800;
  padding: 13px 28px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.2s;
}
.ob-btn-go:hover { opacity: 0.9; }

.ob-skip {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}
.ob-skip:hover { color: var(--text); }

/* ── Recruit form ── */
.ob-recruit-form { text-align: left; margin-bottom: 16px; }
.ob-field { margin-bottom: 12px; }
.ob-field-row { display: flex; gap: 10px; }
.ob-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dim);
  margin-bottom: 5px;
}
.ob-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  padding: 9px 12px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.ob-input:focus { outline: none; border-color: var(--purple); }
.ob-input-error { border-color: #ef4444 !important; }
.ob-textarea { resize: none; line-height: 1.5; }

.ob-recruit-quest-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f59e0b10;
  border: 1px solid #f59e0b44;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  color: var(--gold);
  margin-top: 4px;
}
.ob-recruit-quest-badge strong { color: var(--gold); }

.ob-btn-hire {
  flex: 1;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 13px 20px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.2s;
}
.ob-btn-hire:hover { opacity: 0.88; }

/* ── Hired success flash ── */
.ob-hired-flash {
  text-align: center;
  padding: 16px 0 8px;
  animation: obSlideIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.ob-hired-check {
  font-size: 3.5rem;
  margin-bottom: 10px;
  animation: obPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes obPop {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.ob-hired-title { font-size: 1.4rem; font-weight: 800; color: var(--green); margin-bottom: 8px; }
.ob-hired-quest { font-size: 0.85rem; color: var(--dim); margin-bottom: 10px; }
.ob-hired-xp {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 10px;
  animation: obPop 0.5s 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}
.ob-hired-role {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.85rem;
  color: var(--cyan);
  font-weight: bold;
}

/* ── BETA FEEDBACK (remove after pilot) ─────────────────────────────────────── */
.beta-feedback-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px #7c3aed44;
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.5px;
}
.beta-feedback-btn:hover { opacity: 0.88; transform: translateY(-2px); }
/* ── END BETA FEEDBACK ───────────────────────────────────────────────────────── */

/* ── UI TOUR ──────────────────────────────────────────────────────────────────── */
#tourOverlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}
.tour-hl {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  pointer-events: none;
  z-index: 1001;
  transition: all 0.25s ease;
}

/* Blur app content during onboarding */
#app.ob-blurred { filter: blur(4px); pointer-events: none; user-select: none; }
.tour-tt {
  position: fixed;
  z-index: 1002;
  background: var(--bg3);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  pointer-events: auto;
}
.tour-step-num {
  font-size: 0.75rem;
  color: var(--dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tour-tt-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}
.tour-tt-body {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 16px;
}
.tour-tt-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.tour-skip-btn {
  background: transparent;
  border: 1px solid var(--dim);
  color: var(--dim);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.82rem;
}
.tour-next-btn {
  background: var(--gold);
  border: none;
  color: #000;
  border-radius: 6px;
  padding: 6px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}
.tour-next-btn:hover { opacity: 0.9; }

/* ── RECRUITING FOCUS MODE ──────────────────────────────────────────────────── */
.quest-start-badge {
  background: linear-gradient(135deg, var(--gold), #f97316);
  color: #000;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 6px 6px 0 0;
  margin: -1px -1px 12px -1px;
  text-align: center;
}
.quest-focus-spotlight {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.25), 0 4px 24px rgba(245,158,11,0.15);
}
.quests-focus-locked {
  grid-column: 1 / -1;
  text-align: center;
  padding: 18px;
  color: var(--dim);
  font-size: 0.88rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-top: 8px;
}
.focus-lock-icon { font-size: 1.1rem; margin-right: 6px; }

/* Recommended next badge on Product card */
.quest-recommended-badge {
  background: linear-gradient(135deg, #1e3a5f, #1e4a3a);
  border: 1px solid #3b82f6;
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px 4px 0 0;
  text-align: center;
}
.quest-recommended {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.2), 0 4px 16px rgba(59,130,246,0.1);
}

/* Quest unlock toast */
.quest-unlock-toast {
  background: linear-gradient(135deg, #1a2a1a, #1e2e1e);
  border: 1px solid #22c55e;
  border-radius: 10px;
  color: #86efac;
  font-size: 0.88rem;
  padding: 12px 18px;
  margin-bottom: 16px;
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.quest-unlock-toast.toast-visible {
  opacity: 1;
  transform: translateY(0);
}
.quest-unlock-toast strong { color: #fff; }

/* ob-hired-unlock line */
.ob-hired-unlock {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #86efac;
  font-weight: 600;
  letter-spacing: 0.3px;
}
/* ── END UI TOUR ─────────────────────────────────────────────────────────────── */

/* ── WAR ROOM ────────────────────────────────────────────────────────────────── */
.wr-container { padding: 4px 0 16px; }
.wr-header { margin-bottom: 16px; }
.wr-title { font-size: 1.1rem; font-weight: 700; color: var(--gold); letter-spacing: 1px; }
.wr-subtitle { font-size: 0.8rem; color: var(--dim); margin-top: 2px; }
.wr-section-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--dim); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.wr-autosave-label { font-size: 0.7rem; color: #22c55e; letter-spacing: 0; text-transform: none; }
.wr-quest-list { display: flex; flex-direction: column; gap: 6px; }
.wr-quest-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; background: var(--bg2);
  border: 1px solid var(--border); border-left: 3px solid var(--area-color, #888);
  border-radius: 8px; transition: opacity 0.2s;
}
.wr-quest-done { opacity: 0.55; }
.wr-quest-icon { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.wr-quest-body { flex: 1; min-width: 0; }
.wr-quest-area { font-size: 0.75rem; font-weight: 700; color: var(--area-color, #888); text-transform: uppercase; letter-spacing: 0.5px; }
.wr-done-badge { color: #22c55e; font-weight: 700; }
.wr-quest-action { font-size: 0.8rem; color: #ccc; margin: 2px 0 4px; }
.wr-quest-note { font-size: 0.78rem; color: #94a3b8; font-style: italic; line-height: 1.4; white-space: pre-wrap; }
.wr-note-empty { color: #3f4a5a; }
.wr-empty { color: var(--dim); font-size: 0.85rem; padding: 12px 0; }
.wr-scratchpad {
  width: 100%; min-height: 140px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 8px;
  color: #ccc; font-size: 0.85rem; font-family: inherit;
  line-height: 1.6; padding: 12px 14px; resize: vertical; outline: none;
  transition: border-color 0.2s;
}
.wr-scratchpad:focus { border-color: var(--gold); }
.wr-scratchpad::placeholder { color: #3f4a5a; }
/* ── END WAR ROOM ────────────────────────────────────────────────────────────── */

/* ── HELP CENTER ─────────────────────────────────────────────────────────────── */
.hc-quest-list { display: flex; flex-direction: column; gap: 6px; }
.hc-quest-item {
  border: 1px solid var(--border); border-left: 3px solid var(--area-color, #888);
  border-radius: 8px; background: var(--bg2); overflow: hidden; transition: border-color 0.2s;
}
.hc-quest-item.hc-open { border-color: var(--area-color, #888); }
.hc-quest-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; cursor: pointer;
}
.hc-quest-header:hover { background: rgba(255,255,255,0.03); }
.hc-quest-icon { font-size: 1.1rem; flex-shrink: 0; }
.hc-quest-info { flex: 1; min-width: 0; }
.hc-quest-area { font-size: 0.72rem; font-weight: 700; color: var(--area-color, #888); text-transform: uppercase; letter-spacing: 0.5px; }
.hc-quest-action { font-size: 0.82rem; color: #ccc; margin-top: 1px; }
.hc-chevron { font-size: 0.65rem; color: var(--dim); flex-shrink: 0; }
.hc-detail { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.hc-coming-soon { color: var(--dim); font-size: 0.83rem; font-style: italic; }
.hc-why-label, .hc-steps-label, .hc-example-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--dim); margin: 14px 0 6px;
}
.hc-why { font-size: 0.84rem; color: #c8d4e0; line-height: 1.6; }
.hc-step {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.hc-step:last-child { border-bottom: none; }
.hc-step-num {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--area-color, #888); color: #000;
  font-size: 0.7rem; font-weight: 700; display: flex;
  align-items: center; justify-content: center; margin-top: 1px;
}
.hc-step-body { flex: 1; }
.hc-step-task { font-size: 0.8rem; font-weight: 600; color: #ddd; margin-bottom: 3px; }
.hc-step-tip { font-size: 0.79rem; color: #94a3b8; line-height: 1.55; }
.hc-example {
  font-size: 0.82rem; color: #86efac; line-height: 1.6;
  background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.15);
  border-radius: 6px; padding: 10px 12px; font-style: italic;
}
.hc-prev-stage {
  margin-top: 16px; border-top: 1px solid var(--border); padding-top: 8px;
}
.hc-prev-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 6px; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 600; color: var(--dim);
  transition: background 0.15s;
}
.hc-prev-header:hover { background: rgba(255,255,255,0.06); color: #ccc; }
.hc-prev-list { margin-top: 8px; }
/* ── END HELP CENTER ─────────────────────────────────────────────────────────── */

.quest-help-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 0 2px; opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
  line-height: 1; flex-shrink: 0; margin-left: auto;
}
.quest-help-btn:hover { opacity: 1; transform: scale(1.2); }
