/**
 * GLOBAL STYLES & ROOT VARIABLES
 */
:root {
	font-family: 'Inter', sans-serif;
	--p: 261 51% 40%;
}

body {
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-size: 14px;
	color: #e5e7eb;
	background: #0b0612;
}

.font-data {
	font-family: 'JetBrains Mono', monospace;
}

.player-name-tag, .map-label, h2, span, div, i {
	font-style: normal !important;
}


/**
 * HEADER & NAVIGATION
 */
.tactical-header {
	min-height: 4rem;
	padding: 0 2rem;
	background-color: #1a1025;
	border-bottom: 2px solid #663399;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.logo-glow {
	box-shadow: 0 0 15px rgba(168, 114, 230, 0.4);
	border: 1px solid rgba(168, 114, 230, 0.6);
}


/**
 * MAP INTERFACE & BATTLE GRID
 */
#mapWrapper {
	flex: 1;
	position: relative;
	background-color: #0d0d0d;
	overflow: hidden;
	cursor: grab;
	display: flex;
	align-items: center;
	justify-content: center;
}

#mapCanvas {
	position: relative;
	width: auto;
	height: auto;
	transform-origin: center center;
	will-change: transform;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
	image-rendering: pixelated;
}

.battle-grid {
	position: relative;
	display: grid;
	grid-template-columns: repeat(28, 44px);
	grid-template-rows: repeat(28, 44px);
	gap: 1px;
	background-color: #333;
	transform: rotate(45deg);
	transform-style: preserve-3d;
	backface-visibility: hidden;
}

.grid-item {
	width: 44px;
	height: 44px;
	background-color: #1a1a1a;
	border: 0.1px solid #222;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: visible;
}

.grid-name {
	position: absolute;
	pointer-events: none;
	text-transform: uppercase;
	color: white;
	font-size: 16px;
	font-weight: 900;
	transform: rotate(-45deg); 
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	text-shadow: 
		-1px -1px 0 #000,  
		 1px -1px 0 #000,
		-1px  1px 0 #000,
		 1px  1px 0 #000;
}

.grid-item.green {
	background-color: #166534;
	cursor: not-allowed;
	opacity: 0.6;
}

.grid-item.yellow {
	background-color: #854d0e;
	cursor: not-allowed;
	opacity: 0.6;
}

.grid-item.occupied {
	background-color: #663399;
	border-color: #a872e6;
	cursor: pointer;
	opacity: 1;
}

.map-label {
	position: absolute;
	z-index: 100;
	pointer-events: none;
	font-weight: 900;
	color: #ffffff;
	white-space: nowrap;
	font-size: 32px;
	letter-spacing: 0.15em;
	transform: translate(-50%, -50%) rotate(-45deg);
	transform-origin: center center;
	-webkit-font-smoothing: none;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeSpeed;
	backface-visibility: hidden;
	text-shadow: 
		-1px -1px 0 #000,  
		 1px -1px 0 #000,
		-1px  1px 0 #000,
		 1px  1px 0 #000;
}

#player-tooltip {
	pointer-events: none;
	transition: opacity 0.1s ease-out;
}

#player-tooltip .tactical-box {
	background: rgba(26, 16, 37, 0.95);
	backdrop-filter: blur(4px);
}


/**
 * SIDEBAR & UI COMPONENTS
 */
.tactical-box {
	background-color: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	padding: 10px;
	margin-bottom: 0.75rem;
	display: block;
	width: 100%;
	box-sizing: border-box;
}

#panel-alliances:not(.hidden), 
#panel-coordinate:not(.hidden), 
#panel-warning:not(.hidden) {
	display: flex;
	flex-direction: column;
}

.player-card {
	width: 100%;
	display: block;
}

.tab-vertical {
	writing-mode: vertical-rl;
	text-orientation: mixed;
	transform: rotate(180deg);
	height: 120px;
	font-size: 11px;
	font-weight: 700;
	border-left: 3px solid transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #9ca3af;
}

.tab-vertical.active {
	background-color: rgba(102, 51, 153, 0.1);
	border-left: 3px solid #663399;
	color: #a872e6;
}


/**
 * PLAYER CARDS & DATA CHIPS
 */
