/* ================================================
   BASE STYLES - CSS Variables, Reset, Typography
   ================================================ */

/* CSS Custom Properties (Design Tokens) */
:root {
	color-scheme: dark;
	
	/* Typography */
	--font-family: 'Share Tech Mono', 'Orbitron', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
	--font-display: 'Orbitron', sans-serif;
	--body-letter-spacing: 0.04em;
	--body-line-height: 1.45;
	
	/* Colors */
	--bg-primary: #050205;
	--bg-secondary: #160004;
	--accent: #ff2b45;
	--accent-soft: rgba(255, 43, 69, 0.38);
	--glow: rgba(255, 72, 102, 0.32);
	--text-primary: #f6f2f3;
	--text-secondary: rgba(255, 227, 231, 0.72);
	
	/* Transitions */
	--transition-fast: 220ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-slow: 650ms cubic-bezier(0.2, 0, 0.15, 1);
	
	/* Layout */
	--shell-frame-padding: clamp(0.5rem, 4vw, 2.5rem);
	--game-width: min(100vw, 540px);
	--game-height: min(100dvh, 960px);
	
	/* Spacing Scale */
	--gap-xs: clamp(0.5rem, 2vw, 0.75rem);
	--gap-sm: clamp(0.75rem, 3vw, 1rem);
	--gap-md: clamp(1rem, 4vw, 1.5rem);
	--gap-lg: clamp(1.25rem, 4vw, 2rem);
	--gap-xl: clamp(1.5rem, 5vw, 2.5rem);
}

/* Reset & Box Model */
*,
*::before,
*::after {
	box-sizing: border-box;
	/* Angular cyberpunk aesthetic - no rounded corners */
	border-radius: 0 !important;
}

/* Base HTML & Body */
html,
body {
	height: 100%;
	margin: 0;
	overflow-x: hidden;
	overscroll-behavior: none;
	/* Hide scrollbars but preserve scrolling */
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE 10+ */
}

/* WebKit scrollbar hiding */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

/* Body Styles */
body {
	font-family: var(--font-family);
	background: linear-gradient(180deg, #4b0010 0%, #160006 45%, #000000 100%);
	color: var(--text-primary);
	letter-spacing: var(--body-letter-spacing);
	line-height: var(--body-line-height);
	min-height: 100dvh;
	
	/* Touch optimization */
	touch-action: manipulation;
	-webkit-touch-callout: none;
	-ms-touch-action: manipulation;
	
	/* Layout */
	padding: env(safe-area-inset-top) var(--shell-frame-padding) 
	         calc(var(--shell-frame-padding) + env(safe-area-inset-bottom)) 
	         var(--shell-frame-padding);
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	isolation: isolate;
}

/* Decorative Background Gradients */
body::before,
body::after {
	content: "";
	position: fixed;
	inset: -18vmax;
	z-index: -2;
	pointer-events: none;
}

body::before {
	background: radial-gradient(ellipse at top center, rgba(255, 64, 96, 0.28) 0%, transparent 68%);
	opacity: 0.35;
	transform: translateY(-10vh) scale(1.05);
	mix-blend-mode: screen;
}

body::after {
	background: radial-gradient(ellipse at bottom center, rgba(140, 0, 25, 0.35) 0%, transparent 70%);
	mix-blend-mode: screen;
	filter: blur(12px);
	opacity: 0.45;
}

/* Mobile Safari Image Optimization */
.battle-card img,
.battle-card--animating img {
	background-color: transparent;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	will-change: transform, opacity;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
