/* ============================================================================
   components.css — Кнопки, карточки, плитки, таблицы коэффициентов,
   модалки, лого, бейджи, чипы, тосты.
   ========================================================================== */

/* ── Кнопки ──────────────────────────────────────────────────────────────── */
.btn {
    --_h: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--_h);
    padding: 0 20px;
    border-radius: var(--r-md);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-16);
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--text-0);
    background: var(--bg-2);
    border: 1px solid var(--stroke);
    transition: transform var(--t-fast) var(--ease),
                background var(--t-fast) var(--ease),
                box-shadow var(--t-med) var(--ease),
                border-color var(--t-fast) var(--ease);
    white-space: nowrap;
    user-select: none;
}
.btn:hover { background: var(--bg-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--accent {
    color: var(--accent-ink);
    background: var(--grad-lime);
    border-color: transparent;
    box-shadow: var(--glow-cta);
}
.btn--accent:hover { box-shadow: var(--glow-cta-hover); background: var(--grad-lime); }

.btn--gold {
    color: #201700;
    background: linear-gradient(120deg, #ffd84a, var(--accent-2));
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(255, 196, 0, .5), 0 8px 26px var(--gold-glow);
}

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--bg-2); border-color: var(--bg-3); }

.btn--outline-accent {
    background: transparent;
    color: var(--accent);
    border-color: rgba(198, 255, 0, .45);
}
.btn--outline-accent:hover {
    background: rgba(198, 255, 0, .08);
    border-color: var(--accent);
}

.btn--sm { --_h: 40px; padding: 0 14px; font-size: var(--fs-14); }
.btn--lg { --_h: 56px; padding: 0 30px; font-size: var(--fs-20); border-radius: var(--r-lg); }
.btn--block { width: 100%; }

/* Иконочная кнопка (поиск, звезда, бургер) */
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    color: var(--text-0);
    border: 1px solid transparent;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-2); color: var(--accent); }
.icon-btn svg { width: 22px; height: 22px; }

/* ── Бейджи / чипы ───────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    font-size: var(--fs-12);
    font-weight: 700;
    letter-spacing: .04em;
    background: var(--bg-2);
    color: var(--text-1);
    border: 1px solid var(--stroke);
}
.badge--accent { background: rgba(198, 255, 0, .12); color: var(--accent); border-color: rgba(198, 255, 0, .3); }
.badge--gold { background: rgba(255, 196, 0, .12); color: var(--accent-2); border-color: rgba(255, 196, 0, .3); }
.badge--live { background: rgba(255, 59, 59, .14); color: var(--live); border-color: rgba(255, 59, 59, .35); }
.badge--markets { background: var(--bg-0); color: var(--accent); border-color: rgba(198, 255, 0, .25); font-variant-numeric: tabular-nums; }

/* Пульсирующая точка LIVE */
.live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 rgba(255, 59, 59, .6);
    animation: livePulse 1.6s infinite;
}
@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 59, 59, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(255, 59, 59, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); }
}

/* ── Карточка (общая) ────────────────────────────────────────────────────── */
.card {
    background: var(--grad-panel);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease),
                box-shadow var(--t-med) var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--bg-3); box-shadow: var(--shadow-md); }

/* ── Таблица коэффициентов: клетки 1 / X / 2 ─────────────────────────────── */
.odds-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.odd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: var(--bg-0);
    border: 1px solid var(--stroke);
    color: var(--text-0);
    font-variant-numeric: tabular-nums;
    transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease);
    position: relative;
    overflow: hidden;
}
.odd:hover:not(:disabled) { border-color: rgba(198, 255, 0, .5); background: var(--bg-1); }
.odd .odd-key { color: var(--text-2); font-size: var(--fs-12); font-weight: 700; }
.odd .odd-val { font-weight: 700; font-size: var(--fs-16); letter-spacing: .01em; }
.odd .odd-arrow { font-size: 10px; width: 10px; opacity: 0; transition: opacity var(--t-fast); }

.odd.is-selected {
    background: var(--grad-lime);
    border-color: transparent;
    color: var(--accent-ink);
    box-shadow: 0 0 18px var(--accent-glow);
}
.odd.is-selected .odd-key { color: rgba(11, 14, 17, .6); }

.odd.is-up   { animation: flashUp .6s var(--ease); }
.odd.is-down { animation: flashDown .6s var(--ease); }
.odd.is-up   .odd-arrow { opacity: 1; color: var(--up); }
.odd.is-down .odd-arrow { opacity: 1; color: var(--down); }
@keyframes flashUp {
    0% { background: rgba(46, 204, 113, .28); border-color: var(--up); }
    100% { background: var(--bg-0); }
}
@keyframes flashDown {
    0% { background: rgba(255, 90, 90, .28); border-color: var(--down); }
    100% { background: var(--bg-0); }
}
.odd:disabled { opacity: .35; cursor: not-allowed; }