.player-name-tag {
	font-size: 11px;
	font-weight: 900;
	text-transform: uppercase;
	color: #ffffff !important;
	margin-bottom: 6px;
	letter-spacing: 0.1em;
	display: flex;
	align-items: center;
	gap: 6px;
}

.player-name-tag::before {
	content: "";
	display: block;
	width: 3px;
	height: 10px;
	background-color: #663399;
	border-radius: 1px;
}

.timer-grid {
	display: flex;
	flex-direction: row;
	gap: 6px;
	width: 100%;
}

.data-chip {
	display: flex;
	flex: 1;
	height: 22px;
	background: rgba(255, 255, 255, 0.03);
	overflow: hidden;
}

.chip-label {
	flex: 0 0 18px;
	font-size: 8px;
	font-weight: 900;
	background: #663399 !important;
	color: #ffffff !important;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px 0 0 4px;
}

.chip-value {
	flex: 1;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #f3f4f6 !important;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-left: none;
	border-radius: 0 4px 4px 0;
}


/**
 * MODAL STYLING
 */
#player_modal .data-chip {
	height: 38px;
	background: #000;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	display: flex;
	align-items: center;
	overflow: hidden;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

input[type="number"] {
	-moz-appearance: textfield;
}

#player_modal .btn-ghost {
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
}

#player_modal .chip-label {
	flex: 0 0 85px;
	font-size: 10px;
	letter-spacing: 0.05em;
	border-right: 1px solid rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

#player_modal .chip-input-field {
	flex: 1;
	min-width: 0;
	background: transparent !important;
	border: none !important;
	padding: 0 12px;
	color: white !important;
	font-family: 'JetBrains Mono', monospace;
	font-weight: 700;
	font-size: 13px;
	outline: none;
	height: 100%;
}

#p-ally option {
	background-color: #1a1025;
	color: #ffffff;
}

/**
 * NOTIFICATIONS
 */
.notify-card {
	width: 450px;
	background: rgba(11, 6, 18, 0.6);
	backdrop-filter: blur(12px);
	border: 1px solid rgba(102, 51, 153, 0.4);
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
	border-radius: 8px;
	animation: notify-center-fade 8s ease-in-out forwards;
	pointer-events: auto;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.notify-titlebar {
	background: rgba(102, 51, 153, 0.5);
	padding: 10px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notify-title-text {
	font-weight: 900;
	font-size: 14px;
	color: white;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.notify-close-btn {
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	font-weight: bold;
	font-size: 20px;
	line-height: 1;
}

.notify-close-btn:hover {
	color: #ff4d4d;
}

.notify-body {
	padding: 24px 24px 8px 24px;
	text-align: center;
	font-size: 13px;
	font-weight: 400;
	color: #f3f4f6;
	line-height: 1.5;
}

.notify-footer {
	padding: 0 12px 10px 12px;
	display: flex;
	justify-content: flex-end;
}

.notify-timer {
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	color: #a872e6;
	font-weight: 800;
}

@keyframes notify-center-fade {
	0% { transform: scale(0.85); opacity: 0; }
	5% { transform: scale(1); opacity: 1; }
	95% { transform: scale(1); opacity: 1; }
	100% { transform: scale(1.05); opacity: 0; }
}


/**
 * THEME OVERRIDES & UTILITIES
 */
.border-primary {
	border-color: #663399 !important;
}

.checkbox-primary {
	--chkbg: 261 51% 40% !important;
	--chkfg: 0 0% 100% !important;
	border-color: #663399 !important;
}

.checkbox-primary:checked {
	background-color: #663399 !important;
	border-color: #663399 !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E") !important;
	background-size: 100% 100% !important;
}

.input, .select {
	color: white !important;
	border-color: rgba(255, 255, 255, 0.2) !important;
	background: #000 !important;
}

.btn-purple {
	background-color: #663399 !important;
	color: white !important;
	border: none;
	font-weight: 900;
}

.btn-outline.btn-error {
	border-color: #ff4d4d !important;
	color: #ff4d4d !important;
}

.text-error {
	color: #ff4d4d !important;
}

[data-theme="business"] .text-primary {
	color: #a872e6 !important;
}