/* ==========================================================================
   QF GLASS / HUD LAYER
   Visual-only overrides for .panel: frosted glass, glow, corner brackets,
   scan sweep, animated data-lines. Loaded after main.css.
   ========================================================================== */

:root {
	--qf-cyan: 0, 161, 255;        /* #00A1FF */
	--qf-ice: 31, 217, 241;        /* #1fd9f1 */
	--qf-glass-top: rgba(8, 36, 70, 0.38);
	--qf-glass-bot: rgba(2, 12, 30, 0.52);
	--qf-line: rgba(var(--qf-cyan), 0.45);
}

/* --------------------------------------------------------------------------
   Panel chrome: drop the bitmap border-image, go glass
   -------------------------------------------------------------------------- */
.panel,
.panel.alt {
	border-image: none;
	border: 1px solid var(--qf-line);
	padding: 10px;
	background:
		/* corner light bloom */
		radial-gradient(120% 60% at 0% 0%, rgba(var(--qf-cyan), 0.16) 0%, rgba(var(--qf-cyan), 0) 55%),
		/* micro grid */
		repeating-linear-gradient(0deg,  rgba(var(--qf-cyan), 0.045) 0 1px, transparent 1px 24px),
		repeating-linear-gradient(90deg, rgba(var(--qf-cyan), 0.045) 0 1px, transparent 1px 24px),
		/* glass body */
		linear-gradient(170deg, var(--qf-glass-top) 0%, var(--qf-glass-bot) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.14),              /* top bevel highlight */
		inset 0 0 0 1px rgba(var(--qf-cyan), 0.06),
		inset 0 0 48px rgba(var(--qf-cyan), 0.07),             /* inner haze */
		0 0 0 1px rgba(0, 0, 0, 0.35),
		0 0 24px rgba(var(--qf-cyan), 0.18),                   /* outer glow */
		0 18px 50px rgba(0, 0, 0, 0.45);
	-webkit-backdrop-filter: blur(14px) saturate(150%);
	backdrop-filter: blur(14px) saturate(150%);
}
.panel.alt {
	background:
		radial-gradient(120% 60% at 100% 0%, rgba(var(--qf-cyan), 0.16) 0%, rgba(var(--qf-cyan), 0) 55%),
		repeating-linear-gradient(0deg,  rgba(var(--qf-cyan), 0.045) 0 1px, transparent 1px 24px),
		repeating-linear-gradient(90deg, rgba(var(--qf-cyan), 0.045) 0 1px, transparent 1px 24px),
		linear-gradient(190deg, var(--qf-glass-top) 0%, var(--qf-glass-bot) 100%);
}
/* nested panels: lighter, no second blur pass */
.panel .panel {
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	background: linear-gradient(170deg, rgba(var(--qf-cyan), 0.08), rgba(0, 0, 0, 0.25));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 12px rgba(var(--qf-cyan), 0.12);
}

/* --------------------------------------------------------------------------
   Corner brackets (4 corners, one pseudo-element, 8 gradients)
   -------------------------------------------------------------------------- */
.panel::before {
	content: '';
	position: absolute;
	inset: -1px;
	pointer-events: none;
	z-index: 3;
	--b: 3px;   /* bracket thickness */
	--l: 28px;  /* bracket length */
	--c: rgb(var(--qf-ice));
	background:
		linear-gradient(var(--c), var(--c)) top left     / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) top left     / var(--b) var(--l) no-repeat,
		linear-gradient(var(--c), var(--c)) top right    / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) top right    / var(--b) var(--l) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom left  / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom left  / var(--b) var(--l) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom right / var(--b) var(--l) no-repeat;
	animation: qf-bracket-pulse 3.2s ease-in-out infinite;
}
.panel .panel::before { --l: 12px; animation: none; opacity: 0.6; }

/* --------------------------------------------------------------------------
   Scan sweeps (vertical on .panel_inner::before, horizontal on .panel::after)
   + status readout
   -------------------------------------------------------------------------- */
.panel {
	overflow: hidden;
}
.panel .panel_inner {
	overflow: hidden;
}
.panel::after {                         /* scan sweep: left -> right */
	content: '';
	position: absolute;
	top: 0; bottom: 0; left: 0;
	width: 1px;
	pointer-events: none;
	z-index: 2;
	background: linear-gradient(180deg,
		rgba(var(--qf-ice), 0) 0%,
		rgba(var(--qf-ice), 0.3) 35%,
		rgba(255, 255, 255, 0.45) 50%,
		rgba(var(--qf-ice), 0.3) 65%,
		rgba(var(--qf-ice), 0) 100%);
	box-shadow: 0 0 6px rgba(var(--qf-ice), 0.3);
	opacity: 0;
	animation: qf-scan-h 13s linear infinite;
	animation-delay: 5s;
}
.panel .panel::after { display: none; }
.panel .panel_inner::before {           /* scan sweep: top -> bottom */
	content: '';
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 1px;
	pointer-events: none;
	z-index: 2;
	background: linear-gradient(90deg,
		rgba(var(--qf-ice), 0) 0%,
		rgba(var(--qf-ice), 0.35) 35%,
		rgba(255, 255, 255, 0.5) 50%,
		rgba(var(--qf-ice), 0.35) 65%,
		rgba(var(--qf-ice), 0) 100%);
	box-shadow: 0 0 6px rgba(var(--qf-ice), 0.3);
	opacity: 0;
	animation: qf-scan-v 9s linear infinite;
	animation-delay: 1.5s;
}
.panel .panel_inner::after {            /* status readout */
	content: '\25C8  SYS.LINK  \2022  NOMINAL';
	position: absolute;
	right: 10px;
	bottom: 4px;
	pointer-events: none;
	z-index: 2;
	font-family: 'Play', 'Consolas', monospace;
	font-size: 9px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(var(--qf-ice), 0.55);
	text-shadow: 0 0 6px rgba(var(--qf-ice), 0.5);
	animation: qf-blink 2.4s steps(1, end) infinite;
}
.panel .panel .panel_inner::before,
.panel .panel .panel_inner::after { display: none; }

/* --------------------------------------------------------------------------
   Panel title: glow + animated data-line underneath
   -------------------------------------------------------------------------- */
.panel h5.cardTitle {
	position: relative;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #dff4ff;
	text-shadow:
		0 0 6px rgba(var(--qf-cyan), 0.9),
		0 0 18px rgba(var(--qf-cyan), 0.45);
	padding-left: 20px;
	margin-bottom: 10px;
}
.panel h5.cardTitle::before {           /* pulsing indicator chip */
	content: '';
	position: absolute;
	left: 6px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -5px;
	background: rgb(var(--qf-ice));
	box-shadow: 0 0 8px rgba(var(--qf-ice), 0.9), 0 0 16px rgba(var(--qf-ice), 0.5);
	transform: rotate(45deg);
	animation: qf-chip 1.8s ease-in-out infinite;
}
.panel h5.cardTitle::after {            /* static data-line */
	content: '';
	position: absolute;
	left: 6px;
	right: 40px;
	bottom: -2px;
	height: 1px;
	background: linear-gradient(90deg, rgba(var(--qf-cyan), 0.9), rgba(var(--qf-cyan), 0));
	box-shadow: 0 0 6px rgba(var(--qf-cyan), 0.4);
	opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Section headers, dividers, list items
   -------------------------------------------------------------------------- */
.panel h6 {
	position: relative;
	letter-spacing: 0.08em;
	padding-bottom: 4px;
	margin-bottom: 8px;
	border-bottom: 1px solid rgba(var(--qf-cyan), 0.18);
}
.panel h6::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 48px;
	height: 1px;
	background: rgb(var(--qf-ice));
	box-shadow: 0 0 6px rgba(var(--qf-ice), 0.8);
}
.panel h6.gold { border-bottom-color: rgba(255, 204, 0, 0.2); }
.panel h6.gold::after { background: #FFCC00; box-shadow: 0 0 6px rgba(255, 204, 0, 0.8); }

.panel .divider {
	border: 0;
	height: 1px;
	margin: 18px 0;
	background: linear-gradient(90deg,
		rgba(var(--qf-cyan), 0) 0%,
		rgba(var(--qf-cyan), 0.7) 20%,
		rgba(var(--qf-cyan), 0.7) 80%,
		rgba(var(--qf-cyan), 0) 100%);
	box-shadow: 0 0 8px rgba(var(--qf-cyan), 0.35);
}

.panel .list > li,
.panel .list > .item {
	border-left-color: rgba(var(--qf-cyan), 0.7);
	border-radius: 0 3px 3px 0;
	transition: background-color 0.25s, box-shadow 0.25s, border-color 0.25s, opacity 0.35s, transform 0.35s;
}
.panel .list > .item.hoverable:hover,
.panel .list > li.hoverable:hover {
	background: linear-gradient(90deg, rgba(var(--qf-cyan), 0.16), rgba(var(--qf-cyan), 0.02));
	border-left-color: rgb(var(--qf-ice));
	box-shadow: inset 2px 0 10px rgba(var(--qf-ice), 0.25);
}

/* close button: glass chip */
.panel .btn_close {
	border: 1px solid rgba(var(--qf-cyan), 0.35);
	background: rgba(var(--qf-cyan), 0.06);
	z-index: 4;
}
.panel .btn_close:hover,
.panel .btn_close:focus {
	border-color: rgba(var(--qf-ice), 0.9);
	background: rgba(var(--qf-cyan), 0.18);
	box-shadow: 0 0 10px rgba(var(--qf-ice), 0.5);
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes qf-scan-v {
	0%   { transform: translateY(0);     opacity: 0; }
	3%   { opacity: 0.6; }
	38%  { transform: translateY(100vh); opacity: 0.6; }
	40%  { opacity: 0; }
	100% { transform: translateY(100vh); opacity: 0; }
}
@keyframes qf-scan-h {
	0%   { transform: translateX(0);     opacity: 0; }
	3%   { opacity: 0.55; }
	42%  { transform: translateX(100vw); opacity: 0.55; }
	44%  { opacity: 0; }
	100% { transform: translateX(100vw); opacity: 0; }
}
@keyframes qf-blink {
	0%, 70%  { opacity: 1; }
	71%, 76% { opacity: 0.25; }
	77%, 100%{ opacity: 1; }
}
@keyframes qf-chip {
	0%, 100% { opacity: 1;   transform: rotate(45deg) scale(1); }
	50%      { opacity: 0.4; transform: rotate(45deg) scale(0.7); }
}
@keyframes qf-bracket-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.7; }
}

/* The left-edge mission quicklist sits over the left-side panels when there
   are no completed missions (panels only shift right once there are). Fade
   it while one of those panels is open so it doesn't bleed through the glass. */
body:not(.has_completed_missions):has(.panel.panel_group_user.active) .nav_fixed.left .mission_quicklist {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}

/* low gfx or reduced motion: keep it calm */
@media (prefers-reduced-motion: reduce) {
	.panel::before,
	.panel::after,
	.panel .panel_inner::before,
	.panel .panel_inner::after,
	.panel h5.cardTitle::before { animation: none; }
	.panel .panel_inner::before,
	.panel::after { display: none; }
}

/* ==========================================================================
   HUD EDGE BARS
   Replaces the PNG button-holders (.nav_fixed corners + top center) and the
   footer with glass shapes. ::before = blurred glass fill (clip-path),
   ::after = SVG outline + travelling glint. Corner bars share one shape and
   are mirrored per corner, so the geometry lives in one place.
   Buttons / icon sprites are untouched.
   ========================================================================== */

.nav_fixed.top_left:not(.no-bg),
.nav_fixed.top_right:not(.no-bg),
.nav_fixed.bottom_left,
.nav_fixed.bottom_right,
.nav_fixed.top_center {
	background-image: none;
}

/* ---- shared pseudo setup ---- */
.nav_fixed.top_left:not(.no-bg)::before,
.nav_fixed.top_right:not(.no-bg)::before,
.nav_fixed.bottom_left::before,
.nav_fixed.bottom_right::before,
.nav_fixed.top_left:not(.no-bg)::after,
.nav_fixed.top_right:not(.no-bg)::after,
.nav_fixed.bottom_left::after,
.nav_fixed.bottom_right::after,
.nav_fixed.top_center::before,
.nav_fixed.top_center::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	pointer-events: none;
	z-index: -1;
}

