:root {
	--bg-primary: #ffffff;
	--bg-secondary: #f8f9fa;
	--bg-card: #ffffff;
	--text-primary: #212529;
	--text-secondary: #6c757d;
	--border-color: #dee2e6;
	--accent-color: #007bff;
	--accent-hover: #0056b3;
	--success-color: #28a745;
	--danger-color: #dc3545;
	--warning-color: #ffc107;
	--shadow: 0 2px 4px rgba(0,0,0,0.1);
	--shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
	--gradient-primary: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

[data-theme="dark"] {
	--bg-primary: #1a1a2e;
	--bg-secondary: #16213e;
	--bg-card: #0f3460;
	--text-primary: #e94560;
	--text-secondary: #ffffff;
	--border-color: #533483;
	--accent-color: #e94560;
	--accent-hover: #d63447;
	--success-color: #00ff88;
	--danger-color: #ff6b6b;
	--warning-color: #ffd93d;
	--shadow: 0 2px 4px rgba(0,0,0,0.3);
	--shadow-hover: 0 4px 8px rgba(0,0,0,0.4);
	--gradient-primary: linear-gradient(135deg, #e94560 0%, #d63447 100%);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--bg-primary);
	color: var(--text-primary);
	line-height: 1.6;
	transition: all 0.3s ease;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.container {
	max-width: 768px;
	margin: 0 auto;
	padding: 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 0;
	border-bottom: 2px solid var(--border-color);
	margin-bottom: 1.5rem;
	background: var(--gradient-primary);
	background-clip: text;
	-webkit-background-clip: text;
}

.header h1 {
	font-size: 2rem;
	font-weight: 800;
	background: var(--gradient-primary);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.theme-toggle {
	background: var(--bg-card);
	border: 2px solid var(--border-color);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	transition: all 0.3s ease;
	box-shadow: var(--shadow);
}

.theme-toggle:hover {
	background: var(--accent-color);
	color: white;
	box-shadow: var(--shadow-hover);
	transform: translateY(-2px) scale(1.05);
}

.main {
	flex: 1;
}

.card-section {
	background: var(--bg-card);
	border-radius: 16px;
	padding: 1.5rem;
	margin-bottom: 1rem;
	box-shadow: var(--shadow);
	border: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.card-section:hover {
	box-shadow: var(--shadow-hover);
	transform: translateY(-1px);
}

.card-section h2 {
	margin-bottom: 1rem;
	color: var(--accent-color);
	font-size: 1.2rem;
	font-weight: 700;
	text-align: center;
}

.card-input-group {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	max-width: 400px;
	margin: 0 auto;
}

.community-cards {
	grid-template-columns: repeat(5, 1fr);
	max-width: 600px;
}

.card-input {
	display: flex;
	gap: 0.5rem;
	flex-direction: column;
}

.rank-select,
.suit-select {
	padding: 0.75rem;
	border: 2px solid var(--border-color);
	border-radius: 12px;
	background: var(--bg-secondary);
	color: var(--text-primary);
	font-size: 1rem;
	font-weight: 600;
	transition: all 0.3s ease;
	cursor: pointer;
}

.rank-select:focus,
.suit-select:focus {
	outline: none;
	border-color: var(--accent-color);
	box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
	transform: translateY(-1px);
}

.suit-select {
	font-size: 1.3rem;
}

/* Compact Opponents Section */
.opponents-section {
	background: var(--bg-secondary);
	border-radius: 12px;
	padding: 1rem 1.5rem;
	margin-bottom: 1rem;
	box-shadow: var(--shadow);
	border: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.opponents-section:hover {
	box-shadow: var(--shadow-hover);
	transform: translateY(-1px);
}

.opponents-container {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.opponents-label {
	font-weight: 700;
	color: var(--accent-color);
	font-size: 1rem;
	white-space: nowrap;
}

.opponents-select {
	padding: 0.5rem 1rem;
	border: 2px solid var(--border-color);
	border-radius: 8px;
	background: var(--bg-card);
	color: var(--text-primary);
	font-size: 1rem;
	font-weight: 600;
	transition: all 0.3s ease;
	cursor: pointer;
	min-width: 60px;
}

.opponents-select:focus {
	outline: none;
	border-color: var(--accent-color);
	box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.results-section {
	background: var(--bg-card);
	border-radius: 16px;
	padding: 1.5rem;
	margin-bottom: 1rem;
	box-shadow: var(--shadow);
	border: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.results-section:hover {
	box-shadow: var(--shadow-hover);
}

.results-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.result-card {
	background: var(--bg-secondary);
	border-radius: 12px;
	padding: 1.2rem;
	text-align: center;
	border: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.result-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-hover);
}

.result-card.primary {
	background: var(--gradient-primary);
	border: 2px solid var(--accent-color);
	color: white;
	position: relative;
	overflow: hidden;
}

.result-card.primary::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--gradient-primary);
	opacity: 0.9;
	z-index: 1;
}

.result-card.primary > * {
	position: relative;
	z-index: 2;
}

.result-card h3 {
	color: var(--accent-color);
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.result-card.primary h3 {
	color: rgba(255, 255, 255, 0.9);
}

.result-value {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--text-primary);
	margin-bottom: 0.25rem;
}

.result-value.large {
	font-size: 2.8rem;
	font-weight: 900;
}

.result-card.primary .result-value {
	color: white;
	text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.result-subtitle {
	font-size: 0.8rem;
	color: var(--text-secondary);
	font-weight: 500;
}

.result-card.primary .result-subtitle {
	color: rgba(255, 255, 255, 0.8);
}

.draws-breakdown,
.hand-breakdown {
	background: var(--bg-secondary);
	border-radius: 12px;
	padding: 1rem;
	margin-bottom: 1rem;
	border: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.draws-breakdown:hover,
.hand-breakdown:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow);
}

.draws-breakdown h3,
.hand-breakdown h3 {
	color: var(--accent-color);
	margin-bottom: 0.75rem;
	font-size: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.draws-container {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.draw-item {
	background: var(--bg-primary);
	border-radius: 8px;
	padding: 0.75rem;
	border: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.draw-item:hover {
	transform: translateX(4px);
	box-shadow: var(--shadow);
}

.draw-type {
	font-weight: 700;
	color: var(--accent-color);
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
}

.draw-details {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.draw-outs {
	font-weight: 700;
	color: var(--text-primary);
}

.draw-description {
	color: var(--text-secondary);
	font-size: 0.85rem;
}

.breakdown-list {
	background: var(--bg-primary);
	border-radius: 8px;
	padding: 1rem;
	border: 1px solid var(--border-color);
}

.breakdown-item {
	display: flex;
	justify-content: space-between;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.breakdown-item:hover {
	background: var(--bg-secondary);
	margin: 0 -0.5rem;
	padding: 0.5rem;
	border-radius: 6px;
}

.breakdown-item:last-child {
	border-bottom: none;
}

.breakdown-hand {
	font-weight: 700;
	color: var(--text-primary);
}

.breakdown-probability {
	color: var(--text-secondary);
	font-weight: 600;
}

.controls {
	display: none;
}

.btn {
	padding: 1rem 2rem;
	border: none;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 1px;
	box-shadow: var(--shadow);
	background: var(--gradient-primary);
	color: white;
}

.btn:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-hover);
}

.btn:active {
	transform: translateY(-1px);
}

.btn-primary {
	background: var(--gradient-primary);
	color: white;
}

.btn-secondary {
	background: var(--bg-secondary);
	color: var(--text-primary);
	border: 2px solid var(--border-color);
}

.btn-secondary:hover {
	background: var(--border-color);
}

/* Footer Styles - Full Width */
.footer {
	background: var(--bg-secondary);
	border-top: 1px solid var(--border-color);
	padding: 1.5rem 0;
	margin-top: 2rem;
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
}

.footer-content {
	max-width: 768px;
	margin: 0 auto;
	text-align: center;
	padding: 0 1rem;
}

.footer-text {
	color: var(--text-primary);
	font-weight: 600;
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
}

.footer-subtext {
	color: var(--text-secondary);
	font-size: 0.8rem;
}

/* Floating Action Buttons - Base Styles */
.floating-buttons {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	z-index: 9999;
	pointer-events: none;
}

.floating-buttons > * {
	pointer-events: auto;
}

.fab {
	display: flex !important;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	border: none;
	border-radius: 50px;
	font-size: 0.9rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	min-width: 140px;
	justify-content: center;
	text-decoration: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

.fab:hover,
.fab:focus {
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 8px 25px rgba(0,0,0,0.3);
	outline: none;
}

.fab:active {
	transform: translateY(-1px) scale(0.98);
}

.fab-primary {
	background: var(--gradient-primary) !important;
	color: white !important;
	border: 2px solid var(--accent-color) !important;
}

.fab-primary:hover {
	background: var(--accent-hover) !important;
}

.fab-secondary {
	background: var(--bg-card) !important;
	color: var(--text-primary) !important;
	border: 2px solid var(--border-color) !important;
}

.fab-secondary:hover {
	background: var(--bg-secondary) !important;
	border-color: var(--accent-color) !important;
}

.fab-icon {
	font-size: 1.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.fab-text {
	font-size: 0.85rem;
	font-weight: 800;
	line-height: 1;
}

/* Calculating state */
.fab.calculating {
	opacity: 0.7 !important;
	cursor: not-allowed !important;
}

.fab.calculating .fab-icon {
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

/* Card Input States */
.card-input.valid {
	background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
	border-radius: 12px;
	padding: 6px;
	border: 1px solid rgba(40, 167, 69, 0.3);
}

.card-input.invalid {
	background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
	border-radius: 12px;
	padding: 6px;
	border: 1px solid rgba(220, 53, 69, 0.3);
	animation: shake 0.5s ease-in-out;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

/* PWA Icon optimization */
@media (display-mode: standalone) {
	.header h1 {
		font-size: 1.8rem;
	}
	
	.theme-toggle {
		width: 45px;
		height: 45px;
		font-size: 1.1rem;
	}
}

/* Mobile Responsive Design */
@media screen and (max-width: 768px) {
	.container {
		padding: 0.75rem;
	}
	
	.header h1 {
		font-size: 1.6rem;
	}
	
	.card-input-group {
		grid-template-columns: 1fr;
		max-width: 300px;
	}
	
	.community-cards {
		grid-template-columns: repeat(3, 1fr);
		max-width: 400px;
	}
	
	.results-grid {
		grid-template-columns: 1fr;
	}
	
	.result-value.large {
		font-size: 2.2rem;
	}
	
	.opponents-container {
		flex-direction: column;
		gap: 0.75rem;
	}
	
	.draw-details {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}

	/* Mobile Floating Buttons */
	.floating-buttons {
		position: fixed !important;
		bottom: 1rem !important;
		left: 1rem !important;
		right: 1rem !important;
		flex-direction: row !important;
		justify-content: center !important;
		gap: 1rem !important;
		z-index: 9999 !important;
		pointer-events: none;
	}
	
	.floating-buttons > * {
		pointer-events: auto;
	}
	
	.fab {
		flex: 1 !important;
		min-width: auto !important;
		max-width: none !important;
		padding: 1rem 0.75rem !important;
		font-size: 0.85rem !important;
	}
	
	.fab-text {
		font-size: 0.8rem !important;
	}
	
	.fab-icon {
		font-size: 1.1rem !important;
	}
}

@media screen and (max-width: 480px) {
	.community-cards {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.result-value.large {
		font-size: 1.8rem;
	}

	.card-section {
		padding: 1rem;
	}

	.footer {
		padding: 1rem 0;
	}

	/* Small Mobile Floating Buttons */
	.floating-buttons {
		gap: 0.75rem !important;
		bottom: 0.75rem !important;
		left: 0.75rem !important;
		right: 0.75rem !important;
	}
	
	.fab {
		padding: 0.875rem 0.5rem !important;
		font-size: 0.8rem !important;
		gap: 0.5rem !important;
	}
	
	.fab-icon {
		font-size: 1rem !important;
	}
	
	.fab-text {
		font-size: 0.75rem !important;
	}
}

/* Loading states */
.calculating {
	opacity: 0.7;
	pointer-events: none;
}

.calculating::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid var(--accent-color);
	border-top: 2px solid transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Enhanced visual effects */
.card-section,
.results-section {
	position: relative;
	overflow: hidden;
}

.card-section::before,
.results-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
	transition: left 0.5s;
}

.card-section:hover::before,
.results-section:hover::before {
	left: 100%;
}