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

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

:root {
    --bg:       #070a12;
    --bg-2:     #0d1220;
    --card:     #141a2a;
    --card-2:   #1c2438;
    --line:     #232c42;
    --line-2:   #323c56;
    --text:     #eef2f8;
    --text-2:   #8892aa;
    --text-3:   #5a6480;
    --orange:   #ff6b1a;
    --orange-2: #ff9650;
    --orange-3: #ffb37a;
    --gold:     #fbbf24;
    --green:    #22c55e;
    --red:      #ef4444;
    --r:  12px;
    --rs: 10px;
    --rx: 8px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    min-height: 100vh;
    overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a, button, input { outline: none; }

/* ==================== HUD ==================== */
.hud {
    background: linear-gradient(180deg, #0f1524 0%, #0a0e18 100%);
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 4px 14px rgba(0,0,0,.5);
}

.hud__stats {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    width: 100%;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    border-radius: var(--rx);
    color: var(--text-2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    flex: 1;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.stat i {
    font-style: normal;
    font-size: 12px;
    opacity: .9;
    flex: 0 0 auto;
}

.stat--energy {
    color: var(--text);
    background: linear-gradient(180deg, rgba(120,160,255,.06) 0%, rgba(120,160,255,.02) 100%);
    border-color: rgba(120,160,255,.15);
}
.stat--power  {
    color: var(--orange-2);
    background: linear-gradient(180deg, rgba(255,107,26,.12) 0%, rgba(255,107,26,.04) 100%);
    border-color: rgba(255,107,26,.3);
    box-shadow: inset 0 1px 0 rgba(255,150,80,.25), 0 0 12px rgba(255,107,26,.15);
}
.stat--gold   {
    color: var(--gold);
    background: linear-gradient(180deg, rgba(251,191,36,.1) 0%, rgba(251,191,36,.02) 100%);
    border-color: rgba(251,191,36,.2);
}
.stat--coins  { color: var(--text-2); }

.hud__level {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.hud__lvl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .08em;
    flex: 0 0 auto;
}

.bar {
    flex: 1;
    height: 6px;
    background: #050810;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.8);
}

.bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #d94800, var(--orange) 50%, var(--orange-2));
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,200,150,.4);
    transition: width .3s ease;
}

/* ==================== BANNER ==================== */
.banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 12px;
    padding: 10px 36px 10px 14px;
    background: linear-gradient(135deg, rgba(255,107,26,.1) 0%, #141a2a 100%);
    border: 1px solid var(--line);
    border-left: 3px solid var(--orange);
    border-radius: var(--rs);
    font-size: 12px;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 2px 8px rgba(0,0,0,.4);
}

.banner__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    flex: 0 0 auto;
    box-shadow: 0 0 8px rgba(239,68,68,.8);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 60%, 100% { opacity: 1; }
    70%, 90%      { opacity: .3; }
}

.banner__text {
    flex: 1;
    color: var(--text);
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banner__link {
    color: var(--orange-2);
    font-weight: 600;
    font-size: 11.5px;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.banner__close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 14px;
    border-radius: 50%;
    transition: all .12s;
}

.banner__close:hover {
    color: var(--text);
    background: rgba(255,255,255,.06);
}

/* ==================== CITY ==================== */
.city {
    margin: 12px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255,107,26,.08) 0%, transparent 50%),
        linear-gradient(180deg, #0f1a2e 0%, #0a1020 40%, #060a14 100%);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 4px 20px rgba(0,0,0,.6);
    position: relative;
}

.city::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.4), transparent),
        radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,.3), transparent),
        radial-gradient(1px 1px at 45% 60%, rgba(255,255,255,.25), transparent),
        radial-gradient(1px 1px at 85% 45%, rgba(255,255,255,.35), transparent),
        radial-gradient(1px 1px at 15% 75%, rgba(255,255,255,.25), transparent),
        radial-gradient(1px 1px at 60% 85%, rgba(255,255,255,.3), transparent);
    pointer-events: none;
    opacity: .7;
}

.city__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 10px;
    position: relative;
    z-index: 2;
}

.city__head-left { flex: 1; min-width: 0; }

