/* ==============================================
   MALINOVKA GUESSR — Stylesheet
   ============================================== */

:root {
    --bg:             #06060f;
    --surface:        #12122a;
    --surface-light:  #1a1a3e;
    --surface-hover:  #222250;
    --accent:         #ff6b35;
    --accent-hover:   #ff8c5a;
    --accent-glow:    rgba(255, 107, 53, .25);
    --gold:           #ffd700;
    --gold-glow:      rgba(255, 215, 0, .15);
    --green:          #4caf50;
    --red:            #f44336;
    --text:           #e8e8f0;
    --text-muted:     #6a6a8a;
    --border:         #2a2a4a;
    --border-light:   #35355a;
    --radius:         14px;
    --radius-sm:      8px;
    --ease:           cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    user-select: none;
    -webkit-user-select: none;
}

.screen {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1;
}
.screen.active { display: flex; }
.hidden { display: none !important; }

.centered-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 24px;
    text-align: center;
    overflow-y: auto;
    position: relative;
    z-index: 2;
}

/* ==============================================
   ДЕКОРАТИВНЫЙ ФОН
   ============================================== */
.bg-decoration {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}
.bg-orb-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,107,53,.12) 0%, transparent 70%);
    top: -100px; left: -100px;
    animation: float-orb 12s ease-in-out infinite;
}
.bg-orb-2 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(255,215,0,.08) 0%, transparent 70%);
    bottom: -80px; right: -80px;
    animation: float-orb 15s ease-in-out infinite reverse;
}
.bg-orb-3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(100,100,255,.06) 0%, transparent 70%);
    top: 50%; left: 60%;
    animation: float-orb 18s ease-in-out infinite 3s;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -20px) scale(1.05); }
    66%      { transform: translate(-20px, 15px) scale(0.95); }
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ==============================================
   АНИМАЦИИ
   ============================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.7s var(--ease) forwards;
}
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50%      { background-position: 100% center; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

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

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

@keyframes timer-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.2; }
}

/* ==============================================
   КНОПКИ
   ============================================== */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    letter-spacing: 0.5px;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-icon { font-size: 18px; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #e55a2b 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
    border: 1px solid rgba(255,255,255,.1);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}
.btn-glow::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}
.btn-glow:hover::before { opacity: 1; }

.btn-lg { padding: 16px 44px; font-size: 18px; border-radius: 10px; }

.btn-secondary {
    background: rgba(255,255,255,.03);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    padding: 11px 28px;
    backdrop-filter: blur(4px);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255,107,53,.06);
    border-color: rgba(255,107,53,.3);
    color: var(--accent);
}

.buttons-divider {
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 4px 0;
}

/* ==============================================
   СТАРТОВЫЙ ЭКРАН
   ============================================== */
#start-screen {
    background: var(--bg);
}

.logo-container { margin-bottom: 4px; }

.logo-pin {
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;
    animation: bounce 2.5s ease-in-out infinite;
}

.logo-pin-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 25px var(--accent-glow));
}

.game-title {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff9a5c 50%, var(--accent) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
    line-height: 1;
}

.game-subtitle {
    font-size: 30px;
    font-weight: 300;
    letter-spacing: 16px;
    color: var(--gold);
    margin-top: 6px;
    text-shadow: 0 0 30px var(--gold-glow);
}

.tagline {
    color: var(--text-muted);
    font-size: 15px;
    margin: 20px 0 28px;
    line-height: 1.6;
}

