/* ══════════════════════════════════════════
   COMPONENTS — кнопки, badges, модалки, тосты, dropdown, tabs
   ══════════════════════════════════════════ */

/* === Кнопки === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: var(--transition-all);
    text-decoration: none;
    line-height: 1.2;
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--text-xs);
    height: 32px;
}

.btn-md {
    height: 40px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: var(--text-base);
    height: 48px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    box-shadow: var(--shadow-sm), 0 0 15px var(--accent-glow);
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #8183f7);
    box-shadow: var(--shadow-md), 0 0 25px var(--accent-glow), 0 4px 10px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    color: #fff;
    box-shadow: var(--shadow-sm), 0 0 15px rgba(129, 140, 248, 0.25);
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #a78bfa, #c084fc);
    box-shadow: var(--shadow-md), 0 0 25px rgba(129, 140, 248, 0.35), 0 4px 10px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: #fff;
    box-shadow: var(--shadow-sm), 0 0 15px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow-danger), 0 4px 10px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #4ade80);
    color: #fff;
    box-shadow: var(--shadow-sm), 0 0 15px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow-success), 0 4px 10px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #facc15);
    color: var(--text-inverse);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-icon.btn-lg {
    width: 48px;
    height: 48px;
}

.btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn[disabled],
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Ripple */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0);
    animation: ripple 600ms linear;
    pointer-events: none;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.6;
}

.badge-live {
    background: var(--danger-subtle);
    color: var(--danger);
}

.badge-upcoming {
    background: var(--info-subtle);
    color: var(--info);
}

.badge-scheduled {
    background: var(--info-subtle);
    color: var(--info);
}

.badge-completed {
    background: var(--success-subtle);
    color: var(--success);
}

.badge-finished {
    background: var(--success-subtle);
    color: var(--success);
}

.badge-in_progress {
    background: var(--warning-subtle);
    color: var(--warning);
}

.badge-registration {
    background: var(--accent-subtle);
    color: var(--accent);
}

.badge-cancelled {
    background: var(--bg-surface-3);
    color: var(--text-tertiary);
}

.badge-pending {
    background: var(--warning-subtle);
    color: var(--warning);
}

.badge-accepted {
    background: var(--success-subtle);
    color: var(--success);
}

.badge-declined {
    background: var(--danger-subtle);
    color: var(--danger);
}



.badge-cs2 {
    background: var(--cs2-subtle);
    color: var(--cs2);
}

.badge-sm {
    font-size: 10px;
    padding: 1px 7px;
}

.badge-lg {
    font-size: var(--text-sm);
    padding: 4px 14px;
}

.badge-ct {
    background: var(--ct-bg);
    color: var(--ct-color);
}

.badge-t {
    background: var(--t-bg);
    color: var(--t-color);
}

.text-success {
    color: var(--win-color);
}

.text-danger {
    color: var(--loss-color);
}

.text-warning {
    color: var(--warning-color);
}

.country-flag {
    min-width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    font-size: 18px;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.country-flag-lg {
    min-width: 32px;
    height: 24px;
    border-radius: 3px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    font-size: 24px;
    line-height: 24px;
    text-align: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal) var(--ease-out),
        visibility var(--duration-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.92) translateY(10px);
    transition: transform var(--duration-normal) var(--ease-spring);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal--lg {
    max-width: 720px;
}

.modal--xl {
    max-width: 900px;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal__title {
    font-size: var(--text-lg);
    font-weight: 700;
}

.modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: var(--text-lg);
    transition: var(--transition-all);
}

.modal__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal__body {
    padding: 24px;
}

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

/* === Toast === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    pointer-events: all;
    animation: toastSlideIn var(--duration-slow) var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.toast.removing {
    animation: toastSlideOut var(--duration-normal) var(--ease-out) forwards;
}

.toast--success {
    border-left: 3px solid var(--success);
}

.toast--error {
    border-left: 3px solid var(--danger);
}

.toast--warning {
    border-left: 3px solid var(--warning);
}

.toast--info {
    border-left: 3px solid var(--info);
}

.toast__icon {
    font-size: var(--text-lg);
    flex-shrink: 0;
    line-height: 1;
}

.toast__content {
    flex: 1;
    min-width: 0;
}

.toast__title {
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: 2px;
}

.toast__message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.toast__close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: var(--text-sm);
    padding: 4px;
    border-radius: var(--radius-xs);
}

.toast__close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    animation: toastProgress linear forwards;
}

/* === Dropdown === */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: var(--transition-all);
    padding: 4px;
}

.dropdown__menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown__menu.right {
    left: auto;
    right: 0;
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-colors);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown__item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown__item--danger {
    color: var(--danger);
}

.dropdown__item--danger:hover {
    background: var(--danger-subtle);
}

.dropdown__divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

