/**
 * Likha Scorer styles
 * Scoped to .likha-scorer to avoid theme conflicts.
 */
.likha-scorer {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    font-size: 15px;
    line-height: 1.5;
    color: #222;
}

.likha-scorer * {
    box-sizing: border-box;
}

/* ===== Start screen ===== */
.likha-scorer .lk-start {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
}

.likha-scorer .lk-start-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px;
}

.likha-scorer .lk-start-hint {
    font-size: 13px;
    color: #666;
    margin: 0 0 20px;
}

.likha-scorer .lk-start-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.likha-scorer .lk-team-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: #fafafa;
    border: 1px solid #eee;
}

.likha-scorer .lk-team-label {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 0;
    text-align: center;
    border-radius: 6px;
}

.likha-scorer .lk-team-label.lk-team-1 { background: #e6f2fb; color: #1a5490; }
.likha-scorer .lk-team-label.lk-team-2 { background: #fbe9e7; color: #a1341f; }

.likha-scorer .lk-start-input {
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    width: 100%;
}

.likha-scorer .lk-start-input:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.2);
}

.likha-scorer .lk-suggest-label {
    font-size: 12px;
    color: #666;
    margin: 8px 0 8px;
}

.likha-scorer .lk-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 0 auto 20px;
    max-width: 320px;
}

.likha-scorer .lk-suggest-chip {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #d0d0d0;
    background: #f7f7f5;
    color: #333;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
}

.likha-scorer .lk-suggest-chip:hover,
.likha-scorer .lk-suggest-chip:active {
    background: #2b6cb0;
    color: #fff;
    border-color: #2b6cb0;
}

.likha-scorer .lk-start-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.likha-scorer .lk-start-btn:hover {
    background: #2c5282;
}

