/* TecnoCric Ultra-Compact 20-Team Auction Controller Layout */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #1769d2;
    --primary-dark: #082a72;
    --brand-gradient: linear-gradient(110deg, #06183f 0%, #082a72 68%, #0a3a8f 100%);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --dark: #08152f;
    --light: #f4f7fb;
    --card-bg: #ffffff;
    --line: #dfe7f2;
    --muted: #64748b;
    --shadow: 0 4px 16px rgba(8,28,65,0.06);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.3;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 70px;
}

button, input, select { font-family: inherit; }

/* NAVBAR */
.navbar {
    background: var(--brand-gradient);
    color: white;
    padding: 8px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(6, 24, 63, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 52px;
}

.navbar-left { display: flex; align-items: center; gap: 12px; }
.navbar-brand { 
    font-family: 'Space Grotesk', sans-serif; 
    font-size: 1.25rem; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.navbar-brand i { color: #55b8ff; }
.auction-tag { font-size: 0.75rem; opacity: 0.85; font-weight: 500; background: rgba(255,255,255,0.15); padding: 2px 8px; border-radius: 4px; }

.nav-select { padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: #fff; font-size: 0.8rem; outline: none; }
.nav-select option { background: var(--dark); color: #fff; }

.wa-lang-wrapper { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; }
.nav-select-sm { padding: 3px 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: #fff; font-size: 0.75rem; }

.btn-danger-reset {
    background: rgba(220, 38, 38, 0.18); color: #fecaca; font-size: 0.7rem; padding: 4px 9px;
    border-radius: 5px; font-weight: 700; border: 1px solid rgba(252, 165, 165, 0.3);
    cursor: pointer; display: flex; align-items: center; gap: 4px; transition: 0.2s;
}
.btn-danger-reset:hover { background: var(--danger); color: white; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a, .btn-stats-toggle { 
    color: #d7e4f7; text-decoration: none; font-weight: 600; font-size: 0.78rem; 
    padding: 5px 9px; border-radius: 6px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.nav-links a:hover, .btn-stats-toggle:hover { color: white; background: rgba(255,255,255,0.1); }
.btn-reset-unsold { background: #dc2626 !important; color: white !important; }
.logout-link { color: #fca5a5 !important; }

/* STATS OVERVIEW PANEL */
.auction-overview { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px; display: none; }
.auction-overview.open { display: block; }
.overview-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.overview-eyebrow { font-size: 0.65rem; font-weight: 700; color: var(--primary); letter-spacing: 0.05em; }
.overview-heading h2 { font-size: 1.1rem; font-family: 'Space Grotesk', sans-serif; }
.overview-actions { display: flex; gap: 8px; }
.overview-refresh { background: var(--light); border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; cursor: pointer; }
.overview-stats { display: flex; gap: 15px; margin-bottom: 10px; flex-wrap: wrap; }
.overview-stat { background: var(--light); padding: 8px 14px; border-radius: 8px; flex: 1; min-width: 110px; border: 1px solid var(--line); }
.overview-stat span { display: block; font-size: 0.7rem; color: var(--muted); }
.overview-stat strong { font-size: 1.1rem; font-family: 'Space Grotesk', sans-serif; }
.overview-stat small { display: block; font-size: 0.65rem; color: var(--muted); }
.progress-area { margin-top: 5px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 4px; }
.progress-track { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width 0.3s; }
.progress-foot { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); margin-top: 3px; }

/* MAIN CONTAINER GRID */
.main-container {
    display: grid; 
    grid-template-columns: 290px 1fr; 
    gap: 12px;
    padding: 10px 14px; 
    align-items: start;
    max-width: 100vw;
}

/* SIDEBAR */
.player-sidebar {
    background: var(--card-bg); 
    border-radius: 12px; 
    padding: 12px;
    box-shadow: var(--shadow); 
    border: 1px solid var(--line);
    display: flex; 
    flex-direction: column;
    height: calc(100vh - 74px);
    overflow-y: auto;
    position: relative;
}

/* SEARCH WRAPPER */
.search-wrapper { position: relative; margin-bottom: 10px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.8rem; }
#searchBox {
    width: 100%; padding: 8px 30px 8px 28px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 0.85rem; background: #fff; color: var(--dark); outline: none; transition: 0.2s;
}
#searchBox:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(23,105,210,0.12); }
.search-clear-btn {
    position: absolute; right: 42px; top: 50%; transform: translateY(-50%); background: none; border: none;
    font-size: 1.1rem; color: var(--muted); cursor: pointer; display: none; line-height: 1;
}
.search-hint { 
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%); 
    font-size: 0.65rem; color: var(--primary); background: #edf5ff; padding: 2px 5px; border-radius: 4px; border: 1px solid #cfe5fb;
}

.suggestions {
    position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--line); border-radius: 8px;
    max-height: 280px; overflow-y: auto; z-index: 2500; box-shadow: 0 10px 25px rgba(8,28,65,0.15); margin-top: 4px;
}
.suggestion-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f1f5f9; display: flex; flex-direction: column; gap: 2px; }
.suggestion-item:hover, .suggestion-item.kbd-active { background: #edf5ff; }
.sugg-header { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.8rem; color: var(--dark); }
.sugg-price { font-family: 'Space Grotesk', sans-serif; color: var(--primary); }
.sugg-meta { display: flex; justify-content: space-between; font-size: 0.7rem; align-items: center; }

.status-badge { padding: 2px 6px; border-radius: 4px; font-weight: 700; font-size: 0.65rem; text-transform: uppercase; }
.bg-success { background: #dcfce7; color: #166534; }
.bg-danger { background: #fee2e2; color: #991b1b; }
.bg-primary { background: #dbeafe; color: #1e40af; }

/* SELECTION TOOLS */
.selection-tools { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.selection-tools-heading { font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; }
.selection-mode-switch { display: flex; gap: 4px; margin-bottom: 6px; }
.mode-btn { flex: 1; padding: 4px; font-size: 0.72rem; border-radius: 5px; border: 1px solid var(--line); background: white; cursor: pointer; font-weight: 600; }
.mode-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.selection-actions { display: flex; gap: 6px; }
.pick-random-btn, .next-player-btn { flex: 1; padding: 6px; border-radius: 6px; border: 1px solid var(--line); font-size: 0.75rem; font-weight: 700; cursor: pointer; background: white; }
.pick-random-btn:hover, .next-player-btn:hover { background: #edf5ff; color: var(--primary); }

/* PLAYER PHOTO & INFO */
.player-photo-wrapper {
    width: 100%; height: 160px; background: #f8fafc; border-radius: 8px;
    overflow: hidden; margin-bottom: 8px; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
}
.player-photo { width: 100%; height: 100%; object-fit: contain; }
.empty-state { text-align: center; color: var(--muted); font-size: 0.75rem; }
.empty-state i { font-size: 2.5rem; margin-bottom: 4px; opacity: 0.3; }

.player-serial { font-size: 0.7rem; font-weight: 700; color: var(--primary); text-align: center; letter-spacing: 0.05em; }
.player-name { font-size: 1.15rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; text-align: center; margin-bottom: 6px; color: var(--dark); line-height: 1.2; }
.player-meta { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.badge { padding: 3px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; }
.badge-role { background: #edf5ff; color: var(--primary); }
.badge-address { background: #eef2ff; color: #4f46e5; }

/* BID DASHBOARD */
.bid-dashboard {
    background: #f7faff; border-radius: 10px; padding: 10px; text-align: center;
    border: 1px solid var(--line); margin-top: auto;
}
.bid-label { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.current-bid-display { font-size: 1.8rem; font-weight: 800; color: var(--primary); font-family: 'Space Grotesk', sans-serif; line-height: 1.1; margin: 2px 0; }
.current-holder { font-size: 0.85rem; font-weight: 700; color: var(--dark); min-height: 1.2rem; }
.base-price-info { font-size: 0.72rem; color: var(--muted); margin-bottom: 8px; }

.custom-bid-wrapper { display: flex; gap: 6px; margin-bottom: 8px; }
#customBidInput { flex: 1; padding: 6px; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; text-align: center; font-size: 0.88rem; outline: none; }
.btn-custom-set { background: var(--primary-dark); color: white; border: none; padding: 0 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.btn-custom-set:hover { background: var(--primary); }

.special-assign-row { display: flex; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.btn-assign { flex: 1; padding: 5px; border-radius: 6px; font-size: 0.68rem; font-weight: 700; cursor: pointer; border: 1px solid; background: white; }
.btn-assign-captain { border-color: var(--primary); color: var(--primary); }
.btn-assign-captain:hover { background: var(--primary); color: white; }
.btn-assign-icon { border-color: var(--warning); color: var(--warning); }
.btn-assign-icon:hover { background: var(--warning); color: white; }

/* STATUS BANNERS */
.status-banner { border-radius: 10px; padding: 12px; text-align: center; margin-top: auto; border: 1px solid; }
.banner-sold { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.banner-unsold { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.banner-title { font-weight: 800; text-transform: uppercase; font-size: 0.8rem; margin-top: 4px; }
.banner-team { font-size: 1rem; font-weight: 700; }
.banner-price { font-size: 1.4rem; font-weight: 800; font-family: 'Space Grotesk', sans-serif; margin: 4px 0; }
.action-buttons { display: flex; gap: 6px; margin-top: 8px; }
.btn-outline { flex: 1; padding: 6px; border-radius: 6px; font-weight: 700; font-size: 0.72rem; cursor: pointer; background: white; border: 1px solid; }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-outline-warning { border-color: var(--warning); color: var(--warning); }
.btn-outline-warning:hover { background: var(--warning); color: white; }

/* ================= TEAMS GRID (20 TEAMS COMPACT VIEW) ================= */
.team-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* 5 columns x 4 rows = 20 cards */
    gap: 8px;
    align-content: start;
}

.team-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 88px;
    box-shadow: var(--shadow);
}

.team-card:hover {
    transform: translateY(-2px);
    border-color: #b8d8f5;
    box-shadow: 0 6px 16px rgba(8,28,65,0.1);
}

/* Leading Team Glow */
.team-card.highest {
    border: 2px solid var(--success) !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
    background: #f0fdf4 !important;
}
.team-card.highest::after {
    content: 'LEADING';
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--success);
    color: white;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.key-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #edf5ff;
    color: var(--primary);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid #cfe5fb;
    line-height: 1;
}

.team-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px; /* clearance for key badge */
}

.team-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    border: 1px solid var(--line);
    background: #f8fafc;
    flex-shrink: 0;
}

.team-info { flex: 1; min-width: 0; }
.team-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.team-squad {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 600;
}

.team-card-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid #f1f5f9;
    gap: 4px;
}

.stat-box { display: flex; flex-direction: column; }
.stat-lbl { font-size: 0.58rem; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; }
.stat-val { font-size: 0.78rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: var(--dark); white-space: nowrap; }

.stat-box-max { text-align: right; }
.stat-box-max .stat-lbl { color: var(--primary); }
.stat-box-max .stat-val { color: var(--primary); }

.team-card.disabled {
    opacity: 0.45;
    filter: grayscale(0.8);
    pointer-events: none;
    background: #f1f5f9 !important;
    border: 1px dashed #cbd5e1;
}

/* BOTTOM ACTION BAR */
.bottom-action-bar {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #06183f;
    padding: 6px 14px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(6, 24, 63, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    border: 1px solid rgba(255,255,255,0.15);
}

.bar-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); }

.btn-action {
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.18s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.btn-sold { background: var(--success); color: white; }
.btn-sold:hover { background: #15803d; transform: translateY(-1px); }
.btn-unsold { background: var(--danger); color: white; }
.btn-unsold:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-util { background: rgba(255,255,255,0.15); color: white; }
.btn-util:hover { background: rgba(255,255,255,0.25); }
.btn-screen { background: var(--primary); }

.shortcut-hint {
    font-size: 0.6rem;
    opacity: 0.75;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 1px 4px;
    border-radius: 3px;
}

/* MODALS */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(8, 21, 47, 0.65); backdrop-filter: blur(4px);
    z-index: 3000; display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: white; padding: 22px; border-radius: 14px; width: 380px; max-width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25); border: 1px solid var(--line);
}
.modal-title { font-size: 1.2rem; font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: 600; font-size: 0.8rem; margin-bottom: 4px; color: var(--muted); }
.form-control { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.9rem; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.btn-cancel { flex: 1; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: white; font-weight: 700; cursor: pointer; }
.btn-ok { flex: 1; padding: 8px; border-radius: 6px; border: none; background: var(--primary); color: white; font-weight: 700; cursor: pointer; }
.btn-ok.danger { background: var(--danger); }
.modal-hint { font-size: 0.7rem; color: var(--muted); text-align: center; margin-top: 10px; }

/* TOASTS */
#toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; }
.toast {
    background: white; color: var(--dark); padding: 10px 16px; border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12); margin-bottom: 10px; font-weight: 600; font-size: 0.82rem;
    display: flex; align-items: center; gap: 8px; border-left: 4px solid var(--primary); min-width: 250px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1500px) {
    .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
    .main-container { grid-template-columns: 260px 1fr; }
    .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
    .main-container { grid-template-columns: 1fr; }
    .player-sidebar { height: auto; }
    .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 500px) {
    .team-grid { grid-template-columns: 1fr; }
    .shortcut-hint { display: none; }
}


/* ==========================================================
   TECNOCRIC CONTROLLER — READABILITY & ACCESSIBILITY PATCH
   Keeps existing HTML/JS selectors and auction behavior intact.
   ========================================================== */

:root {
    --primary: #1557b0;
    --primary-dark: #103b78;
    --brand-gradient: linear-gradient(110deg, #071b43 0%, #0b2d67 100%);
    --dark: #10213d;
    --light: #eef3f9;
    --card-bg: #ffffff;
    --line: #cbd7e6;
    --muted: #52647d;
    --shadow: 0 2px 8px rgba(16, 33, 61, 0.08);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    color: var(--dark);
    background: #edf2f8;
    line-height: 1.45;
    font-size: 15px;
    padding-bottom: 84px;
}

button, input, select {
    font-size: inherit;
}

button {
    min-height: 36px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.team-card:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

/* Header: stronger contrast and prevent controls from becoming cramped. */
.navbar {
    position: sticky;
    top: 0;
    min-height: 58px;
    height: auto;
    padding: 8px 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.navbar-brand {
    font-size: 1.2rem;
    white-space: nowrap;
}

.auction-tag {
    font-size: 0.78rem;
    line-height: 1.35;
    max-width: 250px;
}

.nav-select,
.nav-select-sm {
    min-height: 36px;
    padding: 6px 10px;
    background: #ffffff;
    color: #10213d;
    border: 1px solid #b9c9dd;
    font-size: 0.85rem;
}

.nav-select option,
.nav-select-sm option {
    color: #10213d;
    background: #ffffff;
}

.wa-lang-wrapper {
    gap: 8px;
    font-size: 0.82rem;
}

.nav-links {
    gap: 4px;
    flex-wrap: wrap;
}

.nav-links a,
.btn-stats-toggle {
    min-height: 36px;
    padding: 8px 10px;
    color: #f4f7ff;
    font-size: 0.84rem;
    white-space: nowrap;
}

.btn-danger-reset {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.78rem;
    color: #ffffff;
    background: #b91c1c;
    border-color: #fecaca;
}

/* Main split: a little more room for the player controls. */
.main-container {
    grid-template-columns: minmax(290px, 320px) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
}

.player-sidebar {
    height: calc(100vh - 86px);
    min-height: 620px;
    padding: 14px;
    border-radius: 10px;
    border-color: #cbd7e6;
    box-shadow: 0 2px 10px rgba(16, 33, 61, 0.07);
}

.search-wrapper {
    margin-bottom: 14px;
}

#searchBox {
    min-height: 42px;
    padding: 9px 38px 9px 34px;
    border: 1px solid #b9c9dd;
    border-radius: 7px;
    color: #10213d;
    font-size: 0.95rem;
}

#searchBox::placeholder {
    color: #65758c;
    opacity: 1;
}

.search-hint {
    color: #124b98;
    background: #e8f1ff;
    border-color: #b9d2f5;
    font-size: 0.7rem;
}

.suggestions {
    border-color: #b9c9dd;
    border-radius: 7px;
}

.suggestion-item {
    padding: 10px 12px;
}

.sugg-header {
    font-size: 0.9rem;
}

.sugg-meta {
    font-size: 0.78rem;
    color: #52647d;
}

/* Selection panel: clearer labels and larger click targets. */
.selection-tools {
    padding: 11px;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #f4f7fb;
}

.selection-tools-heading {
    font-size: 0.82rem;
    color: #334761;
    font-weight: 700;
    margin-bottom: 8px;
}

.mode-btn {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.84rem;
}

.mode-btn.active {
    background: #1557b0;
    color: #ffffff;
}

.pick-random-btn,
.next-player-btn {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.84rem;
}

.search-hint,
.shortcut-hint,
.key-badge {
    font-weight: 700;
}

/* Player panel: make the name and auction amount the visual priority. */
.player-photo-wrapper {
    height: clamp(170px, 23vh, 230px);
    background: #f1f5f9;
    border: 1px solid #cbd7e6;
    border-radius: 7px;
}

.empty-state {
    font-size: 0.86rem;
    color: #52647d;
}

.player-serial {
    font-size: 0.78rem;
    color: #1557b0;
}

.player-name {
    font-size: clamp(1.2rem, 1.5vw, 1.55rem);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.player-meta {
    gap: 7px;
}

.badge {
    padding: 5px 9px;
    font-size: 0.74rem;
}

.bid-dashboard {
    padding: 13px;
    margin-top: 14px;
    background: #f2f7ff;
    border: 1px solid #c5d7ef;
    border-radius: 8px;
}

.bid-label {
    font-size: 0.76rem;
    color: #52647d;
}

.current-bid-display {
    font-size: clamp(2rem, 2.6vw, 2.5rem);
    color: #124b98;
    line-height: 1.2;
}

.current-holder {
    font-size: 0.95rem;
    line-height: 1.35;
}

.base-price-info {
    font-size: 0.82rem;
    color: #52647d;
}

#customBidInput {
    min-height: 40px;
    font-size: 1rem;
    border-color: #b9c9dd;
}

.btn-custom-set,
.btn-assign,
.btn-outline {
    min-height: 38px;
    font-size: 0.8rem;
}

.status-banner {
    border-radius: 8px;
}

/* Team cards: remove pastel wash, increase text contrast and make stats legible. */
.team-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.team-card {
    min-height: 150px;
    padding: 11px;
    border: 1px solid #cbd7e6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(16, 33, 61, 0.06);
    color: #10213d;
}

.team-card:hover {
    transform: translateY(-1px);
    border-color: #8eadd4;
    box-shadow: 0 4px 12px rgba(16, 33, 61, 0.10);
}

.team-card.highest {
    border: 2px solid #16803d !important;
    background: #f0fdf4 !important;
    box-shadow: none;
}

.team-card.highest::after {
    top: 7px;
    right: 7px;
    font-size: 0.62rem;
    padding: 3px 6px;
}

.key-badge {
    top: 7px;
    left: 7px;
    padding: 3px 5px;
    font-size: 0.68rem;
    line-height: 1.1;
    color: #124b98;
    background: #eaf2ff;
    border-color: #bfd4f1;
}

.team-card-header {
    gap: 9px;
    margin-top: 19px;
    min-width: 0;
}

.team-logo {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    border: 1px solid #d5dfeb;
    background: #f8fafc;
}

.team-info {
    min-width: 0;
}

.team-name {
    color: #10213d;
    font-size: 0.9rem;
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.team-squad {
    margin-top: 2px;
    color: #52647d;
    font-size: 0.78rem;
    line-height: 1.3;
}

.team-card-stats {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e1e8f0;
}

.stat-box {
    min-width: 0;
}

.stat-lbl {
    color: #52647d;
    font-size: 0.68rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.stat-val {
    color: #10213d;
    font-size: 0.9rem;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}

.stat-box-max {
    text-align: right;
}

.stat-box-max .stat-lbl,
.stat-box-max .stat-val {
    color: #124b98;
}

.team-card.disabled {
    opacity: 0.62;
    filter: grayscale(0.35);
}

/* Bottom controls: keep labels readable and allow wrapping on narrow screens. */
.bottom-action-bar {
    max-width: calc(100vw - 24px);
    padding: 8px 12px;
    gap: 7px;
    border-radius: 10px;
    flex-wrap: wrap;
    justify-content: center;
    background: #071b43;
}

.btn-action {
    min-height: 40px;
    padding: 9px 13px;
    border-radius: 6px;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.shortcut-hint {
    font-size: 0.68rem;
}

/* Dialogs and feedback: stronger text contrast. */
.modal-overlay {
    background: rgba(8, 21, 47, 0.72);
    backdrop-filter: none;
}

.modal-content {
    border-radius: 9px;
}

.modal-title {
    color: #10213d;
}

.form-group label {
    color: #40536d;
}

.form-control {
    min-height: 40px;
    border-color: #b9c9dd;
    color: #10213d;
}

.modal-hint {
    font-size: 0.78rem;
}

.toast {
    color: #10213d;
    font-size: 0.9rem;
}

/* Responsive layouts */
@media (max-width: 1500px) {
    .team-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .navbar {
        position: relative;
    }

    .main-container {
        grid-template-columns: 270px minmax(0, 1fr);
    }

    .team-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .team-card {
        min-height: 145px;
    }
}

@media (max-width: 850px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .player-sidebar {
        height: auto;
        min-height: 0;
    }

    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .navbar {
        align-items: flex-start;
    }

    .nav-links {
        width: 100%;
    }

    .bottom-action-bar {
        bottom: 8px;
        width: calc(100vw - 16px);
    }
}

@media (max-width: 520px) {
    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-card {
        min-height: 130px;
    }

    .navbar {
        padding: 10px;
    }

    .auction-tag {
        max-width: 180px;
    }

    .btn-action {
        flex: 1 1 auto;
        justify-content: center;
    }

    .shortcut-hint {
        display: none;
    }
}

/* Respect reduced-motion settings. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