/* === Tabs === */
.tabs-container {
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 12px 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-colors);
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: left var(--duration-normal) var(--ease-out),
        width var(--duration-normal) var(--ease-out);
}

.tab-content {
    display: none;
    padding-top: 20px;
    animation: fadeIn var(--duration-normal) var(--ease-out);
}

.tab-content.active {
    display: block;
}

/* === Confirm Dialog === */
.confirm-dialog {
    text-align: center;
    padding: 24px;
}

.confirm-dialog__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.confirm-dialog__title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: 8px;
}

.confirm-dialog__message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.confirm-dialog__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* === Avatar === */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: var(--text-sm);
    flex-shrink: 0;
    background: var(--accent);
    text-transform: uppercase;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--text-xl);
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: var(--text-3xl);
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state__text {
    font-size: var(--text-sm);
    max-width: 360px;
    margin: 0 auto 20px;
}

/* === Progress bar === */
.progress-bar {
    height: 6px;
    background: var(--bg-surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
}

/* === Skeleton === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-surface-3) 50%, var(--bg-surface-2) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
}

/* === Live indicator === */
.live-dot {
    width: 8px;
    height: 8px;
    background: var(--live-color);
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--live-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Tooltip === */
[data-tooltip] {
    position: relative;
}

/* === Tag === */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-surface-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* === Divider === */
.divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 16px 0;
}

/* === Info grid === */
.info-grid {
    display: grid;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* === Step progress === */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
}

.step::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border-subtle);
    margin: 0 8px;
}

.step:last-child::after {
    display: none;
}

.step:last-child {
    flex: 0;
}

.step__number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    background: var(--bg-surface-3);
    color: var(--text-tertiary);
    border: 2px solid var(--border-default);
    flex-shrink: 0;
}

.step.active .step__number {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.step.completed .step__number {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.step.completed::after {
    background: var(--success);
}

.step.active::after {
    background: linear-gradient(90deg, var(--accent), var(--border-subtle));
}

.step__label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    display: none;
}

.step.active .step__label {
    color: var(--accent);
}

.step.completed .step__label {
    color: var(--success);
}

/* === Stat mini === */
.stat-mini {
    text-align: center;
    padding: 12px;
}

.stat-mini__value {
    font-size: var(--text-2xl);
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-mini__label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Form dots (win/loss) === */
.form-dots {
    display: inline-flex;
    gap: 3px;
}

.form-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.form-dot--win {
    background: var(--win-color);
}

.form-dot--loss {
    background: var(--loss-color);
}

.form-dot--draw {
    background: var(--draw-color);
}

/* === Rank badge === */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* === Search overlay === */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: var(--z-search);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal) var(--ease-out), visibility var(--duration-normal);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-dialog {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 580px;
    max-width: 90vw;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    animation: modalIn var(--duration-normal) var(--ease-spring);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.search-input-wrapper svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-tertiary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    font-size: var(--text-md);
    background: none;
    border: none;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    outline: none;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-colors);
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-hover);
}

.search-result-item__icon {
    font-size: var(--text-lg);
    width: 32px;
    text-align: center;
}

.search-result-item__info {
    flex: 1;
    min-width: 0;
}

.search-result-item__name {
    font-weight: 500;
}

.search-result-item__meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.search-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.search-footer kbd {
    margin: 0 2px;
}

/* === Faceit Levels & ELO === */
.faceit-badge {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.faceit-badge svg {
    width: 100%;
    height: 100%;
}

.faceit-badge--challenger {
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.4));
}