.site-link {
    display: inline-block;
    margin-top: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.site-link:hover { opacity: 1; text-decoration: underline; }

/* --- Поле имени --- */
.name-input-wrapper {
    margin-bottom: 22px;
    width: 100%;
    max-width: 320px;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.name-input {
    width: 100%;
    padding: 14px 20px 14px 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    text-align: left;
    letter-spacing: 0.3px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
}
.name-input::placeholder { color: var(--text-muted); }
.name-input:focus {
    border-color: var(--accent);
    background: var(--surface-light);
    box-shadow: 0 0 0 3px rgba(255,107,53,.1), 0 4px 20px rgba(0,0,0,.3);
}
.name-input.input-error {
    border-color: var(--red);
    animation: shake 0.4s ease;
}

/* --- Выбор режима игры --- */
.mode-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    width: 100%;
    max-width: 520px;
}

.mode-picker-label {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.3px;
}

.mode-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.mode-card {
    flex: 0 0 110px;
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
    color: var(--text);
    text-align: center;
}

.mode-card:hover {
    border-color: var(--border-light);
    background: var(--surface-light);
    transform: translateY(-2px);
}

.mode-card.selected {
    border-color: var(--accent);
    background: var(--surface-light);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 4px 20px var(--accent-glow);
}

.mode-card-icon {
    font-size: 26px;
    line-height: 1;
}

.mode-card-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.mode-card-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.mode-card.selected .mode-card-desc {
    color: var(--accent-hover);
}

/* --- Daily режим --- */
.mode-card.daily-played {
    opacity: 0.6;
    cursor: default;
    border-color: #4caf50 !important;
}
.mode-card.daily-played .mode-card-desc {
    color: #4caf50 !important;
}

.lb-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}
.lb-date-btn {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.lb-date-btn:hover:not(:disabled) { background: var(--surface-hover); }
.lb-date-btn:disabled { opacity: 0.35; cursor: default; }
.lb-date-label {
    font-size: 14px;
    color: var(--text-muted);
    min-width: 160px;
    text-align: center;
}

/* --- Кнопки стартового экрана --- */
.option-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.3px;
}

.option-label select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    appearance: auto;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.option-label select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,107,53,.1);
    outline: none;
}

/* --- Кнопки стартового экрана --- */
.start-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
    width: 100%;
    max-width: 320px;
}
.start-buttons .btn { width: 100%; }

.warning {
    margin-top: 20px;
    padding: 12px 20px;
    background: rgba(244,67,54,.08);
    border: 1px solid rgba(244,67,54,.2);
    border-radius: var(--radius-sm);
    color: #ff8a80;
    font-size: 13px;
}
.warning code {
    background: rgba(255,255,255,.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* ==============================================
   ИГРОВОЙ ЭКРАН
   ============================================== */
#game-screen {
    flex-direction: column;
    background: #000;
}

#hud {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, rgba(0,0,0,.4) 70%, transparent 100%);
    z-index: 700;
    pointer-events: none;
}
#hud > * { pointer-events: auto; }

.hud-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    min-width: 0;
}
.hud-zone-left  { justify-content: flex-start; }
.hud-zone-center { justify-content: center; }
.hud-zone-right { justify-content: flex-end; }

/* Кнопка закрыть всегда минимум 36×36 */
#back-btn.hud-btn {
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
}

.hud-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(12,12,30,.85);
    padding: 6px 12px;
    border-radius: 22px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    white-space: nowrap;
    flex-shrink: 0;
}
.hud-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}
.hud-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--gold);
}

.hud-btn {
    width: 36px; height: 36px;
    background: rgba(12,12,30,.85);
    border: 1px solid rgba(255,255,255,.06);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    transition: .2s;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.hud-btn:hover { color: var(--text); border-color: var(--accent); }

/* --- Скриншот --- */
#screenshot-area {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 10;
    overflow: hidden;
    touch-action: none;
}
#screenshot-bg {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.35) saturate(1.4);
    transform: scale(1.08);
    z-index: 0;
    transition: background-image 0.4s ease;
}
#screenshot-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    will-change: transform;
}

/* Зум — фиксированный badge снизу слева */
.hud-zoom-group {
    position: fixed;
    bottom: 28px;
    left: 16px;
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(12,12,30,.85);
    padding: 6px 12px;
    border-radius: 22px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    pointer-events: none;
    white-space: nowrap;
}
.hud-zoom-icon {
    font-size: 14px;
    line-height: 1;
}
#screenshot-error { text-align: center; color: var(--text-muted); }
#screenshot-error p:first-child { font-size: 24px; margin-bottom: 8px; }