.city__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.city__title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    text-shadow: 0 1px 0 #000;
}

.city__online {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.3);
    border-radius: 999px;
    color: #86efac;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.city__online-dot,
.chat__online-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,.9);
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .55; transform: scale(.85); }
}

.city__sub {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.35;
}

.city__switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px 6px 8px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    flex: 0 0 auto;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 1px 4px rgba(0,0,0,.4);
    transition: all .15s;
}

.city__switch:hover {
    background: #232a3a;
    border-color: var(--line-2);
}

.city__switch:active { transform: scale(.96); }

.city__switch-ico {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.city__switch-text {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-2);
    letter-spacing: -0.005em;
    white-space: nowrap;
}

.city__switch:hover .city__switch-text { color: var(--text); }

.city__map {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
}

.city__roads {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(255,180,100,.25));
}

.loc {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 3;
    transition: transform .15s ease;
}

.loc__pin {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #2a3450 0%, #151c2c 100%);
    border: 2px solid #3a4560;
    border-radius: 50%;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.15),
        inset 0 -2px 4px rgba(0,0,0,.5),
        0 4px 10px rgba(0,0,0,.6),
        0 0 0 4px rgba(255,255,255,.02);
    position: relative;
}

.loc__pin::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #151c2c;
    filter: drop-shadow(0 1px 0 rgba(255,255,255,.08));
}

.loc__ico {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
}

.loc__name {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.8);
    letter-spacing: .02em;
    white-space: nowrap;
    padding: 2px 6px;
    background: rgba(0,0,0,.5);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.06);
}

.loc:hover { transform: translate(-50%, -50%) scale(1.08); }

.loc:hover .loc__pin {
    border-color: var(--orange);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.2),
        inset 0 -2px 4px rgba(0,0,0,.5),
        0 4px 14px rgba(0,0,0,.7),
        0 0 20px rgba(255,107,26,.5),
        0 0 0 4px rgba(255,107,26,.15);
}

.loc:active { transform: translate(-50%, -50%) scale(.94); }

.loc--garage .loc__pin,
.loc--salon .loc__pin,
.loc--race .loc__pin,
.loc--chat .loc__pin {
    border-color: rgba(255,107,26,.5);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.2),
        inset 0 -2px 4px rgba(0,0,0,.5),
        0 4px 12px rgba(0,0,0,.7),
        0 0 16px rgba(255,107,26,.35);
}

.loc--garage::before,
.loc--salon::before,
.loc--race::before,
.loc--chat::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--orange);
    opacity: 0;
    animation: ring 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes ring {
    0%   { opacity: .7; transform: translateX(-50%) scale(1); }
    100% { opacity: 0;  transform: translateX(-50%) scale(1.7); }
}

.city__me {
    position: absolute;
    left: 50%;
    top: 45%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 0 4px rgba(59,130,246,.25),
        0 0 20px rgba(59,130,246,.9);
    z-index: 4;
}

.city__me::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    opacity: 0;
    animation: ring2 2s ease-out infinite;
}

@keyframes ring2 {
    0%   { opacity: .8; transform: scale(1); }
    100% { opacity: 0;  transform: scale(2.5); }
}

/* ==================== HERO ==================== */
.hero {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px 16px;
    padding: 12px;
    background: linear-gradient(180deg, #1a2234 0%, #111726 100%);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 2px 8px rgba(0,0,0,.4);
    position: relative;
}

.hero__img {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    background: linear-gradient(180deg, #232a40, #0d1220);
    border: 1px solid var(--line);
    border-radius: var(--rs);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.hero__body { flex: 1; min-width: 0; }

.hero__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; }

.hero__power {
    color: var(--orange-2);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255,107,26,.35);
}

.hero__go {
    padding: 7px 11px;
    background: var(--orange);
    color: #1a0d00;
    border-radius: var(--rx);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        0 2px 6px rgba(255,107,26,.35);
    transition: all .12s;
    flex: 0 0 auto;
}

.hero__go:hover { background: var(--orange-2); }
.hero__go:active { transform: scale(.96); }

/* ==================== BADGE ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
}

.badge--A { background: rgba(239,68,68,.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.badge--B { background: rgba(34,197,94,.15);  color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.badge--C { background: rgba(251,191,36,.15); color: #fcd34d; border: 1px solid rgba(251,191,36,.3); }
.badge--D { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 2px;
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs__item {
    padding: 7px 14px;
    color: var(--text-2);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all .12s;
}

.tabs__item:hover { color: var(--text); background: var(--card-2); }

.tabs__item--active {
    background: var(--orange);
    color: #1a0d00;
    border-color: var(--orange);
    font-weight: 700;
}

.tabs__item--back { background: var(--card); color: var(--text-2); }

/* ==================== PAGE TITLE ==================== */
.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-title__add {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    font-weight: 400;
    transition: all .12s;
}

.page-title__add:hover { background: #16a34a; }
.page-title__add:active { transform: scale(.92); }

/* ==================== CARD ==================== */
.card {
    margin: 0 12px 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 14px;
}

.card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.card__name { color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: -0.015em; }

.card__meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-2); }

