/* ===== Танки 3D — оформление ===== */
body.t3-page {
    overscroll-behavior-y: contain;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(45, 120, 180, .18), transparent 70%),
        var(--bg, #070b12);
}

.t3-hero { margin-bottom: 14px; }
.t3-titlebar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.t3-titlebar h1 {
    margin: 0 0 4px; font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: .06em;
}
.t3-titlebar h1 span { color: var(--amber, #fbbf24); text-shadow: 0 0 22px rgba(251,191,36,.45); }
.t3-titlebar p { margin: 0; color: var(--muted, #93a4bb); font-size: .92rem; max-width: 680px; }
.t3-titlebar p a { color: #7dd3fc; }
.t3-titlebar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.t3-chip {
    background: #101a2b; color: #cfe0f5; border: 1px solid var(--line, #23314a);
    border-radius: 999px; padding: 8px 14px; font-size: .85rem; cursor: pointer;
}
.t3-chip:hover { border-color: #3d6f9e; color: #fff; }

.t3-help { margin-top: 12px; }
.t3-help-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
    background: #0c1422; border: 1px solid var(--line, #23314a); border-radius: 14px; padding: 16px 18px;
}
.t3-help h4 { margin: 0 0 6px; color: var(--amber, #fbbf24); font-size: .92rem; }
.t3-help ul { margin: 0; padding-left: 18px; color: var(--muted, #93a4bb); font-size: .85rem; line-height: 1.55; }
.t3-help b { color: #dbeafe; }

/* ---------- сцена ---------- */
.t3-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.t3-stage {
    position: relative; overflow: hidden; border-radius: 16px;
    border: 1px solid var(--line, #23314a); background: #070b12;
    aspect-ratio: auto; height: clamp(540px, 74vh, 820px); max-height: 78vh; min-height: 520px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .5), inset 0 0 80px rgba(20, 60, 100, .12);
    touch-action: none; user-select: none;
}
#t3-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
/* author-стили display:flex не должны показывать скрытые оверлеи */
.t3-stage [hidden] { display: none !important; }
.t3-stage.fs { position: fixed; inset: 0; z-index: 999; width: 100vw; height: 100vh; max-height: none; aspect-ratio: auto; border: none; border-radius: 0; }

/* ---------- HUD ---------- */
.t3-loading {
    position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 45%, rgba(18, 35, 55, .72), rgba(4, 8, 14, .95));
    backdrop-filter: blur(2px); pointer-events: auto;
}
.t3-loading-card {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 22px 30px; border: 1px solid #2b4a68; border-radius: 14px;
    background: rgba(7, 15, 25, .92); box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    color: #dbeafe; letter-spacing: .08em; font-size: .78rem;
}
.t3-loading-card b { font-size: .95rem; color: #fbbf24; }
.t3-loading-card span { color: #8fa7c2; letter-spacing: .02em; }
.t3-spinner {
    width: 30px; height: 30px; margin-bottom: 3px; border-radius: 50%;
    border: 3px solid rgba(90, 155, 210, .25); border-top-color: #6cc4ff;
    animation: t3-spin .75s linear infinite;
}
@keyframes t3-spin { to { transform: rotate(360deg); } }

.t3-hud {
    position: absolute; inset: 0; pointer-events: none; z-index: 3; font-size: .9rem;
    box-shadow: inset 0 0 110px rgba(0, 0, 0, .24);
}
.t3-hud button, .t3-hud .t3-supplies, .t3-hud .t3-touch { pointer-events: auto; }
body.t3-battle #t3-canvas { cursor: none; }
.t3-hud-top {
    position: absolute; top: 10px; left: 12px; right: 12px;
    display: flex; align-items: center; gap: 10px;
}
.t3-badge {
    background: rgba(10, 20, 34, .78); border: 1px solid rgba(93, 145, 200, .35);
    color: #cfe6ff; border-radius: 8px; padding: 5px 10px; font-size: .72rem; letter-spacing: .08em;
}
.t3-score { font-weight: 700; color: #fff; background: rgba(10,20,34,.78); border-radius: 8px; padding: 5px 12px; }
.t3-clock {
    font-variant-numeric: tabular-nums; font-weight: 700; color: var(--amber, #fbbf24);
    background: rgba(10,20,34,.78); border: 1px solid rgba(251,191,36,.25); border-radius: 8px; padding: 5px 10px;
}
.t3-crystals { margin-left: auto; color: #ffe08a; background: rgba(10,20,34,.78); border-radius: 8px; padding: 5px 10px; }
.t3-hud-btns { display: flex; gap: 6px; }
.t3-hud-btns button {
    width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(93,145,200,.3);
    background: rgba(10,20,34,.8); color: #cfe6ff; font-size: 1rem; cursor: pointer;
}
.t3-hud-btns button:hover { border-color: #4f8fc4; }

.t3-feed { position: absolute; top: 58px; right: 12px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.t3-feed-line {
    background: rgba(8, 14, 24, .78); border: 1px solid rgba(90, 130, 175, .22);
    border-radius: 8px; padding: 5px 9px; font-size: .78rem; color: #c7d8ec;
    animation: t3feed .25s ease-out;
}
.t3-feed-line.me { border-color: rgba(94, 234, 212, .45); color: #ccfbf1; }
.t3-feed-line.gold { border-color: rgba(251,191,36,.5); color: #fde68a; }
@keyframes t3feed { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.t3-gold-warn {
    position: absolute; top: 14%; left: 50%; transform: translateX(-50%);
    background: rgba(120, 74, 8, .92); border: 1px solid #fbbf24; color: #fff3c4;
    padding: 9px 18px; border-radius: 10px; font-weight: 700; font-size: .9rem;
    animation: t3pulse 1.1s infinite alternate; white-space: nowrap;
}
@keyframes t3pulse { from { box-shadow: 0 0 0 rgba(251,191,36,0); } to { box-shadow: 0 0 26px rgba(251,191,36,.55); } }

.t3-crosshair {
    position: absolute; left: 50%; top: 50%; width: 26px; height: 26px;
    margin: 0; transform: translate(-50%, -50%);
    border: 1px solid rgba(150, 230, 255, .62); border-radius: 50%;
    box-shadow: inset 0 0 8px rgba(120, 220, 255, .35), 0 0 10px rgba(70,180,255,.12);
    transition: border-color .12s, box-shadow .12s, opacity .15s;
}
.t3-crosshair::before, .t3-crosshair::after {
    content: ""; position: absolute; background: rgba(150, 230, 255, .72);
}
.t3-crosshair::before { left: 50%; top: -7px; width: 1px; height: 6px; }
.t3-crosshair::after { left: 50%; bottom: -7px; width: 1px; height: 6px; }
.t3-crosshair.fire { border-color: rgba(255, 225, 150, .95); box-shadow: 0 0 16px rgba(255,190,90,.7); }
body.has-touch .t3-crosshair { display: none; }

/* снайперский режим: лёгкий виньеточный фокус, не перекрывающий обзор */
.t3-scope {
    position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: radial-gradient(circle at 50% 50%, transparent 48%, rgba(0,0,0,.03) 64%, rgba(0,0,0,.30) 100%);
    transition: opacity .16s ease;
}
body.t3-sniper .t3-scope { opacity: 1; }
.t3-sniper-tag {
    position: absolute; top: 52px; right: 16px; pointer-events: none;
    padding: 5px 10px; border-radius: 7px;
    background: rgba(8, 14, 24, .84); border: 1px solid rgba(255, 210, 100, .45);
    color: #ffe1a8; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
    opacity: 0; transform: translateY(-4px); transition: opacity .16s ease, transform .16s ease;
}
body.t3-sniper .t3-sniper-tag { opacity: 1; transform: none; }
body.t3-sniper .t3-crosshair {
    width: 34px; height: 34px;
    border-color: rgba(255, 211, 106, .9);
    box-shadow: inset 0 0 10px rgba(255, 196, 80, .26), 0 0 14px rgba(255, 180, 50, .22);
}
body.t3-sniper .t3-crosshair::before {
    left: 50%; top: 50%; width: 52px; height: 1px;
    transform: translate(-50%, -50%);
    background: rgba(255, 220, 135, .9);
}
body.t3-sniper .t3-crosshair::after {
    left: 50%; top: 50%; bottom: auto; width: 1px; height: 52px;
    transform: translate(-50%, -50%);
    background: rgba(255, 220, 135, .9);
}

.t3-hitmark {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.7);
    color: #ffd166; font-size: 31px; font-weight: 900; line-height: 1;
    text-shadow: 0 0 10px rgba(255, 180, 60, .85), 0 1px 3px #000;
    opacity: 0; pointer-events: none;
}
.t3-hitmark.show { animation: t3hit .32s ease-out; }
@keyframes t3hit {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-8deg); }
    28% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(0deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
}

.t3-target {
    position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
    width: min(340px, 64%); padding: 8px 12px 9px;
    background: linear-gradient(180deg, rgba(9, 17, 28, .88), rgba(8, 14, 24, .76));
    border: 1px solid rgba(255, 120, 95, .45); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 20px rgba(120,30,20,.12);
}
.t3-target-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.t3-target-head span:first-child { color: #ffd7cf; font-weight: 700; font-size: .78rem; letter-spacing: .04em; }
.t3-target-head span:last-child { color: #ffc4b8; font-size: .7rem; font-variant-numeric: tabular-nums; }
.t3-target-hp { height: 8px; margin-top: 6px; border-radius: 5px; overflow: hidden; background: rgba(4,8,13,.88); border: 1px solid rgba(255,140,110,.28); }
.t3-target-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ef4444, #fb923c); transition: width .14s linear; }

.t3-damage {
    position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: radial-gradient(circle at center, transparent 34%, rgba(190, 24, 24, .55) 100%);
    mix-blend-mode: screen;
}
.t3-damage.show { animation: t3damage .38s ease-out; }
@keyframes t3damage {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

.t3-mini {
    position: absolute; top: 58px; left: 12px; width: 150px; height: 150px;
    border-radius: 10px; border: 1px solid rgba(93,145,200,.3);
    background: rgba(6, 12, 20, .72); box-shadow: 0 6px 20px rgba(0,0,0,.35);
}

.t3-hud-bottom {
    position: absolute; left: 12px; right: 12px; bottom: 12px;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.t3-hpbox { min-width: 210px; max-width: 46%; }
.t3-hp { height: 14px; border-radius: 8px; background: rgba(8, 15, 25, .8); border: 1px solid rgba(90,140,190,.32); overflow: hidden; }
.t3-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #22c55e, #86efac); transition: width .16s linear; }
.t3-hp i.mid { background: linear-gradient(90deg, #f59e0b, #fde68a); }
.t3-hp i.low { background: linear-gradient(90deg, #dc2626, #f87171); }
.t3-hud-bottom {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 12px rgba(0, 0, 0, .6);
}
.t3-hp-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: .78rem; color: #eaf6ff; font-variant-numeric: tabular-nums; }
.t3-reload { height: 5px; border-radius: 4px; background: rgba(8,15,25,.75); margin-top: 5px; overflow: hidden; }
.t3-reload i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #38bdf8, #bae6fd); }

.t3-supplies { display: flex; gap: 8px; }
.t3-supplies button {
    position: relative; width: 54px; height: 54px; border-radius: 14px;
    background: rgba(10, 18, 30, .82); border: 1px solid rgba(90, 140, 190, .35);
    color: #e2efff; font-size: 1.25rem; cursor: pointer;
}
.t3-supplies button b {
    position: absolute; right: -4px; bottom: -4px; min-width: 19px; height: 19px;
    border-radius: 999px; background: #0f2439; border: 1px solid #3d6f9e;
    font-size: .68rem; line-height: 18px; color: #bfe3ff;
}
.t3-supplies button.active { border-color: #5eead4; box-shadow: 0 0 16px rgba(94,234,212,.45); }
.t3-supplies button:disabled { opacity: .38; cursor: default; }

.t3-death {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(20, 4, 4, .32); backdrop-filter: blur(1px);
}
.t3-death-card { text-align: center; color: #ffe4e6; }
.t3-death-skull { font-size: 2.6rem; }
.t3-death-card h3 { margin: 4px 0; letter-spacing: .12em; font-size: 1.1rem; }
.t3-death-card p { margin: 0; color: #fecdd3; }

.t3-touch { display: none; position: absolute; inset: auto 0 0 0; padding: 16px; justify-content: space-between; align-items: flex-end; }
body.has-touch .t3-touch, body.force-touch .t3-touch { display: flex; }
body.has-touch .t3-supplies { transform: translateY(-70px); }
.t3-stick {
    position: relative; width: 132px; height: 132px; border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, rgba(60,90,130,.28), rgba(10,16,26,.62) 70%), rgba(12,18,30,.35);
    border: 2px solid rgba(120,160,210,.3); touch-action: none;
}
.t3-stick i {
    position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
    border-radius: 50%; transform: translate(-50%, -50%) !important;
    background: radial-gradient(circle at 34% 28%, #9fe6ff, #2f7fb0 60%, #1b5273);
    box-shadow: 0 5px 16px rgba(0,0,0,.55), inset 0 -3px 8px rgba(0,0,0,.35);
    pointer-events: none;
}
.t3-touch-right { display: flex; align-items: flex-end; gap: 12px; }
.t3-fire-btn {
    width: 96px; height: 96px; border-radius: 50%; border: 2px solid #fb923c;
    background: radial-gradient(circle at 36% 30%, rgba(255,150,60,.65), rgba(180,70,25,.6));
    font-size: 2.1rem; box-shadow: 0 8px 26px rgba(251,146,60,.4); cursor: pointer; touch-action: none;
}
.t3-fire-btn:active { transform: scale(.95); background: rgba(255,170,70,.75); }

.t3-scoreboard {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(4, 8, 14, .82); backdrop-filter: blur(3px); pointer-events: auto; z-index: 9;
}
.t3-scoreboard-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.t3-scoreboard h3 { color: var(--amber, #fbbf24); letter-spacing: .12em; margin: 0; }
.t3-score-close {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid #2a405c;
    background: #0d1726; color: #cfe0f2; cursor: pointer; font-size: 1rem;
}
.t3-score-close:hover { border-color: #3b82f6; }
.t3-scoreboard table { border-collapse: collapse; min-width: min(520px, 88%); background: #0b1422; border-radius: 10px; overflow: hidden; }
.t3-scoreboard th, .t3-scoreboard td { padding: 7px 14px; text-align: left; font-size: .85rem; border-bottom: 1px solid #1b2a40; }
.t3-scoreboard th { color: #93a4bb; font-weight: 600; font-size: .75rem; text-transform: uppercase; }
.t3-scoreboard tr.me { background: rgba(56, 189, 248, .12); color: #e0f2fe; }
.t3-scoreboard tr.red td:first-child { color: #fca5a5; }
.t3-scoreboard tr.blue td:first-child { color: #93c5fd; }
.t3-scoreboard-hint { color: #6b7f99; font-size: .75rem; }
@media (max-width: 600px) {
    .t3-scoreboard table { min-width: 94%; }
    .t3-scoreboard th, .t3-scoreboard td { padding: 6px 7px; font-size: .76rem; }
    .t3-scoreboard-head { gap: 8px; margin-bottom: 6px; }
    .t3-scoreboard h3 { font-size: .95rem; }
    .t3-result-card, .t3-pause-card { padding: 20px 14px; }
    .t3-result-card h2, .t3-pause-card h2 { font-size: 1.6rem; }
    .t3-result-btns { gap: 8px; }
}

/* ---------- лобби ---------- */
.t3-lobby {
    position: absolute; inset: 0; z-index: 4; display: flex; align-items: flex-start; justify-content: center;
    background: linear-gradient(90deg, rgba(6, 11, 19, .94) 0%, rgba(6, 11, 19, .78) 52%, rgba(6, 11, 19, .30) 100%);
    overflow: auto;
}
.t3-lobby::-webkit-scrollbar { width: 7px; }
.t3-lobby::-webkit-scrollbar-thumb { background: #2b4160; border-radius: 4px; }
.t3-lobby-inner { width: min(760px, 96%); padding: 14px 20px; margin: 0 auto; }
.t3-lobby-head h1 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: .08em; }
.t3-lobby-head h1 span { color: var(--amber, #fbbf24); text-shadow: 0 0 26px rgba(251,191,36,.5); }
.t3-lobby-head p { color: #a8bdd6; margin: 4px 0 10px; font-size: .9rem; }

.t3-login {
    background: rgba(12, 22, 36, .9); border: 1px solid #263b57; border-radius: 14px; padding: 16px 18px;
    max-width: 440px;
}
.t3-login label { display: block; color: var(--amber, #fbbf24); font-size: .8rem; letter-spacing: .08em; margin-bottom: 7px; }
.t3-login-row { display: flex; gap: 9px; }
.t3-login input {
    flex: 1; min-width: 0; background: #081120; border: 1px solid #2b4160; border-radius: 9px;
    color: #e7f1ff; padding: 10px 12px; font-size: 1rem; outline: none;
}
.t3-login input:focus { border-color: #4f8fc4; box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.t3-login small { display: block; color: #7e93ad; font-size: .76rem; margin-top: 9px; line-height: 1.5; }
.t3-login small b { color: #fde68a; }

.t3-lobby-main { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.t3-profile { background: rgba(10, 19, 32, .82); border: 1px solid #223650; border-radius: 12px; padding: 11px 13px; }
.t3-profile-name { font-size: 1.2rem; font-weight: 700; color: #f0f9ff; }
.t3-profile-crystals { color: #ffe08a; margin-top: 4px; }
.t3-profile-stats { color: #8fa7c2; font-size: .8rem; margin-top: 4px; }
.t3-lobby-tip { margin-top: 9px; color: #8fa7c2; font-size: .77rem; line-height: 1.5; }
.t3-lobby-tip b { color: #dbeafe; }

.t3-lobby-right { display: flex; flex-direction: column; gap: 8px; }
.t3-opt > span { display: block; color: #8fa7c2; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 4px; }
.t3-seg { display: flex; background: rgba(8, 15, 25, .8); border: 1px solid #223650; border-radius: 9px; overflow: hidden; }
.t3-seg button {
    flex: 1; background: transparent; border: none; color: #a8bdd6; padding: 7px 8px;
    font-size: .78rem; cursor: pointer; white-space: nowrap;
}
.t3-seg button + button { border-left: 1px solid #223650; }
.t3-seg button.active { background: linear-gradient(180deg, rgba(56,189,248,.22), rgba(56,189,248,.08)); color: #e0f2fe; }
.t3-lobby-actions { display: flex; gap: 9px; margin-top: 2px; }
.t3-play {
    flex: 1; border: none; border-radius: 11px; padding: 11px 18px; cursor: pointer;
    background: linear-gradient(180deg, #fbbf24, #f59e0b); color: #241500;
    font-weight: 800; letter-spacing: .09em; font-size: 1rem;
    box-shadow: 0 8px 24px rgba(245,158,11,.35);
}
.t3-play:hover { filter: brightness(1.07); }
.t3-play:active { transform: translateY(1px); }
.t3-btn {
    border: 1px solid #31527a; background: rgba(16, 29, 47, .9); color: #d7e7fa;
    border-radius: 10px; padding: 11px 16px; cursor: pointer; font-size: .88rem;
}
.t3-btn:hover { border-color: #4f8fc4; }
.t3-btn:disabled { opacity: .45; cursor: default; }
.t3-btn-gold { background: linear-gradient(180deg, #fbbf24, #e0a008); color: #241500; border-color: #fbbf24; font-weight: 700; }
.t3-btn-ghost { background: transparent; }

.t3-rating-box { background: rgba(10,19,32,.72); border: 1px solid #223650; border-radius: 11px; padding: 8px 11px; }
.t3-rating-box h4 { margin: 0 0 5px; font-size: .78rem; color: var(--amber, #fbbf24); }
.t3-rating { display: flex; flex-direction: column; gap: 3px; font-size: .76rem; color: #b9cce3; max-height: 76px; overflow: auto; }
.t3-rating div { display: flex; justify-content: space-between; gap: 8px; }
.t3-rating b { color: #dbeafe; font-weight: 500; }
.t3-lobby-crystals { color: #7e93ad; font-size: .76rem; }

/* ---------- гараж ---------- */
.t3-garage {
    position: absolute; inset: 0; z-index: 7; background: rgba(5, 9, 16, .97);
    backdrop-filter: blur(3px); display: flex; flex-direction: column; padding: 14px 16px;
}
.t3-garage-head { display: flex; align-items: center; gap: 14px; }
.t3-garage-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: .12em; color: #e0f2fe; }
.t3-garage-money { color: #ffe08a; margin-left: auto; }
.t3-close {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid #2b4160;
    background: #0b1626; color: #cbd9ea; cursor: pointer; font-size: .95rem;
}
.t3-garage-tabs { display: flex; gap: 6px; margin: 12px 0; }
.t3-garage-tabs button {
    background: #0b1626; border: 1px solid #223650; color: #9fb5ce;
    border-radius: 8px; padding: 8px 14px; font-size: .8rem; letter-spacing: .08em; cursor: pointer;
}
.t3-garage-tabs button.active { background: rgba(56,189,248,.16); border-color: #3d7fb3; color: #e0f2fe; }
.t3-garage-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.t3-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.t3-card { background: #0a1422; border: 1px solid #223650; border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; }
.t3-card.equipped { border-color: #fbbf24; box-shadow: inset 0 0 22px rgba(251,191,36,.08); }
.t3-card-head { display: flex; gap: 10px; align-items: flex-start; }
.t3-card-head h4 { margin: 0; color: #e7f1ff; font-size: .98rem; }
.t3-card-head p { margin: 2px 0 0; color: #8fa7c2; font-size: .76rem; line-height: 1.4; }
.t3-card-ico { font-size: 1.4rem; }
.t3-swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(255,255,255,.22); flex: none; }
.t3-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: .74rem; }
.t3-card-stats span { display: flex; justify-content: space-between; gap: 6px; }
.t3-card-stats i { color: #7e93ad; font-style: normal; }
.t3-card-stats b { color: #cfe0f5; font-weight: 500; }
.t3-card-actions { margin-top: auto; display: flex; }
.t3-card-actions .t3-btn { flex: 1; padding: 8px 10px; font-size: .78rem; }
.t3-upgrades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.t3-up { background: #0a1422; border: 1px solid #223650; border-radius: 10px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t3-up b { color: #e7f1ff; font-size: .84rem; }
.t3-up span { color: #8fa7c2; font-size: .74rem; flex: 1; }
.t3-up .t3-btn { padding: 7px 10px; font-size: .74rem; }

/* ---------- результат / пауза ---------- */
.t3-result, .t3-pause {
    position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center;
    background: rgba(4, 8, 14, .82); backdrop-filter: blur(4px);
}
.t3-result-card, .t3-pause-card {
    text-align: center; background: #0b1524; border: 1px solid #2b4160; border-radius: 16px;
    padding: 26px 30px; width: min(460px, 92%); max-width: 92%; min-width: 0;
    box-sizing: border-box; box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.t3-result-card h2 { margin: 0; font-size: 2rem; letter-spacing: .16em; }
.t3-result-card h2.win { color: #4ade80; text-shadow: 0 0 26px rgba(74,222,128,.45); }
.t3-result-card h2.lose { color: #fb7185; text-shadow: 0 0 26px rgba(251,113,133,.4); }
.t3-result-card p { color: #9fb5ce; margin: 6px 0; }
.t3-result-reward { font-size: 2rem; font-weight: 800; color: #fde68a; margin: 10px 0; }
.t3-result-detail { font-size: .8rem; color: #7e93ad; }
.t3-result-btns { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.t3-result-btns .t3-btn, .t3-result-btns .t3-play { flex: none; }
.t3-pause-card h2 { margin: 0 0 6px; letter-spacing: .16em; }

/* ---------- уведомление ---------- */
.t3-toast {
    position: absolute; left: 50%; top: 62px; transform: translate(-50%, -10px);
    background: rgba(8, 15, 25, .92); border: 1px solid #3d6f9e; color: #dbeafe;
    padding: 9px 16px; border-radius: 10px; font-size: .84rem; opacity: 0;
    transition: opacity .2s, transform .2s; pointer-events: none; z-index: 5;
}
.t3-toast.show { opacity: 1; transform: translate(-50%, 0); }
body.has-touch .t3-hpbox, body.force-touch .t3-hpbox {
    position: absolute; left: 12px; bottom: 166px;
    width: 180px; min-width: 0; max-width: none;
}

/* ---------- правая колонка ---------- */
.t3-side { display: flex; flex-direction: column; gap: 12px; }
.t3-side-card { background: #0b1422; border: 1px solid var(--line, #23314a); border-radius: 13px; padding: 13px 15px; }
.t3-side-card h3 { margin: 0 0 7px; font-size: .9rem; color: var(--amber, #fbbf24); }
.t3-side-card ul { margin: 0; padding-left: 17px; color: var(--muted, #93a4bb); font-size: .8rem; line-height: 1.6; }
.t3-side-card p { margin: 0; color: var(--muted, #93a4bb); font-size: .8rem; line-height: 1.55; }
.t3-side-warn { border-color: rgba(251,191,36,.25); }

@media (max-width: 1080px) {
    .t3-layout { grid-template-columns: 1fr; }
    .t3-side { flex-direction: row; flex-wrap: wrap; }
    .t3-side-card { flex: 1 1 220px; }
}
/* В бою на телефоне игра занимает весь экран: HUD и кнопки не уезжают за край. */
@media (max-width: 900px) {
    body.t3-playing { overflow: hidden; }
    body.t3-playing .site-header,
    body.t3-playing .site-footer,
    body.t3-playing .t3-hero,
    body.t3-playing .t3-side { display: none !important; }
    body.t3-playing main.wrap { padding: 0; margin: 0; max-width: none; }
    body.t3-playing .t3-layout { display: block; }
    body.t3-playing .t3-stage {
        position: fixed; inset: 0; z-index: 1000;
        width: 100vw; height: 100vh; height: 100dvh;
        max-height: none; min-height: 0; border: none; border-radius: 0;
    }
    body.has-touch .t3-supplies,
    body.force-touch .t3-supplies {
        position: absolute; right: 12px; bottom: 128px;
        display: grid; grid-template-columns: repeat(2, 46px); gap: 7px;
        transform: none;
    }
    body.has-touch .t3-supplies button { width: 46px; height: 46px; }
    body.has-touch .t3-toast, body.force-touch .t3-toast { top: 224px; bottom: auto; }
}
@media (max-width: 780px) {
    .t3-stage { aspect-ratio: auto; height: min(72vh, 640px); min-height: 430px; }
    .t3-lobby-main { grid-template-columns: 1fr; }
    .t3-lobby { align-items: flex-start; }
    .t3-lobby-inner { padding: 16px; }
    .t3-lobby-head h1 { font-size: 1.8rem; }
    .t3-hud-top { flex-wrap: wrap; }
    .t3-crystals { order: 3; margin-left: 0; }
    .t3-mini { width: 112px; height: 112px; top: 96px; }
    .t3-hpbox { max-width: 52%; min-width: 150px; }
    .t3-supplies button { width: 46px; height: 46px; font-size: 1.05rem; }
    .t3-upgrades { grid-template-columns: 1fr; }
    .t3-titlebar-btns { width: 100%; }
    .t3-result-card, .t3-pause-card { padding: 20px 18px; }
}