/* --- Карта --- */
#map-widget {
    position: fixed;
    bottom: 25px; right: 25px;
    width: 320px; height: 230px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid rgba(255,107,53,.35);
    box-shadow: 0 8px 40px rgba(0,0,0,.6), 0 0 20px rgba(255,107,53,.1);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transition: width .4s var(--ease), height .4s var(--ease);
}
#map-widget.expanded {
    width: min(72vw, 820px);
    height: min(65vh, 620px);
}
#map-widget.fullscreen {
    inset: 0; width: 100%; height: 100%;
    border-radius: 0; border: none; z-index: 50;
    transition: none;
}
#map-widget.fullscreen .leaflet-top {
    top: 68px;
}
#map { flex: 1; width: 100%; cursor: crosshair; }

#map-buttons {
    position: absolute; top: 8px; left: 8px;
    z-index: 510; display: flex; gap: 5px;
}
.map-ctrl {
    width: 32px; height: 32px;
    background: rgba(12,12,30,.9);
    border: 1px solid rgba(255,255,255,.1);
    color: var(--text); border-radius: 6px;
    cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: .2s;
}
.map-ctrl:hover { background: var(--accent); border-color: var(--accent); }

#guess-btn {
    position: absolute; bottom: 10px; left: 50%;
    transform: translateX(-50%); z-index: 510; white-space: nowrap;
}

/* --- Маркеры --- */
.custom-marker { background: none; border: none; }
.marker-guess {
    width: 22px; height: 22px;
    background: var(--accent);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0,0,0,.5);
}
.marker-actual {
    width: 22px; height: 22px;
    background: var(--green);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0,0,0,.5);
}

/* --- Панель результата --- */
#result-panel {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 200; display: flex; justify-content: center;
    padding: 20px; pointer-events: none;
}
#result-panel.animate-in { animation: slideUp .5s var(--ease) both; }

.result-content {
    background: rgba(12,12,30,.92);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
    padding: 24px 32px;
    max-width: 480px; width: 100%;
    pointer-events: auto;
    box-shadow: 0 -8px 50px rgba(0,0,0,.5), 0 0 30px rgba(255,107,53,.05);
}

.result-score { text-align: center; margin-bottom: 16px; }
.result-score span {
    font-size: 48px; font-weight: 900; color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow);
}
.result-score small { font-size: 16px; color: var(--text-muted); font-weight: 400; }

.result-details { margin-bottom: 16px; }
.detail-row {
    display: flex; justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 15px;
}
.detail-row span:first-child { color: var(--text-muted); }
.detail-row span:last-child  { font-weight: 600; }

.bar-track {
    width: 100%; height: 6px;
    background: rgba(255,255,255,.06);
    border-radius: 3px; margin-bottom: 20px; overflow: hidden;
}
.bar-fill {
    height: 100%; width: 0%; border-radius: 3px;
    transition: width 1s var(--ease);
}

#result-panel .btn { width: 100%; }

.leaflet-container { background: #93DDD0 !important; }

/* ==============================================
   ТАЙМЕР
   ============================================== */
.hud-timer-group { gap: 8px; padding: 4px 14px 4px 6px; }
.hud-timer-group.timer-hidden { display: none !important; }

.timer-circle {
    position: relative; width: 34px; height: 34px; flex-shrink: 0;
}
.timer-svg {
    width: 100%; height: 100%; transform: rotate(-90deg); display: block;
}
.timer-track { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 3; }
.timer-fill {
    fill: none; stroke: var(--green); stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.4s ease;
}
.timer-icon {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; pointer-events: none;
}

.hud-timer-group #hud-timer {
    font-variant-numeric: tabular-nums;
    min-width: 32px; text-align: center; transition: color 0.3s ease;
}

.hud-timer-group.timer-warning .timer-fill { stroke: var(--gold); }
.hud-timer-group.timer-warning #hud-timer  { color: var(--gold); }
.hud-timer-group.timer-danger .timer-fill  { stroke: var(--red); }
.hud-timer-group.timer-danger #hud-timer   { color: var(--red); }