.card__power { color: var(--orange-2); font-weight: 700; }

.card__image {
    height: 140px;
    margin: 12px 0;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--rs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: var(--text-3);
}

.card__desc {
    background: var(--card-2);
    border-radius: var(--rx);
    padding: 12px;
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.card__desc a { color: var(--orange-2); font-weight: 600; }
.card__desc a:hover { text-decoration: underline; }

.card__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.card__actions .btn { width: 100%; }

/* ==================== CAR-ITEM ==================== */
.car-item {
    margin: 0 12px 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 14px;
    transition: border-color .12s;
}

.car-item:hover { border-color: var(--line-2); }

.car-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.car-item__name { font-weight: 700; color: var(--text); font-size: 14px; letter-spacing: -0.01em; }

.car-item__info { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 6px; color: var(--text-2); }

.car-item__power { color: var(--orange-2); font-weight: 700; }

.car-item__image {
    height: 105px;
    margin: 12px 0;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--rs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: var(--text-3);
}

.car-item__stock { color: var(--green); font-size: 11.5px; text-align: center; margin-bottom: 6px; font-weight: 600; }

.car-item__buy { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 6px; }

.car-item__price { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; color: var(--gold); }

.car-item__price--silver { color: var(--text-2); }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 10px 12px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--rx);
    color: var(--text);
    font-weight: 600;
    font-size: 12.5px;
    text-align: center;
    transition: all .12s;
}

.btn:hover { background: #232a3a; border-color: var(--line-2); }
.btn:active { transform: scale(.98); }

.btn--green {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    font-weight: 700;
}

.btn--green:hover { background: #16a34a; border-color: #16a34a; }
.btn--green:active { background: #15803d; border-color: #15803d; }

/* ==================== FOOTER ==================== */
.footer {
    margin-top: 20px;
    padding: 16px 12px 22px;
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
    border-top: 1px solid var(--line);
}

.footer a {
    margin: 0 4px;
    color: var(--text-2);
    font-weight: 500;
    transition: color .12s;
}

.footer a:hover { color: var(--orange-2); }

.footer__copy { margin-top: 8px; color: var(--text-3); opacity: .6; }

/* ==================== AUTH ==================== */
.auth {
    max-width: 340px;
    margin: 60px auto 40px;
    padding: 26px 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth__title {
    text-align: center;
    font-size: 20px;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth__title::after {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background: var(--orange);
    border-radius: 2px;
    margin: 12px auto 0;
}

.auth__input {
    padding: 12px 14px;
    border-radius: var(--rx);
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
    transition: all .12s;
}

.auth__input::placeholder { color: var(--text-3); }

.auth__input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,26,.15); }

.auth__submit {
    padding: 12px;
    border-radius: var(--rx);
    background: var(--orange);
    color: #1a0d00;
    font-weight: 700;
    font-size: 13.5px;
    transition: all .12s;
    margin-top: 4px;
}

.auth__submit:hover { background: var(--orange-2); }
.auth__submit:active { background: #e05a00; transform: scale(.985); }

.auth__error { color: #fca5a5; font-size: 12px; min-height: 16px; text-align: center; }

.auth__link { color: var(--text-2); text-align: center; font-size: 12px; font-weight: 500; margin-top: 4px; }
.auth__link:hover { color: var(--orange-2); }

/* ==================== CITY INFO ==================== */
.city-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 12px 12px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(255,107,26,.12) 0%, var(--card) 100%);
    border: 1px solid var(--line);
    border-left: 3px solid var(--orange);
    border-radius: var(--r);
}

.city-info__icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--rs);
}

.city-info__body { flex: 1; min-width: 0; }

.city-info__label { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

.city-info__name { font-size: 18px; font-weight: 800; color: var(--text); margin: 3px 0 4px; letter-spacing: -0.02em; }

.city-info__bonus { font-size: 12px; color: var(--orange-2); font-weight: 700; }

/* ==================== CHAT ==================== */
.chat {
    display: flex;
    flex-direction: column;
    margin: 0 12px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    height: calc(100vh - 240px);
    min-height: 340px;
    max-height: 640px;
}

.chat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    background: var(--card-2);
    border-bottom: 1px solid var(--line);
}

.chat__head-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chat__head-online {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.3);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    color: #86efac;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    flex: 0 0 auto;
}

