/* Mythica Console — the profile skinned into an instrument.
   Additive overlays only: fixed panels that slide in over the page. Nothing here
   reflows or hides the theme's own columns (the lesson of the profile-crush).
   Palette mirrors journey.css. */

:root {
	--mjc-gold: #e8c47a; --mjc-gold2: #f2d79a; --mjc-fg: #e6ebfb; --mjc-dim: #9fb0e6;
	--mjc-card: rgba(20,26,54,.68); --mjc-line: rgba(140,170,235,.16);
	--mjc-rail-line: rgba(232,196,122,.30); --mjc-w: 408px;
}

/* ===================== the two doors + handles ===================== */
.mj-door {
	position: fixed; z-index: 9994; cursor: pointer; border: 0; color: #0e0b16;
	background: linear-gradient(180deg, var(--mjc-gold2), #d8ad5c);
	box-shadow: -6px 4px 18px rgba(0,0,0,.4);
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.mj-door--weave { right: 0; top: 118px; width: 44px; height: 74px; border-radius: 12px 0 0 12px; }
.mj-door-ico { font-size: 18px; line-height: 1; }
.mj-door-lbl { writing-mode: vertical-rl; text-orientation: mixed; font-size: 9px;
	letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }

.mj-rail-open {
	display: grid; place-items: center; position: fixed; top: 46%; z-index: 9994;
	width: 40px; height: 56px; border: 0; cursor: pointer; color: #0e0b16;
	background: linear-gradient(180deg, var(--mjc-gold2), #d8ad5c); font-size: 17px;
}
.mj-rail-open--right { right: 0; border-radius: 12px 0 0 12px; box-shadow: -6px 4px 18px rgba(0,0,0,.4); }
.mj-rail-open--left  { left: 0;  border-radius: 0 12px 12px 0; box-shadow: 6px 4px 18px rgba(0,0,0,.4); top: 40%; }

.mj-pin {
	position: fixed; left: 12px; bottom: 84px; z-index: 9994; width: 34px; height: 34px; border-radius: 50%;
	cursor: pointer; font-size: 15px; color: var(--mjc-gold);
	border: 1px solid rgba(232,196,122,.4); background: rgba(12,16,36,.75);
}
.mj-pin[aria-pressed="true"] { color: #0e0b16; background: linear-gradient(180deg, var(--mjc-gold2), #d8ad5c); border-color: transparent; }

/* ===================== the scrim ===================== */
.mj-scrim {
	position: fixed; inset: 0; z-index: 9997; background: rgba(4,5,14,.5);
	-webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
	opacity: 0; pointer-events: none; transition: opacity .28s ease;
}
.mj-scrim.is-on { opacity: 1; pointer-events: auto; }

/* ===================== rails + weave: the shared panel skin ===================== */
.mj-rail, .mj-weave {
	position: fixed; top: 0; bottom: 0; width: var(--mjc-w); max-width: 92vw; z-index: 9999;
	display: flex; flex-direction: column; padding: 118px 12px 14px; /* clear the absolute header so nav/content don't collide with the title */
	background:
		radial-gradient(120% 40% at 50% 0%, rgba(42,36,86,.5) 0%, rgba(11,13,32,0) 60%),
		linear-gradient(180deg, rgba(11,13,32,.975), rgba(8,9,26,.985));
	-webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
	transition: transform .32s cubic-bezier(.22,.61,.36,1);
}
.mj-rail--right, .mj-weave { right: 0; border-left: 1px solid var(--mjc-rail-line);
	box-shadow: -20px 0 55px rgba(0,0,0,.5); transform: translateX(100%); }
.mj-rail--left { left: 0; border-right: 1px solid var(--mjc-rail-line);
	box-shadow: 20px 0 55px rgba(0,0,0,.5); transform: translateX(-100%); }
.mj-rail.is-open, .mj-weave.is-open { transform: none; }

.mj-rail-head { position: absolute; top: 52px; left: 0; right: 0; text-align: center; }
.mj-rail-ornament { color: var(--mjc-gold); font-size: 15px; opacity: .9; }
.mj-rail-title { margin: 3px 0 0; font-size: 20px; color: var(--mjc-gold);
	font-family: "Cormorant Garamond", Georgia, serif; }
.mj-rail-sub { margin: 2px 0 0; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mjc-dim); }
.mj-rail-inner { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
	scrollbar-width: thin; scrollbar-color: rgba(232,196,122,.35) transparent; }
.mj-rail-inner::-webkit-scrollbar { width: 7px; }
.mj-rail-inner::-webkit-scrollbar-thumb { background: rgba(232,196,122,.3); border-radius: 4px; }
.mj-rail-close {
	position: absolute; top: 16px; right: 14px; z-index: 3; width: 32px; height: 32px; border-radius: 50%;
	border: 1px solid rgba(232,196,122,.3); background: rgba(10,14,32,.7); color: #e6ddc4;
	font-size: 18px; line-height: 1; cursor: pointer;
}
.mj-rail--left .mj-rail-close { right: auto; left: 14px; }
.mj-rail-rule { height: 1px; margin: 14px 6px;
	background: linear-gradient(90deg, transparent, rgba(232,196,122,.4), transparent); }

/* ---- The Journey rail: the timeline COMPACTED (no full-panel bg) ---- */
.mj-rail--right .mythica-journey { max-width: none; margin: 0; padding: 4px 2px 24px;
	border-radius: 0; background: none !important; overflow: visible; }
.mj-rail--right .mythica-journey.has-bg::before, .mj-rail--right .mythica-journey.has-bg::after { display: none !important; }
.mj-rail--right .mj-timeline { padding-left: 26px; }
.mj-rail--right .mj-timeline::before { left: 7px; }
.mj-rail--right .mj-year { margin-left: -26px; padding-left: 26px; font-size: 18px; }
.mj-rail--right .mj-dot { left: -23px; width: 10px; height: 10px; }
.mj-rail--right .mj-card { padding: 10px 12px; }
.mj-rail--right .mj-media-item img { height: 62px; }
.mj-rail--right .mj-text { font-size: 13px; line-height: 1.5; }
.mj-rail--right .mj-person img { width: 26px; height: 26px; }

/* ===================== The Field rail content ===================== */
.mj-sig-label { font-size: 10px; letter-spacing: .13em; text-transform: uppercase;
	color: var(--mjc-dim); text-align: center; margin-bottom: 8px; }
.mj-sig-label--sp { margin-top: 14px; }
.mj-glyphs { color: var(--mjc-gold); display: flex; justify-content: center; }
.mj-starrow { display: flex; justify-content: center; gap: 8px; margin: 8px 0 2px; }
.mj-starrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--mjc-gold);
	box-shadow: 0 0 8px 2px rgba(232,196,122,.5); display: block; }
.mj-starrow i:nth-child(2) { opacity: .5; transform: translateY(6px); }
.mj-starrow i:nth-child(3) { opacity: .75; transform: translateY(-4px); }
.mj-starrow i:nth-child(4) { opacity: .4; transform: translateY(3px); }
.mj-starrow i:nth-child(5) { opacity: .85; }
.mj-bloom { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mj-ph { aspect-ratio: 1; border-radius: 12px; background-size: cover; background-position: center;
	border: 1px solid rgba(232,196,122,.18); }
.mj-ph--tall { grid-row: span 2; aspect-ratio: auto; }
.mj-field-foot { margin-top: 14px; text-align: center; font-size: 11px; color: var(--mjc-dim); }
.mj-field-empty { text-align: center; color: var(--mjc-dim); font-size: 13px; padding: 16px 8px; line-height: 1.6; }

/* ===================== the live-reading slot ===================== */
.mythica-reading { position: relative; display: flex; align-items: center; gap: 14px;
	border-radius: 14px; padding: 14px; border: 1px solid rgba(232,196,122,.28);
	background: radial-gradient(120% 140% at 12% 20%, #2a2450 0%, #0d0f26 70%); }
.mythica-reading__disc { width: 84px; height: 84px; border-radius: 50%; flex: none;
	background: conic-gradient(from 210deg, #e8c47a, #7d6bd6, #3aa38a, #e8c47a);
	-webkit-mask: radial-gradient(circle, transparent 27px, #000 28px);
	mask: radial-gradient(circle, transparent 27px, #000 28px);
	box-shadow: 0 0 24px rgba(232,196,122,.35); }
.mythica-reading__kick { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mjc-dim); }
.mythica-reading__title { margin: 3px 0 5px; font-size: 18px; color: var(--mjc-gold);
	font-family: "Cormorant Garamond", Georgia, serif; }
.mythica-reading__text p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mjc-fg); }

/* ===================== The Weave: social nav + faces ===================== */
.mj-weave-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.mj-weave-link { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 12px;
	color: var(--mjc-fg); text-decoration: none; border: 1px solid transparent; }
.mj-weave-link:hover { background: rgba(140,170,235,.08); border-color: rgba(232,196,122,.28); }
.mj-weave-ico { color: var(--mjc-gold); line-height: 0; display: inline-flex; }
.mj-weave-sub { margin: 18px 4px 8px; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--mjc-dim); }
.mj-weave-faces { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px; }
.mj-weave-face { line-height: 0; }
.mj-weave-face img { width: 40px; height: 40px; border-radius: 50%;
	border: 1px solid rgba(232,196,122,.4); display: block; }

/* ===================== PINNED: dock the rails into the gutters (wide only) =====
   Only where there's genuinely empty gutter beside a centred column — so we never
   overlap content. Below the threshold, pinned falls back to on-demand overlays. */
@media (min-width: 1600px) {
	body.mythica-console-pinned .mj-rail--left,
	body.mythica-console-pinned .mj-rail--right { transform: none; box-shadow: none;
		background: linear-gradient(180deg, rgba(11,13,32,.6), rgba(8,9,26,.72)); }
	body.mythica-console-pinned .mj-rail-open--left,
	body.mythica-console-pinned .mj-rail-open--right { display: none; }
}

/* ===================== BRANDED CHROME (additive colour only) =================
   Recolour a few BuddyBoss profile elements to the Mythica gold. Colour/border
   only — no layout, no display changes — so it can't crush anything. Selectors
   are broad but safe; live-tune per the active theme. */
body.mythica-console-brand .bb-profile-header .header-buttons a.button,
body.mythica-console-brand .bp-profile-buttons a.button,
body.mythica-console-brand #buddypress .generic-button a.button {
	border-color: rgba(232,196,122,.5) !important; color: var(--mjc-gold) !important;
}
body.mythica-console-brand #item-nav .item-list-tabs li.current a,
body.mythica-console-brand .bb-nav .current a,
body.mythica-console-brand #buddypress div.item-list-tabs ul li.selected a {
	color: var(--mjc-gold) !important; box-shadow: inset 0 -2px 0 var(--mjc-gold);
}

/* ============================================================================
   THE HUD v2 — the profile as a quest console, WRAPPED via BuddyPress action
   hooks (bp_before/after_member_home_content) rather than a template override —
   the native cover image, avatar upload, tabs and body render 100% untouched,
   in their original order, inside `.mythica-hud2__native`. We only ADD: a Field
   band (glyphs · aka · reading · quest) BAKED ABOVE the native content in one
   wide main column, and a Journey aside — the ONLY thing that folds in/out,
   from the container's right edge.
   ========================================================================== */
/* We now render INSIDE BuddyBoss's own `.bb-profile-grid` (forked template), so
   the native grid is the container: #item-body is the main column and our
   Journey aside is its sibling — exactly where #secondary would sit. */
.bb-profile-grid.mythica-hud-grid {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--mjc-journey-w, 380px);
	gap: 18px; align-items: start;
	transition: grid-template-columns .34s cubic-bezier(.22,.61,.36,1);
}
.bb-profile-grid.mythica-hud-grid > #item-body { min-width: 0; }
/* the theme's Recent-Posts sidebar steps aside on the profile — our Journey
   occupies that slot instead */