/* ---- corner bars: 280 x 45, shape drawn for top-left ---- */
.nav_fixed.top_left:not(.no-bg)::before,
.nav_fixed.top_right:not(.no-bg)::before,
.nav_fixed.bottom_left::before,
.nav_fixed.bottom_right::before {
	width: 280px;
	height: 45px;
	clip-path: polygon(0 0, 280px 0, 256px 35px, 118px 35px, 110px 43px, 0 43px);
	background:
		repeating-linear-gradient(90deg, rgba(var(--qf-cyan), 0.06) 0 1px, transparent 1px 12px),
		linear-gradient(180deg, rgba(8, 36, 70, 0.55) 0%, rgba(2, 14, 34, 0.7) 100%);
	-webkit-backdrop-filter: blur(10px) saturate(150%);
	backdrop-filter: blur(10px) saturate(150%);
}
.nav_fixed.top_left:not(.no-bg)::after,
.nav_fixed.top_right:not(.no-bg)::after,
.nav_fixed.bottom_left::after,
.nav_fixed.bottom_right::after {
	width: 280px;
	height: 45px;
	background:
		linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%) -60px 34px / 40px 1px no-repeat,
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='45' viewBox='0 0 280 45'%3E%3Cpath d='M0 0.5H279' stroke='rgba(31,217,241,0.25)' fill='none'/%3E%3Cpath d='M279 0.5L256 34.5H118L110 42.5H0' stroke='rgba(31,217,241,0.75)' fill='none'/%3E%3Cpath d='M0 42.5H44' stroke='%231fd9f1' stroke-width='2' fill='none'/%3E%3Cpath d='M126 39.5H246' stroke='rgba(31,217,241,0.45)' stroke-dasharray='2 4' fill='none'/%3E%3Ccircle cx='256' cy='34.5' r='2' fill='%231fd9f1'/%3E%3Cpath d='M262 6h10M264 10h6' stroke='rgba(31,217,241,0.5)' fill='none'/%3E%3C/svg%3E") 0 0 / 280px 45px no-repeat;
	filter: drop-shadow(0 0 3px rgba(var(--qf-ice), 0.7));
	animation: qf-glint-corner 9s linear infinite;
}

/* mirror per corner (fill + outline flip together) */
.nav_fixed.top_right:not(.no-bg)::before,
.nav_fixed.top_right:not(.no-bg)::after   { left: auto; right: 0; transform: scaleX(-1); }
.nav_fixed.bottom_left::before,
.nav_fixed.bottom_left::after             { top: auto; bottom: 0; transform: scaleY(-1); }
.nav_fixed.bottom_right::before,
.nav_fixed.bottom_right::after            { top: auto; bottom: 0; left: auto; right: 0; transform: scale(-1, -1); }

/* offset glints so the four corners never fire together */
.nav_fixed.top_left:not(.no-bg)::after  { animation-delay: 0s; }
.nav_fixed.top_right:not(.no-bg)::after { animation-delay: 2.3s; }
.nav_fixed.bottom_right::after          { animation-delay: 4.7s; }
.nav_fixed.bottom_left::after           { animation-delay: 6.9s; }

/* ---- top center: 630 x 45 ---- */
.nav_fixed.top_center::before {
	width: 630px;
	height: 45px;
	clip-path: polygon(0 0, 630px 0, 596px 31px, 392px 31px, 376px 44px, 254px 44px, 238px 31px, 34px 31px);
	background:
		radial-gradient(90px 40px at 50% 0%, rgba(var(--qf-cyan), 0.28), rgba(var(--qf-cyan), 0) 100%),
		repeating-linear-gradient(90deg, rgba(var(--qf-cyan), 0.06) 0 1px, transparent 1px 12px),
		linear-gradient(180deg, rgba(8, 36, 70, 0.55) 0%, rgba(2, 14, 34, 0.7) 100%);
	-webkit-backdrop-filter: blur(10px) saturate(150%);
	backdrop-filter: blur(10px) saturate(150%);
}
.nav_fixed.top_center::after {
	width: 630px;
	height: 45px;
	background:
		linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%) -60px 30px / 40px 1px no-repeat,
		linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%) 690px 30px / 40px 1px no-repeat,
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='630' height='45' viewBox='0 0 630 45'%3E%3Cpath d='M0 0.5H630' stroke='rgba(31,217,241,0.25)' fill='none'/%3E%3Cpath d='M0 0.5L34 30.5H238L254 43.5H376L392 30.5H596L630 0.5' stroke='rgba(31,217,241,0.75)' fill='none'/%3E%3Cpath d='M262 43.5H368' stroke='%231fd9f1' stroke-width='2' fill='none'/%3E%3Cpath d='M60 36.5H220M410 36.5H570' stroke='rgba(31,217,241,0.4)' stroke-dasharray='2 4' fill='none'/%3E%3Ccircle cx='238' cy='30.5' r='2' fill='%231fd9f1'/%3E%3Ccircle cx='392' cy='30.5' r='2' fill='%231fd9f1'/%3E%3Cpath d='M44 8h14M48 12h6M572 8h14M576 12h6' stroke='rgba(31,217,241,0.5)' fill='none'/%3E%3C/svg%3E") 0 0 / 630px 45px no-repeat;
	filter: drop-shadow(0 0 3px rgba(var(--qf-ice), 0.7));
	animation: qf-glint-center 11s linear infinite;
	animation-delay: 1.2s;
}

/* rotating reticle rings behind the logo */
.nav_fixed.top_center .logo::before,
.nav_fixed.top_center .logo::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	pointer-events: none;
	z-index: -1;
}
.nav_fixed.top_center .logo::before {
	width: 64px;
	height: 64px;
	margin: -32px 0 0 -32px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='30' fill='none' stroke='rgba(31,217,241,0.45)' stroke-dasharray='1.5 3.5'/%3E%3Ccircle cx='32' cy='32' r='26' fill='none' stroke='rgba(31,217,241,0.6)' stroke-width='1.5' stroke-dasharray='28 12 6 12'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: qf-spin 28s linear infinite;
}
.nav_fixed.top_center .logo::after {
	width: 46px;
	height: 46px;
	margin: -23px 0 0 -23px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' viewBox='0 0 46 46'%3E%3Ccircle cx='23' cy='23' r='21' fill='none' stroke='rgba(31,217,241,0.35)' stroke-width='1' stroke-dasharray='10 6'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: qf-spin 18s linear infinite reverse;
}
.nav_fixed.top_center .logo img {
	filter: drop-shadow(0 0 6px rgba(var(--qf-cyan), 0.6));
}

/* ---- button glow (sprites unchanged) ---- */
.nav_fixed .ibtn {
	transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.25s;
}
.nav_fixed .ibtn:hover,
.nav_fixed .ibtn:focus,
.nav_fixed .ibtn.active {
	filter: drop-shadow(0 0 6px rgba(var(--qf-ice), 0.85));
}

/* ---- readouts under the top corners ---- */
.nav_fixed .map_stats,
.top_left .map_stats {
	padding-left: 10px;
	border-left: 1px solid rgba(var(--qf-cyan), 0.45);
	letter-spacing: 0.06em;
}
.nav_fixed .map_stats::before {
	content: '';
	position: absolute;
	left: -1px;
	top: 0;
	width: 2px;
	height: 14px;
	background: rgb(var(--qf-ice));
	box-shadow: 0 0 6px rgba(var(--qf-ice), 0.8);
}
.nav_fixed .map_stats .map_stat.name {
	color: #dff4ff;
	text-shadow: 0 0 6px rgba(var(--qf-cyan), 0.7);
}
.nav_fixed .currencies {
	padding-right: 10px;
	border-right: 1px solid rgba(var(--qf-cyan), 0.45);
}
.nav_fixed .currencies::before {
	content: '';
	position: absolute;
	right: -1px;
	top: 0;
	width: 2px;
	height: 14px;
	background: rgb(var(--qf-ice));
	box-shadow: 0 0 6px rgba(var(--qf-ice), 0.8);
}

/* ---- bottom center: footer strip ---- */
.fullscreen .main_footer::before {
	content: '';
	position: absolute;
	left: 0; right: 0; top: -4px; bottom: -4px;
	z-index: -1;
	pointer-events: none;
	clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 100%, 0 100%);
	background: linear-gradient(180deg, rgba(8, 36, 70, 0.5), rgba(2, 14, 34, 0.7));
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.fullscreen .main_footer::after {
	content: '';
	position: absolute;
	left: 22px; right: 22px; top: -4px;
	height: 1px;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(var(--qf-ice), 0), rgba(var(--qf-ice), 0.8) 50%, rgba(var(--qf-ice), 0));
	box-shadow: 0 0 6px rgba(var(--qf-ice), 0.5);
}

/* ---- keyframes ---- */
@keyframes qf-glint-corner {
	0%      { background-position: 104px 34px, 0 0; }
	30%     { background-position: 236px 34px, 0 0; }
	30.01%, 100% { background-position: -60px 34px, 0 0; }
}
@keyframes qf-glint-center {     /* two glints converge on the centre notch */
	0%      { background-position: 20px 30px, 590px 30px, 0 0; }
	32%     { background-position: 214px 30px, 376px 30px, 0 0; }
	32.01%, 100% { background-position: -60px 30px, 690px 30px, 0 0; }
}
@keyframes qf-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.nav_fixed::after,
	.nav_fixed .logo::before,
	.nav_fixed .logo::after { animation: none; }
}

/* faction users: readout accents follow the faction text colour */
body[data-user-faction] .nav_fixed .map_stats,
body[data-user-faction] .nav_fixed .currencies { border-color: currentColor; }
body[data-user-faction] .nav_fixed .map_stats::before,
body[data-user-faction] .nav_fixed .currencies::before { background: currentColor; box-shadow: 0 0 6px currentColor; }
body[data-user-faction] .nav_fixed .map_stats .map_stat.name { color: inherit; text-shadow: 0 0 6px currentColor; }

/* ==========================================================================
   GLASS TABS  (reusable)
   Usage, new markup:
       <ul class="qf-tabs">
         <li><a class="qf-tab active" href="#">Ships</a></li>
         <li><a class="qf-tab" href="#">Weapons</a></li>
       </ul>
   Bootstrap pills inside any .panel get the same look automatically
   (.panel .nav-pills > .nav-item > .nav-link), e.g. Hangar / Inventory.
   Shape: chamfered top-left + bottom-right corners, glass fill,
   underline indicator that grows in on hover/active.
   ========================================================================== */

.qf-tabs,
.panel .nav-pills {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	list-style: none;
	margin: 0 0 10px 0;
	padding: 0 0 6px 0;
	position: relative;
	/* rail under the tab row */
	background: linear-gradient(90deg,
		rgba(var(--qf-cyan), 0) 0%,
		rgba(var(--qf-cyan), 0.55) 15%,
		rgba(var(--qf-cyan), 0.55) 85%,
		rgba(var(--qf-cyan), 0) 100%) left bottom / 100% 1px no-repeat;
}
.qf-tabs > li,
.panel .nav-pills > .nav-item {
	flex: 1 1 0;
	margin: 0;
}
.panel .nav-fill .nav-item,
.panel .nav-fill .nav-item:last-child { margin-right: 0; }

