/**
 * Aviator Betting Game — Frontend CSS
 */

/* ===== Wrapper ===== */
.abg-game-wrapper {
	--abg-bg: #060a12;
	--abg-panel: #0d1117;
	--abg-border: rgba(255,255,255,0.08);
	--abg-text: #ffffff;
	--abg-text-dim: rgba(255,255,255,0.5);
	--abg-green: #22c55e;
	--abg-orange: #f97316;
	--abg-red: #ef4444;
	--abg-input-bg: #161b22;

	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--abg-text);
	background: var(--abg-bg);
	line-height: 1.5;
}

.abg-game-wrapper *,
.abg-game-wrapper *::before,
.abg-game-wrapper *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ===== Container ===== */
.abg-game-container {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	max-width: 1200px;
	margin: 0 auto;
}

/* ===== Header ===== */
.abg-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid var(--abg-border);
}

.abg-header-left {
	display: flex;
	align-items: center;
	gap: 8px;
}

.abg-logo {
	font-size: 20px;
}

.abg-title {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 2px;
}

.abg-fair-badge {
	font-size: 11px;
	color: rgba(255,255,255,0.25);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 20px;
	padding: 2px 10px;
}

/* ===== Main Layout ===== */
.abg-main {
	display: flex;
	gap: 12px;
	padding: 12px;
	flex: 1;
}

.abg-game-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

/* ===== Canvas ===== */
.abg-canvas-wrap {
	flex: 1;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--abg-border);
	min-height: 350px;
	position: relative;
}

.abg-canvas-wrap canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* ===== History Strip ===== */
.abg-history-strip {
	background: var(--abg-panel);
	border-radius: 10px;
	border: 1px solid var(--abg-border);
	padding: 10px 12px;
}

.abg-history-scroll {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 4px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.abg-history-scroll::-webkit-scrollbar {
	height: 4px;
}

.abg-history-scroll::-webkit-scrollbar-thumb {
	background: rgba(255,255,255,0.15);
	border-radius: 2px;
}

.abg-history-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	font-family: monospace;
	white-space: nowrap;
	flex-shrink: 0;
	border: 1px solid transparent;
}

