/* ==================================
   ADVANCED DARK THEME - CYBER STYLE
   ================================== */
:root {
    --primary: #00D9FF;
    --primary-bright: #00F0FF;
    --primary-dark: #00A8CC;
    --accent: #3B7B89;
    --accent-bright: #5DBCC7;
    --bg-main: #060A12;
    --bg-secondary: #0A0E1A;
    --bg-card: #0F1420;
    --bg-elevated: #151B2B;
    --bg-hover: #1A2236;
    --border: rgba(0, 217, 255, 0.2);
    --border-bright: rgba(0, 217, 255, 0.4);
    --border-glow: rgba(0, 217, 255, 0.6);
    --text-primary: #E8F0F2;
    --text-secondary: #A0B4C0;
    --text-muted: #6B7C8A;
    --success: #00FF88;
    --warning: #FFB800;
    --danger: #FF3366;
    --glow-sm: 0 0 10px rgba(0, 217, 255, 0.3);
    --glow-md: 0 0 20px rgba(0, 217, 255, 0.4);
    --glow-lg: 0 0 30px rgba(0, 217, 255, 0.5);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-elevated: 0 12px 48px rgba(0, 0, 0, 0.8);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background effects */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 217, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 20%, rgba(0, 217, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(59, 123, 137, 0.12) 0%, transparent 40%);
    z-index: 0;
    pointer-events: none;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Header */
.header {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--border);
    padding: var(--space-lg) var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.header-content {
    max-width: 1900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xl);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo-container {
    position: relative;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(var(--glow-md));
}

.logo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, var(--primary), transparent 70%);
    border-radius: 50%;
    animation: logoPulse 3s ease-in-out infinite;
    opacity: 0.3;
    z-index: 1;
}

@keyframes logoPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.2; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.4; }
}

.header-text h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.year-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--bg-main);
    padding: 0.2rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-left: 0.5rem;
    box-shadow: var(--glow-md);
}

.subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.subtitle-divider {
    color: var(--primary);
    opacity: 0.5;
}

.global-stats {
    display: flex;
    gap: var(--space-md);
}

.stat-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 120px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--border-bright);
    box-shadow: var(--glow-md);
}

.stat-icon {
    font-size: 1.8rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: var(--glow-sm);
}

.stat-available {
    color: var(--success);
}

.stat-bids {
    color: var(--warning);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.stat-pulse {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0.5;
}

/* Main Container */
.main-container {
    max-width: 1900px;
    margin: 0 auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    position: relative;
    z-index: 1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.title-icon {
    font-size: 2rem;
    filter: drop-shadow(var(--glow-md));
}

.section-title h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.title-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--border-bright), transparent);
}

/* ==================================
   CAPTAINS TABLE LAYOUT
   ================================== */
.captains-table-wrapper {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.captains-table {
    width: 100%;
    border-collapse: collapse;
}

/* Top Row - Captain Info */
.captains-table thead tr {
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-secondary));
}

.captain-col {
    width: 25%;
    padding: var(--space-lg);
    border-right: 2px solid var(--border);
    vertical-align: top;
}

.captain-col:last-child {
    border-right: none;
}

.captain-header-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
}

.captain-avatar-mini {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--bg-main);
    box-shadow: var(--glow-md);
}

.captain-name-mini {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    margin: 0;
}

.captain-stats-mini {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.stat-mini strong {
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 700;
}

/* Bottom Row - Team Members */
.team-col {
    width: 25%;
    padding: 0;
    border-right: 2px solid var(--border);
    vertical-align: top;
    background: var(--bg-secondary);
}

.team-col:last-child {
    border-right: none;
}

.team-members-box {
    min-height: 350px;
    max-height: 350px;
    overflow-y: auto;
    padding: var(--space-md);
}

.team-members-box::-webkit-scrollbar {
    width: 6px;
}

.team-members-box::-webkit-scrollbar-track {
    background: var(--bg-main);
}

.team-members-box::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 3px;
}

.team-members-box::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.empty-team {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--space-xl);
    font-size: 0.9rem;
}

.team-member-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: itemSlideIn 0.4s ease forwards;
}

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

.team-member-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-bright);
    transform: translateX(4px);
}

.member-info-inline {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.member-number {
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-display);
    flex-shrink: 0;
}

.member-info-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bid-amount {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 217, 255, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-shadow: var(--glow-sm);
    flex-shrink: 0;
}