.chat__form {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: var(--card-2);
    border-bottom: 1px solid var(--line);
}

.chat__input {
    flex: 1;
    padding: 9px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color .12s;
    min-width: 0;
}

.chat__input::placeholder { color: var(--text-3); }

.chat__input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,26,.12); }

.chat__send {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--orange);
    color: #1a0d00;
    border-radius: 50%;
    font-size: 17px;
    font-weight: 900;
    transition: all .12s;
}

.chat__send:hover { background: var(--orange-2); }
.chat__send:active { transform: scale(.94); }
.chat__send:disabled { opacity: .5; cursor: not-allowed; }

.chat__list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat__list::-webkit-scrollbar { width: 6px; }
.chat__list::-webkit-scrollbar-track { background: transparent; }
.chat__list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.chat__empty { margin: auto; color: var(--text-3); font-size: 12.5px; text-align: center; padding: 20px; }

.chat__load {
    align-self: center;
    margin: 4px 0 6px;
    padding: 6px 14px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 700;
    transition: all .12s;
}

.chat__load:hover { color: var(--orange-2); border-color: rgba(255,107,26,.35); }
.chat__load:active { transform: scale(.96); }

.chat__msg {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: background .12s;
}

.chat__msg:hover { background: rgba(255,255,255,.02); }

.chat__msg--mine {
    background: rgba(255,107,26,.06);
    border-left: 2px solid var(--orange);
    padding-left: 8px;
}

.chat__nick { font-weight: 700; color: var(--orange-2); margin-right: 6px; }
.chat__msg--mine .chat__nick { color: var(--orange-3); }

.chat__lvl {
    display: inline-block;
    padding: 0 4px;
    margin-right: 4px;
    background: rgba(255,255,255,.05);
    border-radius: 3px;
    font-size: 9.5px;
    color: var(--text-3);
    font-weight: 700;
    vertical-align: middle;
    line-height: 1.4;
}

.chat__text { color: var(--text); }

/* ==================== КАРТА РОССИИ ==================== */
.rusmap {
    position: relative;
    margin: 0 12px 12px;
    height: 480px;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255,107,26,.06) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 70%, rgba(59,130,246,.05) 0%, transparent 60%),
        linear-gradient(160deg, #0f1a2e 0%, #0a1020 40%, #060a14 100%);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 4px 20px rgba(0,0,0,.6);
}

.rusmap__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.rusmap__lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: .6;
}

.citypoint {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    z-index: 3;
    transition: transform .15s ease;
}

.citypoint__pin {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #2a3450 0%, #151c2c 100%);
    border: 2px solid #3a4560;
    border-radius: 50%;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.15),
        inset 0 -2px 4px rgba(0,0,0,.5),
        0 4px 10px rgba(0,0,0,.6);
}

.citypoint__pin::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #151c2c;
}

.citypoint__ico { font-size: 18px; line-height: 1; }

.citypoint__name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.9);
    white-space: nowrap;
    padding: 1px 5px;
    background: rgba(0,0,0,.65);
    border-radius: 3px;
    line-height: 1.4;
}