.hud-timer-group.timer-danger .timer-circle {
    animation: timer-pulse 0.6s ease-in-out infinite;
}
.hud-timer-group.timer-expired #hud-timer {
    animation: timer-blink 0.3s ease-in-out 3;
}

/* ==============================================
   ИТОГОВЫЙ ЭКРАН
   ============================================== */
#summary-screen { background: var(--bg); }

.summary-scroll {
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
}

.summary-title {
    font-size: 28px;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.score-card {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface-light) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 36px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.04);
}

.final-score { margin-bottom: 8px; }
#final-score-value {
    font-size: 56px; font-weight: 900;
    background: linear-gradient(135deg, var(--gold) 0%, #ffed4a 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px var(--gold-glow));
}
.stars { font-size: 28px; margin-bottom: 16px; letter-spacing: 6px; }

/* --- Стрик в HUD --- */
.hud-streak-group .hud-value {
    color: #ff9a2e;
    font-size: 16px;
    letter-spacing: 0.5px;
}

@keyframes streak-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
@keyframes streak-reset {
    0%   { color: #ff9a2e; }
    30%  { color: #f44336; transform: scale(0.85); }
    100% { color: #f44336; opacity: 0; }
}

.streak-bump { animation: streak-bump 0.4s var(--ease); }
.streak-reset { animation: streak-reset 0.6s var(--ease) forwards; }

/* --- Лучший стрик в итогах --- */
.best-streak-badge {
    margin: 0 0 8px;
    padding: 7px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    background: linear-gradient(135deg, rgba(255,154,46,.15), rgba(255,107,53,.05));
    border: 1px solid rgba(255,154,46,.3);
    color: #ff9a2e;
}


.position-badge {
    margin: 0;
    padding: 8px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}
.position-badge.top1 {
    background: linear-gradient(135deg, rgba(255,215,0,.15), rgba(255,215,0,.05));
    border: 1px solid rgba(255,215,0,.3);
    color: var(--gold);
}
.position-badge.top3 {
    background: linear-gradient(135deg, rgba(192,192,192,.1), rgba(192,192,192,.03));
    border: 1px solid rgba(192,192,192,.2);
    color: #c0c0c0;
}
.position-badge.top10 {
    background: linear-gradient(135deg, rgba(205,127,50,.1), rgba(205,127,50,.03));
    border: 1px solid rgba(205,127,50,.2);
    color: #cd7f32;
}
.position-badge.top-other {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* --- Список раундов --- */
.rounds-list-wrapper {
    width: 100%;
    max-width: 500px;
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.rounds-list-wrapper::-webkit-scrollbar { width: 5px; }
.rounds-list-wrapper::-webkit-scrollbar-track { background: transparent; }
.rounds-list-wrapper::-webkit-scrollbar-thumb {
    background: var(--border); border-radius: 3px;
}

.rounds-list-header {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1;
}

.rounds-list { padding: 6px; }

.round-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,.02);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    border-left: 3px solid var(--accent);
    transition: background 0.2s;
}
.round-row:hover { background: rgba(255,255,255,.04); }
.round-row:last-child { margin-bottom: 0; }

.round-row-left {
    display: flex; align-items: center; gap: 12px; text-align: left;
}
.round-number {
    font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; white-space: nowrap;
}
.round-name  { font-size: 14px; }
.round-right { text-align: right; white-space: nowrap; }
.round-score { font-weight: 700; color: var(--gold); }
.round-dist  { font-size: 11px; color: var(--text-muted); margin-left: 4px; }

/* --- Кнопки итогового экрана --- */
.summary-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 320px;
}
.summary-buttons .btn { width: 100%; }

/* ==============================================
   ТАБЛИЦА ЛИДЕРОВ
   ============================================== */
#leaderboard-screen { background: var(--bg); z-index: 2; }

/* Разрешаем выделение текста только в таблице лидеров */
#leaderboard-screen .lb-table {
    user-select: text;
    -webkit-user-select: text;
}

.lb-header {
    position: relative; width: 100%; max-width: 600px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.lb-close { position: absolute; left: 0; }
.lb-title { font-size: 24px; letter-spacing: 0.5px; }

.lb-filters {
    display: flex; gap: 14px; margin-bottom: 12px;
    flex-wrap: wrap; justify-content: center;
}

.lb-status {
    color: var(--text-muted); font-size: 15px; padding: 40px 0;
}

.lb-table-wrapper {
    width: 100%; max-width: 620px; max-height: 55vh;
    overflow-y: auto; border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.lb-table-wrapper::-webkit-scrollbar { width: 5px; }
.lb-table-wrapper::-webkit-scrollbar-track { background: transparent; }
.lb-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border); border-radius: 3px;
}

.lb-table {
    width: 100%; border-collapse: collapse;
    font-size: 14px; table-layout: fixed;
}
.lb-table thead { position: sticky; top: 0; z-index: 1; }
.lb-table th {
    background: var(--surface-light);
    color: var(--text-muted);
    font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 11px 12px; text-align: left;
    border-bottom: 1px solid var(--border);
}
.lb-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.02);
    white-space: nowrap; vertical-align: middle;
}
.lb-table td.lb-col-date { white-space: normal; }
.lb-table td.lb-col-name { overflow: hidden; text-overflow: ellipsis; }

