@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0a0c10;
    --bg-card: rgba(20, 24, 35, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --primary: #00e5ff;       /* Neon Cyan */
    --primary-glow: rgba(0, 229, 255, 0.35);
    --accent: #ffd700;        /* Gold MADI */
    --accent-glow: rgba(253, 215, 0, 0.35);
    
    --text-main: #f0f2f5;
    --text-muted: #8e9cae;
    
    --rarity-common: #8c96a3;
    --rarity-rare: #0072ff;
    --rarity-epic: #b200ff;
    --rarity-legendary: #ffaa00;
    
    --speed-fast: 0.2s;
    --speed-normal: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 229, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(178, 0, 255, 0.06) 0%, transparent 40%);
}

/* Ограничитель ширины под мобильный формат Telegram App */
.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    max-height: 920px;
    background: linear-gradient(180deg, #0d1017 0%, #06070a 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.02);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

@media (min-width: 481px) {
    .app-container {
        border-radius: 36px;
        height: 90vh;
        border: 2px solid rgba(0, 229, 255, 0.15);
    }
}

/* Header с балансом */
.app-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 12, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 10;
}

.madi-logo-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.madi-logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #ffd700 0%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.madi-logo-sub {
    font-size: 8px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 6px 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.energy-badge {
    color: var(--primary);
    border-color: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.05);
}

.status-badge.points-badge {
    color: var(--accent);
    border-color: rgba(253, 215, 0, 0.2);
    box-shadow: 0 0 10px rgba(253, 215, 0, 0.05);
}

/* Контент-слайдер */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 90px; /* Отступ под нижнее меню */
    scrollbar-width: none; /* Скрываем скроллбар в Firefox */
}

.app-content::-webkit-scrollbar {
    display: none; /* Скрываем скроллбар в Chrome/Safari */
}

/* Нижнее меню */
.app-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: all var(--speed-normal);
    cursor: pointer;
    flex: 1;
    padding: 8px 0;
}

.nav-item i {
    font-size: 20px;
    transition: transform var(--speed-fast);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-4px) scale(1.15);
    text-shadow: 0 0 15px var(--primary-glow);
}

/* Экраны (Screens) */
.screen {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Красивые заголовки разделов */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title span {
    background: linear-gradient(90deg, #fff 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Карточки и стеклянные контейнеры */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

/* === ГАРАЖ И КАРТ === */
.garage-display {
    position: relative;
    width: 100%;
    height: 240px;
    background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.15) 0%, transparent 70%);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(0, 229, 255, 0.1);
    margin-bottom: 20px;
}

.kart-svg-container {
    width: 220px;
    height: 180px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kart-svg-container:hover {
    transform: scale(1.05) rotate(-2deg);
}

.weight-info-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.15);
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.weight-value {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.slot-card {
    background: rgba(10, 12, 16, 0.7);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--speed-normal);
}

.slot-card.equipped {
    border-style: solid;
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.03);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.05);
}

.slot-icon {
    font-size: 22px;
    color: var(--text-muted);
}

.slot-card.equipped .slot-icon {
    color: var(--primary);
}

.slot-name {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.slot-detail-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Инвентарь */
.inventory-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.detail-card {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all var(--speed-normal);
    overflow: hidden;
}

.detail-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.detail-card.equipped-border {
    border-color: var(--primary);
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1);
}

.detail-card.equipped-badge::after {
    content: 'E';
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--primary);
    color: #000;
    font-size: 8px;
    font-weight: 800;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detail-card.common { border-bottom: 3px solid var(--rarity-common); }
.detail-card.rare { border-bottom: 3px solid var(--rarity-rare); }
.detail-card.epic { border-bottom: 3px solid var(--rarity-epic); }
.detail-card.legendary { 
    border-bottom: 3px solid var(--rarity-legendary);
    animation: goldGlow 2s infinite alternate;
}

@keyframes goldGlow {
    from { box-shadow: 0 0 5px rgba(255, 170, 0, 0.1); }
    to { box-shadow: 0 0 15px rgba(255, 170, 0, 0.3); }
}