.qf-tab,
.panel .nav-pills .nav-link {
	--chamfer: 8px;
	--edge: rgba(var(--qf-cyan), 0.35);
	position: relative;
	display: block;
	height: 100%;
	padding: 7px 10px;
	text-align: center;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(var(--qf-ice), 0.65);
	border: 1px solid var(--edge);
	border-radius: 0;
	clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
	background:
		/* diagonal edges on the two chamfers (border can't draw these) */
		linear-gradient(135deg, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px), var(--edge) calc(50% + 0.6px), transparent calc(50% + 0.6px)) left top / var(--chamfer) var(--chamfer) no-repeat border-box,
		linear-gradient(135deg, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px), var(--edge) calc(50% + 0.6px), transparent calc(50% + 0.6px)) right bottom / var(--chamfer) var(--chamfer) no-repeat border-box,
		/* underline indicator, scaled to 0 until hover/active */
		linear-gradient(rgb(var(--qf-ice)), rgb(var(--qf-ice))) center bottom / 0% 2px no-repeat border-box,
		/* glass body */
		linear-gradient(180deg, rgba(var(--qf-cyan), 0.07) 0%, rgba(0, 10, 28, 0.45) 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
	transition: color 0.25s, background-size 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, text-shadow 0.25s, border-color 0.25s;
}
.qf-tab i,
.qf-tab .fa,
.qf-tab img,
.panel .nav-pills .nav-link i,
.panel .nav-pills .nav-link .fa,
.panel .nav-pills .nav-link img {
	opacity: 0.55;
	transition: filter 0.25s, opacity 0.25s;
}
.qf-tab:hover i, .qf-tab:hover .fa, .qf-tab:hover img,
.qf-tab:focus i, .qf-tab:focus .fa, .qf-tab:focus img,
.panel .nav-pills .nav-link:hover i, .panel .nav-pills .nav-link:hover .fa, .panel .nav-pills .nav-link:hover img,
.panel .nav-pills .nav-link:focus i, .panel .nav-pills .nav-link:focus .fa, .panel .nav-pills .nav-link:focus img {
	opacity: 0.9;
}

/* hover */
.qf-tab:hover,
.qf-tab:focus,
.panel .nav-pills .nav-link:hover,
.panel .nav-pills .nav-link:focus {
	--edge: rgba(var(--qf-ice), 0.6);
	color: #dff4ff;
	background-size: var(--chamfer) var(--chamfer), var(--chamfer) var(--chamfer), 40% 2px, auto;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 14px rgba(var(--qf-cyan), 0.18);
	text-decoration: none;
}

/* active */
.qf-tab.active,
.panel .nav-pills .nav-link.active,
.panel .nav-pills .show > .nav-link {
	--edge: rgba(var(--qf-ice), 0.9);
	color: #ffffff;
	text-shadow: 0 0 6px rgba(var(--qf-ice), 0.9);
	background:
		linear-gradient(135deg, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px), var(--edge) calc(50% + 0.6px), transparent calc(50% + 0.6px)) left top / var(--chamfer) var(--chamfer) no-repeat border-box,
		linear-gradient(135deg, transparent calc(50% - 0.6px), var(--edge) calc(50% - 0.6px), var(--edge) calc(50% + 0.6px), transparent calc(50% + 0.6px)) right bottom / var(--chamfer) var(--chamfer) no-repeat border-box,
		linear-gradient(rgb(var(--qf-ice)), rgb(var(--qf-ice))) center bottom / 100% 2px no-repeat border-box,
		radial-gradient(120% 90% at 50% 100%, rgba(var(--qf-ice), 0.35) 0%, rgba(var(--qf-ice), 0) 70%),
		linear-gradient(180deg, rgba(var(--qf-cyan), 0.22) 0%, rgba(var(--qf-cyan), 0.08) 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 18px rgba(var(--qf-ice), 0.25);
}
.qf-tab.active i,
.qf-tab.active .fa,
.qf-tab.active img,
.panel .nav-pills .nav-link.active i,
.panel .nav-pills .nav-link.active .fa,
.panel .nav-pills .nav-link.active img {
	opacity: 1;
	filter: drop-shadow(0 0 5px rgba(var(--qf-ice), 0.9));
}

/* disabled */
.qf-tab.disabled,
.panel .nav-pills .nav-link.disabled {
	opacity: 0.35;
	pointer-events: none;
}

/* ==========================================================================
   HANGAR FLEET HEXES  (scoped to #panel_hangar; combat reuses the markup
   with its own scaling, so it is left alone)
   The two PNGs (.hex-combat base / .hex-combat-active hover) stay in the DOM
   so existing show/hide logic keeps working; object-position pushes the
   bitmap out of the box and an SVG background draws the hex instead.
   ========================================================================== */

/* empty hexes: deep, low-opacity blue so class-coloured (esp. cyan C) ships stand out */
#panel_hangar .fleet_positions .hangar_module .hex-combat {
	object-position: -9999px 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%2300a1ff' stop-opacity='0.06'/%3E%3Cstop offset='1' stop-color='%2300a1ff' stop-opacity='0.01'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolygon points='4,50 26.75,10.6 73.25,10.6 96,50 73.25,89.4 26.75,89.4' fill='url(%23g)' stroke='rgba(0,120,200,0.30)' stroke-width='1'/%3E%3Cpath d='M4 50h4M92 50h4' stroke='rgba(0,140,220,0.45)' stroke-width='1'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
#panel_hangar .fleet_positions .hangar_module { --hx: 31, 217, 241; }   /* hex accent; class colour when occupied */
#panel_hangar .fleet_positions .hangar_module .hex-combat.hex-combat-active {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='r' cx='0.5' cy='0.5' r='0.5'%3E%3Cstop offset='0' stop-color='%231fd9f1' stop-opacity='0.28'/%3E%3Cstop offset='1' stop-color='%2300a1ff' stop-opacity='0.04'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpolygon points='4,50 26.75,10.6 73.25,10.6 96,50 73.25,89.4 26.75,89.4' fill='url(%23r)' stroke='%231fd9f1' stroke-width='1.6'/%3E%3Cpolygon points='14,50 31.75,19.3 68.25,19.3 86,50 68.25,80.7 31.75,80.7' fill='none' stroke='rgba(31,217,241,0.5)' stroke-width='0.8' stroke-dasharray='3 3'/%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='4' cy='50' r='1.8'/%3E%3Ccircle cx='96' cy='50' r='1.8'/%3E%3Ccircle cx='26.75' cy='10.6' r='1.4'/%3E%3Ccircle cx='73.25' cy='10.6' r='1.4'/%3E%3Ccircle cx='26.75' cy='89.4' r='1.4'/%3E%3Ccircle cx='73.25' cy='89.4' r='1.4'/%3E%3C/g%3E%3C/svg%3E");
	filter: drop-shadow(0 0 4px rgba(var(--hx), 0.75));
}
/* occupied: same art in the ship's class colour (SVGs built in hangar.js getQfHexStyle) */
#panel_hangar .fleet_positions .hangar_module[data-qf-hex] .hex-combat { background-image: var(--hex-bg); }
#panel_hangar .fleet_positions .hangar_module[data-qf-hex] .hex-combat.hex-combat-active { background-image: var(--hex-on); }

/* opacity states (override combat.css PNG tuning, hangar only) */
#panel_hangar .fleet_positions .hangar_module .hex-combat,
#panel_hangar .fleet_positions .hangar_module.empty .hex-combat {
	opacity: 1;
	transition: opacity 0.25s, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.25s;
}
#panel_hangar .fleet_positions .hangar_module .hex-combat.hex-combat-active {
	opacity: 0;
	transform: scale(0.9);
}
#panel_hangar .fleet_positions .hangar_module:hover .hex-combat,
#panel_hangar .fleet_positions .hangar_module:focus .hex-combat,
#panel_hangar .fleet_positions .hangar_module.hovered .hex-combat,
#panel_hangar .fleet_positions .hangar_module.active .hex-combat {
	opacity: 0;
}
#panel_hangar .fleet_positions .hangar_module:hover .hex-combat.hex-combat-active,
#panel_hangar .fleet_positions .hangar_module:focus .hex-combat.hex-combat-active,
#panel_hangar .fleet_positions .hangar_module.hovered .hex-combat.hex-combat-active,
#panel_hangar .fleet_positions .hangar_module.active .hex-combat.hex-combat-active {
	opacity: 1;
	transform: scale(1);
	animation: qf-hex-pulse 2.2s ease-in-out infinite;
}

/* "+" becomes a thin crosshair */
#panel_hangar .hangar_module.empty::after {
	content: '';
	left: 50%;
	top: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	line-height: normal;
	font-size: 0;
	background:
		linear-gradient(rgba(0, 140, 220, 0.4), rgba(0, 140, 220, 0.4)) center / 100% 1px no-repeat,
		linear-gradient(rgba(0, 140, 220, 0.4), rgba(0, 140, 220, 0.4)) center / 1px 100% no-repeat;
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.25s, opacity 0.25s;
	z-index: 2;
	pointer-events: none;
}
#panel_hangar .hangar_module.empty:hover::after {
	color: transparent;
	transform: rotate(90deg) scale(1.15);
	background:
		linear-gradient(#ffffff, #ffffff) center / 100% 1px no-repeat,
		linear-gradient(#ffffff, #ffffff) center / 1px 100% no-repeat;
	filter: drop-shadow(0 0 3px rgba(31, 217, 241, 1));
}

/* slot label (B-1, M-2 ...) sits inside the hex as a small readout */
#panel_hangar .hangar_module::before {
	bottom: 18%;
	padding: 0;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.18em;
	color: #dff4ff;
	text-shadow: 0 0 6px rgba(31, 217, 241, 0.9);
	transform: translateY(4px);
}
#panel_hangar .hangar_module:hover::before,
#panel_hangar .hangar_module:focus::before {
	opacity: 1;
	transform: translateY(0);
}

@keyframes qf-hex-pulse {
	0%, 100% { filter: drop-shadow(0 0 4px rgba(var(--hx), 0.75)); }
	50%      { filter: drop-shadow(0 0 9px rgba(var(--hx), 0.95)); }
}
@media (prefers-reduced-motion: reduce) {
	#panel_hangar .fleet_positions .hangar_module .hex-combat.hex-combat-active { animation: none !important; }
}

/* ---- equipped slots: ship above the hex effects, scales up on hover ---- */
#panel_hangar .fleet_positions .hangar_module:not(.empty) > .item {
	z-index: 3;                         /* above .hex-combat-active (z 1) */
	transform-origin: 50% 50%;
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.4), filter 0.3s;
}
#panel_hangar .fleet_positions .hangar_module:not(.empty) > .item_eq_holder { z-index: 6; }
/* fleet hex pips: 1px outline in the hexes' default stroke colour; static (no hover change) */
#panel_hangar .fleet_positions .hangar_module > .qf-slots .qf-col i,
#panel_hangar .fleet_positions .hangar_module:hover > .qf-slots .qf-col i {
	outline: 1px solid rgba(var(--hx), 0.38);
	outline-offset: 0;
}
#panel_hangar .fleet_positions .hangar_module:not(.empty)::before { z-index: 4; }   /* slot label */

#panel_hangar .fleet_positions .hangar_module:not(.empty):hover,
#panel_hangar .fleet_positions .hangar_module:not(.empty):focus,
#panel_hangar .fleet_positions .hangar_module:not(.empty).hovered {
	overflow: visible;                  /* let the ship bleed past the tile */
	z-index: 5;                         /* and over neighbouring tiles */
}
#panel_hangar .fleet_positions .hangar_module:not(.empty):hover > .item,
#panel_hangar .fleet_positions .hangar_module:not(.empty):focus > .item,
#panel_hangar .fleet_positions .hangar_module:not(.empty).hovered > .item {
	transform: scale(1.4);
	filter: drop-shadow(0 0 6px rgba(var(--hx), 0.55)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
}

/* selected: the ship open in the centre panel. 3x outline + lit fill, stays on under hover */
#panel_hangar .fleet_positions .hangar_module.qf-selected .hex-combat:not(.hex-combat-active),
#panel_hangar .fleet_positions .hangar_module.qf-selected:hover .hex-combat:not(.hex-combat-active),
#panel_hangar .fleet_positions .hangar_module.qf-selected.hovered .hex-combat:not(.hex-combat-active) {
	background-image: var(--hex-sel);
	opacity: 1;
	filter: drop-shadow(0 0 6px rgba(var(--hx), 0.8));
}
#panel_hangar .fleet_positions .hangar_module.qf-selected::before { opacity: 1; transform: translateY(0); }   /* keep its B-1 label up */

/* ==========================================================================
   INVENTORY CARDS  (Hangar + Inventory panels)
   Markup from inventory.js renderInventoryCard(). Scoped with an id-level
   :is() so it beats the legacy "#panel_hangar .item .thumbnail" rules and
   also styles the jQuery-UI drag clone (appended inside #panel_hangar).
   Colour always means item CLASS (F..Z); stat icons are neutral.
   ========================================================================== */

