/*
The level sheet (system/box/level_status.php): the level on a solid violet hexagon with a dark
edge, a solid bar (objects get solid KTC colours, not the gradient), the XP to the next level, and
for your own: the closest badge and where XP comes from today.
*/
html .ktc_lv { padding: 8px 20px 20px; color: var(--kt-ink); }
html .ktc_lv_head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
html .ktc_lv_hex {
	flex: none; width: 60px; height: 60px; display: grid; place-items: center; position: relative; isolation: isolate;
	background: var(--kt-edge); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
	color: #fff; font: 700 24px/1 'KTC', 'Outfit', sans-serif;
}
html .ktc_lv_hex::before {
	content: ''; position: absolute; inset: 4px; z-index: -1; background: var(--kt-violet);
	clip-path: inherit; box-shadow: inset 3px 4px 0 rgba(255, 255, 255, .25);
}
html .ktc_lv_title { font: 700 28px/1.1 'KTC', 'Outfit', sans-serif; }
html .ktc_lv_who { color: var(--kt-faint); font-size: 14px; }
html .ktc_lv_bar { height: 14px; border-radius: 7px; background: var(--kt-wash); border: 2px solid var(--kt-edge); overflow: hidden; }
html .ktc_lv_bar span { display: block; height: 100%; min-width: 4px; background: var(--kt-cyan); border-radius: 5px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .3); }
html .ktc_lv_line { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--kt-faint); }
html .ktc_lv_to { color: var(--kt-ink); font-weight: 600; }
html .ktc_lv_section { margin: 20px 0 8px; font-size: 13px; font-weight: 700; color: var(--kt-faint); text-transform: uppercase; letter-spacing: .05em; }
html .ktc_lv_badge { display: flex; align-items: center; gap: 12px; }
html .ktc_lv_badge img { width: 52px; height: 52px; flex: none; }
html .ktc_lv_badge_text { flex: 1; min-width: 0; }
html .ktc_lv_badge_name { font-weight: 700; }
html .ktc_lv_small_bar { height: 8px; border-radius: 4px; background: var(--kt-wash); margin: 6px 0 4px; overflow: hidden; }
html .ktc_lv_small_bar span { display: block; height: 100%; background: var(--kt-up); border-radius: 4px; }
html .ktc_lv_muted { color: var(--kt-muted); font-size: 13px; }

/*
The level ring on your own avatar (js/ktc/ktc_level.js): the header and the phone's Me tab sit on the
KTC gradient, so the arc is white on a dark track there. The ring keeps a gap round the avatar; the
level is a small violet pill placed where nothing else is (top right in the header, opposite the
status dot; centred under the ring on the Me tab, the tab's dot moved to the ring's top right).
*/
.ktc_ringed { position: relative; }
.ktc_ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.ktc_ring svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ktc_ring circle { fill: none; stroke-width: 3; }
.ktc_ring_track { stroke: rgba(20, 6, 31, .45); }
.ktc_ring_arc { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.16, 1, .3, 1); }
.ktc_ring_arc.no_ease { transition: none; }
.ktc_ring_lv {
	position: absolute; min-width: 18px; height: 16px; padding: 0 4px; box-sizing: border-box;
	display: grid; place-items: center; background: var(--kt-violet); color: #fff;
	border: 2px solid var(--kt-edge); border-radius: 8px;
	font: 700 10px/1 'KTC', 'Outfit', sans-serif; white-space: nowrap;
}
/* desktop header (50px tall): a 28px avatar in a 38px ring; the status dot keeps its own place at the
bottom left, the level sits at the ring's top right */
#main_mob_menu.ktc_ringed .avatar_menu { width: 28px; height: 28px; box-shadow: none; }
#main_mob_menu.ktc_ringed .ktc_ring { width: 38px; height: 38px; }
#main_mob_menu.ktc_ringed .ktc_ring_lv { top: -4px; right: -8px; }
/* the ring breaks round the status dot (12px, its centre 6px in and 30px down the ring's box), so
the dot keeps its own place and nothing runs under it */
#main_mob_menu.ktc_ringed .ktc_ring svg {
	-webkit-mask: radial-gradient(circle at 6px 30px, transparent 8.5px, #000 9px);
	mask: radial-gradient(circle at 6px 30px, transparent 8.5px, #000 9px);
}
/* the phone's Me tab: the ring is the icon's box, so it takes its room in the bar; your 18px avatar
sits in it, the level on the ring's bottom edge, the tab's dot outside at the top right */
.ktc_tab_av { position: relative; width: 28px; height: 28px; display: block; margin: 0 0 5px; flex: none; }
.ktc_tab_av img { position: absolute; left: 5px; top: 5px; width: 18px; height: 18px; border-radius: 50%; display: block; }
.ktc_tab_av .ktc_ring { width: 28px; height: 28px; }
.ktc_tab_av .ktc_ring circle { stroke-width: 3.5; }
.ktc_tab_av .ktc_ring_lv { left: 50%; bottom: -5px; transform: translateX(-50%); height: 13px; min-width: 15px; padding: 0 3px; font-size: 9px; border-width: 1.5px; border-radius: 7px; }
#my_menu .ktc_tab.ktc_ringed { opacity: 1; gap: 1px; }
#my_menu .ktc_tab.ktc_ringed .ktc_tab_dot { top: 0; left: calc(50% + 14px); }
/* "+N XP" rising off the avatar, kept on screen: up from the Me tab, down from the header */
.ktc_xp_pop {
	position: absolute; right: 0; white-space: nowrap; pointer-events: none; z-index: 2;
	font: 700 13px/1 'KTC', 'Outfit', sans-serif; color: #fff; text-shadow: 0 2px 0 var(--kt-edge), 0 0 6px rgba(20, 6, 31, .6);
}
.ktc_tab .ktc_xp_pop { bottom: 100%; animation: ktcXpUp 1.2s cubic-bezier(.16, 1, .3, 1) forwards; }
#main_mob_menu .ktc_xp_pop { top: 100%; animation: ktcXpDown 1.2s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes ktcXpUp { 0% { opacity: 0; transform: translateY(6px) scale(.85); } 20% { opacity: 1; transform: translateY(-4px) scale(1.05); } 100% { opacity: 0; transform: translateY(-22px); } }
@keyframes ktcXpDown { 0% { opacity: 0; transform: translateY(-6px) scale(.85); } 20% { opacity: 1; transform: translateY(4px) scale(1.05); } 100% { opacity: 0; transform: translateY(20px); } }
/* the Level row at the top of your menu */
#ktc_level_row .ktc_level_row_hex {
	display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto; background: var(--kt-violet); color: #fff;
	border: 2px solid var(--kt-edge); border-radius: 7px; font: 700 12px/1 'KTC', 'Outfit', sans-serif;
}
#ktc_level_row .ktc_level_row_title { font-weight: 600; }
#ktc_level_row .ktc_level_row_bar { height: 6px; border-radius: 3px; background: var(--kt-wash); margin-top: 6px; overflow: hidden; }
#ktc_level_row .ktc_level_row_bar span { display: block; height: 100%; background: var(--kt-cyan); border-radius: 3px; transition: width .6s cubic-bezier(.16, 1, .3, 1); }
@media (prefers-reduced-motion: reduce) {
	.ktc_ring_arc, #ktc_level_row .ktc_level_row_bar span { transition: none; }
}