/* Export Button */
.action-btn {
    position: relative;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    overflow: hidden;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.action-btn:hover .btn-glow {
    left: 100%;
}

.action-btn:hover {
    background: var(--primary);
    color: var(--bg-main);
    border-color: var(--primary);
    box-shadow: var(--glow-lg);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.2rem;
}

.export-btn {
    margin-left: auto;
    background: linear-gradient(135deg, var(--accent), var(--accent-bright));
    border-color: var(--border-bright);
}

.export-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

/* Members Section */
.members-section {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-card);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
    max-height: 350px;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.members-grid::-webkit-scrollbar {
    width: 8px;
}

.members-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.members-grid::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 4px;
}

.members-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.member-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.member-card:hover::before {
    transform: scaleX(1);
}

.member-card:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3);
    transform: translateY(-6px);
}

.member-card.selected {
    background: rgba(0, 217, 255, 0.05);
    border-color: rgba(0, 217, 255, 0.3);
    opacity: 0.5;
    pointer-events: none;
}

.member-card.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.3;
}

.member-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.member-status {
    font-size: 0.65rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-available {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.status-selected {
    background: rgba(0, 217, 255, 0.15);
    color: var(--primary);
    border: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 18, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border-bright);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-elevated), var(--glow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 217, 255, 0.1), transparent);
    pointer-events: none;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), transparent);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.1em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.close-btn:hover {
    background: var(--bg-hover);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.member-display {
    background: var(--bg-elevated);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-bright);
    text-align: center;
}

.member-display-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.member-display-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: var(--glow-md);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.custom-select,
.custom-input {
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.custom-select:focus,
.custom-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.2);
    background: var(--bg-elevated);
}

.bid-info {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.bid-info.error {
    background: rgba(255, 51, 102, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 51, 102, 0.3);
}

.bid-info.success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.modal-footer {
    padding: var(--space-xl);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    background: var(--bg-secondary);
}

.btn {
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
}

.btn-cancel {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-cancel:hover {
    background: var(--bg-hover);
    border-color: var(--border-bright);
}

.btn-confirm {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--bg-main);
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.4);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 217, 255, 0.6);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 2px solid var(--success);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    display: none;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 2000;
    min-width: 300px;
}

.toast.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    width: 36px;
    height: 36px;
    background: var(--success);
    color: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.toast-message {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--success);
    width: 100%;
    animation: toastProgress 3s linear;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ==================================
   PLAYER PHOTOS / AVATARS
   ================================== */
.player-avatar {
    position: relative;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: 2px solid var(--border-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Initials shown until a real photo loads */
.player-avatar-fallback {
    font-family: var(--font-display);
    font-weight: 900;
    color: var(--bg-main);
    letter-spacing: 0.02em;
    user-select: none;
}

.player-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.player-avatar-img.loaded {
    opacity: 1;
}

.avatar-lg {
    width: 128px;
    height: 128px;
    animation: avatarGlow 3s ease-in-out infinite;
}

.avatar-lg .player-avatar-fallback {
    font-size: 3rem;
}

.avatar-md {
    width: 88px;
    height: 88px;
    box-shadow: var(--glow-sm);
}

.avatar-md .player-avatar-fallback {
    font-size: 2rem;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    border-width: 1px;
}

.avatar-sm .player-avatar-fallback {
    font-size: 0.85rem;
}

@keyframes avatarGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(0, 217, 255, 0.35); }
    50%      { box-shadow: 0 0 26px rgba(0, 217, 255, 0.65); }
}

.member-card:hover .avatar-md {
    border-color: var(--primary);
    box-shadow: var(--glow-md);
    transform: scale(1.06);
}

/* Pick number sitting on the team-list avatar */
.member-avatar-rank {
    position: relative;
    flex-shrink: 0;
}

.member-rank-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-bright);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Photo + name header used by both modals */
.member-display.with-avatar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    text-align: left;
}

.member-display.with-avatar .member-display-text {
    min-width: 0;
}

.member-display-role {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-bright);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ==================================
   PLAYER STATS
   ================================== */

/* --- Compact stats on the player pool cards --- */
.member-card {
    gap: 0.4rem;
    justify-content: flex-start;
}