:root {
	--qf-cls-f: 153, 153, 153;
	--qf-cls-e: 238, 238, 238;
	--qf-cls-d: 60, 201, 67;
	--qf-cls-c: 31, 217, 241;
	--qf-cls-b: 143, 83, 255;
	--qf-cls-a: 223, 15, 178;
	--qf-cls-s: 255, 130, 38;
	--qf-cls-z: 255, 238, 0;
}

/* header grows by one row (class filter + Stack) */
#panel_hangar .inventory_list.has_header .inventory_inner {
	top: 86px;
	height: calc(100% - 86px);
}

/* Inventory panel: header is absolutely positioned there too, but the list had no offset */
#panel_inventory .inventory_list:not(.has_header) .inventory_inner {
	padding-top: 62px;
}

/* ---- class filter row ---- */
.qf-filterbar {
	display: flex;
	align-items: center;
	gap: 6px 12px;
	margin: 0 0 6px;
}
.qf-classfilter {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	flex: 1 1 auto;
	min-width: 0;
}
.qf-cf {
	--c: 153, 153, 153;
	position: relative;
	margin: 0;
	cursor: pointer;
	user-select: none;
}
.qf-cf input { position: absolute; opacity: 0; pointer-events: none; }
.qf-cf span {
	display: block;
	min-width: 30px;
	height: 24px;              /* slant 6px over 24px: card badges use the same ratio */
	padding: 0 10px;
	line-height: 22px;
	text-align: center;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: rgba(var(--c), 0.55);
	border: 1px solid rgba(var(--c), 0.35);
	background: rgba(0, 0, 0, 0.25);
	clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
	transition: color 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.qf-cf input:checked + span {
	color: #06101c;
	background: rgb(var(--c));
	border-color: rgb(var(--c));
	box-shadow: 0 0 12px rgba(var(--c), 0.7);
}
.qf-cf:hover span { border-color: rgba(var(--c), 0.9); color: rgb(var(--c)); }
.qf-cf input:checked + span:hover { color: #06101c; }
.qf-cf input:focus-visible + span { outline: 1px solid rgb(var(--qf-ice)); outline-offset: 2px; }
.qf-cf-all { --c: var(--qf-ice); }
.qf-cf-sep { width: 1px; background: rgba(var(--qf-cyan), 0.3); margin: 0 3px; }
.qf-cf[data-class_slug="f"] { --c: 153, 153, 153; }
.qf-cf[data-class_slug="e"] { --c: 238, 238, 238; }
.qf-cf[data-class_slug="d"] { --c: 60, 201, 67; }
.qf-cf[data-class_slug="c"] { --c: 31, 217, 241; }
.qf-cf[data-class_slug="b"] { --c: 143, 83, 255; }
.qf-cf[data-class_slug="a"] { --c: 223, 15, 178; }
.qf-cf[data-class_slug="s"] { --c: 255, 130, 38; }
.qf-cf[data-class_slug="z"] { --c: 255, 238, 0; }
.qf-stack {
	margin: 0 0 0 auto;
	flex: none;
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
	color: rgba(var(--qf-ice), 0.6);
}
.qf-stack:hover { color: #dff4ff; }
.qf-stack input { accent-color: rgb(var(--qf-ice)); margin: 0; }
.qf-empty-note { display: block; color: rgba(var(--qf-ice), 0.55); }

/* ---- card ---- */
:is(#panel_hangar, #panel_inventory) .item.qf-card {
	--c: 153, 153, 153;           /* class colour */
	--ch: 10px;                   /* bottom-right chamfer */
	--bh: 16px;                   /* class badge height */
	--sl: 4px;                    /* badge slant: 4/16 = filter chips 6/24 */
	--edge: rgba(var(--c), 0.45);
	position: relative;
	display: inline-block;
	vertical-align: top;
	width: 92px;
	height: 118px;
	padding: 0;
	margin: 0 6px 8px 0;
	cursor: pointer;
	isolation: isolate;
	transform: none;
	clip-path: polygon(var(--sl) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--bh));
	border: 1px solid var(--edge);
	background:
		linear-gradient(135deg, transparent calc(50% - 0.7px), var(--edge) calc(50% - 0.7px), var(--edge) calc(50% + 0.7px), transparent calc(50% + 0.7px)) right bottom / var(--ch) var(--ch) no-repeat border-box,
		radial-gradient(60% 45% at 50% 42%, rgba(var(--c), 0.20), rgba(var(--c), 0) 100%),
		linear-gradient(180deg, rgba(10, 30, 56, 0.65), rgba(2, 10, 24, 0.85));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
	transition: box-shadow 0.3s, border-color 0.3s;
}
:is(#panel_hangar, #panel_inventory) .item.qf-card.equipped_to { display: none; }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="f"] { --c: var(--qf-cls-f); }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="e"] { --c: var(--qf-cls-e); }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="d"] { --c: var(--qf-cls-d); }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="c"] { --c: var(--qf-cls-c); }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="b"] { --c: var(--qf-cls-b); }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="a"] { --c: var(--qf-cls-a); }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="s"] { --c: var(--qf-cls-s); }
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-class_slug="z"] { --c: var(--qf-cls-z); }

/* top accent line after the badge; kill the legacy ship class badge (::after) */
:is(#panel_hangar, #panel_inventory) .item.qf-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 30px;
	right: 0;
	height: 1px;
	z-index: 2;
	background: linear-gradient(90deg, rgba(var(--c), 0.9), rgba(var(--c), 0));
	box-shadow: 0 0 6px rgba(var(--c), 0.7);
}
:is(#panel_hangar, #panel_inventory) .item.qf-card::after { content: none; display: none; }

/* class badge: parallelogram in the cut top-left corner */
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-badge {
	position: absolute;
	top: -1px;
	left: -1px;
	z-index: 3;
	height: calc(var(--bh) + 1px);
	min-width: 30px;
	padding: 0 8px;
	text-align: center;
	font-size: 10px;
	font-weight: 700;
	line-height: calc(var(--bh) + 1px);
	letter-spacing: 0.08em;
	color: #06101c;
	background: rgb(var(--c));
	clip-path: polygon(var(--sl) 0, 100% 0, calc(100% - var(--sl)) 100%, 0 100%);
	box-shadow: 0 0 10px rgba(var(--c), 0.8);
}

/* art */
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-art {
	position: absolute;
	left: 8%;
	right: 8%;
	top: 14%;
	height: 52%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-art img.thumbnail {
	float: none;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
	object-fit: contain;
	filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.4), filter 0.3s, opacity 0.3s;
}
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-itemtype="1"] .qf-art img.thumbnail { transform: scale(1.25); }
/* equipment art is square painted icons: frame it as an inset screen */
:is(#panel_hangar, #panel_inventory) .item.qf-card:not([data-itemtype="1"]) .qf-art img.thumbnail {
	width: 72%;
	max-height: none;
	aspect-ratio: 1;
	object-fit: cover;
	clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
	opacity: 0.92;
}

/* ---- shared ship slot visualizer (hangar.js renderShipSlotsHTML) ----
   Columns atk/def/util/crew/skin, 3px pips stacking upward.
   Lit pip = class of the item equipped there. Grey = empty slot.
   Also carries .item_eq_holder (legacy hooks), so neutralise that box model. */
.qf-slots.item_eq_holder,
.qf-slots {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	padding: 0;
	margin: 0;
	font-size: 0;
	line-height: 0;
	pointer-events: auto;
}
.qf-slots .qf-col { display: flex; flex-direction: column-reverse; gap: 3px; }
.qf-slots .qf-col i { display: block; width: 3px; height: 3px; background: #3f414a; }
.qf-slots .qf-col i.on { background: rgb(var(--p)); box-shadow: 0 0 3px rgba(var(--p), 0.9); }
/* placement: inventory card */
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-slots {
	position: absolute;
	left: 8px;
	bottom: 28px;
	z-index: 2;
}
/* placement: fleet hex, anchored bottom-left of the square tile (8px, like the cards;
   it may sit outside the hexagon), always above the ship art (z 3) and its hover scale */
#panel_hangar .fleet_positions .hangar_module > .qf-slots {
	position: absolute;
	left: 8px;
	bottom: 8px;
	z-index: 6;
}
/* occupied hex: move the hover slot label (B-1 ...) to the top so it clears the visualizer */
#panel_hangar .hangar_module:not(.empty)::before {
	bottom: auto;
	top: 16%;
	transform: translateY(-4px);
}
#panel_hangar .hangar_module:not(.empty):hover::before { transform: translateY(0); }
.qf-col i.on[data-c="f"] { --p: var(--qf-cls-f); }
.qf-col i.on[data-c="e"] { --p: var(--qf-cls-e); }
.qf-col i.on[data-c="d"] { --p: var(--qf-cls-d); }
.qf-col i.on[data-c="c"] { --p: var(--qf-cls-c); }
.qf-col i.on[data-c="b"] { --p: var(--qf-cls-b); }
.qf-col i.on[data-c="a"] { --p: var(--qf-cls-a); }
.qf-col i.on[data-c="s"] { --p: var(--qf-cls-s); }
.qf-col i.on[data-c="z"] { --p: var(--qf-cls-z); }

/* stat readout (equipment): neutral icons, colour is reserved for class */
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-stat {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 23px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 8px;
}
.qf-s { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; letter-spacing: 0.06em; font-weight: 700; color: #dbe9f5; }
.qf-s svg { width: 11px; height: 11px; flex: none; opacity: 0.85; }
.qf-s.minor { opacity: 0.55; font-weight: 400; }

/* name strip */
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-name.description {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 20px;
	z-index: 2;
	margin: 0;
	padding: 0 12px 0 8px;
	font-size: 10px;
	font-weight: 400;
	line-height: 20px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	color: #dbe9f5;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border: 0;
	border-top: 1px solid rgba(var(--c), 0.25);
	border-radius: 0;
	background: linear-gradient(180deg, rgba(var(--c), 0.10), rgba(0, 0, 0, 0.35));
}

/* stack count */
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-count {
	position: absolute;
	right: 4px;
	top: 4px;
	z-index: 4;
	padding: 0 5px;
	font-size: 10px;
	font-weight: 700;
	line-height: 14px;
	letter-spacing: 0.06em;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(var(--qf-ice), 0.6);
	text-shadow: 0 0 4px rgba(var(--qf-ice), 0.9);
	transition: border-color 0.25s, box-shadow 0.25s;
}

/* hover: card holds still, art lifts, edge + glow brighten, brackets snap in, one sweep */
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-brk {
	position: absolute;
	inset: 3px;
	z-index: 3;
	pointer-events: none;
	opacity: 0;
	transform: scale(1.06);
	transition: opacity 0.25s, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
	--b: 1.5px;
	--l: 10px;
	--k: rgb(var(--qf-ice));
	background:
		linear-gradient(var(--k), var(--k)) top right / var(--l) var(--b) no-repeat,
		linear-gradient(var(--k), var(--k)) top right / var(--b) var(--l) no-repeat,
		linear-gradient(var(--k), var(--k)) bottom left / var(--l) var(--b) no-repeat,
		linear-gradient(var(--k), var(--k)) bottom left / var(--b) var(--l) no-repeat;
}
/* with a count chip in the top-right, the chip replaces that corner bracket */
:is(#panel_hangar, #panel_inventory) .item.qf-card:has(.qf-count) .qf-brk {
	background:
		linear-gradient(var(--k), var(--k)) bottom left / var(--l) var(--b) no-repeat,
		linear-gradient(var(--k), var(--k)) bottom left / var(--b) var(--l) no-repeat;
}
:is(#panel_hangar, #panel_inventory) .item.qf-card .qf-sweep {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.14) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
}
:is(#panel_hangar, #panel_inventory) .item.qf-card:hover {
	--edge: rgba(var(--c), 0.95);
	box-shadow: inset 0 0 22px rgba(var(--c), 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
:is(#panel_hangar, #panel_inventory) .item.qf-card:hover .qf-brk { opacity: 1; transform: scale(1); }
:is(#panel_hangar, #panel_inventory) .item.qf-card:hover .qf-count { border-color: rgb(var(--qf-ice)); box-shadow: 0 0 8px rgba(var(--qf-ice), 0.7); }
:is(#panel_hangar, #panel_inventory) .item.qf-card:hover .qf-art img.thumbnail {
	filter: drop-shadow(0 0 8px rgba(var(--c), 0.6)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6));
}
:is(#panel_hangar, #panel_inventory) .item.qf-card[data-itemtype="1"]:hover .qf-art img.thumbnail { transform: scale(1.55) translateY(-3px); }
:is(#panel_hangar, #panel_inventory) .item.qf-card:not([data-itemtype="1"]):hover .qf-art img.thumbnail { transform: scale(1.08); opacity: 1; }
:is(#panel_hangar, #panel_inventory) .item.qf-card:hover .qf-sweep { animation: qf-card-sweep 0.7s ease-out 1; }
@keyframes qf-card-sweep { to { background-position: 150% 0; } }

/* selected (last clicked) */
:is(#panel_hangar, #panel_inventory) .item.qf-card.selected {
	--edge: rgb(var(--qf-ice));
	box-shadow: inset 0 0 0 1px rgba(var(--qf-ice), 0.6), inset 0 0 24px rgba(var(--qf-ice), 0.3);
}
:is(#panel_hangar, #panel_inventory) .item.qf-card.selected .qf-brk { opacity: 1; transform: none; }


@media (prefers-reduced-motion: reduce) {
	:is(#panel_hangar, #panel_inventory) .item.qf-card:hover .qf-sweep { animation: none; }
}


/* ==========================================================================
   HANGAR DETAILS PANE (center column: selected ship / item)
   Markup: inventory.js renderItemHMTL_1 / renderItemHMTL_default.
   Prefixed with #panel_hangar to beat the legacy .hangar_context rules.
   ========================================================================== */

#panel_hangar .hangar_context .qf-detail {
	--c: 153, 153, 153;
	display: grid;
	grid-template-columns: minmax(150px, 34%) 1fr;
	grid-template-areas: "bay main" "side main";
	grid-template-rows: auto 1fr;
	gap: 12px 16px;
	align-items: start;
	padding-top: 4px;                   /* not margin: it collapses through .main and pushes the pane 4px past its scroller */
}
#panel_hangar .hangar_context .qf-detail[data-class_slug="f"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="f"] { --c: var(--qf-cls-f); }
#panel_hangar .hangar_context .qf-detail[data-class_slug="e"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="e"] { --c: var(--qf-cls-e); }
#panel_hangar .hangar_context .qf-detail[data-class_slug="d"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="d"] { --c: var(--qf-cls-d); }
#panel_hangar .hangar_context .qf-detail[data-class_slug="c"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="c"] { --c: var(--qf-cls-c); }
#panel_hangar .hangar_context .qf-detail[data-class_slug="b"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="b"] { --c: var(--qf-cls-b); }
#panel_hangar .hangar_context .qf-detail[data-class_slug="a"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="a"] { --c: var(--qf-cls-a); }
#panel_hangar .hangar_context .qf-detail[data-class_slug="s"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="s"] { --c: var(--qf-cls-s); }
#panel_hangar .hangar_context .qf-detail[data-class_slug="z"],
#panel_hangar .hangar_context .qf-bay[data-class_slug="z"] { --c: var(--qf-cls-z); }

/* ---- bay: framed art, class badge, class name, location, slot visualizer ---- */
#panel_hangar .hangar_context .qf-bay {
	--bh: 20px;
	--sl: 5px;                 /* 5/20 = same slant as the filter chips and card badges */
	--ch: 12px;
	--edge: rgba(var(--c), 0.55);
	grid-area: bay;
	position: relative;
	aspect-ratio: 1;
	isolation: isolate;
	clip-path: polygon(var(--sl) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--bh));
	border: 1px solid var(--edge);
	background:
		linear-gradient(135deg, transparent calc(50% - 0.7px), var(--edge) calc(50% - 0.7px), var(--edge) calc(50% + 0.7px), transparent calc(50% + 0.7px)) right bottom / var(--ch) var(--ch) no-repeat border-box,
		/* holo pad under the ship */
		radial-gradient(42% 9% at 50% 74%, rgba(var(--c), 0.45), rgba(var(--c), 0) 100%),
		radial-gradient(55% 45% at 50% 48%, rgba(var(--c), 0.22), rgba(var(--c), 0) 100%),
		linear-gradient(180deg, rgba(10, 30, 56, 0.6), rgba(2, 10, 24, 0.85));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 30px rgba(var(--c), 0.12);
}
#panel_hangar .hangar_context .qf-bay::before {      /* top accent after the badge */
	content: '';
	position: absolute;
	top: 0;
	left: 36px;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, rgba(var(--c), 0.9), rgba(var(--c), 0));
	box-shadow: 0 0 6px rgba(var(--c), 0.7);
}
#panel_hangar .hangar_context .qf-bay .qf-badge {
	position: absolute;
	top: -1px;
	left: -1px;
	z-index: 3;
	height: calc(var(--bh) + 1px);
	min-width: 36px;
	padding: 0 10px;
	text-align: center;
	font-size: 12px;
	font-weight: 700;
	line-height: calc(var(--bh) + 1px);
	letter-spacing: 0.08em;
	color: #06101c;
	background: rgb(var(--c));
	clip-path: polygon(var(--sl) 0, 100% 0, calc(100% - var(--sl)) 100%, 0 100%);
	box-shadow: 0 0 12px rgba(var(--c), 0.8);
}
#panel_hangar .hangar_context .qf-bay-class {
	position: absolute;
	top: 6px;
	right: 10px;
	z-index: 2;
	font-size: 9px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(var(--c), 0.85);
	text-shadow: 0 0 6px rgba(var(--c), 0.5);
}
#panel_hangar .hangar_context .qf-bay img.main_img {
	position: absolute;
	left: 10%;
	right: 10%;
	top: 14%;
	width: 80%;
	height: 62%;
	object-fit: contain;
	border: 0;
	background: none;
	filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
	box-shadow: none;          /* legacy main.css shadow drew a box around the image */
	z-index: 1;
}
#panel_hangar .hangar_context .qf-detail-item .qf-bay img.main_img {   /* square painted item icons */
	left: 22%;
	right: 22%;
	width: 56%;
	top: 18%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
#panel_hangar .hangar_context .qf-bay .qf-slots {
	position: absolute;
	left: 12px;
	bottom: 12px;
	z-index: 2;
}
#panel_hangar .hangar_context .qf-bay-loc {
	position: absolute;
	right: 16px;
	bottom: 10px;
	z-index: 2;
	padding: 0 8px;
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: 0.14em;
	color: #dff4ff;
	border: 1px solid rgba(var(--qf-ice), 0.5);
	background: rgba(0, 0, 0, 0.45);
	text-shadow: 0 0 6px rgba(var(--qf-ice), 0.8);
}
#panel_hangar .hangar_context .qf-unfielded .qf-bay-loc {
	color: rgba(var(--qf-ice), 0.6);
	border-color: rgba(var(--qf-ice), 0.25);
	text-shadow: none;
}

