.game-live-stats {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 1050;
	width: min(420px, calc(100vw - 32px));
	background: #1e232b;
	background-image: none !important;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	color: #e2e8f0;
	font-size: 13px;
	display: none;
	flex-direction: column;
	overflow: hidden;
}

.game-live-stats.is-open {
	display: flex;
}

.game-live-stats__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.game-live-stats__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #f1f5f9;
	display: flex;
	align-items: center;
	gap: 8px;
}

.game-live-stats__title i {
	color: #0ac18f;
	font-size: 14px;
}

.game-live-stats__close {
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	font-size: 16px;
	padding: 4px 6px;
	line-height: 1;
}

.game-live-stats__close:hover {
	color: #f1f5f9;
}

.game-live-stats__toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
}

.game-live-stats__session-label {
	flex: 1;
	height: 34px;
	display: flex;
	align-items: center;
	padding: 0 10px;
	font-size: 13px;
	font-weight: 500;
	color: #94a3b8;
	background: #2a3140;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
}

.game-live-stats__filter {
	flex: 1;
	height: 34px;
	background: #2a3140;
	background-image: none!important;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	color: #e2e8f0;
	padding: 0 10px;
	font-size: 13px;
	cursor: pointer;
}

.game-live-stats__refresh {
	width: 34px;
	height: 34px;
	background: #2a3140;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	color: #94a3b8;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.game-live-stats__refresh:hover {
	color: #0ac18f;
	border-color: rgba(10, 193, 143, 0.35);
}

.game-live-stats__summary {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	margin: 0 16px;
	background: rgba(255, 255, 255, 0.06);
	border-radius: 10px;
	overflow: hidden;
}

.game-live-stats__stat {
	background: #252b36;
	padding: 12px 14px;
}

.game-live-stats__stat-label {
	color: #94a3b8;
	font-size: 12px;
	margin-bottom: 6px;
}

.game-live-stats__stat-value {
	font-size: 15px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 6px;
	line-height: 1.2;
	word-break: break-all;
}

