/* ================================================================
   Snail Racing Tycoon — Основные стили v10.0
   ================================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    min-height: 100vh;
}

.container { max-width: 500px; margin: 0 auto; padding: 10px; }

.hidden { display: none !important; }

/* ========== Приветственный экран ========== */
#welcome-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.welcome-screen-inner { text-align: center; padding: 30px 20px; animation: fadeIn 0.8s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.welcome-logo { font-size: 80px; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.welcome-title { font-size: 28px; font-weight: bold; margin: 15px 0 10px; background: linear-gradient(45deg,#ff6b6b,#ffd93d,#6bcb77,#4d96ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.welcome-subtitle { color: #aaa; font-size: 14px; margin-bottom: 25px; line-height: 1.5; }
.welcome-buttons { display: flex; flex-direction: column; gap: 10px; max-width: 300px; margin: 0 auto; }

.btn-welcome { padding: 14px 20px; border-radius: 15px; border: none; font-size: 15px; font-weight: bold; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 10px; justify-content: center; }
.btn-welcome:active { transform: scale(0.96); }
.btn-play { background: linear-gradient(135deg,#ff6b6b,#ff8e53); color: #fff; font-size: 18px; padding: 18px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.4); } 50% { box-shadow: 0 0 0 15px rgba(255,107,107,0); } }
.btn-info { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.btn-referral { background: linear-gradient(135deg,#ffd93d,#f39c12); color: #000; }
.btn-help { background: rgba(77,150,255,0.2); color: #4d96ff; border: 1px solid rgba(77,150,255,0.3); }

/* ========== Шапка ========== */
#main-screen, #page-container { min-height: 100vh; }
#main-screen::before, #page-container::before { content: ''; display: block; height: 120px; background: #000; }
.header { background: linear-gradient(135deg, rgba(255,107,107,0.2), rgba(255,215,0,0.2)); border-radius: 20px; padding: 15px; text-align: center; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); }
.player-stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.stat-item { background: rgba(0,0,0,0.4); border-radius: 12px; padding: 8px 6px; text-align: center; min-width: 50px; flex: 1; }
.stat-icon { font-size: 22px; display: block; margin-bottom: 2px; }
.stat-value { font-size: 18px; font-weight: 800; }
.stat-label { font-size: 9px; color: #aaa; margin-top: 2px; }

.incubator { background: rgba(255,182,193,0.2); border-radius: 15px; padding: 12px; margin-bottom: 10px; border: 2px dashed rgba(255,182,193,0.5); cursor: pointer; text-align: center; }

/* ========== Меню ========== */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.menu-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 15px; padding: 16px 10px; color: #fff; font-size: 13px; cursor: pointer; text-align: center; transition: all 0.2s; }
.menu-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.15); }
.menu-btn .icon { font-size: 28px; display: block; margin-bottom: 4px; }

/* ========== Кнопки ========== */
.btn-primary { width: 100%; padding: 14px; background: linear-gradient(135deg,#ff6b6b,#ff8e53); color: #fff; border: none; border-radius: 15px; font-size: 15px; font-weight: bold; cursor: pointer; margin-top: 6px; transition: all 0.2s; }
.btn-primary:active { transform: scale(0.97); opacity: 0.8; }
.btn-back { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 10px 20px; border-radius: 12px; font-size: 14px; cursor: pointer; margin-bottom: 15px; display: inline-block; }
.section-title { font-size: 18px; margin: 10px 0 15px; font-weight: bold; }

/* ========== Карточки улиток ========== */
.snail-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 15px; padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.snail-card:active { background: rgba(255,255,255,0.12); }

/* Цвета редкостей */
.rarity-common { background: rgba(170,170,170,0.3); color: #aaa; }
.rarity-uncommon { background: rgba(46,204,113,0.3); color: #2ecc71; }
.rarity-rare { background: rgba(52,152,219,0.3); color: #3498db; }
.rarity-super_rare { background: rgba(155,89,182,0.3); color: #9b59b6; }
.rarity-epic { background: rgba(231,76,60,0.3); color: #e74c3c; }
.rarity-mythic { background: rgba(26,188,156,0.3); color: #1abc9c; }
.rarity-legendary { background: rgba(241,196,15,0.3); color: #f1c40f; }
.rarity-ancient { background: rgba(230,126,34,0.3); color: #e67e22; }
.rarity-cosmic { background: rgba(142,68,173,0.3); color: #8e44ad; }
.rarity-divine { background: rgba(255,215,0,0.4); color: #ffd700; }

/* ========== Модальное окно ========== */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #1a1a2e; border-radius: 20px; padding: 20px; max-width: 380px; width: 90%; max-height: 80vh; overflow-y: auto; }
.action-btn { display: block; width: 100%; padding: 11px; margin: 4px 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 10px; font-size: 13px; cursor: pointer; text-align: left; }
.action-btn:active { background: rgba(255,255,255,0.2); }

/* ========== Инфо-карточки ========== */
.info-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 15px; padding: 15px; margin-bottom: 10px; }
.info-card h3 { margin-bottom: 8px; }
.info-card p { font-size: 13px; color: #bbb; line-height: 1.5; }

/* ========== Рефералы ========== */
.ref-stats { display: flex; justify-content: center; gap: 20px; margin: 15px 0; }
.ref-stat { text-align: center; }
.ref-stat .big { font-size: 24px; font-weight: bold; color: #ffd700; }
.ref-stat .label { font-size: 11px; color: #aaa; }
.ref-link-box { background: rgba(0,0,0,0.4); padding: 15px; border-radius: 12px; word-break: break-all; margin: 15px 0; border: 1px solid rgba(255,215,0,0.3); }
.ref-link-box code { color: #ffd700; font-size: 12px; }

/* ========== СВОДКА УЛИТОК ========== */
.snails-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 15px; }
.summary-card { background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; padding: 12px 8px; text-align: center; backdrop-filter: blur(10px); transition: transform 0.2s; }
.summary-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.25); }
.summary-icon { font-size: 24px; margin-bottom: 4px; }
.summary-count { font-size: 22px; font-weight: 800; background: linear-gradient(135deg, #ffd700, #ff8e53); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.summary-label { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

/* ========== ФИЛЬТРЫ ========== */
.snails-toolbar { margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.snails-toolbar::-webkit-scrollbar { display: none; }
.filter-chips { display: flex; gap: 6px; padding-bottom: 4px; flex-wrap: nowrap; }
.chip { padding: 8px 14px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); color: #aaa; font-size: 12px; cursor: pointer; white-space: nowrap; transition: all 0.2s; backdrop-filter: blur(5px); }
.chip.active { background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(138, 43, 226, 0.2)); border-color: rgba(0, 255, 255, 0.5); color: #fff; font-weight: 600; box-shadow: 0 0 15px rgba(0, 255, 255, 0.15); }
.chip:active { transform: scale(0.95); }

/* ========== СЕТКА УЛИТОК ========== */
.snails-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 80px; }
.snail-card-v2 { background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 14px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; backdrop-filter: blur(8px); }
.snail-card-v2::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--rarity-color, #aaa), transparent); opacity: 0.6; }
.snail-card-v2:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.25); box-shadow: 0 8px 25px rgba(0,0,0,0.3), 0 0 20px rgba(255,215,0,0.05); }
.snail-card-v2:active { transform: scale(0.97); }
.snail-card-v2 .card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.snail-card-v2 .snail-avatar { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; overflow: hidden; }
.snail-card-v2 .snail-info { flex: 1; min-width: 0; }
.snail-card-v2 .snail-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snail-card-v2 .snail-subtitle { font-size: 10px; color: #888; margin-top: 2px; }
.snail-card-v2 .rarity-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }
.snail-card-v2 .card-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 8px; }
.snail-card-v2 .mini-stat { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #bbb; background: rgba(0,0,0,0.2); padding: 4px 6px; border-radius: 8px; }
.snail-card-v2 .card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); }
.snail-card-v2 .status-dots { display: flex; gap: 4px; }
.snail-card-v2 .status-dot { width: 8px; height: 8px; border-radius: 50%; }
.snail-card-v2 .status-dot.active { box-shadow: 0 0 6px currentColor; }
.dot-fed { background: #2ecc71; }
.dot-unfed { background: #555; }
.dot-trained { background: #3498db; }
.dot-untrained { background: #555; }
.snail-card-v2 .age-badge { font-size: 9px; color: #666; background: rgba(0,0,0,0.3); padding: 3px 8px; border-radius: 8px; }

/* ========== СТРАНИЦА ПРОФИЛЯ УЛИТКИ ========== */
.snail-detail-container { background: rgba(255,255,255,0.03); border-radius: 24px; overflow: hidden; }
.detail-header { padding: 30px 20px 20px; text-align: center; }
.detail-avatar { font-size: 80px; display: block; margin-bottom: 10px; animation: floatAvatar 3s ease-in-out infinite; }
@keyframes floatAvatar { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-8px); } }
.detail-name { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.detail-rarity { display: inline-block; padding: 4px 14px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.detail-subtitle { font-size: 12px; color: #888; margin-top: 8px; }
.detail-section { padding: 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.section-title-sm { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #ddd; }

/* ========== СЕТКА ДЕЙСТВИЙ 3×2 ========== */
.detail-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-action-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-align: center; min-height: 90px; }
.detail-action-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.12); }
.detail-action-btn .action-icon { font-size: 28px; display: block; }
.detail-action-btn .action-sub { font-size: 10px; color: #888; font-weight: 400; }
.detail-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Цветовые акценты */
.detail-action-btn.tap-btn { border-color: rgba(255,215,0,0.3); background: rgba(255,215,0,0.08); }
.detail-action-btn.tap-btn .action-icon { color: #ffd700; }
.detail-action-btn.gym-btn { border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.08); }
.detail-action-btn.gym-btn .action-icon { color: #ff6b6b; }
.detail-action-btn.feed-btn { border-color: rgba(46,204,113,0.3); background: rgba(46,204,113,0.08); }
.detail-action-btn.feed-btn .action-icon { color: #2ecc71; }
.detail-action-btn.item-btn { border-color: rgba(52,152,219,0.3); background: rgba(52,152,219,0.08); }
.detail-action-btn.item-btn .action-icon { color: #3498db; }
.detail-action-btn.elixir-btn { border-color: rgba(155,89,182,0.3); background: rgba(155,89,182,0.08); }
.detail-action-btn.elixir-btn .action-icon { color: #9b59b6; }

/* ========== Статы ========== */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 15px; }
.stat-box { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat-box .stat-emoji { font-size: 20px; margin-bottom: 4px; }
.stat-box .stat-value { font-size: 18px; font-weight: 800; }
.stat-box .stat-label { font-size: 9px; color: #888; text-transform: uppercase; }

/* ========== Бары ========== */
.profile-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 15px; }
.bar-container { display: flex; align-items: center; gap: 10px; }
.bar-emoji { font-size: 18px; width: 24px; text-align: center; }
.bar-wrapper { flex: 1; height: 12px; background: rgba(255,255,255,0.1); border-radius: 6px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 6px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-fill.energy { background: linear-gradient(90deg, #f1c40f, #f39c12); }
.bar-fill.mood { background: linear-gradient(90deg, #e74c3c, #e67e22); }
.bar-fill.exp { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.bar-value { font-size: 11px; font-weight: 600; color: #aaa; min-width: 45px; text-align: right; }

/* ========== Дневник ========== */
.diary-entry { background: rgba(255,255,255,0.04); border-left: 3px solid var(--rarity-color, rgba(255,255,255,0.2)); padding: 10px 12px; margin-bottom: 8px; border-radius: 0 10px 10px 0; font-size: 12px; color: #bbb; }
.diary-entry .diary-date { font-size: 9px; color: #666; margin-bottom: 3px; }

/* ========== СПОРТЗАЛ ========== */
.gym-select-snail select { font-family: inherit; }
.gym-snail-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 14px; margin-bottom: 15px; text-align: center; }
.gym-snail-card .gym-avatar { width: 80px; height: 80px; margin: 0 auto 10px; }
.gym-snail-card .gym-avatar img { width: 100%; height: 100%; object-fit: contain; }
.gym-snail-card .gym-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.gym-snail-card .gym-stats { font-size: 11px; color: #aaa; line-height: 1.6; }

.gym-machine { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 16px; margin-bottom: 12px; }
.machine-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.machine-icon { font-size: 36px; }
.machine-name { font-weight: 700; font-size: 15px; }
.machine-desc { font-size: 11px; color: #888; }
.machine-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.machine-btn { padding: 12px; border-radius: 12px; border: none; font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.2s; text-align: center; }
.machine-btn:active { transform: scale(0.95); }
.machine-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.machine-btn.free-btn { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }
.machine-btn.paid-btn { background: linear-gradient(135deg, #f39c12, #e67e22); color: #fff; }
.machine-status { font-size: 11px; color: #888; margin-top: 8px; text-align: center; }

/* ========== СТОЛОВАЯ ========== */
.cafeteria-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 14px; margin-bottom: 10px; text-align: center; }
.cafeteria-card-header { margin-bottom: 10px; }
.cafeteria-avatar { width: 80px; height: 80px; margin: 0 auto 8px; }
.cafeteria-avatar img { width: 100%; height: 100%; object-fit: contain; }
.cafeteria-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.cafeteria-stats { font-size: 11px; color: #aaa; line-height: 1.6; margin-bottom: 10px; }
.cafeteria-feed-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #2ecc71, #27ae60); border: none; border-radius: 12px; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.cafeteria-feed-btn:active { transform: scale(0.97); }
.cafeteria-feed-btn.fed { background: rgba(46,204,113,0.3); color: #2ecc71; }
.cafeteria-feed-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== TOAST УВЕДОМЛЕНИЯ ========== */
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(-20px); } }

/* ========== КНОПКА СОЗДАНИЯ УЛИТКИ ========== */
.floating-create-btn { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: calc(100% - 40px); max-width: 460px; padding: 16px; border-radius: 18px; border: none; background: linear-gradient(135deg, #00d2ff, #3a7bd5); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 30px rgba(0,210,255,0.3); transition: all 0.3s; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 8px; animation: floatBtn 3s ease-in-out infinite; }
@keyframes floatBtn { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
.floating-create-btn:active { transform: translateX(-50%) scale(0.96); box-shadow: 0 4px 15px rgba(0,210,255,0.2); }

/* ========== ПУСТЫЕ СОСТОЯНИЯ ========== */
.empty-state { text-align: center; padding: 40px 20px; color: #888; }
.empty-state .empty-icon { font-size: 60px; margin-bottom: 15px; }
.empty-state p { font-size: 14px; }

/* ========== КНОПКА НАЗАД (ОТСТУП) ========== */
.btn-back { margin-top: 10px; margin-bottom: 12px; }

/* ========== КОНТЕЙНЕР ========== */
.container { max-width: 500px; margin: 0 auto; padding: 8px 12px 20px; }


/* ========== МАГАЗИН РАКУШЕЙ ========== */
.shells-balance-card { background: linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,180,50,0.06)); border: 1px solid rgba(255,215,0,0.3); border-radius: 20px; padding: 20px; text-align: center; margin-bottom: 15px; }
.shells-balance-card .shells-icon { font-size: 50px; animation: floatBadge 2s ease-in-out infinite; }
.shells-balance-card .shells-amount { font-size: 28px; font-weight: 800; color: #ffd700; margin: 8px 0; }
.shells-balance-card .shells-label { font-size: 11px; color: #aaa; }
.shells-pack-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; transition: all 0.2s; }
.shells-pack-card:hover { background: rgba(255,215,0,0.06); border-color: rgba(255,215,0,0.2); }
.shells-pack-emoji { font-size: 36px; min-width: 44px; text-align: center; }
.shells-pack-info { flex: 1; }
.shells-pack-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.shells-pack-amount { font-size: 16px; font-weight: 800; color: #ffd700; }
.shells-pack-bonus { font-size: 10px; color: #2ecc71; }
.shells-pack-price { font-weight: 700; color: #fff; font-size: 16px; margin-right: 8px; }
.shells-buy-btn { padding: 10px 18px; background: linear-gradient(135deg, #ffd700, #f39c12); border: none; border-radius: 12px; color: #000; font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.shells-buy-btn:active { transform: scale(0.95); }
.shells-item-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.shells-item-emoji { font-size: 28px; min-width: 36px; text-align: center; }
.shells-item-name { font-weight: 600; font-size: 13px; flex: 1; }
.shells-item-cost { color: #ffd700; font-weight: 700; font-size: 14px; margin-right: 8px; }

/* ========== ГОРОД УЛИТОК ========== */
.city-container { background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 30%, #90EE90 55%, #228B22 100%); border-radius: 20px; padding: 12px 10px 10px; margin-bottom: 12px; cursor: pointer; border: 2px solid rgba(255,255,255,0.3); position: relative; overflow: hidden; min-height: 180px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.city-sky { position: absolute; top: 0; left: 0; right: 0; height: 55%; pointer-events: none; }
.cloud { position: absolute; font-size: 22px; opacity: 0.5; }
.c1 { top: 5px; left: 5%; animation: cloudDrift 12s linear infinite; }
.c2 { top: 15px; right: 8%; animation: cloudDrift 10s linear infinite reverse; font-size: 16px; }
@keyframes cloudDrift { 0% { transform: translateX(0); } 50% { transform: translateX(20px); } 100% { transform: translateX(0); } }
.city-title-box { background: rgba(0,0,0,0.55); border-radius: 8px; padding: 4px 10px; margin-bottom: 2px; position: relative; z-index: 2; }
.city-title-text { font-size: 13px; font-weight: 800; color: #FFD700; text-shadow: 0 0 8px rgba(255,215,0,0.4); letter-spacing: 1px; white-space: nowrap; }
.city-snails-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 4px; position: relative; z-index: 2; }
.funny-snail { position: relative; animation: snailWiggle 0.8s ease-in-out infinite; }
.funny-snail:nth-child(1) { animation-delay: 0s; }
.funny-snail:nth-child(2) { animation-delay: 0.2s; }
.funny-snail:nth-child(3) { animation-delay: 0.4s; }
.funny-snail.big { transform: scale(1.2); }
.funny-snail.big .snail-face { font-size: 46px; }
.snail-face { font-size: 38px; display: block; line-height: 1; }
.snail-hat { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 16px; animation: hatBounce 0.5s ease-in-out infinite; }
@keyframes snailWiggle { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-4px) rotate(-3deg); } 75% { transform: translateY(-2px) rotate(3deg); } }
@keyframes hatBounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-2px); } }
.city-race-track { display: flex; align-items: center; gap: 8px; width: 90%; max-width: 320px; margin-bottom: 4px; position: relative; z-index: 2; }
.track-flag { font-size: 22px; flex-shrink: 0; }
.track-lanes { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.track-lane { height: 10px; background: #8B7355; border-radius: 3px; border: 1px solid #6B5335; }
.track-lines { height: 4px; background: repeating-linear-gradient(90deg, #FFD700 0px, #FFD700 8px, transparent 8px, transparent 16px); border-radius: 2px; animation: trackMove 0.5s linear infinite; }
@keyframes trackMove { 0% { background-position: 0 0; } 100% { background-position: -16px 0; } }
.city-bottom-text { font-size: 10px; color: #fff; text-align: center; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.6); position: relative; z-index: 2; }

/* ========== ДОСТИЖЕНИЯ ========== */
.achievements-header { text-align: center; padding: 20px 10px 10px; }
.ach-header-icon { font-size: 60px; animation: floatBadge 2s ease-in-out infinite; }
@keyframes floatBadge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ach-header-title { font-size: 24px; font-weight: 800; margin-top: 5px; background: linear-gradient(135deg, #ffd700, #ff8e53); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ach-header-sub { font-size: 13px; color: #888; margin-top: 2px; }

.ach-categories { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ach-categories::-webkit-scrollbar { display: none; }
.ach-cat-btn { padding: 7px 12px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: #888; font-size: 11px; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.ach-cat-btn.active { background: rgba(255,215,0,0.15); border-color: rgba(255,215,0,0.35); color: #ffd700; font-weight: 600; }

.ach-loading { font-size: 50px; animation: floatBadge 1s ease-in-out infinite; }

.achievements-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.achievement-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 12px; text-align: center; transition: all 0.2s; position: relative; overflow: hidden; }
.achievement-card.unlocked { background: rgba(255,215,0,0.08); border-color: rgba(255,215,0,0.25); }
.achievement-card .ach-card-icon { font-size: 36px; margin-bottom: 4px; }
.achievement-card .ach-card-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.achievement-card.unlocked .ach-card-name { color: #ffd700; }
.achievement-card.locked .ach-card-name { color: #aaa; }
.achievement-card .ach-card-desc { font-size: 9px; color: #666; margin-bottom: 6px; line-height: 1.3; }
.achievement-card .ach-card-progress { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; margin-bottom: 2px; overflow: hidden; }
.achievement-card .ach-card-fill { height: 100%; border-radius: 2px; }
.achievement-card.unlocked .ach-card-fill { background: #ffd700; }
.achievement-card.locked .ach-card-fill { background: #555; }
.achievement-card .ach-card-nums { font-size: 8px; color: #555; margin-bottom: 4px; }
.achievement-card .ach-card-reward { font-size: 11px; font-weight: 700; }
.achievement-card.unlocked .ach-card-reward { color: #ffd700; }
.achievement-card.locked .ach-card-reward { color: #555; }
.achievement-card .ach-card-badge { position: absolute; top: 8px; right: 8px; font-size: 14px; }