/* side column: sell values + description */
#panel_hangar .hangar_context .qf-detail-side { grid-area: side; }
#panel_hangar .hangar_context .qf-detail-side .costs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 8px;
	font-size: 12px;
}
#panel_hangar .hangar_context .qf-detail-side .costs > span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0 !important;
	padding: 2px 8px;
	color: #dbe9f5;
	border: 1px solid rgba(var(--qf-cyan), 0.3);
	background: rgba(0, 0, 0, 0.3);
}
#panel_hangar .hangar_context .qf-detail-side .costs .icon { width: 1.3em; margin: 0; }
#panel_hangar .hangar_context .qf-detail-side .description {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: rgba(219, 233, 245, 0.7);
}

/* ---- main column ---- */
#panel_hangar .hangar_context .qf-detail-main { grid-area: main; min-width: 0; }
#panel_hangar .hangar_context .qf-detail-main .stats,
#panel_hangar .hangar_context .qf-detail-main .equipment {
	background: none;
	border: 0;
	box-shadow: none;
	padding: 0;
	margin: 0 0 12px;
}
#panel_hangar .hangar_context .qf-type-desc {
	color: rgba(219, 233, 245, 0.7);
	font-size: 13px;
	letter-spacing: 0.04em;
}

/* stat tiles */
#panel_hangar .hangar_context .qf-stat-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
	gap: 6px;
}
#panel_hangar .hangar_context .qf-stat-tile.stat {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 8px;
	padding: 8px 10px;
	text-align: left;
	border: 1px solid rgba(var(--qf-cyan), 0.3);
	background:
		linear-gradient(135deg, transparent calc(50% - 0.6px), rgba(var(--qf-cyan), 0.3) calc(50% - 0.6px), rgba(var(--qf-cyan), 0.3) calc(50% + 0.6px), transparent calc(50% + 0.6px)) right bottom / 8px 8px no-repeat border-box,
		linear-gradient(180deg, rgba(var(--qf-cyan), 0.08), rgba(0, 10, 28, 0.45));
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
#panel_hangar .hangar_context .qf-stat-ico { grid-row: 1 / span 2; display: flex; color: #dbe9f5; }
#panel_hangar .hangar_context .qf-stat-ico svg { width: 18px; height: 18px; opacity: 0.85; }
#panel_hangar .hangar_context .qf-stat-tile .value {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.1;
	color: #ffffff;
	text-shadow: 0 0 8px rgba(var(--qf-ice), 0.5);
}
#panel_hangar .hangar_context .qf-stat-lbl {
	font-size: 9px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(var(--qf-ice), 0.65);
}

/* ---- equipment rows ---- */
#panel_hangar .hangar_context .equipment { display: flex; flex-direction: column; gap: 6px; }
#panel_hangar .hangar_context .equipment .slot_row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border-radius: 0;
	border-left: 2px solid rgba(var(--qf-cyan), 0.45);
	background: linear-gradient(90deg, rgba(var(--qf-cyan), 0.07), rgba(var(--qf-cyan), 0) 70%);
	transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
	animation: none;
}
#panel_hangar .hangar_context .equipment .slot_row:hover { border-left-color: rgb(var(--qf-ice)); }
#panel_hangar .hangar_context .equipment .slot_label {
	display: flex;
	flex-direction: column;
	width: 72px;
	height: auto;
	flex: none;
	line-height: 1.2;
	text-align: left;
	text-shadow: none;
}
#panel_hangar .hangar_context .qf-row-name {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #dff4ff;
}
#panel_hangar .hangar_context .qf-row-count {
	font-size: 10px;
	letter-spacing: 0.1em;
	color: rgba(var(--qf-ice), 0.6);
}
#panel_hangar .hangar_context .qf-row-tiles { display: flex; flex-wrap: wrap; gap: 6px; }

/* slot tile: empty = dashed socket with crosshair, occupied = class-edged item */
#panel_hangar .hangar_context .equipment .slot_tile {
	--c: var(--qf-ice);
	position: relative;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px dashed rgba(var(--qf-ice), 0.3);
	background:
		linear-gradient(rgba(var(--qf-ice), 0.25), rgba(var(--qf-ice), 0.25)) center / 10px 1px no-repeat,
		linear-gradient(rgba(var(--qf-ice), 0.25), rgba(var(--qf-ice), 0.25)) center / 1px 10px no-repeat,
		rgba(0, 0, 0, 0.3);
	clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
	box-shadow: none;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