/* ===== Menu ===== */
.likha-scorer .lk-menu {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.likha-scorer .lk-menu button {
    flex: 1;
    min-width: 72px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #222;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.likha-scorer .lk-menu button:hover {
    background: #f5f5f5;
    border-color: #999;
}

.likha-scorer .lk-menu button.lk-btn-add {
    background: #2b6cb0;
    color: #fff;
    border-color: #2b6cb0;
}

.likha-scorer .lk-menu button.lk-btn-add:hover {
    background: #2c5282;
    border-color: #2c5282;
}

/* ===== Status banner ===== */
.likha-scorer .lk-status-banner {
    display: none;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}

.likha-scorer .lk-status-banner.lk-winner-t1 {
    background: #e6f2fb;
    color: #1a5490;
    border: 1px solid #bee3f8;
}

.likha-scorer .lk-status-banner.lk-winner-t2 {
    background: #fbe9e7;
    color: #a1341f;
    border: 1px solid #ffccbc;
}

.likha-scorer .lk-status-banner.lk-tiebreak {
    background: #fff8e1;
    color: #8a6d00;
    border: 1px solid #ffe082;
}

/* ===== Board ===== */
.likha-scorer .lk-board-wrap {
    width: 100%;
    margin-bottom: 16px;
}

.likha-scorer .lk-board {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

.likha-scorer .lk-board th,
.likha-scorer .lk-board td {
    padding: 9px 4px;
    text-align: center;
    border-bottom: 1px solid #eee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.likha-scorer .lk-board tbody td {
    color: #000;
    font-weight: 700;
    font-size: 16px;
}

.likha-scorer .lk-board thead th {
    font-weight: 700;
    font-size: 15px;
    border-bottom: 2px solid #d0d0d0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.likha-scorer .lk-board thead th.lk-col-rnd {
    color: #999;
    font-weight: 500;
}

.likha-scorer .lk-col-rnd {
    width: 28px;
    color: #999;
}

.likha-scorer .lk-board tbody tr {
    cursor: pointer;
}

.likha-scorer .lk-board tbody tr:hover {
    background: #fafafa;
}

.likha-scorer .lk-empty {
    padding: 24px !important;
    color: #999;
    text-align: center !important;
    font-style: italic;
    white-space: normal !important;
}

/* Team column tints (headers only — body uses solid black bold) */
.likha-scorer .lk-board thead th.lk-team-1 { background: #f0f7fc; color: #1a5490; }
.likha-scorer .lk-board thead th.lk-team-2 { background: #fdf4f2; color: #a1341f; }

/* Body cells: override any team tint with solid black bold */
.likha-scorer .lk-board tbody td.lk-team-1,
.likha-scorer .lk-board tbody td.lk-team-2 {
    color: #000;
}

/* Burn marker — the very cell where the player burned */
.likha-scorer .lk-burn-this {
    background: #ffebee !important;
    color: #c0392b !important;
    font-weight: 700;
}

/* Already burned on previous rounds */
.likha-scorer .lk-already-burned {
    color: #c0392b !important;
    font-weight: 700;
}

/* ===== Footer totals (sticky feel) ===== */
.likha-scorer .lk-board tfoot td {
    border-top: 2px solid #d0d0d0;
    border-bottom: none;
    font-weight: 700;
    font-size: 18px;
    color: #000;
    background: #f7f7f5;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.likha-scorer .lk-board tfoot .lk-team-1 { background: #e6f2fb; color: #000; }
.likha-scorer .lk-board tfoot .lk-team-2 { background: #fbe9e7; color: #000; }

.likha-scorer .lk-board tfoot .lk-burn-total {
    color: #c0392b !important;
}

/* ===== Modal ===== */
.likha-scorer .lk-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.likha-scorer .lk-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.likha-scorer .lk-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.likha-scorer .lk-modal-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
}

.likha-scorer .lk-modal-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.likha-scorer .lk-modal-row {
    display: grid;
    grid-template-columns: 1fr 90px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.likha-scorer .lk-modal-row.lk-team-1 { background: #f0f7fc; border-color: #d6e8f5; }
.likha-scorer .lk-modal-row.lk-team-2 { background: #fdf4f2; border-color: #f5d9d0; }

.likha-scorer .lk-modal-row label {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.likha-scorer .lk-team-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,0.08);
    letter-spacing: 0.05em;
}

.likha-scorer .lk-modal-row.lk-team-1 .lk-team-tag { background: #1a5490; color: #fff; }
.likha-scorer .lk-modal-row.lk-team-2 .lk-team-tag { background: #a1341f; color: #fff; }

.likha-scorer .lk-modal-row input[type=number] {
    padding: 9px 10px;
    font-size: 16px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    text-align: right;
    font-family: inherit;
    width: 100%;
    -moz-appearance: textfield;
}

.likha-scorer .lk-modal-row input[type=number]::-webkit-outer-spin-button,
.likha-scorer .lk-modal-row input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.likha-scorer .lk-modal-row input[type=number]:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.2);
}

.likha-scorer .lk-modal-sum {
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 8px;
    font-weight: 600;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 10px;
}

.likha-scorer .lk-modal-sum.ok {
    color: #2e7d32;
    background: #e8f5e9;
}

.likha-scorer .lk-modal-error {
    color: #c0392b;
    background: #fdf2f2;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
    border: 1px solid #fce4e4;
}

.likha-scorer .lk-modal-actions {
    display: flex;
    gap: 8px;
}

.likha-scorer .lk-modal-actions button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}

.likha-scorer .lk-modal-save {
    background: #2b6cb0 !important;
    color: #fff !important;
    border-color: #2b6cb0 !important;
}

.likha-scorer .lk-modal-save:hover {
    background: #2c5282 !important;
    border-color: #2c5282 !important;
}

.likha-scorer .lk-modal-delete {
    background: #fff !important;
    color: #c0392b !important;
    border-color: #c0392b !important;
}

.likha-scorer .lk-modal-cancel:hover {
    background: #f5f5f5;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .likha-scorer {
        margin-left: calc(50% - 50vw + 8px);
        margin-right: calc(50% - 50vw + 8px);
        max-width: none;
    }
}

@media (max-width: 480px) {
    .likha-scorer .lk-start-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .likha-scorer .lk-board {
        font-size: 14px;
    }
    .likha-scorer .lk-board th,
    .likha-scorer .lk-board td {
        padding: 10px 3px;
    }
    .likha-scorer .lk-board thead th {
        font-size: 15px;
    }
    .likha-scorer .lk-col-rnd {
        width: 26px;
    }
    .likha-scorer .lk-modal {
        padding: 4px;
    }
    .likha-scorer .lk-modal-content {
        padding: 14px 12px;
        max-width: 100%;
        max-height: 96vh;
    }
    .likha-scorer .lk-modal-row {
        grid-template-columns: 1fr 80px;
        gap: 8px;
    }
}