.lb-table tbody tr { transition: background 0.15s; }
.lb-table tbody tr:hover { background: rgba(255,107,53,.04); }

.lb-col-rank     { width: 52px;  text-align: center !important; overflow: visible; }
.lb-col-name     { width: auto; }
.lb-col-score    { width: 120px; text-align: right !important; }
.lb-col-attempts { width: 80px;  text-align: center !important; }
.lb-col-date     { width: 110px; text-align: right !important; }

.lb-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    font-weight: 700; font-size: 12px; color: var(--text-muted);
}
.lb-rank-1 { background: rgba(255,215,0,.15); color: var(--gold); }
.lb-rank-2 { background: rgba(192,192,192,.1); color: #c0c0c0; }
.lb-rank-3 { background: rgba(205,127,50,.1);  color: #cd7f32; }

.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lb-score-value { color: var(--gold); font-weight: 700; font-size: 15px; }

.lb-attempts {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--text-muted); font-size: 13px; font-weight: 500;
}
.lb-attempts-icon { font-size: 11px; opacity: 0.6; }

.lb-date-wrapper {
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 2px; line-height: 1.3;
}
.lb-date { color: var(--text-muted); font-size: 12px; }
.lb-time { color: var(--text-muted); font-size: 10px; opacity: 0.6; letter-spacing: 0.3px; }

.lb-table tbody tr.lb-highlight { background: rgba(255,107,53,.06); }
.lb-table tbody tr.lb-highlight td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.lb-count-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0 2px;
    opacity: 0.4;
}