#panel_hangar .hangar_context .equipment .slot_tile.occupied {
	cursor: pointer;
	border: 1px solid rgba(var(--c), 0.8);
	background: rgba(0, 0, 0, 0.4);
	box-shadow: inset 0 0 10px rgba(var(--c), 0.35);
}
#panel_hangar .hangar_context .slot_tile[data-class_slug="f"] { --c: var(--qf-cls-f); }
#panel_hangar .hangar_context .slot_tile[data-class_slug="e"] { --c: var(--qf-cls-e); }
#panel_hangar .hangar_context .slot_tile[data-class_slug="d"] { --c: var(--qf-cls-d); }
#panel_hangar .hangar_context .slot_tile[data-class_slug="c"] { --c: var(--qf-cls-c); }
#panel_hangar .hangar_context .slot_tile[data-class_slug="b"] { --c: var(--qf-cls-b); }
#panel_hangar .hangar_context .slot_tile[data-class_slug="a"] { --c: var(--qf-cls-a); }
#panel_hangar .hangar_context .slot_tile[data-class_slug="s"] { --c: var(--qf-cls-s); }
#panel_hangar .hangar_context .slot_tile[data-class_slug="z"] { --c: var(--qf-cls-z); }
#panel_hangar .hangar_context .equipment .slot_tile .thumbnail {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	float: none;
	object-fit: cover;
	background: none;
}
#panel_hangar .hangar_context .qf-tile-badge {
	position: absolute;
	top: 0;
	left: 0;
	height: 11px;
	padding: 0 4px 0 5px;
	font-size: 8px;
	font-weight: 700;
	line-height: 11px;
	color: #06101c;
	background: rgb(var(--c));
	clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
	pointer-events: none;
}
/* occupied hover: remove hint */
#panel_hangar .hangar_context .qf-tile-x {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	background:
		linear-gradient(45deg, transparent calc(50% - 1px), #ffffff calc(50% - 1px), #ffffff calc(50% + 1px), transparent calc(50% + 1px)) center / 14px 14px no-repeat,
		linear-gradient(-45deg, transparent calc(50% - 1px), #ffffff calc(50% - 1px), #ffffff calc(50% + 1px), transparent calc(50% + 1px)) center / 14px 14px no-repeat,
		rgba(120, 10, 30, 0.6);
	transition: opacity 0.2s;
}
#panel_hangar .hangar_context .equipment .slot_tile.occupied:hover {
	border-color: #ff4d6a;
	box-shadow: inset 0 0 12px rgba(255, 77, 106, 0.5);
}
#panel_hangar .hangar_context .equipment .slot_tile.occupied:hover .qf-tile-x { opacity: 1; }

/* drag states: compatible rows light up; hovered row pulls its free sockets bright */
#panel_hangar .hangar_context .equipment .slot_row.drop-target-active {
	border-left-color: rgb(var(--qf-ice));
	background: linear-gradient(90deg, rgba(var(--qf-ice), 0.16), rgba(var(--qf-ice), 0) 80%);
	animation: qf-row-pulse 1.4s ease-in-out infinite;
}
#panel_hangar .hangar_context .equipment .slot_row.drop-target-active .slot_tile:not(.occupied) {
	border-color: rgba(var(--qf-ice), 0.75);
	box-shadow: inset 0 0 10px rgba(var(--qf-ice), 0.3);
}
#panel_hangar .hangar_context .equipment .slot_row.drop-target-active .slot_label { color: inherit; text-shadow: none; }
#panel_hangar .hangar_context .equipment .slot_row.drop-target-hover {
	border-left-color: #ffffff;
	background: linear-gradient(90deg, rgba(var(--qf-ice), 0.28), rgba(var(--qf-ice), 0) 85%);
}
#panel_hangar .hangar_context .equipment .slot_row.drop-target-hover .slot_tile:not(.occupied) {
	border-style: solid;
	border-color: #ffffff;
	box-shadow: inset 0 0 14px rgba(var(--qf-ice), 0.6), 0 0 8px rgba(var(--qf-ice), 0.6);
}
#panel_hangar .hangar_context .equipment .slot_row.drop-target-hover .slot_label { color: inherit; text-shadow: none; }
#panel_hangar .hangar_context .equipment .slot_tile.drop-target-hover {
	border-style: solid;
	border-color: #ffffff;
	box-shadow: inset 0 0 14px rgba(var(--qf-ice), 0.6);
}
@keyframes qf-row-pulse {
	0%, 100% { box-shadow: inset 2px 0 8px rgba(var(--qf-ice), 0.15); }
	50%      { box-shadow: inset 2px 0 16px rgba(var(--qf-ice), 0.4); }
}

/* not in the fleet yet: equipping needs a fleet tile */
#panel_hangar .hangar_context .qf-equip-hint {
	padding: 6px 10px;
	font-size: 11px;
	letter-spacing: 0.08em;
	color: #ffd36b;
	border-left: 2px solid #ffcc00;
	background: linear-gradient(90deg, rgba(255, 204, 0, 0.12), rgba(255, 204, 0, 0));
}
#panel_hangar .hangar_context .qf-unfielded .equipment .slot_row { opacity: 0.55; }

/* ---- actions (remove from fleet / remove equipment) ---- */
#panel_hangar .hangar_context .actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 4px 0 0;
	padding: 10px 0 0;
	border-top: 1px solid rgba(var(--qf-cyan), 0.2);
}
#panel_hangar .hangar_context .actions .action {
	display: flex;
	align-items: center;
	margin: 0;
	font-size: 12px;
	color: rgba(219, 233, 245, 0.75);
}
#panel_hangar .hangar_context .actions .action em { font-style: normal; letter-spacing: 0.04em; }
#panel_hangar .hangar_context .actions .action strong { color: #dff4ff; letter-spacing: 0.1em; }
#panel_hangar .hangar_context .actions .btn {
	width: 30px;
	height: 26px;
	padding: 0 !important;
	margin-right: 8px !important;
	font-weight: 700;
	line-height: 24px;
	border-radius: 0;
	clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
	box-shadow: none;
	transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
#panel_hangar .hangar_context .actions .btn-danger {
	color: #ffd9df;
	border: 1px solid rgba(255, 77, 106, 0.7);
	background: rgba(150, 20, 45, 0.45);
}
#panel_hangar .hangar_context .actions .btn-danger:hover { background: rgba(200, 30, 60, 0.7); box-shadow: 0 0 10px rgba(255, 77, 106, 0.6); }
#panel_hangar .hangar_context .actions .btn-secondary {
	color: #dff4ff;
	border: 1px solid rgba(var(--qf-ice), 0.5);
	background: rgba(var(--qf-cyan), 0.12);
}
#panel_hangar .hangar_context .actions .btn-secondary:hover { background: rgba(var(--qf-cyan), 0.3); box-shadow: 0 0 10px rgba(var(--qf-ice), 0.5); }

@media (prefers-reduced-motion: reduce) {
	#panel_hangar .hangar_context .equipment .slot_row.drop-target-active { animation: none; }
}

/* ==========================================================================
   DRAG & DROP (qf-drag.js)
   source card stays lit, valid fleet hexes glow, a small chip follows the
   pointer and an orthogonal wire runs from the source to the pointer.
   ========================================================================== */
#panel_hangar .view_inventory .item,
#panel_hangar .fleet_positions .hangar_module > .item {
	-webkit-user-drag: none;
	user-select: none;
}
/* Scoped to the panel on purpose: a `body.qf-dragging *` rule restyles every element on
   the page — including the ~130 map tiles behind the panel, each a composited layer —
   and the resulting re-raster shows as tiles flashing black when a drag starts. */
body.qf-dragging { cursor: grabbing; }
body.qf-dragging #panel_hangar,
body.qf-dragging #panel_hangar *,
body.qf-dragging .qf-drag-layer * { cursor: grabbing !important; user-select: none; }

/* source card: its hover look, plus a cyan edge */
#panel_hangar .item.qf-card.qf-drag-source {
	--edge: rgb(var(--qf-ice));
	box-shadow: inset 0 0 0 1px rgba(var(--qf-ice), 0.9), inset 0 0 24px rgba(var(--qf-ice), 0.32), 0 0 12px rgba(var(--qf-ice), 0.35);
}
#panel_hangar .item.qf-card.qf-drag-source .qf-brk { opacity: 1; transform: scale(1); --k: rgb(var(--qf-ice)); }
#panel_hangar .item.qf-card.qf-drag-source .qf-art img.thumbnail {
	filter: drop-shadow(0 0 8px rgba(var(--c), 0.6)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6));
}
#panel_hangar .item.qf-card[data-itemtype="1"].qf-drag-source .qf-art img.thumbnail { transform: scale(1.55) translateY(-3px); }
#panel_hangar .item.qf-card:not([data-itemtype="1"]).qf-drag-source .qf-art img.thumbnail { transform: scale(1.08); opacity: 1; }

/* source fleet ship: its hex stays in the hover state */
#panel_hangar .fleet_positions .hangar_module.qf-drag-origin .hex-combat { opacity: 0; }
#panel_hangar .fleet_positions .hangar_module.qf-drag-origin .hex-combat.hex-combat-active { opacity: 1; transform: scale(1); }
#panel_hangar .fleet_positions .hangar_module.qf-drag-origin > .item {
	filter: drop-shadow(0 0 6px rgba(31, 217, 241, 0.8)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
}

/* fleet hexes that can take the dragged item: the lit hex at partial strength, pulsing */
#panel_hangar .fleet_positions .hangar_module.qf-drop-ok .hex-combat.hex-combat-active {
	transform: scale(1);
	animation: qf-drop-ok 1.4s ease-in-out infinite;
}
#panel_hangar .fleet_positions .hangar_module.qf-drop-ok.hovered .hex-combat.hex-combat-active {
	animation: qf-hex-pulse 2.2s ease-in-out infinite;
}
@keyframes qf-drop-ok {
	0%, 100% { opacity: 0.35; }
	50%      { opacity: 0.7; }
}

/* overlay: wire + pointer chip */
.qf-drag-layer {
	position: fixed;
	inset: 0;
	z-index: 10000;
	pointer-events: none;
	contain: layout paint;   /* nothing in here affects layout or painting outside it */
}
/* mounted once and left in place; a new fixed layer appearing over the map on every
   drag start forces the compositor to rebuild the layers beneath it */