.member-expertise {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-card:hover .member-expertise {
    color: var(--accent-bright);
}

.member-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.member-exp-badge {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
}

/* --- Extra line inside a captain's team list --- */
.team-member-item {
    cursor: pointer;
}

.member-info-stack {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

/* Let the name/expertise block shrink so it truncates
   instead of sliding under the bid amount */
.team-member-item .member-info-inline {
    flex: 1;
    min-width: 0;
}

.team-member-item > div:last-child {
    flex-shrink: 0;
}

.member-info-stack .member-info-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-info-meta {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-item:hover .member-info-meta {
    color: var(--text-secondary);
}

/* --- Stats panel (bidding modal + stats modal) --- */
.player-stats-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.player-stats-panel:empty {
    display: none;
}

.stats-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.player-stat-tile {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all 0.3s ease;
}

.player-stat-tile:hover {
    border-color: var(--border-bright);
    box-shadow: var(--glow-sm);
}

.player-stat-icon {
    font-size: 1.2rem;
}

.player-stat-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.player-stat-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: var(--glow-sm);
}

.player-stat-label {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-block-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-block-value {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-bright);
    letter-spacing: 0.03em;
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.skill-chip {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
}

.skill-chip:hover {
    border-color: var(--border-bright);
    background: rgba(0, 217, 255, 0.15);
}

.skill-chip-empty {
    color: var(--text-muted);
    font-style: italic;
}

.rating-bar {
    height: 8px;
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    box-shadow: var(--glow-sm);
    border-radius: var(--radius-sm);
    transition: width 0.6s ease;
}

/* --- Stats modal extras --- */
.stats-team-tag {
    margin-top: var(--space-sm);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Keep taller modals usable on short screens */
.modal-content {
    max-height: 92vh;
    overflow-y: auto;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .global-stats {
        width: 100%;
        justify-content: center;
    }

    .member-display.with-avatar {
        flex-direction: column;
        text-align: center;
    }

    .member-display.with-avatar .member-display-text {
        text-align: center;
    }

    .player-stat-tile {
        flex-direction: column;
        gap: 0.2rem;
        text-align: center;
    }

    .player-stat-info {
        align-items: center;
    }
}

/* ==================================
   LIVE AUCTION STAGE
   Full-screen big-board bidding view
   ================================== */
.auction-stage {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 18, 0.94);
    backdrop-filter: blur(10px);
    z-index: 1500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.auction-stage.active {
    display: flex;
    opacity: 1;
}

.auction-inner {
    margin: auto;
    width: 100%;
    max-width: 1400px;
    max-height: 100vh;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-lg);
}

/* Everything except the bid history holds its size; the history is the
   one element allowed to shrink, so short screens lose log rows rather
   than pushing the SOLD button off the bottom. */
.auction-player,
.auction-bid-hero,
.auction-controls,
.auction-captains,
.auction-actions {
    flex-shrink: 0;
}

.auction-log-wrap {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Fixed, not absolute, so it stays pinned when the stage scrolls on
   shorter laptop screens. Hidden with the stage since the parent is display:none. */
.auction-close {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-xl);
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.auction-close:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* --- Player header --- */
.auction-player {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.auction-player-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.auction-player-name {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    text-transform: uppercase;
    line-height: 1.1;
}

.auction-player-role {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
}

.auction-player-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

.auction-chip {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.6rem;
}

/* --- The hero number --- */
.auction-bid-hero {
    text-align: center;
    background: var(--bg-card);
    border: 2px solid var(--border-bright);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card), var(--glow-md);
    padding: var(--space-lg) var(--space-xl);
}

.auction-bid-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.auction-bid-value {
    font-family: var(--font-display);
    /* Bounded by height as well as width so the whole stage still fits
       (SOLD included) on a 768px-tall laptop without scrolling. */
    font-size: clamp(3rem, min(13vw, 17vh), 10rem);
    font-weight: 900;
    line-height: 1;
    color: var(--primary);
    text-shadow: var(--glow-lg);
    letter-spacing: 0.02em;
    margin: 0.4rem 0;
}

.auction-bid-value.bid-pop {
    animation: bidPop 0.35s ease;
}

@keyframes bidPop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.12); text-shadow: 0 0 60px rgba(0, 217, 255, 0.9); }
    100% { transform: scale(1); }
}

.auction-leader {
    font-family: var(--font-display);
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.auction-leader.has-leader {
    color: var(--success);
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

/* --- Increment + custom amount --- */
.auction-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.auction-steps {
    display: flex;
    gap: var(--space-xs);
}

.auction-step-chip {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.auction-step-chip:hover {
    border-color: var(--border-bright);
    color: var(--text-primary);
}

.auction-step-chip.is-active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: var(--primary);
    color: var(--bg-main);
    box-shadow: var(--glow-sm);
}

.auction-custom {
    max-width: 220px;
    text-align: center;
}

/* --- Captain bid buttons --- */
.auction-captains {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.auction-captain-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg) var(--space-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.auction-captain-btn:not(:disabled):hover {
    border-color: var(--border-bright);
    box-shadow: var(--glow-md);
    transform: translateY(-2px);
}

.auction-captain-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.auction-captain-btn.is-leading {
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.35);
    opacity: 1;
}

.auction-captain-name {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    text-transform: uppercase;
}

.auction-captain-points {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.auction-captain-next {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-top: 0.2rem;
}

.auction-captain-btn.is-leading .auction-captain-next {
    color: var(--success);
}

/* --- Bid history --- */
.auction-log-wrap {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-md) var(--space-lg);
}

.auction-log-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.auction-log {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: var(--space-xs);
    flex: 1 1 auto;
    min-height: 34px;
    max-height: 140px;
    overflow-y: auto;
}

.auction-log::-webkit-scrollbar {
    width: 6px;
}

.auction-log::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.auction-log::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 3px;
}

.auction-log-empty {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

.auction-log-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.75rem;
    animation: itemSlideIn 0.3s ease backwards;
}

.auction-log-item.is-top {
    border-color: var(--success);
    background: rgba(0, 255, 136, 0.08);
}

.auction-log-captain {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.auction-log-item.is-top .auction-log-captain {
    color: var(--text-primary);
}

.auction-log-amount {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.auction-log-item.is-top .auction-log-amount {
    color: var(--success);
}

/* --- Actions --- */
.auction-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.btn-sold {
    background: linear-gradient(135deg, var(--success), #00b35f);
    color: var(--bg-main);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.4);
    padding: var(--space-md) 3rem;
    font-size: 1rem;
}

.btn-sold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 255, 136, 0.65);
}

/* The bidding modal footer now carries three buttons. Rather than let
   three fight over 456px, GO LIVE takes its own full-width row on top -
   it is the primary action during the event - with the original
   CANCEL / CONFIRM BID pair unchanged beneath it. */
.modal-footer {
    flex-wrap: wrap;
}

.modal-footer .btn-auction {
    flex: 1 1 100%;
    order: -1;
}

.btn-auction {
    background: var(--bg-elevated);
    color: var(--primary);
    border: 2px solid var(--border-bright);
}

.btn-auction:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    box-shadow: var(--glow-sm);
}

/* Short viewports (most laptops): compact the stage so the SOLD button
   stays on screen without scrolling. */
@media (max-height: 900px) {
    .auction-inner {
        padding: var(--space-md) var(--space-lg);
        gap: var(--space-sm);
    }

    .auction-bid-hero {
        padding: var(--space-sm) var(--space-lg);
    }

    .auction-bid-value {
        margin: 0.1rem 0;
    }

    .auction-player-chips {
        display: none;
    }

    .auction-captain-btn {
        padding: var(--space-sm) var(--space-xs);
    }

    .auction-log-wrap {
        padding: var(--space-xs) var(--space-md);
    }

    .auction-log {
        max-height: 74px;
    }

    .auction-close {
        top: var(--space-xs);
        right: var(--space-sm);
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
}

/* Very short screens: drop the avatar and tighten further, but keep the
   bid history visible - it is the whole point of the stage. */
@media (max-height: 700px) {
    .auction-player .player-avatar {
        display: none;
    }

    .auction-inner {
        padding: var(--space-sm) var(--space-lg);
        gap: var(--space-xs);
    }

    .auction-player-name {
        font-size: 1.7rem;
    }

    .auction-captain-btn {
        padding: var(--space-xs);
    }

    .auction-log {
        max-height: 40px;
    }
}

@media (max-width: 900px) {
    .auction-inner {
        padding: var(--space-lg) var(--space-md);
        gap: var(--space-md);
    }

    .auction-player {
        flex-direction: column;
        text-align: center;
    }

    .auction-player-chips {
        justify-content: center;
    }

    .auction-captains {
        grid-template-columns: repeat(2, 1fr);
    }

    .auction-close {
        top: var(--space-sm);
        right: var(--space-sm);
    }
}