.game-live-stats__stat-value img {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.game-live-stats__stat-value.is-profit-positive {
	color: #38cb74;
}

.game-live-stats__stat-value.is-profit-negative {
	color: #ff5722;
}

.game-live-stats__stat-value.is-wins {
	color: #38cb74;
}

.game-live-stats__stat-value.is-losses {
	color: #ff5722;
}

.game-live-stats__stat-value.is-neutral {
	color: #f1f5f9;
}

.game-live-stats__chart-wrap {
	padding: 12px 16px 16px;
	height: 180px;
	background: rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	margin: 0 16px 16px;
}

.game-live-stats__chart-wrap canvas {
	width: 100% !important;
	height: 100% !important;
}

body:not(.dark_mode) .game-live-stats {
	background: #fff;
	border-color: rgba(0, 0, 0, 0.08);
	color: #334155;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

body:not(.dark_mode) .game-live-stats__title {
	color: #0f172a;
}

body:not(.dark_mode) .game-live-stats__stat {
	background: #f8fafc;
}

body:not(.dark_mode) .game-live-stats__summary {
	background: #e2e8f0;
}

body:not(.dark_mode) .game-live-stats__session-label {
	background: #f1f5f9;
	border-color: #e2e8f0;
	color: #64748b;
}

body:not(.dark_mode) .game-live-stats__chart-wrap {
	background: #f1f5f9;
}

body:not(.dark_mode) .game-live-stats__filter,
body:not(.dark_mode) .game-live-stats__refresh {
	background: #f1f5f9;
	border-color: #e2e8f0;
	color: #475569;
}

body:not(.dark_mode) .game-live-stats__stat-value.is-neutral {
	color: #0f172a;
}

.gx-btn.is-active-stats {
	color: #03a9f4;
	border-color: rgba(10, 193, 143, 0.45);
}

.gx-btn.is-active-progress {
	color: #ff9800;
	border-color: rgba(255, 152, 0, 0.45);
}

/* Floating progress panel (beside live stats) */
.game-progress-panel {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 1050;
	width: min(360px, calc(100vw - 32px));
	background: #1e232b;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	color: #e2e8f0;
	font-size: 13px;
	display: none;
	flex-direction: column;
	overflow: hidden;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

.game-progress-panel.is-open {
	display: flex;
}

body.has-live-stats-open .game-progress-panel.is-open {
	right: calc(16px + min(420px, 100vw - 32px) + 12px);
}

.game-progress-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.game-progress-panel__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #f1f5f9;
	display: flex;
	align-items: center;
	gap: 8px;
}

.game-progress-panel__title i {
	color: #ff9800;
	font-size: 14px;
}

.game-progress-panel__close {
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	font-size: 16px;
	padding: 4px 6px;
	line-height: 1;
}

.game-progress-panel__close:hover {
	color: #f1f5f9;
}

.game-progress-panel__body {
	padding: 12px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.gp-bar__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.gp-bar__label {
	font-size: 13px;
	font-weight: 600;
	color: #f1f5f9;
}

.gp-bar__meta {
	font-size: 11px;
	color: #94a3b8;
	text-align: right;
	line-height: 1.3;
}

.gp-bar__meta b {
	color: #e2e8f0;
	font-weight: 600;
}

.gp-help {
	margin-left: 4px;
	font-size: 11px;
	color: #ff9800;
	cursor: help;
}

.gp-bar__values {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
	font-size: 12px;
	color: #94a3b8;
}

.gp-bar__values b {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	font-weight: 600;
	color: #f1f5f9;
}

.gp-bar__values span:last-child {
	text-align: right;
}

.gp-bar__track {
	height: 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.gp-bar__fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	transition: width 0.25s ease;
}

.gp-bar__fill--wager {
	background: linear-gradient(90deg, #8bc34a 0%, #0daa7f 100%);
}

.gp-bar__fill--spin {
	background: linear-gradient(90deg, #ffc107 0%, #ff6d00 100%);
}

.gp-bar__fill--stamina {
	background: linear-gradient(90deg, #03a9f4 0%, #0288d1 100%);
}

.gp-bar__pct {
	margin-top: 6px;
	font-size: 12px;
	font-weight: 700;
	color: #8bc34a;
	text-align: right;
}

.gp-bar__pct--spin {
	color: #ff9800;
}

.gp-bar__pct--stamina {
	color: #03a9f4;
}

body:not(.dark_mode) .game-progress-panel {
	background: #fff;
	border-color: rgba(0, 0, 0, 0.08);
	color: #334155;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

body:not(.dark_mode) .game-progress-panel__title,
body:not(.dark_mode) .gp-bar__label {
	color: #0f172a;
}

body:not(.dark_mode) .gp-bar__meta,
body:not(.dark_mode) .gp-bar__values {
	color: #64748b;
}

body:not(.dark_mode) .gp-bar__meta b,
body:not(.dark_mode) .gp-bar__values b {
	color: #0f172a;
}

body:not(.dark_mode) .gp-bar__track {
	background: rgba(158, 158, 158, 0.18);
}

@media (max-width: 900px) {
	body.has-live-stats-open .game-progress-panel.is-open {
		right: 16px;
		bottom: auto;
		top: 72px;
		max-height: calc(100vh - 96px);
	}

	body.has-live-stats-open.has-game-progress-open .game-live-stats.is-open {
		max-height: 48vh;
	}
}
.gp-bar__fill--challenge {
	background: linear-gradient(90deg, #9C27B0 0%, #673AB7 100%);
}

.gp-bar__pct {
	margin-top: 6px;
	font-size: 12px;
	font-weight: 700;
	color: #8bc34a;
	text-align: right;
}

.gp-bar__pct--spin {
	color: #ff9800;
}

.gp-bar__pct--stamina {
	color: #03a9f4;
}

.gp-bar__pct--challenge {
	color: #ff9800;
}

.gp-bar--challenge {
	position: relative;
	transition: opacity .45s ease, transform .45s ease;
}
.gp-bar--challenge .gp-bar__head {
	flex-direction: column;
	align-items: stretch;
	gap: 2px;
}
.gp-bar--challenge .gp-bar__label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}
.gp-bar--challenge .gp-bar__meta {
	text-align: left;
}
.gp-bar--challenge .ch-games-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	margin: 0 0 8px;
	padding: 5px 10px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 152, 0, .14);
	color: inherit;
	font-size: 12px;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
}
.gp-bar--challenge .ch-games-btn__text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.gp-bar--challenge .ch-games-btn__more {
	flex: 0 0 auto;
	font-weight: 800;
	color: #ff9800;
}
.ch-games-mask {
	position: fixed;
	inset: 0;
	z-index: 4000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, .55);
}
.ch-games-mask.is-open { display: flex; }
.ch-games-modal {
	position: relative;
	width: min(440px, 100%);
	max-height: 80vh;
	overflow: auto;
	padding: 22px 18px 16px;
	border-radius: 16px;
	background: #1e232b;
	color: #e2e8f0;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}
.ch-games-modal__close {
	position: absolute;
	top: 8px;
	right: 10px;
	border: 0;
	background: transparent;
	color: #94a3b8;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.ch-games-modal__title {
	margin: 0 28px 14px 0;
	font-size: 16px;
	font-weight: 700;
}
.ch-games-modal__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ch-games-chip {
	display: inline-flex;
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
	font-size: 13px;
}
body:not(.dark_mode) .ch-games-modal { background: #fff; color: #1f2937; }
body:not(.dark_mode) .ch-games-chip { background: #f1f5f9; }
body:not(.dark_mode) .gp-bar--challenge .ch-games-btn { background: #fff4e5; color: #1f2937; }
.gp-bar--challenge.is-complete .gp-bar__fill--challenge {
	background: linear-gradient(90deg, #7b1fa2 0%, #34c759 100%);
	box-shadow: 0 0 14px rgba(52, 199, 89, .55);
}
.gp-bar--challenge.is-complete .gp-bar__track {
	box-shadow: 0 0 0 3px rgba(52, 199, 89, .28);
}
.gp-bar--challenge.is-complete .gp-bar__pct--challenge {
	color: #34c759;
}
.gp-bar--challenge.is-complete {
	animation: gp-ch-done .7s ease;
}
.gp-bar--challenge.is-leaving {
	opacity: 0;
	transform: translateY(-6px);
}
@keyframes gp-ch-done {
	0% { transform: scale(1); }
	35% { transform: scale(1.025); }
	100% { transform: scale(1); }
}

body:not(.dark_mode) .game-progress-panel {
	background: #fff;
	border-color: rgba(0, 0, 0, 0.08);
	color: #334155;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

body:not(.dark_mode) .game-progress-panel__title,
body:not(.dark_mode) .gp-bar__label {
	color: #0f172a;
}

body:not(.dark_mode) .gp-bar__meta,
body:not(.dark_mode) .gp-bar__values {
	color: #64748b;
}

body:not(.dark_mode) .gp-bar__meta b,
body:not(.dark_mode) .gp-bar__values b {
	color: #0f172a;
}

body:not(.dark_mode) .gp-bar__track {
	background: rgba(158, 158, 158, 0.18);
}

@media (max-width: 900px) {
	body.has-live-stats-open .game-progress-panel.is-open {
		right: 16px;
		bottom: auto;
		top: 72px;
		max-height: calc(100vh - 96px);
	}

	body.has-live-stats-open.has-game-progress-open .game-live-stats.is-open {
		max-height: 48vh;
	}
}