.citypoint__bonus {
    font-size: 9px;
    font-weight: 700;
    color: var(--orange-2);
    text-shadow: 0 1px 2px #000;
    white-space: nowrap;
    padding: 1px 5px;
    background: rgba(0,0,0,.55);
    border-radius: 3px;
    line-height: 1.4;
}

.citypoint__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #22c55e;
    color: #052e16;
    font-size: 9px;
    font-weight: 800;
    border-radius: 999px;
    border: 2px solid var(--bg);
    box-shadow: 0 0 8px rgba(34,197,94,.7);
    line-height: 1;
}

.citypoint__tag {
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
    margin-top: 1px;
}

.citypoint__tag--current { background: rgba(34,197,94,.2); color: #86efac; border: 1px solid rgba(34,197,94,.45); }
.citypoint__tag--lock    { background: rgba(0,0,0,.55); color: var(--text-2); border: 1px solid rgba(255,255,255,.08); }

.citypoint__btn {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    background: var(--orange);
    color: #1a0d00;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
    margin-top: 1px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        0 2px 6px rgba(255,107,26,.4);
    transition: all .12s;
}

.citypoint__btn:hover { background: var(--orange-2); }
.citypoint__btn:active { transform: scale(.94); }
.citypoint__btn:disabled { opacity: .6; cursor: not-allowed; }

.citypoint--current .citypoint__pin {
    border-color: #22c55e;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.2),
        0 4px 12px rgba(0,0,0,.7),
        0 0 20px rgba(34,197,94,.5);
}

.citypoint--current::before {
    content: '';
    position: absolute;
    top: 19px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #22c55e;
    opacity: 0;
    animation: ring 2.4s ease-out infinite;
    pointer-events: none;
}

.citypoint--open .citypoint__pin {
    border-color: rgba(255,107,26,.6);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.2),
        0 4px 12px rgba(0,0,0,.7),
        0 0 16px rgba(255,107,26,.4);
}

.citypoint--lock .citypoint__pin { opacity: .55; filter: grayscale(.6); }
.citypoint--lock .citypoint__name,
.citypoint--lock .citypoint__bonus { opacity: .8; }

.citypoint:hover { transform: translate(-50%, -50%) scale(1.1); z-index: 5; }
.citypoint:active { transform: translate(-50%, -50%) scale(.96); }

/* ==================== RACE ==================== */
.race-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 12px 12px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.race-info__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-2);
}

.race-info__item b { color: var(--text); font-weight: 700; }
.race-info__ico { font-size: 14px; flex: 0 0 auto; }

.race-banner {
    margin: 12px;
    padding: 14px;
    border-radius: var(--rs);
    text-align: center;
    animation: slideIn .4s ease;
}

.race-banner--win {
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
    border: 1px solid #22c55e;
    box-shadow: 0 4px 14px rgba(34,197,94,.4);
}
.race-banner--draw {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    border: 1px solid #fbbf24;
    box-shadow: 0 4px 14px rgba(251,191,36,.4);
}
.race-banner--lose {
    background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
    border: 1px solid #ef4444;
    box-shadow: 0 4px 14px rgba(239,68,68,.4);
}

.race-banner__title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0,0,0,.4);
    margin-bottom: 8px;
}

.race-banner__rewards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

.race-duel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
    margin: 0 12px 12px;
    padding: 18px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.race-duel__side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.race-duel__car {
    font-size: 52px;
    line-height: 1;
    transform: scaleX(-1);
    filter: drop-shadow(0 3px 8px rgba(0,0,0,.6));
}

.race-duel__car--opp { transform: none; }

.race-duel__nick {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.race-duel__vs {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-3);
    letter-spacing: 2px;
    padding: 0 6px;
}

.race-again {
    display: block;
    margin: 0 12px 12px;
    padding: 12px;
    background: var(--green);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--rx);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        0 2px 8px rgba(34,197,94,.4);
    transition: all .12s;
}