body.mythica-hud-active #secondary,
body.mythica-hud-active .bb-single-secondary,
body.mythica-hud-active .bb-sidebar-panel,
body.mythica-hud-active aside.widget-area,
body.mythica-hud-active .bs-sidebars {
	display: none !important;
}

/* the Field, BAKED IN as a horizontal band above the native profile (not a foldout) */
.mythica-hud2__field {
	display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px;
	padding: 15px 18px; margin-bottom: 4px; border-radius: 16px;
	background: rgba(12,15,34,.5);
	-webkit-backdrop-filter: blur(14px) saturate(1.12); backdrop-filter: blur(14px) saturate(1.12);
	border: 1px solid var(--mjc-rail-line);
	box-shadow: 0 18px 50px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}
.mythica-hud2__field .mj-sig-label { margin: 0; white-space: nowrap; }
.mythica-hud2__field .mj-sig-label--sp { margin-top: 0; }
.mythica-hud2__field .mj-glyphs, .mythica-hud2__field .mj-starrow { margin: 0; }
.mythica-hud2__field .mj-rail-rule { display: none; }
.mythica-hud2__field .mj-bloom { flex: 1 1 220px; display: flex; gap: 8px; overflow-x: auto; }
.mythica-hud2__field .mj-ph { width: 58px; height: 58px; flex: 0 0 auto; aspect-ratio: auto; }
.mythica-hud2__field .mj-ph--tall { width: 58px; height: 58px; }
.mythica-hud2__field .mj-field-foot { margin: 0; flex: 0 0 auto; white-space: nowrap; }