/* ── Круглые быстрые плитки ──────────────────────────────────────────────── */
.quick-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 84px;
    text-align: center;
}
.quick-tile .disc {
    width: 64px; height: 64px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: radial-gradient(120% 120% at 30% 20%, var(--bg-2), var(--bg-1));
    border: 1px solid var(--stroke);
    color: var(--accent);
    transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease),
                border-color var(--t-med) var(--ease);
}
.quick-tile .disc svg { width: 28px; height: 28px; }
.quick-tile:hover .disc {
    transform: translateY(-4px) scale(1.04);
    border-color: rgba(198, 255, 0, .5);
    box-shadow: 0 10px 26px var(--accent-glow);
}
.quick-tile .label { font-size: var(--fs-12); color: var(--text-1); line-height: 1.2; font-weight: 600; }

/* ── Плитка слота (казино-ряды) ──────────────────────────────────────────── */
.slot {
    width: 150px;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-1);
    border: 1px solid var(--stroke);
    position: relative;
    transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease),
                border-color var(--t-med) var(--ease);
}
.slot .cover { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; background: var(--bg-2); }
.slot .slot-meta { padding: 8px 10px; }
.slot .slot-name { font-size: var(--fs-14); font-weight: 700; line-height: 1.2; }
.slot .slot-prov { font-size: var(--fs-12); color: var(--text-2); }
.slot .slot-badge { position: absolute; top: 8px; left: 8px; }
.slot .play {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    background: linear-gradient(180deg, rgba(11,14,17,.1), rgba(11,14,17,.75));
    opacity: 0; transition: opacity var(--t-med) var(--ease);
}
.slot:hover { transform: translateY(-6px); border-color: rgba(198,255,0,.4); box-shadow: 0 16px 36px rgba(0,0,0,.5); }
.slot:hover .play { opacity: 1; }
@media (min-width: 768px) { .slot { width: 168px; } }

/* Стрелки прокрутки карусели */
.carousel { position: relative; }
.carousel-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    display: none; place-items: center; z-index: 3;
    background: var(--bg-2); border: 1px solid var(--stroke); color: var(--text-0);
    box-shadow: var(--shadow-md);
    transition: background var(--t-fast), color var(--t-fast), opacity var(--t-fast);
}
.carousel-nav:hover { background: var(--accent); color: var(--accent-ink); }
.carousel-nav[data-dir="prev"] { left: -8px; }
.carousel-nav[data-dir="next"] { right: -8px; }
.carousel-nav:disabled { opacity: 0; pointer-events: none; }
@media (min-width: 1024px) { .carousel:hover .carousel-nav { display: grid; } }

/* ── Модалки ─────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: var(--z-modal);
    display: grid; place-items: center;
    padding: 16px;
    background: rgba(6, 9, 12, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden;
    transition: opacity var(--t-med) var(--ease), visibility var(--t-med);
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal {
    width: 100%; max-width: 440px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    background: var(--bg-1);
    border: 1px solid var(--stroke);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(198, 255, 0, .06);
    transform: translateY(16px) scale(.98);
    transition: transform var(--t-med) var(--ease-out);
    position: relative;
}
.modal-overlay.is-open .modal { transform: none; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 22px 6px;
}
.modal-head h3 { font-size: var(--fs-28); text-transform: uppercase; }
.modal-body { padding: 12px 22px 22px; }
.modal-close {
    width: 40px; height: 40px; border-radius: var(--r-sm);
    display: grid; place-items: center; color: var(--text-1);
    transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--bg-2); color: var(--text-0); }

/* Табы Zaloguj / Rejestracja внутри модалки */
.auth-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
    background: var(--bg-0); border: 1px solid var(--stroke);
    border-radius: var(--r-md); padding: 4px; margin-bottom: 18px;
}
.auth-tab {
    padding: 10px; border-radius: var(--r-sm);
    font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
    color: var(--text-1); letter-spacing: .02em;
    transition: background var(--t-fast), color var(--t-fast);
}
.auth-tab.is-active { background: var(--bg-2); color: var(--accent); }