/* ==============================================
   CONFIRM DIALOG
   ============================================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.15s var(--ease);
}

.confirm-dialog {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px 32px;
    max-width: 320px;
    width: calc(100% - 48px);
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: slide-up 0.2s var(--ease);
    text-align: center;
}

.confirm-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.confirm-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-buttons .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 768px) {
    .game-title    { font-size: 38px; letter-spacing: 4px; }
    .game-subtitle { font-size: 22px; letter-spacing: 10px; }

    #map-widget { width: 220px; height: 160px; bottom: 15px; right: 15px; }
    #map-widget.expanded { width: 92vw; height: 60vh; }

    .result-content { padding: 18px 20px; }
    .result-score span { font-size: 36px; }

    #final-score-value { font-size: 44px; }
    .score-card { padding: 20px 24px; }
    .rounds-list-wrapper { max-height: 35vh; }
}

@media (max-width: 480px) {
    .game-title    { font-size: 28px; letter-spacing: 2px; }
    .game-subtitle { font-size: 18px; letter-spacing: 6px; }
    .logo-pin { width: 70px; height: 70px; }

    .mode-picker { max-width: 100%; padding: 0 12px; box-sizing: border-box; }
    .mode-cards { gap: 8px; }
    .mode-card { flex: 0 0 calc(50% - 4px); width: calc(50% - 4px); padding: 12px 8px; }
    .mode-card-name { font-size: 13px; }
    .mode-card-desc { font-size: 11px; }

    #map-widget { width: 170px; height: 130px; bottom: 10px; right: 10px; }

    .lb-col-date,
    .lb-col-attempts { display: none; }

    .summary-scroll { padding-top: 24px; padding-bottom: 24px; }
    .rounds-list-wrapper { max-height: 30vh; }
    .score-card { padding: 18px 20px; }
}

/* --- Дуэль как карточка режима --- */
.mode-card.mode-card-duel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.1), rgba(108, 52, 131, 0.06));
    border-color: rgba(142, 68, 173, 0.3);
}
.mode-card.mode-card-duel .mode-card-icon { font-size: 26px; }
.mode-card.mode-card-duel .mode-card-name { color: #c084fc; }
.mode-card.mode-card-duel:hover {
    border-color: rgba(142, 68, 173, 0.7);
    box-shadow: 0 0 20px rgba(142, 68, 173, 0.25);
}
.mode-card.mode-card-duel.selected {
    border-color: #a855f7;
    background: rgba(142, 68, 173, 0.18);
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.2), 0 4px 20px rgba(142, 68, 173, 0.2);
}
.mode-card.mode-card-duel.selected .mode-card-desc { color: #c084fc; }

/* --- Диалог настроек дуэли --- */
.duel-settings-dialog {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px 18px 16px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    max-height: 92vh;
}
.duel-settings-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text);
}
.duel-settings-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.duel-settings-group {
    margin-bottom: 12px;
}
.duel-settings-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}
.duel-settings-options {
    display: flex;
    gap: 6px;
}
.duel-opt-btn {
    flex: 1;
    padding: 7px 6px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    line-height: 1.3;
}
.duel-opt-btn:hover {
    border-color: rgba(142, 68, 173, 0.5);
    background: rgba(142, 68, 173, 0.08);
}
.duel-opt-btn.selected {
    border-color: #8e44ad;
    background: rgba(142, 68, 173, 0.15);
    color: #c084fc;
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.2);
}
.duel-settings-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-shrink: 0;
}
.duel-settings-actions .btn { flex: 1; }

/* Подсказка под переключателем типа лобби */
.duel-visibility-hint {
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    min-height: 14px;
    line-height: 1.3;
}

/* ==============================================
   ДУЭЛЬ — СПИСОК ОТКРЫТЫХ ЛОББИ (внутри диалога)
   ============================================== */
.duel-settings-overlay .confirm-overlay {
    align-items: center;
    justify-content: center;
}

.duel-open-lobbies-section {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 12px;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.duel-open-lobbies-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.duel-open-lobbies-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.duel-refresh-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 2px 7px;
    transition: all 0.15s;
}
.duel-refresh-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.duel-refresh-btn.spinning .duel-refresh-icon {
    display: inline-block;
    animation: spinOnce 0.5s linear;
}
@keyframes spinOnce {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Список лобби — стиль как у lb-table-wrapper */
.duel-open-lobbies-list {
    flex: 1 1 auto;
    min-height: 64px;
    max-height: 200px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-light);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.duel-open-lobbies-list::-webkit-scrollbar { width: 5px; }
.duel-open-lobbies-list::-webkit-scrollbar-track { background: transparent; }
.duel-open-lobbies-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.duel-lobbies-loading,
.duel-lobbies-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 18px 0;
}

/* Строки лобби — как строки таблицы лидеров */
.duel-lobby-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.duel-lobby-row:last-child {
    border-bottom: none;
}
.duel-lobby-row:hover {
    background: rgba(142, 68, 173, 0.06);
}

.duel-lobby-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.duel-lobby-row-host {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.duel-lobby-row-params {
    font-size: 11px;
    color: #c084fc;
}

.duel-lobby-row-ago {
    font-size: 10px;
    color: var(--text-muted);
}

.duel-lobby-join-btn {
    white-space: nowrap;
    padding: 6px 13px !important;
    font-size: 12px !important;
    flex-shrink: 0;
}

.duel-lobby-row-streak {
    font-size: 12px;
}
.duel-lobby-row-streak.off {
    opacity: 0.55;
}

/* ==============================================
   ДУЭЛЬ — ЛОББИ
   ============================================== */
.duel-lobby-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 480px;
    width: 100%;
    text-align: center;
}
.duel-lobby-icon {
    font-size: 4rem;
    line-height: 1;
}
.duel-lobby-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.duel-lobby-cancel-btn {
    margin-top: 4px;
}