.race-again:hover { background: #16a34a; }
.race-again:active { transform: scale(.98); }

.race-hint {
    margin: 0 12px 14px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    border: 1px solid #3b82f6;
    border-radius: var(--rs);
    font-size: 11.5px;
    color: #bfdbfe;
    text-align: center;
    line-height: 1.4;
}

.race-hint b { color: #fff; }

.opponents-title {
    margin: 14px 12px 10px;
    padding: 10px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
    text-transform: uppercase;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--card) 0%, transparent 100%);
}

.opponents {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px 16px;
}

.opp-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 10px 12px 8px;
    transition: all .15s;
}

.opp-card--green  { border-left: 3px solid #22c55e; }
.opp-card--yellow { border-left: 3px solid #fbbf24; }
.opp-card--red    { border-left: 3px solid #ef4444; }

.opp-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 10px;
}

.opp-card__label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.opp-card__label--green  { background: rgba(34,197,94,.15);  color: #86efac; border: 1px solid rgba(34,197,94,.35); }
.opp-card__label--yellow { background: rgba(251,191,36,.15); color: #fcd34d; border: 1px solid rgba(251,191,36,.35); }
.opp-card__label--red    { background: rgba(239,68,68,.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }

.opp-card__left { font-size: 10.5px; color: var(--text-3); font-weight: 600; }

.opp-card__body {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
}

.opp-card__avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--rs);
}

.opp-card__car-block { min-width: 0; text-align: center; }

.opp-card__car {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}

.opp-card__car-name {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.opp-card__spec {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 10.5px;
    color: var(--text-2);
    white-space: nowrap;
}

.opp-card__power { color: var(--orange-2); font-weight: 700; }

.opp-card__btn {
    padding: 9px 14px;
    background: var(--green);
    color: #fff;
    border-radius: var(--rx);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: all .12s;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        0 2px 6px rgba(34,197,94,.35);
}

.opp-card__btn:hover { background: #16a34a; }
.opp-card__btn:active { transform: scale(.96); }

.opp-card__btn--disabled {
    background: var(--card-2);
    color: var(--text-3);
    box-shadow: none;
    cursor: not-allowed;
}

.opp-card__bottom {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== WELCOME ==================== */
.welcome {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 12px;
    padding: 12px 36px 12px 14px;
    background: linear-gradient(135deg, rgba(34,197,94,.15) 0%, rgba(20,26,42,.95) 100%);
    border: 1px solid rgba(34,197,94,.4);
    border-left: 3px solid var(--green);
    border-radius: var(--rs);
    font-size: 13px;
    position: relative;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 2px 10px rgba(0,0,0,.4),
        0 0 20px rgba(34,197,94,.15);
    animation: slideIn .4s ease;
}

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

.welcome__icon { font-size: 20px; flex: 0 0 auto; }

.welcome__text {
    flex: 1;
    font-weight: 700;
    color: #86efac;
    text-shadow: 0 1px 2px #000;
}

.welcome__close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 14px;
    border-radius: 50%;
    transition: all .12s;
}

.welcome__close:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* ==================== МОБИЛЬНЫЙ ==================== */
@media (max-width: 380px) {
    .hud__stats { font-size: 11px; gap: 4px; }
    .stat { padding: 4px 7px; }
    .city__map { height: 340px; }
    .loc__pin { width: 42px; height: 42px; }
    .loc__ico { font-size: 20px; }
    .loc__name { font-size: 10px; }
    .hero__img { width: 56px; height: 56px; flex: 0 0 56px; font-size: 30px; }
    .city__switch { padding: 5px 8px 5px 6px; gap: 6px; }
    .city__switch-ico { width: 20px; height: 20px; flex: 0 0 20px; font-size: 12px; }
    .city__switch-text { font-size: 11px; }
    .rusmap { height: 440px; }
    .citypoint__pin { width: 34px; height: 34px; }
    .citypoint__ico { font-size: 16px; }
    .citypoint__name { font-size: 9px; padding: 1px 4px; }
    .citypoint__bonus { font-size: 8.5px; padding: 1px 4px; }
    .citypoint__btn { font-size: 9px; padding: 3px 8px; }
    .citypoint__tag { font-size: 8.5px; padding: 2px 6px; }
    .opp-card__car { font-size: 28px; }
    .opp-card__btn { padding: 8px 10px; font-size: 11.5px; }
}