.qf-drag-layer:not(.active) > * { display: none; }
.qf-drag-wires {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.qf-drag-wires path { fill: none; stroke: rgb(var(--qf-ice)); stroke-linejoin: miter; }
.qf-drag-wires .qf-wire-glow { stroke-width: 4; opacity: 0.18; }
.qf-drag-wires .qf-wire {
	stroke-width: 1;
	stroke-dasharray: 6 4;
	filter: drop-shadow(0 0 2px rgba(var(--qf-ice), 0.9));
	animation: qf-wire-flow 0.5s linear infinite;
}
.qf-drag-wires .qf-wire-origin { fill: rgb(var(--qf-ice)); filter: drop-shadow(0 0 3px rgba(var(--qf-ice), 1)); }
.qf-drag-wires .qf-wire-tip { fill: #fff; filter: drop-shadow(0 0 3px rgba(var(--qf-ice), 1)); }
@keyframes qf-wire-flow { to { stroke-dashoffset: -10; } }

.qf-drag-helper {
	--c: var(--qf-ice);
	position: absolute;
	left: 0;
	top: 0;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(circle at 50% 40%, rgba(var(--c), 0.22), rgba(6, 14, 26, 0.92) 70%);
	border: 1px solid rgb(var(--c));
	box-shadow: 0 0 14px rgba(var(--c), 0.55), inset 0 0 12px rgba(var(--c), 0.35);
	/* no backdrop-filter: it makes the compositor re-rasterize everything under the chip
	   the moment it appears (the black tile flash) and again on every frame it moves */
	will-change: transform;
}
/* locked onto a valid drop target */
.qf-drag-helper.qf-snapped {
	border-color: #fff;
	box-shadow: 0 0 0 2px rgba(var(--c), 0.9), 0 0 20px rgba(var(--c), 0.85), inset 0 0 12px rgba(var(--c), 0.45);
}
.qf-drag-helper img {
	width: calc(100% - 6px);      /* 3px margin all round inside the ring */
	height: calc(100% - 6px);
	border-radius: 50%;
	object-fit: cover;
}
.qf-drag-helper[data-c="f"] { --c: var(--qf-cls-f); }
.qf-drag-helper[data-c="e"] { --c: var(--qf-cls-e); }
.qf-drag-helper[data-c="d"] { --c: var(--qf-cls-d); }
.qf-drag-helper[data-c="c"] { --c: var(--qf-cls-c); }
.qf-drag-helper[data-c="b"] { --c: var(--qf-cls-b); }
.qf-drag-helper[data-c="a"] { --c: var(--qf-cls-a); }
.qf-drag-helper[data-c="s"] { --c: var(--qf-cls-s); }
.qf-drag-helper[data-c="z"] { --c: var(--qf-cls-z); }

@media (prefers-reduced-motion: reduce) {
	.qf-drag-wires .qf-wire { animation: none; }
	#panel_hangar .fleet_positions .hangar_module.qf-drop-ok .hex-combat.hex-combat-active { animation: none; opacity: 0.5; }
}

/* ==========================================================================
   EQUIP MATERIALIZE (inventory.js playMaterialize)
   ========================================================================== */
#panel_hangar .hangar_context .equipment .slot_tile.qf-mat { animation: qf-mat-tile 0.7s steps(7) 1 both; }
@keyframes qf-mat-tile {
	0%   { box-shadow: inset 0 0 18px rgba(var(--c), 0.9), 0 0 0 rgba(var(--c), 0); border-color: #fff; }
	60%  { box-shadow: inset 0 0 14px rgba(var(--c), 0.7); border-color: rgb(var(--c)); }
	100% { box-shadow: inset 0 0 10px rgba(var(--c), 0.35); border-color: rgba(var(--c), 0.8); }
}
.slot_tile .qf-mat-hide { opacity: 0; }
.slot_tile .qf-mat-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	image-rendering: pixelated;
}
.slot_tile .qf-mat-scan {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 2px;
	z-index: 3;
	pointer-events: none;
	background: #fff;
	box-shadow: 0 0 6px 1px rgba(var(--c), 1), 0 0 14px 2px rgba(var(--c), 0.6);
	opacity: 0;
	animation: qf-mat-scan 0.5s cubic-bezier(0.4, 0, 0.6, 1) 1 both;
}
@keyframes qf-mat-scan {
	0%   { top: 0; opacity: 1; }
	90%  { opacity: 1; }
	100% { top: 100%; opacity: 0; }
}
/* fleet hex pips: the column for the new item flickers on */
#panel_hangar .fleet_positions .qf-slots .qf-col.qf-mat-col i.on { animation: qf-mat-pip 0.7s steps(1) 1 both; animation-delay: inherit; }
@keyframes qf-mat-pip {
	0%, 20%, 40% { background: #fff; box-shadow: 0 0 6px rgba(var(--p), 1); }
	10%, 30%     { background: #3f414a; box-shadow: none; }
	60%          { background: rgb(var(--p)); box-shadow: 0 0 6px rgba(var(--p), 1); }
}
@media (prefers-reduced-motion: reduce) {
	#panel_hangar .hangar_context .equipment .slot_tile.qf-mat,
	.slot_tile .qf-mat-scan,
	#panel_hangar .fleet_positions .qf-slots .qf-col.qf-mat-col i.on { animation: none; }
}


/* ==========================================================================
   HANGAR HOTKEY EQUIP  (hangar.js refreshHotkeyBadges)
   Hovering a gear card numbers every fielded ship; the digit equips it there.
   ========================================================================== */
#panel_hangar .fleet_positions .hangar_module > .qf-hotkey {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 7;                          /* above ship art (3) and equipment pips (6) */
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 4px 8px 3px;
	pointer-events: none;
	white-space: nowrap;
	background: radial-gradient(60% 60% at 50% 50%, rgba(2, 10, 24, 0.85), rgba(2, 10, 24, 0) 100%);
	animation: qf-hotkey-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#panel_hangar .fleet_positions .hangar_module > .qf-hotkey .qf-hotkey-label {
	max-width: 52px;                     /* hex is ~60px wide: wrap "press to equip" onto two lines */
	white-space: normal;
	text-align: center;
	font-size: 7px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(170, 186, 204, 0.8);     /* grey caption */
	text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
}
#panel_hangar .fleet_positions .hangar_module > .qf-hotkey .qf-hotkey-key {
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
	color: #ffffff;                      /* bold white digit */
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 10px rgba(var(--qf-ice), 0.95), 0 0 2px rgba(0, 0, 0, 1);
}
/* the ship art steps back so the digit reads; ready hexes light up in their class colour */
#panel_hangar .fleet_positions .hangar_module.qf-hotkey-ready > .item,
#panel_hangar .fleet_positions .hangar_module.qf-hotkey-blocked > .item { filter: brightness(0.45) saturate(0.7); }
#panel_hangar .fleet_positions .hangar_module.qf-hotkey-ready .hex-combat { opacity: 0; }
#panel_hangar .fleet_positions .hangar_module.qf-hotkey-ready .hex-combat.hex-combat-active { opacity: 1; transform: scale(1); }
/* blocked: muted digit, amber caption with the reason */
#panel_hangar .fleet_positions .hangar_module.qf-hotkey-blocked > .qf-hotkey .qf-hotkey-key {
	color: rgba(170, 186, 204, 0.45);
	text-shadow: 0 0 2px rgba(0, 0, 0, 1);
	text-decoration: line-through;
	text-decoration-thickness: 2px;
}
#panel_hangar .fleet_positions .hangar_module.qf-hotkey-blocked > .qf-hotkey .qf-hotkey-label { color: rgba(255, 170, 60, 0.85); }
@keyframes qf-hotkey-in {
	from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
	to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
	#panel_hangar .fleet_positions .hangar_module > .qf-hotkey { animation: none; }
}

/* ---- drag feedback: full row says why and points at the swap; occupied tiles are swap targets ---- */
#panel_hangar .hangar_context .equipment .slot_row.qf-row-full { border-left-color: rgba(255, 170, 60, 0.9); }
#panel_hangar .hangar_context .equipment .slot_row.qf-row-full .qf-row-why {
	flex: 0 1 150px;
	min-width: 0;
	line-height: 1.3;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 170, 60, 0.9);
	text-shadow: none;
}
#panel_hangar .hangar_context .equipment .slot_tile.occupied.qf-drop-ok {
	border-style: dashed;
	border-color: rgba(255, 255, 255, 0.85);
	animation: qf-swap-ok 1.4s ease-in-out infinite;
}
#panel_hangar .hangar_context .equipment .slot_tile.occupied.qf-drop-ok .thumbnail { opacity: 0.55; }
#panel_hangar .hangar_context .equipment .slot_tile.occupied.drop-target-hover .thumbnail { opacity: 0.35; }
@keyframes qf-swap-ok {
	0%, 100% { box-shadow: inset 0 0 8px rgba(var(--qf-ice), 0.25); }
	50%      { box-shadow: inset 0 0 14px rgba(var(--qf-ice), 0.6); }
}
@media (prefers-reduced-motion: reduce) {
	#panel_hangar .hangar_context .equipment .slot_tile.occupied.qf-drop-ok { animation: none; }
}


/* ==========================================================================
   Buttons: glass HUD treatment for Bootstrap .btn (global, incl. /login).
   The button box itself is transparent: ::before draws the chamfered outline
   and ::after the glass fill, so the drop-shadow glow follows the cut corners.
   <input class="btn"> can't carry pseudo-elements, so it gets a flat fallback.
   ========================================================================== */