/* Бейдж с настройками */
.duel-lobby-settings-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.duel-lobby-badge-item {
    padding: 5px 14px;
    background: rgba(142, 68, 173, 0.12);
    border: 1px solid rgba(142, 68, 173, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #c084fc;
}
.duel-lobby-badge-sep {
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
}

/* Секция приглашения */
.duel-invite-section {
    width: 100%;
}

#duel-lobby-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}
.duel-lobby-desc {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 12px;
}
.duel-invite-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    width: 100%;
}
.duel-invite-url-wrap {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    width: 100%;
}
.duel-invite-url {
    font-size: .78rem;
    color: var(--accent);
    word-break: break-all;
    text-align: left;
    display: block;
    line-height: 1.5;
}
.duel-copy-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}
.duel-copy-icon { font-size: 18px; }

/* Статус ожидания */
@keyframes lobbyPulse {
    0%   { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}
.duel-waiting-dots {
    display: inline-flex;
    gap: 2px;
}
.duel-waiting-dots span {
    display: inline-block;
    color: #a855f7;
    font-size: 1.2rem;
    font-weight: 700;
    animation: dotBounce 1.4s ease-in-out infinite;
}
.duel-waiting-dots span:nth-child(1) { animation-delay: 0s; }
.duel-waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.duel-waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: .4; }
    40%           { transform: translateY(-5px); opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================
   ДУЭЛЬ — ЕДИНОЕ ЛОББИ ОЖИДАНИЯ (.dlw-*)
   ================================================ */
.dlw-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 20px 24px;
    background: var(--surface);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius);
    width: 100%;
    position: relative;
    overflow: hidden;
}
.dlw-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(168,85,247,0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Пульсирующий круг с иконкой */
.dlw-pulse-outer {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.15);
    border: 2px solid rgba(168, 85, 247, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    animation: dlwPulseOuter 2s ease-in-out infinite;
}
.dlw-pulse-outer::before,
.dlw-pulse-outer::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(168, 85, 247, 0.4);
    animation: dlwRing 2s ease-out infinite;
}
.dlw-pulse-outer::after {
    inset: -16px;
    animation-delay: 0.6s;
    border-color: rgba(168, 85, 247, 0.2);
}
.dlw-swords {
    font-size: 1.75rem;
    line-height: 1;
    position: relative;
    z-index: 1;
}
@keyframes dlwPulseOuter {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.25); }
    50%       { box-shadow: 0 0 0 8px rgba(168,85,247,0); }
}
@keyframes dlwRing {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Заголовок */
.dlw-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    line-height: 1.4;
}
.dlw-name {
    color: #c084fc;
    font-weight: 800;
}

/* Подзаголовок */
.dlw-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

/* Анимированные точки */
.dlw-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}
.dlw-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a855f7;
    display: block;
    animation: dlwDot 1.4s ease-in-out infinite;
    opacity: 0.3;
}
.dlw-dots span:nth-child(1) { animation-delay: 0s; }
.dlw-dots span:nth-child(2) { animation-delay: 0.22s; }
.dlw-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes dlwDot {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.25; }
    40%           { transform: scale(1.2); opacity: 1; }
}


/* ==============================================
   ДУЭЛЬ — ОЖИДАНИЕ СОПЕРНИКА (в result-panel)
   ============================================== */