/* the quest strip: today's reading + the threshold meter, right under the Field band */
.mj-hud-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 12px; }
.mj-hud-card { background: var(--mjc-card); border: 1px solid var(--mjc-line); border-radius: 14px; padding: 12px 14px; }
.mj-quest-k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mjc-dim); }
.mj-quest-bar { height: 7px; border-radius: 5px; background: rgba(140,170,235,.18); margin-top: 9px; overflow: hidden; }
.mj-quest-bar span { display: block; height: 100%; background: linear-gradient(90deg, #d8ad5c, #f2d79a); }
.mj-quest-lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--mjc-fg); margin-top: 8px; }
.mj-quest-name { color: var(--mjc-gold); font-family: "Cormorant Garamond", Georgia, serif; font-size: 15px; }

/* the Journey aside — the ONLY foldout, from the container's right edge */
.mythica-hud2__journey {
	position: relative; min-width: 0; overflow: hidden;
	padding: 16px 14px 20px; border-radius: 16px;
	background: rgba(12,15,34,.5);
	-webkit-backdrop-filter: blur(14px) saturate(1.12); backdrop-filter: blur(14px) saturate(1.12);
	border: 1px solid var(--mjc-rail-line);
	box-shadow: 0 18px 50px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
	transition: opacity .28s ease, padding .28s ease;
}
.mythica-hud2 .mj-rail-head { position: static; top: auto; margin-bottom: 12px; }
.mythica-hud2 .mj-rail-head::before, .mythica-hud2 .mj-rail-head::after { display: none; }
.mythica-hud2 .mj-rail-inner { overflow: visible; }