.abg-badge-red    { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.25); }
.abg-badge-orange { background: rgba(249,115,22,0.15); color: #f97316; border-color: rgba(249,115,22,0.25); }
.abg-badge-purple { background: rgba(167,139,250,0.15); color: #a78bfa; border-color: rgba(167,139,250,0.25); }
.abg-badge-blue   { background: rgba(96,165,250,0.15); color: #60a5fa; border-color: rgba(96,165,250,0.25); }
.abg-badge-gold   { background: rgba(251,191,36,0.15); color: #fbbf24; border-color: rgba(251,191,36,0.25); }
.abg-badge-green  { background: rgba(34,197,94,0.15); color: #22c55e; border-color: rgba(34,197,94,0.25); }

.abg-history-empty {
	font-size: 13px;
	color: var(--abg-text-dim);
}

/* ===== Betting Panel ===== */
.abg-betting-panel {
	width: 300px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: var(--abg-panel);
	border-radius: 12px;
	border: 1px solid var(--abg-border);
}

.abg-balance-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.abg-balance-label {
	font-size: 13px;
	color: var(--abg-text-dim);
}

.abg-balance-value {
	font-size: 14px;
	font-weight: 700;
}

/* ===== Form Sections ===== */
.abg-bet-section {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.abg-field-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: rgba(255,255,255,0.35);
	font-weight: 600;
}

.abg-input-row {
	display: flex;
	align-items: center;
	gap: 6px;
}

.abg-input-wrap {
	position: relative;
	flex: 1;
}

.abg-input {
	width: 100%;
	height: 32px;
	background: var(--abg-input-bg);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
	color: #fff;
	font-size: 13px;
	padding: 0 8px;
	outline: none;
	transition: border-color 0.2s;
}

.abg-input:focus {
	border-color: rgba(255,255,255,0.25);
}

.abg-input-prefix,
.abg-input-suffix {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 12px;
	color: rgba(255,255,255,0.35);
	pointer-events: none;
}

.abg-input-prefix { left: 8px; }
.abg-input-suffix { right: 8px; }
.abg-input-wrap:has(.abg-input-prefix) .abg-input { padding-left: 22px; }
.abg-input-wrap:has(.abg-input-suffix) .abg-input { padding-right: 22px; }

.abg-btn-icon {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
	color: rgba(255,255,255,0.6);
	font-size: 16px;
	cursor: pointer;
	transition: all 0.15s;
	flex-shrink: 0;
}

.abg-btn-icon:hover {
	background: rgba(255,255,255,0.1);
	color: #fff;
}

.abg-btn-small {
	height: 32px;
	padding: 0 12px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
	color: rgba(255,255,255,0.4);
	font-size: 12px;
	cursor: pointer;
	transition: all 0.15s;
}

.abg-btn-small:hover {
	background: rgba(255,255,255,0.1);
	color: rgba(255,255,255,0.7);
}

.abg-presets {
	display: flex;
	gap: 4px;
}

.abg-preset-btn {
	flex: 1;
	height: 24px;
	font-size: 11px;
	background: rgba(255,255,255,0.04);
	border: 1px solid transparent;
	border-radius: 6px;
	color: rgba(255,255,255,0.45);
	cursor: pointer;
	transition: all 0.15s;
}

.abg-preset-btn:hover {
	background: rgba(255,255,255,0.08);
	color: rgba(255,255,255,0.8);
}

/* ===== Result Display ===== */
.abg-result {
	text-align: center;
	padding: 8px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	animation: abgFadeIn 0.3s ease;
}

.abg-result-win {
	background: rgba(34,197,94,0.1);
	border: 1px solid rgba(34,197,94,0.2);
	color: #22c55e;
}

.abg-result-loss {
	background: rgba(239,68,68,0.1);
	border: 1px solid rgba(239,68,68,0.2);
	color: #ef4444;
}

@keyframes abgFadeIn {
	from { opacity: 0; transform: scale(0.95); }
	to   { opacity: 1; transform: scale(1); }
}

/* ===== Action Buttons ===== */
.abg-btn-bet {
	width: 100%;
	height: 48px;
	background: #22c55e;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s;
	box-shadow: 0 4px 20px rgba(34,197,94,0.25);
}

.abg-btn-bet:hover {
	background: #16a34a;
	box-shadow: 0 6px 25px rgba(34,197,94,0.35);
}

.abg-btn-bet:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.abg-btn-cashout {
	width: 100%;
	height: 48px;
	background: #f97316;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s;
	box-shadow: 0 4px 20px rgba(249,115,22,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.abg-btn-cashout:hover {
	background: #ea580c;
}

.abg-cashout-mult {
	font-size: 13px;
	font-weight: 400;
	opacity: 0.8;
}

.abg-pulse {
	animation: abgPulse 0.8s ease-in-out infinite;
}

@keyframes abgPulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.02); }
}

.abg-action-disabled {
	width: 100%;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.03);
	border: 1px solid var(--abg-border);
	border-radius: 12px;
	color: rgba(255,255,255,0.35);
	font-size: 13px;
}

/* ===== Seed Row ===== */
.abg-seed-row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 0;
}

.abg-seed-label {
	font-size: 10px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.3);
	letter-spacing: 0.5px;
}

.abg-seed-value {
	font-size: 11px;
	color: rgba(255,255,255,0.25);
	word-break: break-all;
}

/* ===== Footer ===== */
.abg-footer {
	padding: 10px 16px;
	border-top: 1px solid var(--abg-border);
}

.abg-footer p {
	text-align: center;
	font-size: 11px;
	color: rgba(255,255,255,0.15);
}

/* ===== Login Required ===== */
.abg-login-required {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	text-align: center;
	gap: 10px;
}

.abg-login-icon {
	font-size: 48px;
}

.abg-login-required h3 {
	font-size: 20px;
	font-weight: 700;
}

.abg-login-required p {
	font-size: 14px;
	color: var(--abg-text-dim);
}

/* ===== Loading ===== */
.abg-game-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 80px 20px;
	gap: 12px;
}

.abg-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255,255,255,0.1);
	border-top-color: #f97316;
	border-radius: 50%;
	animation: abgSpin 0.8s linear infinite;
}

@keyframes abgSpin {
	to { transform: rotate(360deg); }
}

.abg-game-loading p {
	font-size: 14px;
	color: var(--abg-text-dim);
}

/* ===== Toast Notifications ===== */
.abg-toast-container {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.abg-toast {
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 13px;
	color: #fff;
	box-shadow: 0 4px 20px rgba(0,0,0,0.4);
	animation: abgSlideIn 0.3s ease;
	max-width: 300px;
}

.abg-toast-error { background: #dc2626; }
.abg-toast-success { background: #16a34a; }
.abg-toast-info { background: #2563eb; }

.abg-toast-hide {
	animation: abgSlideOut 0.3s ease forwards;
}

@keyframes abgSlideIn {
	from { transform: translateX(100%); opacity: 0; }
	to   { transform: translateX(0); opacity: 1; }
}

@keyframes abgSlideOut {
	from { transform: translateX(0); opacity: 1; }
	to   { transform: translateX(100%); opacity: 0; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
	.abg-main {
		flex-direction: column;
	}

	.abg-betting-panel {
		width: 100%;
	}

	.abg-canvas-wrap {
		min-height: 300px;
	}

	.abg-history-scroll {
		flex-wrap: wrap;
	}

	.abg-header {
		padding: 10px 12px;
	}

	.abg-title {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.abg-canvas-wrap {
		min-height: 250px;
	}

	.abg-betting-panel {
		padding: 12px;
		gap: 10px;
	}
}

/* ===== WordPress Compatibility ===== */
.abg-game-wrapper img,
.abg-game-wrapper svg {
	max-width: 100%;
}
