/* Creator HQ dashboard styles — complements style.css variables. */
body.hq { background: linear-gradient(180deg, #0a0f22, #05070f 300px); }
.hq-wrap { width: min(1180px, 100% - 28px); margin: 0 auto; padding-bottom: 60px; }

/* login */
.login-box { max-width: 420px; margin: 9vh auto 0; text-align: center; padding: 34px 28px; }
.login-box .logo { font-size: 3rem; }
.login-box h1 { font-size: 1.5rem; margin: 8px 0 4px; }
.login-box p { color: var(--muted); margin-bottom: 18px; }
.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: rgba(7, 12, 26, 0.9);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(56,182,255,.55); border-color: var(--blue); }
.err { color: #ff7d92; min-height: 1.4em; font-weight: 600; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn.danger { background: linear-gradient(90deg, #b91c3f, #7c2d4e); }
.btn.small { padding: 6px 14px; font-size: 0.88rem; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* layout */
.hq-top { display: flex; align-items: center; gap: 14px; padding: 16px 0 6px; flex-wrap: wrap; }
.hq-top .logo { font-size: 2rem; }
.hq-top .who { color: var(--muted); font-weight: 600; }
.hq-top .who b { color: var(--text); }
.hq-top .spacer { flex: 1; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px; }
.tab {
  font: inherit; font-weight: 700; cursor: pointer; color: var(--muted);
  background: rgba(13, 21, 38, 0.85); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
}
.tab.on { color: #fff; background: linear-gradient(90deg, var(--blue2), var(--purple2)); border-color: rgba(140,190,255,.7); }
.tab .badge { background: #ff5470; color: #fff; border-radius: 999px; font-size: 0.72rem; padding: 1px 7px; margin-left: 6px; }

/* HQ navigation: full sticky pill bar on desktop, one compact
   collapsible menu on mobile. Scoped to #tabs (the main nav) so the
   Content Manager kind tabs keep their own layout. */
.nav-toggle { display: none; }
@media (min-width: 761px) {
  #tabs { position: sticky; top: 0; z-index: 40; padding: 10px 0; margin-top: 2px; background: rgba(5, 7, 15, 0.88); backdrop-filter: blur(10px); }
}
@media (max-width: 760px) {
  .nav-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
    font: inherit; font-weight: 800; font-size: 1rem; color: var(--text); cursor: pointer;
    background: linear-gradient(90deg, rgba(47, 123, 255, 0.28), rgba(124, 58, 237, 0.28));
    border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 12px 0 14px;
  }
  .nav-toggle .nav-toggle-chev { color: var(--muted); transition: transform 0.2s ease; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-chev { transform: rotate(180deg); }
  #tabs { display: none; }
  #tabs.open {
    display: flex; flex-direction: column; flex-wrap: nowrap; gap: 6px;
    margin: 0 0 18px; padding: 10px; background: rgba(9, 14, 30, 0.95);
    border: 1px solid var(--line); border-radius: 14px; animation: fadeUp 0.25s ease both;
  }
  #tabs.open .tab { width: 100%; text-align: left; border-radius: 10px; padding: 11px 14px; }
}
.view { display: none; }
.view.on { display: block; animation: fadeUp .35s ease both; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.panel h3.ptitle { font-size: 1.08rem; margin-bottom: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; gap: 10px; align-items: flex-start; background: rgba(9, 14, 30, 0.75);
  border: 1px solid rgba(96, 140, 255, 0.22); border-radius: 12px; padding: 12px 14px;
}
.row .grow { flex: 1; min-width: 0; }
.row .ttl { font-weight: 700; }
.row .sub { color: var(--muted); font-size: 0.88rem; white-space: pre-wrap; word-break: break-word; }
.row .acts { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
.icon-btn {
  font: inherit; cursor: pointer; background: rgba(20, 30, 60, 0.9); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 0.85rem; font-weight: 600;
}
.icon-btn:hover { border-color: var(--blue); }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--blue); }
.pill.pending { color: #ffd94d; border-color: rgba(255, 217, 77, 0.5); }
.pill.approved { color: #3ddc84; border-color: rgba(61, 220, 132, 0.5); }
.pill.rejected { color: #ff7d92; border-color: rgba(255, 84, 112, 0.5); }
.empty-note { color: var(--muted); text-align: center; padding: 18px 8px; }

/* XP / achievements */
.xp-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.xp-num { font-size: 2rem; font-weight: 900; }
.xp-bar { height: 14px; border-radius: 999px; background: rgba(7,12,26,.9); border: 1px solid var(--line); overflow: hidden; margin-top: 10px; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple)); box-shadow: 0 0 12px rgba(168,85,247,.7); transition: width .5s ease; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.badge-card { text-align: center; padding: 16px 10px; border-radius: 14px; border: 1px solid rgba(96,140,255,.22); background: rgba(9,14,30,.75); }
.badge-card .bi { font-size: 1.9rem; filter: grayscale(1); opacity: 0.35; }
.badge-card.got .bi { filter: none; opacity: 1; }
.badge-card.got { border-color: rgba(255, 217, 77, 0.55); box-shadow: 0 0 14px rgba(255,217,77,.18); }
.badge-card.locked { background: rgba(6, 9, 20, 0.65); border-style: dashed; }
.badge-card.locked h4 { color: var(--muted); }
.badge-card h4 { font-size: 0.95rem; margin: 6px 0 2px; }
.badge-card p { color: var(--muted); font-size: 0.8rem; }
.badge-card .xpv { color: var(--purple); font-weight: 800; font-size: 0.8rem; }
.badge-card .bstatus { margin-top: 8px; font-size: 0.7rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.badge-card.got .bstatus { color: #3ddc84; }
.badge-card.just-unlocked { animation: unlockPop 0.9s ease both; }
@keyframes unlockPop {
  0% { transform: scale(0.82); box-shadow: 0 0 0 rgba(255, 217, 77, 0); }
  45% { transform: scale(1.07); box-shadow: 0 0 34px rgba(255, 217, 77, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 14px rgba(255, 217, 77, 0.18); }
}
@media (max-width: 760px) {
  .badge-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .badge-card { padding: 12px 8px; }
  .badge-card .bi { font-size: 1.5rem; }
  .badge-card h4 { font-size: 0.85rem; }
  .badge-card p { font-size: 0.72rem; }
}

/* Your Next Mission card */
.mission-card { margin-bottom: 16px; border-color: rgba(255, 217, 77, 0.5); background: linear-gradient(150deg, rgba(58, 44, 10, 0.5), rgba(10, 15, 34, 0.94)); box-shadow: 0 0 24px rgba(255, 217, 77, 0.12); }
.mission-kicker { color: #ffd94d; font-weight: 800; letter-spacing: 2px; font-size: 0.74rem; }
.mission-card h3 { font-size: 1.4rem; margin: 5px 0 6px; }
.mission-card p { color: var(--muted); max-width: 640px; }
.mission-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.mission-xp { color: #ffd94d; font-weight: 900; font-size: 1.02rem; }
.mission-btn { margin-left: auto; font-size: 1rem; padding: 11px 24px; }
.mission-prog { margin-top: 14px; }
.mission-prog-label { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.mission-done { border-color: rgba(61, 220, 132, 0.55); background: linear-gradient(150deg, rgba(14, 58, 34, 0.5), rgba(10, 15, 34, 0.94)); box-shadow: 0 0 24px rgba(61, 220, 132, 0.15); }
.mission-done .mission-kicker { color: #3ddc84; }
@media (max-width: 560px) { .mission-btn { margin-left: 0; width: 100%; } }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal-head h3 { flex: 1; text-align: center; font-size: 1.15rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; padding: 4px 0; }
.cal-day { min-height: 74px; border: 1px solid rgba(96,140,255,.2); border-radius: 10px; padding: 5px 6px; cursor: pointer; background: rgba(9,14,30,.6); overflow: hidden; }
.cal-day:hover { border-color: var(--blue); }
.cal-day.dim { opacity: 0.35; }
.cal-day.today { border-color: var(--purple); box-shadow: 0 0 10px rgba(168,85,247,.35); }
.cal-day .dn { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.cal-ev { font-size: 0.7rem; font-weight: 700; border-radius: 6px; padding: 1px 5px; margin-top: 3px; background: rgba(47,123,255,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.done { background: rgba(61,220,132,.3); text-decoration: line-through; }
.cal-ev.recording { background: rgba(255,84,112,.35); }
.cal-ev.editing { background: rgba(168,85,247,.4); }
.cal-ev.release { background: rgba(255,217,77,.3); }
@media (max-width: 560px) { .cal-day { min-height: 56px; } .cal-ev { font-size: 0.6rem; } }

/* checklist */
.check-item { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid rgba(96,140,255,.14); }
.check-item input { width: 20px; height: 20px; accent-color: var(--purple2); }
.check-item.done span { color: var(--muted); text-decoration: line-through; }

/* academy */
.lesson-body { color: var(--muted); }
.lesson-body p { margin-bottom: 10px; }
.lesson-body ul { margin: 0 0 10px 20px; }
.lesson-body li { margin-bottom: 4px; }

/* thumbnail lab */
.thumb-canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #000; touch-action: none; cursor: grab; }
.tl-lines { display: flex; flex-direction: column; gap: 10px; }
.tl-line { border: 1px solid rgba(96,140,255,.25); border-radius: 10px; padding: 10px; }
.tl-line .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-line input[type="color"] { padding: 2px; height: 40px; }

/* My Profile editor (Behind the Controller) */
.chips-edit { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip-edit {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px;
  border-radius: 999px; background: rgba(10, 16, 36, 0.85); border: 1px solid var(--line);
  font-weight: 700; font-size: 0.9rem;
}
.chip-edit button {
  font: inherit; cursor: pointer; background: rgba(20, 30, 60, 0.9); color: var(--text);
  border: 1px solid var(--line); border-radius: 50%; width: 22px; height: 22px;
  line-height: 1; font-size: 0.7rem; padding: 0;
}
.chip-edit button:hover { border-color: #ff5470; }
.pfp-addrow { display: flex; gap: 8px; }
.pfp-input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: rgba(7, 12, 26, 0.9);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.pfp-input:focus { outline: 2px solid rgba(56,182,255,.55); border-color: var(--blue); }
.pfp-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pfp-photo { border: 1px solid rgba(96,140,255,.25); border-radius: 12px; overflow: hidden; background: rgba(9,14,30,.75); }
.pfp-photo.feat { border-color: rgba(255, 217, 77, 0.6); box-shadow: 0 0 12px rgba(255,217,77,.2); }
.pfp-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.pfp-photo-acts { display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; align-items: center; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(3, 5, 12, 0.82); display: none; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.modal-back.on { display: flex; }
.modal {
  max-width: 520px; width: 100%; text-align: center; padding: 38px 30px;
  background: linear-gradient(165deg, #16224a, #0a0f22); border: 1px solid rgba(140,190,255,.6);
  border-radius: 22px; box-shadow: var(--glow); animation: fadeUp .4s ease both;
}
.modal .unlock { letter-spacing: 4px; font-weight: 900; font-size: clamp(1.3rem, 6vw, 1.9rem); font-style: italic; }
/* Achievement unlock celebration: the modal pops in with a spring and
   the trophy bounces, on top of the existing toast. */
.modal-back.on .modal { animation: achPop 0.45s cubic-bezier(0.2, 1.5, 0.35, 1) both; }
#ach-modal.on #ach-icon { display: inline-block; animation: achBounce 0.9s ease 0.3s both; }
@keyframes achPop {
  from { transform: scale(0.72) translateY(18px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes achBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.35) rotate(-8deg); }
  60% { transform: scale(1.12) rotate(6deg); }
}
.modal .lines { color: var(--muted); margin: 16px 0 22px; line-height: 1.8; }
.modal .lines b { color: var(--text); }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: linear-gradient(120deg, #1b2a55, #2a1650); border: 1px solid rgba(255,217,77,.6);
  border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  display: flex; gap: 12px; align-items: center; animation: fadeUp .3s ease both; max-width: 320px;
}
.toast .bi { font-size: 1.7rem; }
.toast b { display: block; }
.toast span { color: var(--muted); font-size: 0.85rem; }
