:root {
    --neon-purple: #bc66ff;
    --light-purple: #352659;
    --btn-purple: #6a1b9a;
    --bg-dark: #05060a;
    --energy: #ffeb3b; 
    --coin: #ff9800;   
}

body {
    margin: 0; padding: 0;
    background: var(--bg-dark);
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

.app-container {
    display: flex; flex-direction: column;
    min-height: 100vh; max-width: 480px; margin: 0 auto;
}

/* --- ВЕРХНЯ ПАНЕЛЬ --- */
.top-status-bar {
    padding: 10px 15px;
    background: var(--light-purple);
    border-bottom: 1px solid var(--neon-purple);
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 1001;
}

.tg-user { display: flex; align-items: center; gap: 8px; }
.tg-icon-svg { width: 18px; height: 18px; fill: #24A1DE; }

.online-tag {
    font-size: 10px; font-weight: 800; color: #00ffa3;
    display: flex; align-items: center; gap: 4px;
}

/* --- КОМПАКТНІ БАЛАНСИ --- */
.balance-section {
    padding: 10px 15px;
    background: linear-gradient(180deg, var(--light-purple) 0%, var(--bg-dark) 100%);
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

.balance-box {
    background: var(--btn-purple);
    border: 1px solid var(--neon-purple);
    border-radius: 10px; 
    padding: 8px 5px; /* Зменшена висота */
    display: flex; flex-direction: row; /* В рядок для економії місця */
    align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.balance-box svg { width: 16px; height: 16px; }

.balance-info { display: flex; flex-direction: column; }

.balance-label {
    font-size: 8px; font-weight: 800; color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase; line-height: 1;
}

.balance-value {
    font-size: 15px; font-weight: 900; color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

/* Контент */
.content { flex: 1; padding: 10px 15px 140px; }

/* Нижнє меню */
.bottom-nav-grid {
    position: fixed; bottom: 8px; left: 8px; right: 8px;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
    padding: 8px; background: rgba(20, 20, 35, 0.95);
    border: 1px solid var(--neon-purple); border-radius: 12px;
    backdrop-filter: blur(10px); z-index: 1000;
}

.nav-btn {
    background: var(--btn-purple); border: 1px solid var(--neon-purple);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    padding: 8px 2px; gap: 5px; color: #fff; text-decoration: none; outline: none;
}
.nav-btn svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2.5; }
.nav-btn span { font-size: 9px; font-weight: 800; text-transform: uppercase; }
.nav-btn.active { background: var(--neon-purple); border-color: #fff; }

.page { display: none; }
.page.active { display: block; }

#user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tg-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

/* Контейнер списку (mini-list) */
.mini-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Елемент списку */
.mini-list-item {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 12px; 
    background: rgba(188, 102, 255, 0.03); /* Дуже слабкий фіолетовий фон */
    border: 1px solid rgba(188, 102, 255, 0.15); /* Фіолетова тонка рамка */
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 0.85em;
    transition: 0.3s ease;
}

/* Ефект при наведенні або для виділення */
.mini-list-item:hover {
    background: rgba(188, 102, 255, 0.07);
    border-color: rgba(188, 102, 255, 0.3);
    transform: translateX(2px);
}

/* Стиль для імені користувача */
.mini-list-user {
    color: #efedff; /* Світло-бузковий текст */
    font-weight: 500;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 110px;
}

/* Стиль для суми */
.mini-list-amount {
    display: flex; 
    align-items: center; 
    gap: 6px; 
    flex-shrink: 0;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Специфічні кольори для валют (якщо хочете залишити акценти) */
.mini-list-amount.silver { color: #00ff88; text-shadow: 0 0 10px rgba(0, 255, 136, 0.2); }
.mini-list-amount.gold { color: #ffb703; text-shadow: 0 0 10px rgba(255, 183, 3, 0.2); }

/* Іконка монети */
.mini-list-coin {
    width: 16px; 
    height: 16px;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.3));
}

/* Аватарка користувача у списку */
.list-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(188, 102, 255, 0.1);
    border: 1px solid rgba(188, 102, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--neon-purple);
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(188, 102, 255, 0.2);
}

/* Оновлений контейнер імені для вирівнювання з аватаркою */
.user-with-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Важливо для обрізки тексту */
}



/* MINERS */
.miner-card {
	background: rgba(30, 30, 35, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 15px;
	position: relative;
	overflow: hidden;
	transition: 0.3s;
}

.glow-effect {
	position: absolute;
	top: -50px;
	left: -50px;
	width: 100px;
	height: 100px;
	filter: blur(40px);
	border-radius: 50%;
	pointer-events: none;
}

.miner-main-block {
	display: flex;
	gap: 15px;
	margin-bottom: 15px;
	position: relative;
	z-index: 1;
	align-items: stretch;
}

.miner-image-wrapper {
	flex: 0 0 40%;
	aspect-ratio: 1 / 1;
	background: rgba(0,0,0,0.3);
	border-radius: 12px;
	border: 1px solid;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.miner-image-wrapper img {
	width: 80%;
	height: 80%;
	object-fit: contain;
}

.miner-info-side {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.miner-name {
	margin: 0;
	color: #fff;
	font-size: 1.05em;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.miner-stats {
	font-size: 0.75em;
	font-weight: bold;
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 2px;
}

.price-tag {
	display: flex;
	align-items: center;
	gap: 4px;
	color: rgba(255,255,255,0.8);
}

.owned-badge {
	text-align: right;
	background: rgba(0,0,0,0.2);
	padding: 4px 8px;
	border-radius: 8px;
	border: 1px solid rgba(255,255,255,0.05);
	display: flex;
	flex-direction: column;
}
.owned-badge span {
	font-size: 0.6em;
	color: rgba(255,255,255,0.4);
	letter-spacing: 1px;
}
.owned-badge strong {
	font-size: 1.1em;
	color: #fff;
}

.collection-section {
	background: rgba(0,0,0,0.2);
	padding: 12px;
	border-radius: 12px;
	border: 1px solid rgba(255,255,255,0.03);
	margin-bottom: 15px;
}

.collection-header {
	display: flex;
	justify-content: space-between;
	font-size: 0.75em;
	margin-bottom: 8px;
	align-items: center;
}

.energy-label {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--energy);
	font-weight: 800;
	text-transform: uppercase;
}

.progress-container {
	width: 100%;
	height: 8px;
	background: rgba(255,255,255,0.05);
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid rgba(255,255,255,0.05);
}

.miner-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.game-btn {
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
	color: #fff;
	font-size: 0.75em;
	font-weight: 800;
	cursor: pointer;
	transition: 0.2s;
	background: rgba(255,255,255,0.05);
	text-transform: uppercase;
	padding: 8px 0;
}
.game-btn:active { transform: scale(0.96); }

.btn-buy-gray { border-color: rgba(160, 160, 170, 0.4); background: rgba(160, 160, 170, 0.1); }
.btn-buy-purple { border-color: var(--neon-purple); background: rgba(188, 102, 255, 0.1); }
.btn-buy-gold { border-color: var(--coin); background: rgba(255, 215, 0, 0.1); color: var(--coin); }

.btn-refill { border-color: var(--energy); color: var(--energy); }
.btn-collect { border-color: #00ffa3; color: #00ffa3; }

.btn-start { 
    border-color: #ff4b2b !important; 
    color: #ff4b2b !important; 
}

.animated-tank {
	position: relative;
	transition: width 0.5s ease-in-out;
	height: 100%;
}
.animated-tank::after {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
	animation: energy-shimmer 2s infinite linear;
}
@keyframes energy-shimmer {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}

#refill-input:focus {
    border-color: var(--neon-purple) !important;
    box-shadow: 0 0 10px rgba(188, 102, 255, 0.4);
    background: rgba(188, 102, 255, 0.05) !important;
}

/* Анімація появи модалки */
.modal-overlay {
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.game-info-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(90deg, rgba(188, 102, 255, 0.08) 0%, rgba(30, 30, 35, 0.4) 100%);
    border: 1px solid rgba(188, 102, 255, 0.2);
    border-left: 4px solid var(--neon-purple); /* Яскравий акцент зліва */
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Ефект сяйва на фоні банера */
.game-info-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 10% 50%, rgba(188, 102, 255, 0.1), transparent 70%);
    pointer-events: none;
}

.info-icon-wrapper {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(188, 102, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-purple);
}

.info-icon-wrapper svg {
    width: 20px;
    height: 20px;
}

.info-text-content p {
    font-size: 0.85em;
    color: rgba(239, 237, 255, 0.8); /* Світлий текст як у списках */
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

/* Анімація для іконки (легке пульсування) */
.info-icon-wrapper {
    animation: icon-pulse 2s infinite ease-in-out;
}

@keyframes icon-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}



/* TASKS */
.top-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    gap: 4px;
}

.tab-item {
    flex: 1;
    padding: 10px 5px;
    text-align: center;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: 1px solid transparent;
    transition: 0.2s;
}

.active-tab {
    background: #bc66ff !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}

.pulsate-tab {
    animation: textPulsate 1.5s infinite ease-in-out;
}
@keyframes textPulsate {
    0% { opacity: 1; }
    50% { color: #fffb00; opacity: 0.8; }
    100% { opacity: 1; }
}

.internal-tasks-container {
	--accent: #bc66ff;
	--accent-dim: rgba(188, 102, 255, 0.1);
	--bg-card: rgba(255, 255, 255, 0.03);
	--border-color: rgba(255, 255, 255, 0.1);
	--text-dim: rgba(255, 255, 255, 0.5);
	--success: #00ff88;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Картки завдань */
.task-card-manage {
	background: rgba(30, 30, 35, 0.7) !important;
	border: 1px solid var(--border-color) !important;
	border-radius: 16px;
	padding: 15px;
	transition: 0.3s;
}

/* Кнопки керування */
.mini-ctrl-btn {
	flex: 1;
	padding: 10px 5px;
	border-radius: 10px;
	font-size: 0.75em;
	font-weight: 800;
	text-transform: uppercase;
	border: 1px solid var(--border-color);
	background: rgba(255, 255, 255, 0.05);
	color: #fff;
	cursor: pointer;
	transition: 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
}
.mini-ctrl-btn:active { transform: scale(0.95); }
.mini-ctrl-btn.deposit { border-color: var(--accent); color: var(--accent); }
.mini-ctrl-btn.pause { border-color: #ffb703; color: #ffb703; }
.mini-ctrl-btn.delete { border-color: #ff4d6d; color: #ff4d6d; }

/* Поля вводу */
.ios-input {
	width: 100%;
	background: rgba(255, 255, 255, 0.05) !important;
	border: 1px solid var(--border-color) !important;
	border-radius: 12px !important;
	padding: 12px 15px !important;
	color: white !important;
	outline: none;
	box-sizing: border-box;
	transition: 0.2s;
}
.ios-input:focus { border-color: var(--accent) !important; background: rgba(255, 255, 255, 0.08) !important; }

/* Вибір типу завдання (Radio Cards) */
.task-type-card input[type="radio"] { display: none; }
.task-type-card .card-content {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	cursor: pointer;
	transition: 0.2s;
}
.task-type-card input:checked + .card-content {
	border-color: var(--accent);
	background: var(--accent-dim);
}
.task-type-card .title { font-weight: bold; font-size: 0.9em; }
.task-type-card .desc { font-size: 0.7em; color: var(--text-dim); }

/* Чипи методу перевірки */
.method-chip input { display: none; }
.method-chip span {
	padding: 8px 15px;
	background: var(--bg-card);
	border-radius: 20px;
	font-size: 0.8em;
	border: 1px solid var(--border-color);
	cursor: pointer;
	color: var(--text-dim);
	display: inline-block;
	transition: 0.2s;
}
.method-chip input:checked + span {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-dim);
}

/* Анімації */
@keyframes fadeIn { 
	from { opacity: 0; transform: translateY(8px); } 
	to { opacity: 1; transform: translateY(0); } 
}
.animate-field { animation: fadeIn 0.3s ease forwards; }

/* Кнопка Create (Зелена/Акцентна) */
.ios-share-btn-green {
	background: var(--accent) !important;
	border: none !important;
	border-radius: 12px !important;
	color: white !important;
	font-weight: bold !important;
	cursor: pointer;
	transition: 0.2s;
}
.ios-share-btn-green:active { opacity: 0.8; transform: scale(0.98); }