/* the Journey timeline, compacted inside its column */
.mythica-hud2__journey .mythica-journey { max-width: none; margin: 0; padding: 4px 2px 10px; border-radius: 0; background: none !important; overflow: visible; }
.mythica-hud2__journey .mythica-journey.has-bg::before, .mythica-hud2__journey .mythica-journey.has-bg::after { display: none !important; }
.mythica-hud2__journey .mj-timeline { padding-left: 26px; }
.mythica-hud2__journey .mj-timeline::before { left: 7px; }
.mythica-hud2__journey .mj-year { margin-left: -26px; padding-left: 26px; font-size: 18px; }
.mythica-hud2__journey .mj-dot { left: -23px; width: 10px; height: 10px; }
.mythica-hud2__journey .mj-card { padding: 10px 12px; }
.mythica-hud2__journey .mj-media-item img { height: 62px; }
.mythica-hud2__journey .mj-text { font-size: 13px; line-height: 1.5; }
.mythica-hud2__journey .mj-person img { width: 26px; height: 26px; }

/* Journey defaults CLOSED, pops out from the grid's right edge */
.bb-profile-grid.mythica-hud-grid.is-journey-collapsed { --mjc-journey-w: 0px; }
.bb-profile-grid.mythica-hud-grid.is-journey-collapsed .mythica-hud2__journey {
	padding-left: 0; padding-right: 0; border-width: 0; opacity: 0;
}

/* the edge handle — anchored to the grid, and it must stay visible/clickable even
   when its parent aside is collapsed, so it sits outside the collapsed overflow */
.mythica-hud2__journey { overflow: visible; }
.mythica-hud__handle {
	position: absolute; top: 8px; right: 0; z-index: 6; width: 26px; height: 60px;
	display: grid; place-items: center; border: 0; cursor: pointer; color: #0e0b16;
	background: linear-gradient(180deg, var(--mjc-gold2), #d8ad5c);
	box-shadow: 0 6px 16px rgba(0,0,0,.4); font-size: 13px;
	border-radius: 8px 0 0 8px; opacity: 1;
}
.bb-profile-grid.mythica-hud-grid.is-journey-collapsed .mythica-hud2__journey .mythica-hud__handle {
	opacity: 1; /* the aside fades but its handle stays */
}

/* tablet+ keeps two columns; below, they stack and the handle retires */
@media (max-width: 1100px) {
	.bb-profile-grid.mythica-hud-grid { grid-template-columns: 1fr; }
	.mythica-hud__handle { display: none; }
	.bb-profile-grid.mythica-hud-grid.is-journey-collapsed { --mjc-journey-w: auto; }
	.bb-profile-grid.mythica-hud-grid.is-journey-collapsed .mythica-hud2__journey { padding: 16px 14px 20px; border-width: 1px; opacity: 1; }
	.mj-hud-strip { grid-template-columns: 1fr; }
	.mythica-hud2__field { flex-direction: column; align-items: flex-start; }
}

/* ===================== narrow screens ===================== */
@media (max-width: 640px) {
	.mj-rail, .mj-weave { width: 92vw; }
	.mj-door--weave { top: auto; bottom: 92px; }
}