.btn {
	--qf-btn-c: var(--qf-cyan);            /* accent, rgb triplet */
	--qf-btn-fill: 0.34;                   /* fill alpha at the bottom of the gradient */
	--qf-btn-cut: 9px;                     /* chamfer size */
	position: relative;
	z-index: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #eaf7ff;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-shadow: 0 0 6px rgba(var(--qf-btn-c), 0.45);
	box-shadow: none;
	filter: drop-shadow(0 0 5px rgba(var(--qf-btn-c), 0.35));
	transition: color 0.2s, filter 0.25s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn::before,
.btn::after {
	content: '';
	position: absolute;
	z-index: -1;
	pointer-events: none;
}
.btn::before {                                               /* outline */
	inset: 0;
	clip-path: polygon(var(--qf-btn-cut) 0, 100% 0, 100% calc(100% - var(--qf-btn-cut)), calc(100% - var(--qf-btn-cut)) 100%, 0 100%, 0 var(--qf-btn-cut));
	background: linear-gradient(180deg, rgba(var(--qf-btn-c), 0.95) 0%, rgba(var(--qf-btn-c), 0.55) 100%);
	transition: filter 0.2s;
}
.btn::after {                                                /* glass fill, 1px inside the outline */
	inset: 1px;
	clip-path: polygon(calc(var(--qf-btn-cut) - 0.6px) 0, 100% 0, 100% calc(100% - var(--qf-btn-cut) + 0.6px), calc(100% - var(--qf-btn-cut) + 0.6px) 100%, 0 100%, 0 calc(var(--qf-btn-cut) - 0.6px));
	background:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
		linear-gradient(180deg, rgba(var(--qf-btn-c), calc(var(--qf-btn-fill) + 0.22)) 0%, rgba(var(--qf-btn-c), var(--qf-btn-fill)) 55%, rgba(var(--qf-btn-c), calc(var(--qf-btn-fill) - 0.12)) 100%),
		linear-gradient(180deg, rgba(6, 24, 48, 0.88), rgba(2, 10, 24, 0.92));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 0 rgba(var(--qf-btn-c), 0);
	transition: box-shadow 0.2s;
}
.btn:hover {
	color: #ffffff;
	filter: drop-shadow(0 0 9px rgba(var(--qf-btn-c), 0.7));
}
.btn:hover::before { filter: brightness(1.45) saturate(0.7); }
.btn:hover::after  { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 100px rgba(var(--qf-btn-c), 0.28); }
.btn:focus,
.btn.focus { box-shadow: none; outline: none; }
.btn:focus-visible::before { background: #ffffff; }
.btn:not(:disabled):not(.disabled):active,
.btn:not(:disabled):not(.disabled).active {
	transform: translateY(1px);
	filter: drop-shadow(0 0 3px rgba(var(--qf-btn-c), 0.5));
}
.btn:disabled,
.btn.disabled { opacity: 0.45; filter: none; }
.btn-lg { font-size: 1rem; letter-spacing: 0.2em; padding: 0.75rem 1.5rem; --qf-btn-cut: 12px; }
.btn-sm { letter-spacing: 0.1em; --qf-btn-cut: 6px; }

/* variant accents */
.btn-secondary { --qf-btn-c: 158, 168, 180; --qf-btn-fill: 0.18; }   /* neutral gray */
.btn-success   { --qf-btn-c: 68, 218, 118; --qf-btn-fill: 0.28; }
.btn-danger    { --qf-btn-c: 255, 77, 106; --qf-btn-fill: 0.3; }
.btn-warning   { --qf-btn-c: 255, 174, 72; --qf-btn-fill: 0.3; }
.btn-info      { --qf-btn-c: 31, 217, 241; --qf-btn-fill: 0.28; }
.btn[class*="btn-outline-"] { --qf-btn-fill: 0.14; }
.btn.faction_1 { --qf-btn-c: 68, 218, 118; }
.btn.faction_2 { --qf-btn-c: 255, 174, 72; }
.btn.faction_3 { --qf-btn-c: 202, 165, 251; }
.btn.faction_1:hover, .btn.faction_2:hover, .btn.faction_3:hover { border: 0; }

/* <input class="btn">: no pseudo-elements available, draw the shape on the element itself */
input.btn {
	border: 1px solid rgba(var(--qf-btn-c), 0.8);
	background:
		linear-gradient(180deg, rgba(var(--qf-btn-c), calc(var(--qf-btn-fill) + 0.22)), rgba(var(--qf-btn-c), var(--qf-btn-fill))),
		rgba(4, 18, 40, 0.9);
	clip-path: polygon(var(--qf-btn-cut) 0, 100% 0, 100% calc(100% - var(--qf-btn-cut)), calc(100% - var(--qf-btn-cut)) 100%, 0 100%, 0 var(--qf-btn-cut));
	filter: none;
}
input.btn:hover {
	border-color: #ffffff;
	background:
		linear-gradient(180deg, rgba(var(--qf-btn-c), calc(var(--qf-btn-fill) + 0.5)), rgba(var(--qf-btn-c), calc(var(--qf-btn-fill) + 0.25))),
		rgba(4, 18, 40, 0.9);
}

/* the hangar's small icon buttons draw their own chamfer; keep them flat */
#panel_hangar .hangar_context .actions .btn::before,
#panel_hangar .hangar_context .actions .btn::after { content: none; }
#panel_hangar .hangar_context .actions .btn { filter: none; letter-spacing: 0; text-shadow: none; }

/* Bootstrap paints background/border/box-shadow per variant and state; clear them at matching specificity */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:disabled,
.btn-primary.disabled,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle,
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary.focus,
.btn-secondary:disabled,
.btn-secondary.disabled,
.btn-secondary:not(:disabled):not(.disabled):active,
.btn-secondary:not(:disabled):not(.disabled).active,
.show > .btn-secondary.dropdown-toggle,
.btn-success,
.btn-success:hover,
.btn-success:focus,
.btn-success.focus,
.btn-success:disabled,
.btn-success.disabled,
.btn-success:not(:disabled):not(.disabled):active,
.btn-success:not(:disabled):not(.disabled).active,
.show > .btn-success.dropdown-toggle,
.btn-danger,
.btn-danger:hover,
.btn-danger:focus,
.btn-danger.focus,
.btn-danger:disabled,
.btn-danger.disabled,
.btn-danger:not(:disabled):not(.disabled):active,
.btn-danger:not(:disabled):not(.disabled).active,
.show > .btn-danger.dropdown-toggle,
.btn-warning,
.btn-warning:hover,
.btn-warning:focus,
.btn-warning.focus,
.btn-warning:disabled,
.btn-warning.disabled,
.btn-warning:not(:disabled):not(.disabled):active,
.btn-warning:not(:disabled):not(.disabled).active,
.show > .btn-warning.dropdown-toggle,
.btn-info,
.btn-info:hover,
.btn-info:focus,
.btn-info.focus,
.btn-info:disabled,
.btn-info.disabled,
.btn-info:not(:disabled):not(.disabled):active,
.btn-info:not(:disabled):not(.disabled).active,
.show > .btn-info.dropdown-toggle {
	background-color: transparent;
	border-color: transparent;
	box-shadow: none;
	color: #eaf7ff;
}
.btn.faction_1, .btn.faction_2, .btn.faction_3,
.btn.faction_1:hover, .btn.faction_2:hover, .btn.faction_3:hover { background: transparent; }


/* ==========================================================================
   Territory control bars (bottom-right of the map): one glass block, a row
   per faction with name, share of the map, and a segmented fill that is
   relative to the leading faction. Filled by renderControlBar() in main.js.
   ========================================================================== */
.map-stats.map-stats-primary {
	width: 232px;
	max-width: 232px;
	bottom: 24px;
	right: 16px;
}
.map-stats.map-stats-primary {
	bottom: 66px;
}
.map-stats .faction-control {
	position: relative;
	padding: 9px 12px 8px;
	clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
	background:
		linear-gradient(225deg, transparent 9.9px, rgba(var(--qf-ice), 0.7) 9.9px 10.9px, transparent 10.9px),   /* outline on the cut corners */
		linear-gradient(45deg,  transparent 9.9px, rgba(var(--qf-ice), 0.7) 9.9px 10.9px, transparent 10.9px),
		repeating-linear-gradient(90deg, rgba(var(--qf-cyan), 0.05) 0 1px, transparent 1px 12px),
		linear-gradient(180deg, rgba(8, 36, 70, 0.5) 0%, rgba(2, 14, 34, 0.74) 100%);
	-webkit-backdrop-filter: blur(10px) saturate(150%);
	backdrop-filter: blur(10px) saturate(150%);
	box-shadow: inset 0 0 0 1px rgba(var(--qf-ice), 0.4), inset 0 0 24px rgba(var(--qf-cyan), 0.08);
	font-family: 'Play', sans-serif;
}
.map-stats .faction-control .qf-ctl-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	font-size: 8px;
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: rgba(var(--qf-ice), 0.85);
}
.map-stats .faction-control .qf-ctl-title::before {
	content: '';
	width: 5px;
	height: 5px;
	background: rgb(var(--qf-ice));
	box-shadow: 0 0 6px rgb(var(--qf-ice));
	transform: rotate(45deg);
}
.map-stats .faction-control .qf-ctl-title::after {
	content: '';
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, rgba(var(--qf-ice), 0.5), rgba(var(--qf-ice), 0));
}
.map-stats .faction-control .progress { margin: 0 0 8px; }
.map-stats .faction-control .progress:last-child { margin-bottom: 2px; }
.map-stats .faction-control .progress[data-name=""]::before {
	content: 'Acquiring intel\2026';
	color: rgba(var(--qf-ice), 0.6);
	text-shadow: none;
}
.map-stats .faction-control .progress[data-value=""]::after { content: '\2014'; color: rgba(var(--qf-ice), 0.5); }
.map-stats .faction-control .progress.qf-lead::before { color: #ffffff; text-shadow: 0 0 8px rgba(var(--fc), 0.9); }
.map-stats .faction-control .progress.qf-lead .progress-bar {
	box-shadow: 0 0 12px rgba(var(--fc), 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* navbar "Login" / "Create Account": same padding and chamfer as the login page's Sign In (.btn-lg) */
.navbar .navbar-nav .btn.nav-link {
	padding: 0.75rem 1.5rem;
	margin-left: 10px;
	--qf-btn-cut: 12px;
}

/* --------------------------------------------------------------------------
   Battle modal: in-game viewer for a tile battle (iframe of /combat/view/:slug)
   -------------------------------------------------------------------------- */
.qf-modal {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(1, 6, 16, 0.72);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	animation: qf-modal-in 0.25s ease-out both;
}
.qf-modal__frame {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1400px, 100%);
	height: min(900px, 100%);
	border: 1px solid var(--qf-line);
	background:
		radial-gradient(120% 60% at 0% 0%, rgba(var(--qf-cyan), 0.16) 0%, rgba(var(--qf-cyan), 0) 55%),
		linear-gradient(170deg, var(--qf-glass-top) 0%, var(--qf-glass-bot) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.14),
		0 0 0 1px rgba(0, 0, 0, 0.35),
		0 0 32px rgba(var(--qf-cyan), 0.25),
		0 24px 60px rgba(0, 0, 0, 0.6);
	animation: qf-modal-frame 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.qf-modal__frame::before {                 /* corner brackets, same as .panel */
	content: '';
	position: absolute;
	inset: -1px;
	pointer-events: none;
	z-index: 3;
	--b: 3px;
	--l: 28px;
	--c: rgb(var(--qf-ice));
	background:
		linear-gradient(var(--c), var(--c)) top left     / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) top left     / var(--b) var(--l) no-repeat,
		linear-gradient(var(--c), var(--c)) top right    / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) top right    / var(--b) var(--l) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom left  / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom left  / var(--b) var(--l) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--b) no-repeat,
		linear-gradient(var(--c), var(--c)) bottom right / var(--b) var(--l) no-repeat;
}
.qf-modal__head {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 14px 10px 18px;
	border-bottom: 1px solid rgba(var(--qf-cyan), 0.3);
	font-family: 'Play', sans-serif;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #eaf7ff;
	font-size: 13px;
	font-weight: 700;
}
.qf-modal__head::before {                  /* pulsing indicator chip, as on panel titles */
	content: '';
	width: 8px;
	height: 8px;
	background: rgb(var(--qf-ice));
	box-shadow: 0 0 8px rgba(var(--qf-ice), 0.9);
	transform: rotate(45deg);
	animation: qf-chip 1.6s ease-in-out infinite;
}
.qf-modal__slug {
	flex: 1;
	font-weight: 400;
	letter-spacing: 0.08em;
	text-transform: none;
	color: rgba(var(--qf-ice), 0.8);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.qf-modal__ext,
.qf-modal__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	min-width: 28px;
	padding: 0 10px;
	border: 1px solid rgba(var(--qf-cyan), 0.35);
	background: rgba(var(--qf-cyan), 0.06);
	color: #eaf7ff;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.qf-modal__ext:hover,
.qf-modal__ext:focus,
.qf-modal__close:hover,
.qf-modal__close:focus {
	color: #ffffff;
	text-decoration: none;
	border-color: rgba(var(--qf-ice), 0.9);
	background: rgba(var(--qf-cyan), 0.18);
	box-shadow: 0 0 10px rgba(var(--qf-ice), 0.5);
	outline: none;
}
.qf-modal__close { font-size: 16px; line-height: 1; padding: 0; width: 28px; }
.qf-modal__body {
	flex: 1;
	width: 100%;
	border: 0;
	background: #02060f;
}
@keyframes qf-modal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes qf-modal-frame {
	from { opacity: 0; transform: translateY(24px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.qf-modal, .qf-modal__frame, .qf-modal__head::before { animation: none; }
}

/* ==========================================================================
   MISSION QUICKLIST (left edge)
   Resting: icon with the progress % laid over it. Hover: the badge fades out
   while title / byline / progress fade in to the right of the icon (which
   stays put). Mouse out reverses it.
   ========================================================================== */
.mission_quicklist .item .icon {
	position: relative;
	width: 40px;
	margin: 0 0 10px 16px;
	cursor: pointer;
}
.mission_quicklist .thumbnail {
	display: block;
	margin: 0;
	transition: border-color 0.3s;
}
.mission_quicklist .item .progress_badge {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Share Tech Mono', 'Roboto Mono', Consolas, monospace;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 0.02em;
	color: #ffffff;
	text-shadow: 0 0 3px #000, 0 0 6px #000, 0 0 10px rgba(85, 221, 255, 0.9);
	pointer-events: none;
	transition: opacity 0.28s ease;
}
.mission_quicklist .item.completed .progress_badge { color: #FFCC00; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 0 10px rgba(255, 204, 0, 0.9); }
.mission_quicklist .item .progress_mini {        /* segmented strip along the icon's bottom edge */
	position: absolute;
	left: 2px;
	right: 2px;
	bottom: 3px;
	--w: 36px;                /* icon 40px minus the 2px insets; per-objective segments divide this */
	--seg: 5px;
	--h: 3px;
	transition: opacity 0.28s ease;
}
.mission_quicklist .item.completed .qf-seg { --fc: 255, 204, 0; }
.mission_quicklist .item:hover .progress_badge,
.mission_quicklist .item:hover .progress_mini { opacity: 0; }

.mission_quicklist .item .info {
	top: 1px;
	left: 60px;
	opacity: 0;
	transform: none;
	max-width: 44vw;
	padding: 2px 6px 3px 0;
	transition: opacity 0.35s ease;
}
.mission_quicklist .item:hover .info {
	opacity: 1;
	pointer-events: auto;           /* keeps :hover alive while the pointer is on the text */
	transition: opacity 0.18s ease;
}
.mission_quicklist .item .info > .title { font-size: 15px; letter-spacing: 0.02em; }
.mission_quicklist .item .info > .byline { margin-top: 2px; font-size: 11px; color: #c9d6ea; }
.mission_quicklist .item .info > .progress { --w: 200px; width: var(--w); margin-top: 7px; font-family: 'Play', sans-serif; }

/* Tile details panel: one labeled segmented bar per faction (updateBar in interactive.js) */
.tiledetails_container .progress.qf-seg { margin: 0 0 8px; font-family: 'Play', sans-serif; }

/* Round timer along the bottom edge: the fixed .bar_container is the track, .bar the fill */
.bar_container[data-label="round-duration"].qf-seg {
	--seg: 20px;
	--h: 7px;
	height: 7px;
	background:
		repeating-linear-gradient(90deg, transparent 0 19px, rgba(0, 0, 0, 0.7) 19px 20px),
		#222222;
}
.bar_container[data-label="round-duration"].qf-seg > .bar {
	left: 0;
	bottom: 0;
	height: 7px;
	--fc: 255, 255, 255;
	background:
		repeating-linear-gradient(90deg, transparent 0 19px, rgba(0, 0, 0, 0.55) 19px 20px),
		linear-gradient(90deg, rgba(var(--qf-ice), 0.55) 0%, rgb(var(--qf-ice)) 100%);
	box-shadow: 0 0 8px rgba(var(--qf-ice), 0.6);
	transition: width 1s linear, box-shadow 0.3s;
}
.bar_container[data-label="round-duration"].qf-seg > .bar::after { height: 11px; box-shadow: 0 0 6px rgb(var(--qf-ice)); }

/* Tile battle strip: attacker bar fills from the right (mirrored), defender from the left */
.tile-battle-hp.qf-seg { --h: 3px; --seg: 6px; margin-top: 3px; }
.tile-battle-hp-atk.qf-seg { transform: scaleX(-1); }