/* ── Поля форм ───────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
    display: block; font-size: var(--fs-12); font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; color: var(--text-1);
    margin-bottom: 6px;
}
.field .control { position: relative; }
.input {
    width: 100%; min-height: 48px;
    padding: 12px 14px;
    background: var(--bg-0);
    border: 1px solid var(--stroke);
    border-radius: var(--r-md);
    color: var(--text-0);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--text-2); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198, 255, 0, .15); }
.input[aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 3px rgba(255, 90, 90, .12); }
.field .hint { display: none; margin-top: 6px; font-size: var(--fs-12); color: var(--down); }
.field.has-error .hint { display: block; }
.pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: var(--r-sm);
    display: grid; place-items: center; color: var(--text-1);
}
.pw-toggle:hover { color: var(--accent); }

.check {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: var(--fs-14); color: var(--text-1); cursor: pointer;
    margin-bottom: 12px; line-height: 1.4;
}
.check input { width: 20px; height: 20px; min-width: 20px; margin-top: 1px; accent-color: var(--accent); }
.check a { color: var(--accent); }
.check.has-error { color: var(--down); }

.form-error {
    display: none;
    padding: 10px 12px; margin-bottom: 14px;
    background: rgba(255, 90, 90, .1); border: 1px solid rgba(255, 90, 90, .3);
    border-radius: var(--r-sm); color: #ffb4b4; font-size: var(--fs-14);
}
.form-error.is-visible { display: block; }

.form-switch { text-align: center; margin-top: 14px; font-size: var(--fs-14); color: var(--text-1); }
.form-switch button { color: var(--accent); font-weight: 700; }

/* Многошаговый прогресс регистрации */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps .step { flex: 1; height: 4px; border-radius: 999px; background: var(--stroke); }
.steps .step.is-done { background: var(--accent); }

/* ── Тосты ───────────────────────────────────────────────────────────────── */
.toast-wrap {
    position: fixed; left: 50%; bottom: calc(var(--mobilenav-h) + 16px);
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 10px; align-items: center;
    width: min(92vw, 420px);
    pointer-events: none;
}
@media (min-width: 1024px) { .toast-wrap { bottom: 24px; } }
.toast {
    pointer-events: auto;
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px;
    background: var(--bg-2);
    border: 1px solid var(--stroke);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-14);
    transform: translateY(12px); opacity: 0;
    transition: transform var(--t-med) var(--ease-out), opacity var(--t-med);
}
.toast.is-in { transform: none; opacity: 1; }
.toast.toast--error { border-left-color: var(--down); }
.toast.toast--gold  { border-left-color: var(--accent-2); }
.toast svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--accent); }

/* ── Дропдаун ────────────────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 10px); right: 0;
    min-width: 220px;
    background: var(--bg-1);
    border: 1px solid var(--stroke);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
    z-index: 5;
}
.dropdown.is-open .dropdown-menu,
.dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: var(--r-sm);
    color: var(--text-1); font-size: var(--fs-14); text-align: left;
    transition: background var(--t-fast), color var(--t-fast);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-2); color: var(--text-0); }
.dropdown-menu .sep { height: 1px; background: var(--stroke); margin: 6px 4px; }

/* ── Анимированный SVG-лого ──────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; }
.logo svg { width: 40px; height: 40px; overflow: visible; }
.logo .lv-shield { fill: none; stroke: var(--accent); stroke-width: 3; }
.logo .lv-chevron { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.logo .lv-fill { fill: var(--accent); opacity: 0; }

/* draw-on при загрузке */
.logo .lv-shield, .logo .lv-chevron {
    stroke-dasharray: var(--len, 300);
    stroke-dashoffset: var(--len, 300);
    animation: logoDraw 1.2s var(--ease-out) forwards;
    filter: drop-shadow(0 0 4px var(--accent-glow));
}
.logo .lv-chevron { animation-delay: .25s; }
.logo .lv-fill { animation: logoFill .5s var(--ease-out) 1s forwards; }
@keyframes logoDraw { to { stroke-dashoffset: 0; } }
@keyframes logoFill {
    0%   { opacity: 0; transform: scale(.9); }
    60%  { opacity: .35; }
    100% { opacity: .18; transform: scale(1); }
}
.logo svg { transform-box: fill-box; transform-origin: center; }
.logo .lv-glow { transform-origin: center; }

/* hover — постоянная пульсация + микронаклон шеврона */
.logo:hover .lv-chevron { animation: chevTilt 2s ease-in-out infinite; }
.logo:hover svg { filter: drop-shadow(0 0 10px var(--accent-glow-strong)); transition: filter .3s; }
@keyframes chevTilt {
    0%, 100% { transform: rotate(0deg); }
    50%      { transform: rotate(-3deg) translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
    .logo .lv-shield, .logo .lv-chevron { animation: none; stroke-dashoffset: 0; }
    .logo .lv-fill { animation: none; opacity: .18; }
    .logo:hover .lv-chevron { animation: none; }
    .live-dot { animation: none; }
}

/* ── Скелетоны ───────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-1) 25%, var(--bg-2) 37%, var(--bg-1) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease infinite;
    border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
