#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

:root {
    font-size: var(--rz-root-font-size);
}

body {
    color: var(--rz-text-color);
    font-size: var(--rz-body-font-size);
    line-height: var(--rz-body-line-height);
    background-color: var(--rz-body-background-color);
}

.rz-body {
    --rz-body-padding: 0;
}

a {
    color: var(--rz-link-color);
}

a:hover,
a:focus {
    color: var(--rz-link-hover-color);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxN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*/
/* Reusable classes for the animated hexagonal credit icon */

/* Default size when src="credits-icon.svg" with no class - inline size */
img[src="credits-icon.svg"] {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    filter: drop-shadow(0 0 4px rgba(224, 170, 255, 0.5));
    margin: 0 2px;
}

.credit-icon-svg,
.currency-icon-svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 4px rgba(224, 170, 255, 0.5));
}

.credit-icon-inline {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    filter: drop-shadow(0 0 4px rgba(224, 170, 255, 0.5));
    margin: 0 2px;
}

.credit-icon-large {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px rgba(224, 170, 255, 0.6));
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ===== GRID CELL COMPONENT STYLES ===== */
.grid-cell {
    width: 120px;
    height: 140px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('/images/hex-empty.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.grid-cell:hover {
    background-image: url('/images/hex-hover.svg');
    filter: drop-shadow(0 0 10px rgba(0, 230, 118, 0.3));
    transform: scale(1.05);
}

.grid-cell.selected {
    background-image: url('/images/hex-selected.svg');
    filter: drop-shadow(0 0 20px rgba(0, 230, 118, 0.8));
    transform: scale(1.05);
}

.grid-cell.has-block {
    background-image: none;
    /* Border color will be set via inline style based on block type */
}

/* Resource nodes use dynamic coloring based on resource type */
.grid-cell.has-node {
    /* Background image will be set via inline style based on resource type */
    animation: resourceNodePulse 3s infinite ease-in-out;
}

.grid-cell.has-node.selected {
    background-image: url('/images/hex-node-selected.svg');
    filter: drop-shadow(0 0 20px rgba(244, 67, 54, 0.8));
    transform: scale(1.05);
}

/* Offset odd rows to create hex grid pattern */
/* Use CSS variable --odd-row-offset set per cell for zoom-aware positioning */
.grid-cell.odd-row { transform: translateX(var(--odd-row-offset, 62px)); }
.grid-cell.odd-row:hover { transform: translateX(var(--odd-row-offset, 62px)) scale(1.05); }
.grid-cell.odd-row.selected { transform: translateX(var(--odd-row-offset, 62px)) scale(1.05); }
.grid-cell.odd-row.has-node.selected { transform: translateX(var(--odd-row-offset, 62px)) scale(1.05); }
.grid-cell.odd-row.has-node { animation: resourceNodePulseOddRow 3s infinite ease-in-out; }

@keyframes resourceNodePulse {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

@keyframes resourceNodePulseOddRow {
    0%, 100% {
        opacity: 0.9;
        transform: translateX(var(--odd-row-offset, 62px)) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(var(--odd-row-offset, 62px)) scale(1.03);
    }
}

.resource-node {
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.resource-name {
    text-align: center;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    font-size: 0.7rem;
    line-height: 1.1;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-coords-hover {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-cell:hover .grid-coords-hover { opacity: 1; }

.hex-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    padding: 12px 8px 8px 8px;
    gap: 0.05rem;
    overflow: visible;
}

.block-center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}

.functional-block-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.block-name-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: center;
    max-width: 95%;
}

.block-level {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.block-level .rz-badge {
    border-radius: 4px !important;
    padding: 2px 5px !important;
    min-width: 20px;
    font-size: 0.7rem !important;
}

.block-name {
    text-align: center;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    font-size: 0.75rem;
    line-height: 1.1;
    z-index: 2;
    word-wrap: break-word;
    hyphens: auto;
}

.thread-indicator {
    display: flex;
    gap: 3px;
    align-items: center;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    z-index: 3;
    margin-top: 5px;
}

/* Tighter spacing for resource nodes */
.resource-node-content {
    gap: 0.3rem !important;
    justify-content: center !important;
}

.thread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.thread-dot.filled {
    background: var(--rz-success);
    box-shadow: 0 0 4px var(--rz-success);
    border-color: var(--rz-success);
    animation: threadPulse 2s ease-in-out infinite;
}

.thread-dot.empty {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes threadPulse {
    0%, 100% {
        box-shadow: 0 0 4px var(--rz-success);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 8px var(--rz-success), 0 0 12px var(--rz-success);
        transform: scale(1.15);
    }
}

.thread-overflow {
    font-size: 0.5rem;
    color: var(--rz-success);
    font-weight: bold;
    margin-left: 2px;
}

.empty-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-node-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.resource-node-name {
    font-family: var(--aidle-font-primary);
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
    max-width: 90px;
    line-height: 1.1;
    word-spacing: 100vw;
    display: inline-block;
}

/* Protected radius indicator */
.protected-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse at center, rgba(0, 255, 255, 0.08) 0%, transparent 70%);
    border: 2px solid rgba(0, 255, 255, 0.25);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: protectedPulse 3s ease-in-out infinite;
}

@keyframes protectedPulse {
    0%, 100% {
        opacity: 0.6;
        border-color: rgba(0, 255, 255, 0.25);
        box-shadow: inset 0 0 15px rgba(0, 255, 255, 0.1);
    }
    50% {
        opacity: 0.9;
        border-color: rgba(0, 255, 255, 0.4);
        box-shadow: inset 0 0 25px rgba(0, 255, 255, 0.2);
    }
}

/* Siphon range indicator (for resource nodes) */
.siphon-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    border: 2px solid transparent;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: siphonPulse 3s ease-in-out infinite;
}

@keyframes siphonPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* Latency Indicator Styles */
.ping-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ping-dot.status-excellent {
    background: #10b981;
}

.ping-dot.status-good {
    background: #22c55e;
}

.ping-dot.status-fair {
    background: #f59e0b;
}

.ping-dot.status-poor {
    background: #ef4444;
}

.ping-dot.status-disconnected {
    background: #6b7280;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* BlockCostDisplay Styles */
.cost-container-horizontal {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.cost-container-vertical {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-items: stretch;
	background: rgba(0, 0, 0, 0.6);
	padding: 0.25rem;
	border-radius: 4px;
	backdrop-filter: blur(8px);
}

.cost-container-vertical .cost-badge {
	width: 100%;
	box-sizing: border-box;
}

.cost-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.75rem;
	background: rgba(0, 0, 0, 0.6);
	border: 2px solid;
	border-radius: 4px;
	backdrop-filter: blur(4px);
	pointer-events: none;
	user-select: none;
}

.cost-badge.free-badge {
	border-color: #4CAF50;
	color: #4CAF50;
	padding: 0.5rem 1rem;
	box-shadow: 0 2px 12px rgba(76, 175, 80, 0.5);
	border-width: 2px;
}

.free-text {
	font-size: 0.9rem;
	letter-spacing: 0.5px;
	color: #66BB6A;
	text-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.cost-badge.can-afford {
	background: rgba(10, 14, 39, 0.9);
	border-color: #4CAF50;
	box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.cost-badge.cannot-afford {
	background: rgba(10, 14, 39, 0.9);
	border-color: #f44336;
	box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.cost-amount {
	font-weight: 700;
	font-size: 0.9rem;
	font-family: monospace;
	letter-spacing: 0.5px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Keyboard shortcut styling */
kbd {
	display: inline-block;
	padding: 0.2rem 0.4rem;
	font-size: 0.75rem;
	font-family: monospace;
	font-weight: 700;
	line-height: 1;
	color: #e0e0e0;
	background-color: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

/* ===== 3D CUBE STYLES ===== */

/* Container for 3D cube - adds perspective */
.cube-3d-container {
	perspective: 800px;
	perspective-origin: 50% 50%;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

/* The 3D tank unit (wider and flatter than a cube for vehicle profile) */
.cube-3d {
	position: relative;
	width: 70px;
	height: 40px;
	transform-style: preserve-3d;
	animation: rotateTank 10s infinite linear;
}

/* Tank body faces with armor plating aesthetic */
.cube-face {
	position: absolute;
	background: linear-gradient(135deg, rgba(0, 230, 118, 0.85) 0%, rgba(0, 180, 90, 0.95) 100%);
	border: 2.5px solid rgba(0, 230, 118, 1);
	box-shadow:
		0 0 25px rgba(0, 230, 118, 0.6),
		inset 0 0 15px rgba(0, 230, 118, 0.4),
		inset -5px -5px 10px rgba(0, 0, 0, 0.3); /* Armor depth */
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.8rem;
	color: rgba(255, 255, 255, 0.95);
	text-shadow: 0 0 12px rgba(0, 230, 118, 0.9);
	backdrop-filter: blur(3px);
}

/* Front face - Tank turret/main weapon view */
.cube-face.front {
	width: 70px;
	height: 40px;
	transform: translateZ(20px);
}

/* Back face - Rear armor/engine view */
.cube-face.back {
	width: 70px;
	height: 40px;
	transform: rotateY(180deg) translateZ(20px);
}

/* Right face - Side armor panel */
.cube-face.right {
	width: 40px;
	height: 40px;
	transform: rotateY(90deg) translateZ(35px);
}

/* Left face - Side armor panel */
.cube-face.left {
	width: 40px;
	height: 40px;
	transform: rotateY(-90deg) translateZ(35px);
}

/* Top face - Turret/command module */
.cube-face.top {
	width: 70px;
	height: 40px;
	transform: rotateX(90deg) translateZ(20px);
}

/* Bottom face - Treads/undercarriage */
.cube-face.bottom {
	width: 70px;
	height: 40px;
	transform: rotateX(-90deg) translateZ(20px);
}

/* Tank rotation animation - slower to show vehicle weight */
@keyframes rotateTank {
	0% {
		transform: rotateX(15deg) rotateY(0deg);
	}
	100% {
		transform: rotateX(15deg) rotateY(360deg);
	}
}

/* Hover effect for tank - engagement ready */
.cube-3d-container:hover .cube-3d {
	animation-duration: 3s;
	filter: drop-shadow(0 0 35px rgba(0, 230, 118, 0.9));
	transform: rotateX(15deg) scale(1.05);
}

/* Tank color variants - Unit role-based */

/* Blue Tank - Heavy Armor (Tank role) */
.cube-3d.cube-blue .cube-face {
	background: linear-gradient(135deg, rgba(33, 150, 243, 0.85) 0%, rgba(21, 101, 192, 0.95) 100%);
	border-color: rgba(33, 150, 243, 1);
	box-shadow:
		0 0 25px rgba(33, 150, 243, 0.6),
		inset 0 0 15px rgba(33, 150, 243, 0.4),
		inset -5px -5px 10px rgba(0, 0, 0, 0.3);
	text-shadow: 0 0 12px rgba(33, 150, 243, 0.9);
}

/* Red Tank - Assault (DPS role) */
.cube-3d.cube-red .cube-face {
	background: linear-gradient(135deg, rgba(244, 67, 54, 0.85) 0%, rgba(198, 40, 40, 0.95) 100%);
	border-color: rgba(244, 67, 54, 1);
	box-shadow:
		0 0 25px rgba(244, 67, 54, 0.6),
		inset 0 0 15px rgba(244, 67, 54, 0.4),
		inset -5px -5px 10px rgba(0, 0, 0, 0.3);
	text-shadow: 0 0 12px rgba(244, 67, 54, 0.9);
}

/* Purple Tank - Stealth/Special Ops */
.cube-3d.cube-purple .cube-face {
	background: linear-gradient(135deg, rgba(156, 39, 176, 0.85) 0%, rgba(123, 31, 162, 0.95) 100%);
	border-color: rgba(156, 39, 176, 1);
	box-shadow:
		0 0 25px rgba(156, 39, 176, 0.6),
		inset 0 0 15px rgba(156, 39, 176, 0.4),
		inset -5px -5px 10px rgba(0, 0, 0, 0.3);
	text-shadow: 0 0 12px rgba(156, 39, 176, 0.9);
}

/* Gold Tank - Support/Healer */
.cube-3d.cube-gold .cube-face {
	background: linear-gradient(135deg, rgba(255, 193, 7, 0.85) 0%, rgba(255, 160, 0, 0.95) 100%);
	border-color: rgba(255, 193, 7, 1);
	box-shadow:
		0 0 25px rgba(255, 193, 7, 0.6),
		inset 0 0 15px rgba(255, 193, 7, 0.4),
		inset -5px -5px 10px rgba(0, 0, 0, 0.3);
	text-shadow: 0 0 12px rgba(255, 193, 7, 0.9);
}

/* Tank visual enhancements - Armor plating and details */

/* Add armor panel lines to front face */
.cube-face.front::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 10%;
	right: 10%;
	height: 1px;
	background: rgba(255, 255, 255, 0.2);
	box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Add rivet details to side panels */
.cube-face.left::after,
.cube-face.right::after {
	content: '◦ ◦';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.6rem;
	opacity: 0.4;
	letter-spacing: 8px;
}

/* Turret ring detail on top face */
.cube-face.top::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 25px;
	height: 25px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

/* Tread pattern on bottom face */
.cube-face.bottom::before {
	content: '▬ ▬ ▬';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.8rem;
	opacity: 0.4;
	letter-spacing: 3px;
}