.detail-card-icon {
    font-size: 28px;
}

.detail-card-name {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* === ЗАДАНИЯ (DAILY TASKS) === */
.task-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all var(--speed-normal);
}

.task-card.available:hover {
    border-color: rgba(0, 229, 255, 0.25);
    background: rgba(0, 229, 255, 0.02);
}

.task-card.completed {
    border-color: rgba(0, 229, 255, 0.1);
    opacity: 0.6;
}

.task-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
}

.task-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.task-tag.difficulty-easy { background: rgba(76, 175, 80, 0.15); color: #4caf50; }
.task-tag.difficulty-medium { background: rgba(255, 152, 0, 0.15); color: #ff9800; }
.task-tag.difficulty-hard { background: rgba(244, 67, 54, 0.15); color: #f44336; }

.task-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.task-action-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--speed-fast);
}

.task-card.available .task-action-btn {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
}

.task-card.available .task-action-btn:hover {
    transform: scale(1.05);
}

.task-card.completed .task-action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: default;
}

/* === ГОНКИ (RACING SCREEN) === */
.race-status-panel {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    text-align: center;
}

.race-status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.race-status-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.race-status-value {
    font-size: 18px;
    font-weight: 700;
}

.action-btn-huge {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--primary) 0%, #00a2ff 100%);
    border: none;
    border-radius: 16px;
    color: #000;
    cursor: pointer;
    transition: all var(--speed-normal);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.action-btn-huge:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 229, 255, 0.45);
}

.action-btn-huge:active {
    transform: translateY(1px);
}

/* === ТАБЛИЦА ЛИДЕРОВ (LEADERBOARD) === */
.leaderboard-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 20px;
}

.lead-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--speed-fast);
}

.lead-tab.active {
    background: var(--primary);
    color: #000;
}

.leader-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leader-row {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 12px 16px;
    border-radius: 14px;
    gap: 12px;
}

.leader-row.me {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.04);
}

.leader-rank {
    width: 24px;
    font-weight: 800;
    font-size: 16px;
    color: var(--text-muted);
}

.leader-row:nth-child(1) .leader-rank { color: #ffd700; font-size: 20px; }
.leader-row:nth-child(2) .leader-rank { color: #c0c0c0; font-size: 18px; }
.leader-row:nth-child(3) .leader-rank { color: #cd7f32; font-size: 17px; }

.leader-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    border: 1px solid var(--border-glass);
}

.leader-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leader-name {
    font-weight: 600;
    font-size: 14px;
}

.leader-league {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.leader-points {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--accent);
}

/* === ПРОФИЛЬ (PROFILE SCREEN) === */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.profile-avatar-big {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.1);
    border: 2px solid var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 44px;
    box-shadow: 0 0 20px var(--primary-glow);
}

.profile-nick {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.profile-league {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 1px;
    background: rgba(253, 215, 0, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(253, 215, 0, 0.2);
}

.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-val {
    font-size: 16px;
    font-weight: 700;
}

/* Формы безопасности */
.sec-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 12px;
    font-size: 14px;
    transition: all var(--speed-fast);
}

.sec-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.sec-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--speed-fast);
}

.sec-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* === ПОЛНОЭКРАННЫЕ OVERLAYS (МОДАЛКИ) === */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 7, 10, 0.98);
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94) forwards;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.overlay-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