.duel-waiting-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
}
.duel-waiting-overlay-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 40px;
    padding: 10px 20px;
}
.duel-wait-spinner-wrap {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.duel-wait-pulse {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #a855f7;
    animation: waitPulse 1.2s ease-in-out infinite;
}
@keyframes waitPulse {
    0%, 100% { transform: scale(0.7); opacity: 0.5; }
    50%       { transform: scale(1);   opacity: 1;   }
}
.duel-wait-label {
    font-size: .9rem;
    font-weight: 600;
    color: #c084fc;
}
.duel-wait-dots {
    display: inline-flex;
    gap: 1px;
}
.duel-wait-dots span {
    display: inline-block;
    color: #a855f7;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    animation: dotBounce 1.4s ease-in-out infinite;
}
.duel-wait-dots span:nth-child(1) { animation-delay: 0s; }
.duel-wait-dots span:nth-child(2) { animation-delay: 0.2s; }
.duel-wait-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ==============================================
   ДУЭЛЬ — ОБРАТНЫЙ ОТСЧЁТ ПЕРЕХОДА
   ============================================== */
.duel-advance-overlay {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}
.duel-advance-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(168, 85, 247, 0.10);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 40px;
    padding: 10px 20px 10px 14px;
    animation: advanceFadeIn .3s var(--ease);
}
@keyframes advanceFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.duel-advance-msg {
    font-size: .95rem;
    font-weight: 700;
    color: #c084fc;
    white-space: nowrap;
}
.duel-advance-countdown {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.duel-cd-svg {
    width: 40px;
    height: 40px;
    transform: rotate(-90deg);
}
.duel-cd-track {
    fill: none;
    stroke: rgba(168, 85, 247, 0.2);
    stroke-width: 4;
}
.duel-cd-fill {
    fill: none;
    stroke: #a855f7;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.85s linear;
    transform-origin: center;
}
.duel-cd-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #c084fc;
}

/* ==============================================
   ДУЭЛЬ — ИТОГОВЫЙ ЭКРАН
   ============================================== */
.duel-final-scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    width: 100%;
    max-width: 480px;
}
.duel-final-player {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    transition: all .3s var(--ease);
}
.duel-final-player.duel-winner {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
    background: var(--surface-light);
}
.duel-final-player.duel-loser {
    opacity: .6;
    border-color: rgba(255,255,255,.08);
    background: rgba(255,255,255,.02);
}
.duel-final-name {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.duel-final-score {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
}
.duel-final-player.duel-winner .duel-final-score {
    color: var(--gold);
}
.duel-final-player.duel-loser .duel-final-score {
    color: var(--text-muted);
}
.duel-final-vs {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ==============================================
   ДУЭЛЬ — ДЕТАЛИ РАУНДОВ
   ============================================== */
.duel-round-row {
    display: grid !important;
    grid-template-columns: 80px 1fr 36px 1fr;
    gap: 8px;
    align-items: center;
}
.duel-rr-row-win  { border-left-color: #4caf50 !important; }
.duel-rr-row-loss { border-left-color: #e53935 !important; }
.duel-rr-row-tie  { border-left-color: #ffc107 !important; }
.duel-rr-row-pending { border-left-color: var(--text-muted) !important; }
.duel-rr-round {
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.duel-rr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.duel-rr-col.duel-rr-win {
    background: rgba(76, 175, 80, .15);
    border: 1px solid rgba(76, 175, 80, .3);
}
.duel-rr-vs {
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
}

/* Маркер соперника на карте */
.marker-opponent {
    width: 22px; height: 22px;
    background: #8e44ad;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* Дуэльная таблица лидеров: В/Н/П */
.lb-duel-wdl { font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }
.lb-duel-w   { color: #4ade80; }
.lb-duel-d   { color: #94a3b8; }
.lb-duel-l   { color: #f87171; }

/* ===== Toast-уведомления ===== */
.mg-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 500;
    max-width: min(380px, calc(100vw - 32px));
    width: max-content;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.mg-toast--error {
    background: rgba(30, 10, 10, .88);
    border: 1px solid rgba(248, 113, 113, .45);
    color: #fca5a5;
}
.mg-toast--info {
    background: rgba(10, 20, 35, .88);
    border: 1px solid rgba(96, 165, 250, .4);
    color: #93c5fd;
}
.mg-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.mg-toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}
.mg-toast-text {
    line-height: 1.35;
}
