/* Auction Draft Board — a colorful, ESPN-cheat-sheet-style skin for the
   same live draft the plugin's admin board runs. Position colors are a
   fixed, deliberate palette (never reassigned/cycled): QB blue, RB orange,
   WR purple, TE teal, K green, DST red. */

.kml-draft-root {
    background: #000;
    color: #f8fafc;
    min-height: 60vh;
}

.kml-draft-loading, .kml-draft-empty {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 1rem;
}

/* ---- Header banner ---- */
.kml-draft-banner {
    text-align: center;
    padding: 22px 16px 16px;
    border-bottom: 1px solid #1f2937;
}

.kml-draft-banner h1 {
    font-family: var(--kml-heading-font);
    font-size: clamp(1.3rem, 3.4vw, 2.2rem);
    text-transform: uppercase;
    margin: 0 0 4px;
    color: #fff;
}

.kml-draft-banner h1 .kml-draft-status-live { color: #f59e0b; }
.kml-draft-banner h1 .kml-draft-status-done { color: #22c55e; }

.kml-draft-banner .kml-draft-sub {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 6px 0 0;
}

/* ---- Budget strip: all 12 managers, left to right, on-the-clock glow ---- */
.kml-draft-budgetstrip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 14px 16px;
    background: #000;
    border-bottom: 1px solid #1f2937;
}

.kml-budget-chip {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 8px 14px;
    min-width: 108px;
    text-align: center;
}

.kml-budget-chip .kml-budget-name {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kml-budget-chip .kml-budget-amt {
    display: block;
    font-family: var(--kml-heading-font);
    font-size: 1.15rem;
    color: #f8fafc;
    margin-top: 2px;
}

.kml-budget-chip.kml-mgr-onclock {
    position: relative;
    background: #3a2c05;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 0 16px rgba(245, 158, 11, 0.5);
}

.kml-budget-chip.kml-mgr-onclock .kml-budget-amt { color: #fbbf24; }

.kml-budget-chip.kml-mgr-onclock::before {
    content: "ON THE CLOCK";
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: #1a1305;
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ---- Toolbar ---- */
.kml-draft-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #1f2937;
    border-bottom: 1px solid #000;
    padding: 10px 16px;
}

.kml-draft-toolbar select,
.kml-draft-toolbar input[type="search"] {
    background: #111827;
    border: 1px solid #374151;
    color: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.kml-draft-toolbar input[type="search"] {
    flex: 1;
    min-width: 160px;
    font-weight: 400;
}

.kml-draft-toolbar .kml-draft-toolbar-spacer { flex: 1; }

.kml-draft-tabbtn {
    background: #111827;
    border: 1px solid #374151;
    color: #cbd5e1;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.kml-draft-tabbtn.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #1a1305;
}

/* ---- Section label ---- */
.kml-draft-section-label {
    text-align: center;
    padding: 18px 0 10px;
    font-family: var(--kml-heading-font);
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f8fafc;
    background: #000;
}

/* ---- Player card grid ---- */
.kml-draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 3px;
    background: #000;
    padding: 3px;
}

.kml-draft-card {
    padding: 12px 14px;
    cursor: pointer;
    position: relative;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: filter 0.1s;
}

.kml-draft-card:hover { filter: brightness(1.08); }
.kml-draft-card.is-readonly { cursor: default; }
.kml-draft-card.is-readonly:hover { filter: none; }

.kml-draft-card .kml-dc-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 4px;
    opacity: 0.85;
}

.kml-draft-card .kml-dc-pos {
    font-weight: 900;
}

.kml-draft-card .kml-dc-first {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.1;
}

.kml-draft-card .kml-dc-last {
    font-size: 1.15rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

/* Fixed, deliberate position palette — dark text on a light/mid-tone fill for legibility. */
.kml-pos-QB  { background: #4fc3f7; color: #0b1f2e; }
.kml-pos-RB  { background: #e0995c; color: #2e1a05; }
.kml-pos-WR  { background: #b48ee8; color: #240b3d; }
.kml-pos-TE  { background: #52b8ae; color: #052420; }
.kml-pos-K   { background: #7ed957; color: #10280a; }
.kml-pos-DST { background: #e05c5c; color: #330606; }

/* Roster-slot-only types (never appear on the Player Board, only in a Teams tab roster row). */
.kml-pos-FLEX  { background: #22c1de; color: #062730; }
.kml-pos-BENCH { background: #6b7280; color: #111827; }

/* ---- Teams tab: 12 across (the whole league at a glance on a shared screen), collapsing down as the viewport narrows. ---- */
.kml-draft-teams {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
    padding: 16px;
    background: #0b1220;
}

@media (max-width: 1500px) { .kml-draft-teams { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .kml-draft-teams { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .kml-draft-teams { grid-template-columns: repeat(1, minmax(0, 1fr)); } }

.kml-draft-team-card {
    background: #1e293b;
    border: 1px solid #263548;
    border-radius: 10px;
    padding: 10px;
    min-width: 0;
}

.kml-draft-team-card.kml-mgr-onclock {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 0 14px rgba(245, 158, 11, 0.4);
}

.kml-draft-team-card h3 {
    margin: 0 0 4px;
    font-family: var(--kml-heading-font);
    text-transform: uppercase;
    color: #fbbf24;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kml-draft-team-meta {
    color: #64748b;
    font-size: 0.65rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.kml-draft-roster-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 0;
    border-bottom: 1px solid #263548;
    font-size: 0.72rem;
}

.kml-draft-roster-row:last-child { border-bottom: none; }
.kml-draft-roster-row.kml-dr-emptyrow { opacity: 0.4; }

.kml-draft-roster-row .kml-dr-slot {
    display: inline-block;
    width: 26px;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 2px 0;
    border-radius: 4px;
}

.kml-draft-roster-row .kml-dr-name {
    flex: 1;
    min-width: 0;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kml-draft-roster-row .kml-dr-name.kml-dr-empty { color: #475569; font-style: italic; }
.kml-draft-roster-row .kml-dr-price { color: #fbbf24; font-weight: 700; flex-shrink: 0; }

/* ---- Pick modal ---- */
.kml-draft-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.kml-draft-modal {
    background: #111827;
    border: 1px solid #263548;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 380px;
}

.kml-draft-modal h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
    text-transform: none;
    font-family: var(--kml-body-font);
    font-weight: 800;
}

.kml-draft-modal .kml-dm-sub {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.kml-draft-modal label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin: 12px 0 4px;
}

.kml-draft-modal select,
.kml-draft-modal input {
    width: 100%;
    padding: 10px;
    background: #0b1220;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #f8fafc;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.kml-draft-modal .kml-dm-error {
    color: #fca5a5;
    font-size: 0.8rem;
    min-height: 18px;
    margin-top: 8px;
}

.kml-draft-modal .kml-dm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.kml-draft-modal button {
    padding: 9px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid #374151;
    background: #1f2937;
    color: #f8fafc;
}

.kml-draft-modal button.kml-dm-primary {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #1a1305;
}

@media (max-width: 640px) {
    .kml-draft-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .kml-draft-toolbar { justify-content: center; }
}