.elo-premium {
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    font-size: 1.1em;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .elo-premium {
    background: linear-gradient(135deg, #fff 0%, #bbb 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* === Tiered Selection === */
.tier-group {
    margin-bottom: 24px;
}

.tier-group:last-child {
    margin-bottom: 0;
}

.tier-title {
    font-size: var(--text-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: var(--radius-full);
}

.tier-title.tier1 { color: #ffd700; text-shadow: 0 0 15px rgba(255, 215, 0, 0.3); }
.tier-title.tier1::before { background: linear-gradient(180deg, #fff2a1 0%, #ffd700 100%); box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }

.tier-title.tier15 { color: #e5e4e2; text-shadow: 0 0 15px rgba(229, 228, 226, 0.2); }
.tier-title.tier15::before { background: linear-gradient(180deg, #ffffff 0%, #b8b8b8 100%); box-shadow: 0 0 10px rgba(229, 228, 226, 0.4); }

.tier-title.tier2 { color: #c0c0c0; }
.tier-title.tier2::before { background: linear-gradient(180deg, #e0e0e0 0%, #808080 100%); }

.tier-title.tier3 { color: #cd7f32; }
.tier-title.tier3::before { background: #cd7f32; }

.tier-title.tier4 { color: #b5693c; }
.tier-title.tier4::before { background: #b5693c; }

.tier-title.tier5 { color: #717b85; }
.tier-title.tier5::before { background: #717b85; }

.tier-title.others { color: var(--text-tertiary); }
.tier-title.others::before { background: var(--text-tertiary); }

.tier-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.tier-item {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tier-item input {
    display: none;
}

.tier-item__box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-all);
    user-select: none;
    gap: 4px;
}

.tier-item__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.tier-item__detail {
    display: none;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.tier-item input:checked + .tier-item__box .tier-item__detail {
    display: flex;
}

.tier-item__logo {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.tier-item__logo img,
.tier-item__logo .avatar-fallback {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tier-item__roster {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.tier-item:hover .tier-item__box {
    background: var(--bg-hover);
    border-color: var(--border-default);
    transform: translateY(-1px);
}

.tier-item input:checked + .tier-item__box {
    background: var(--accent-subtle);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.tier-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tier-item__tag {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.tier-item__name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.tier-item__elo {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}



/* === Tiered Tables === */
.table-tier-header {
    background: var(--bg-surface-3) !important;
    pointer-events: none;
    border-bottom: 2px solid var(--border-subtle);
}

.table-tier-header td {
    font-size: var(--text-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 16px !important;
    color: var(--text-tertiary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Tier Specific Styles - Premium Accents */
.table-tier-header.tier1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), rgba(255, 215, 0, 0.05) 50%, transparent) !important;
    border-bottom: 2px solid #ffd700 !important;
    box-shadow: inset 0 -10px 20px -10px rgba(255, 215, 0, 0.1);
}
.table-tier-header.tier1 td { 
    color: #ffd700; 
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    font-weight: 800;
}

.table-tier-header.tier15 {
    background: linear-gradient(90deg, rgba(229, 228, 226, 0.1), rgba(229, 228, 226, 0.03) 50%, transparent) !important;
    border-bottom: 2px solid #a0a09a !important;
}
.table-tier-header.tier15 td { 
    color: #e5e4e2; 
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.table-tier-header.tier2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.08), transparent) !important;
    border-bottom: 2px solid #808080 !important;
}
.table-tier-header.tier2 td { color: #c0c0c0; }

.table-tier-header.tier3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.06), transparent) !important;
    border-bottom: 1px solid #cd7f32 !important;
}
.table-tier-header.tier3 td { color: #cd7f32; }

.table-tier-header.tier4 {
    background: linear-gradient(90deg, rgba(181, 105, 60, 0.06), transparent) !important;
    border-bottom: 1px solid #b5693c !important;
}
.table-tier-header.tier4 td { color: #b5693c; }

.table-tier-header.tier5 {
    background: linear-gradient(90deg, rgba(113, 123, 133, 0.06), transparent) !important;
    border-bottom: 1px solid #717b85 !important;
}
.table-tier-header.tier5 td { color: #717b85; }

/* Tier Row Accents */
.tier-row {
    transition: var(--transition-all);
}

.tier-row.tier1 { 
    border-left: 4px solid #ffd700; 
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.03), transparent 200px) !important;
}
.tier-row.tier15 { 
    border-left: 4px solid #a0a09a; 
    background: linear-gradient(90deg, rgba(229, 228, 226, 0.03), transparent 200px) !important;
}
.tier-row.tier2 { 
    border-left: 3px solid #808080; 
}
.tier-row.tier3 { 
    border-left: 3px solid #cd7f32; 
}
.tier-row.tier4 { 
    border-left: 3px solid #b5693c; 
}
.tier-row.tier5 { 
    border-left: 3px solid #717b85; 
}

.tier-row:hover {
    background: var(--bg-hover) !important;
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.tier-row.tier1:hover {
    box-shadow: inset 4px 0 15px -4px rgba(255, 215, 0, 0.2), var(--shadow-lg);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.06), var(--bg-hover)) !important;
}

.tier-row.tier15:hover {
    box-shadow: inset 4px 0 15px -4px rgba(229, 228, 226, 0.15), var(--shadow-md);
    background: linear-gradient(90deg, rgba(229, 228, 226, 0.05), var(--bg-hover)) !important;
}


/* === Transfer Timeline === */
.transfer-timeline {
    position: relative;
    padding: 20px 0 20px 30px;
    margin-top: 20px;
}

.transfer-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-hover), transparent);
    border-radius: var(--radius-full);
}

.transfer-card {
    position: relative;
    margin-bottom: 24px;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-all);
}

.transfer-card:hover {
    transform: translateX(8px);
    background: var(--bg-surface-raised);
    border-color: var(--accent-subtle);
    box-shadow: var(--shadow-md), 0 0 15px var(--accent-glow);
}

.transfer-card::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 22px;
    width: 12px;
    height: 12px;
    background: var(--accent-gradient);
    border-radius: 50%;
    border: 3px solid var(--bg-body);
    z-index: 2;
    box-shadow: 0 0 8px var(--accent-glow);
}

.transfer-card__date {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.transfer-card__content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.transfer-card__path {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.transfer-card__from, .transfer-card__to {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
}

.transfer-card__from {
    color: var(--text-secondary);
    font-weight: 500;
}

.transfer-card__arrow {
    color: var(--accent);
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 0 8px var(--accent-glow);
}

.transfer-card__debut {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.transfer-card__debut::before {
    content: '🎉';
    font-size: 20px;
}

/* === Tabs === */
.tabs-container {
    border-bottom: 1px solid var(--border-subtle);
}

.tabs {
    display: flex;
    gap: 24px;
}

.tabs__item {
    position: relative;
    padding: 12px 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-colors);
}

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

.tabs__item.active {
    color: var(--accent);
}

.tabs__item.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-subtle);
}

/* === Team Transfer Explorer === */
.tab-content {
    display: none;
    animation: fadeIn var(--duration-normal) var(--ease-out);
}

.tab-content.active {
    display: block;
}

.card--search-container {
    background: var(--bg-surface-2);
    border-color: var(--border-default);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    right: 16px;
    color: var(--text-tertiary);
    font-size: 18px;
    pointer-events: none;
}

#team-search {
    padding-right: 48px;
    height: 52px;
    font-size: var(--text-md);
    border-radius: var(--radius-lg);
    background: var(--bg-body);
}

.card--team-item {
    transition: var(--transition-all);
    border: 1px solid var(--border-subtle);
}

.card--team-item:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface-raised);
}

.mini-transfer-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: var(--transition-all);
}

.mini-transfer-card:hover {
    border-color: var(--border-default);
    background: var(--bg-surface-2);
}

.mini-transfer-card__info {
    flex: 1;
}

.mini-transfer-card__line {
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    border-radius: 0 4px 4px 0;
}

.team-header-simple {
    padding: 24px;
    background: linear-gradient(to right, var(--accent-subtle), transparent);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent);
}

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

/* === Transfer Arrow Animation === */
.transfer-arrow-animated {
    display: inline-block;
    position: relative;
    width: 24px;
    height: 24px;
}

.transfer-arrow-animated svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: absolute;
    left: 0;
    top: 0;
    animation: arrowFly 1.5s ease-in-out infinite;
}

@keyframes arrowFly {
    0% { transform: translateX(-4px); opacity: 0.2; }
    50% { transform: translateX(2px); opacity: 1; }
    100% { transform: translateX(6px); opacity: 0; }
}

/* === Free Agent Ghost SVG === */
.free-agent-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface-3);
    color: var(--text-tertiary);
    border: 1px dashed var(--border-subtle);
}

.free-agent-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    opacity: 0.6;
}

.team-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* === Hero Section === */
.hero {
    position: relative;
    border-radius: var(--radius-2xl);
    padding: 48px;
    overflow: hidden;
    background: #0f121d;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 320px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.1), transparent);
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero__title {
    font-size: var(--text-4xl);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero__desc {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

.hero__actions {
    display: flex;
    gap: 12px;
}

/* === Enhanced Cards (Glassmorphism) === */
.stat-card--glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card--glass:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(99, 102, 241, 0.1);
}

.stat-card--glass .stat-card__icon {
    transition: transform 0.3s ease;
}

.stat-card--glass:hover .stat-card__icon {
    transform: scale(1.1) rotate(5deg);
}

/* === Player Form & Performance === */
.player-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.player-form-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-surface-3);
    position: relative;
}

.player-form-dot--win {
    background: var(--win-color);
    box-shadow: 0 0 8px var(--win-glow);
}

.player-form-dot--loss {
    background: var(--loss-color);
}

.player-form-dot--draw {
    background: var(--text-tertiary);
}

/* === Radar Chart (SVG Based) === */
.radar-chart-container {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.radar-grid-line {
    fill: none;
    stroke: var(--border-subtle);
    stroke-width: 1;
}

.radar-axis {
    stroke: var(--border-subtle);
    stroke-width: 1;
}

.radar-area {
    fill: rgba(255, 255, 255, 0.2);
    fill-opacity: 0.6;
    stroke: #fff;
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.radar-label {
    font-size: 11px;
    font-weight: 900;
    fill: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Mini Stat Cards (Dashboard Style in Profiles) === */
.mini-stat-card {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    transition: var(--transition-all);
}

.mini-stat-card:hover {
    background: var(--bg-surface-raised);
    border-color: var(--accent-subtle);
    transform: translateY(-2px);
}

.mini-stat-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mini-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

/* ====== Loading Overlay ====== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal) var(--ease-out),
        visibility var(--duration-normal);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

.loading-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}