/* Overlay Викторины */
.quiz-question-box {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.quiz-text {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.quiz-timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.timer-svg {
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 6;
}

.timer-bar {
    fill: none;
    stroke: var(--primary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke var(--speed-normal);
}

.timer-text {
    position: absolute;
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin-top: 24px;
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all var(--speed-fast);
}

.quiz-option:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.quiz-option.correct {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    font-weight: 700;
}

.quiz-option.wrong {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    font-weight: 700;
}

/* Анимация LootBox */
.lootbox-animation-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

.box-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
}

.box-img {
    font-size: 80px;
    text-align: center;
    animation: boxFloat 3s ease-in-out infinite;
}

.box-wrapper.shake .box-img {
    animation: boxShake 0.5s ease-in-out infinite;
}

@keyframes boxFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes boxShake {
    0%, 100% { transform: rotate(0) scale(1); }
    20%, 60% { transform: rotate(-8deg) scale(1.05); }
    40%, 80% { transform: rotate(8deg) scale(1.05); }
}

.lootbox-instructions {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Карта награды */
.reward-reveal-card {
    width: 200px;
    aspect-ratio: 0.7;
    background: #11141d;
    border: 2px solid var(--border-glass);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    transform: rotateY(90deg);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-reveal-card.show {
    display: flex;
    transform: rotateY(0);
}

.reward-reveal-card.common { border-color: var(--rarity-common); box-shadow: 0 0 15px rgba(140, 150, 163, 0.2); }
.reward-reveal-card.rare { border-color: var(--rarity-rare); box-shadow: 0 0 20px rgba(0, 114, 255, 0.3); }
.reward-reveal-card.epic { border-color: var(--rarity-epic); box-shadow: 0 0 25px rgba(178, 0, 255, 0.4); }
.reward-reveal-card.legendary { border-color: var(--rarity-legendary); box-shadow: 0 0 35px rgba(255, 170, 0, 0.5); }

.reward-rarity-lbl {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 8px;
}

.reward-reveal-card.common .reward-rarity-lbl { background: rgba(140, 150, 163, 0.1); color: var(--rarity-common); }
.reward-reveal-card.rare .reward-rarity-lbl { background: rgba(0, 114, 255, 0.1); color: var(--rarity-rare); }
.reward-reveal-card.epic .reward-rarity-lbl { background: rgba(178, 0, 255, 0.1); color: var(--rarity-epic); }
.reward-reveal-card.legendary .reward-rarity-lbl { background: rgba(255, 170, 0, 0.1); color: var(--rarity-legendary); }

.reward-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
}

.reward-weight {
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
}

/* === ОВЕРЛЕЙ ГОНКИ (RACE STAGE) === */
.race-track-area {
    width: 100%;
    height: 320px;
    background: #0f121d;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

#raceCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.race-results-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
}

.race-result-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 10px 16px;
    border-radius: 12px;
}

.race-result-item.me {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
}

.race-result-place {
    width: 24px;
    font-weight: 800;
}

.race-result-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}

.race-result-score {
    font-size: 12px;
    color: var(--text-muted);
}

.race-result-points {
    color: var(--accent);
    font-weight: 700;
    margin-left: 10px;
}

/* Модалка Детали в Гараже */
.modal-detail-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.modal-detail-icon {
    font-size: 64px;
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-glass);
}

.modal-detail-icon.common { border-color: var(--rarity-common); }
.modal-detail-icon.rare { border-color: var(--rarity-rare); }
.modal-detail-icon.epic { border-color: var(--rarity-epic); }
.modal-detail-icon.legendary { border-color: var(--rarity-legendary); }

.modal-detail-name {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.modal-detail-weight {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.modal-detail-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 0 10px;
}

/* Кнопка "Установить" */
.equip-btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: #000;
    cursor: pointer;
    transition: all var(--speed-fast);
}

.equip-btn:hover {
    transform: scale(1.02);
}

/* Онбординг (Сценарий приветствия) */
.onboarding-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #06070a;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 30px;
    justify-content: space-between;
}

.onboard-step {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    flex: 1;
}

.onboard-step.active {
    display: flex;
}

.onboard-img {
    font-size: 80px;
    margin-bottom: 10px;
}

.onboard-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

.onboard-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.onboard-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.onboard-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.onboard-dot.active {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.onboard-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.onboard-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 14px;
    color: #000;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--speed-fast);
}

.onboard-btn:hover {
    transform: scale(1.02);
}

/* Уведомления */
.toast {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(20, 24, 35, 0.95);
    border: 1px solid var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
