/**
 * Boxscore — Phase 2 UI (game index + snapshot view)
 */

.boxscore-root {
    width: 100%;
    max-width: 100%;
}

.boxscore-pro-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ui-border, #2e2e2e);
}

.boxscore-pro-header .icon-title h3 {
    margin: 0;
}

.boxscore-desc {
    color: var(--ui-text-muted, #bdbdbd);
    margin: 0 0 24px;
    font-size: 0.95rem;
}

.boxscore-create-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
    padding: 18px 20px;
    background: var(--ui-bg, #161616);
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 12px;
}

.boxscore-category-select {
    min-width: 200px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--ui-border, #2e2e2e);
    background: #121212;
    color: #fff;
    font-family: 'Montserrat', var(--font-body);
}

.boxscore-section-title {
    margin: 0 0 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ui-text-muted, #bdbdbd);
}

.boxscore-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.boxscore-game-card {
    padding: 20px;
    background: var(--ui-bg, #161616);
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.boxscore-game-card:hover {
    border-color: rgba(198, 40, 40, 0.4);
}

.boxscore-game-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.boxscore-game-category {
    font-weight: 700;
    font-size: 0.95rem;
}

.boxscore-game-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 20px;
}

.boxscore-status-scheduled {
    background: rgba(255, 255, 255, 0.08);
    color: #bdbdbd;
}

.boxscore-status-live {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
}

.boxscore-status-final {
    background: rgba(198, 40, 40, 0.15);
    color: #ef9a9a;
}

.boxscore-game-date {
    margin: 0 0 4px;
    color: var(--ui-text-muted, #bdbdbd);
    font-size: 0.85rem;
}

.boxscore-game-id-label {
    margin: 0 0 14px;
    font-size: 0.75rem;
    color: #666;
}

.boxscore-open-game-btn {
    flex: 1;
}

.boxscore-game-card-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
}

.boxscore-delete-game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(198, 40, 40, 0.45);
    background: rgba(198, 40, 40, 0.12);
    color: #ef9a9a;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.boxscore-delete-game-btn:hover {
    background: rgba(198, 40, 40, 0.22);
    border-color: rgba(198, 40, 40, 0.65);
}

.boxscore-date-group {
    margin-bottom: 28px;
}

.boxscore-date-group:last-child {
    margin-bottom: 0;
}

.boxscore-date-heading {
    margin: 0 0 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ui-text-muted, #bdbdbd);
}

.boxscore-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ui-text-muted, #bdbdbd);
    border: 1px dashed var(--ui-border, #2e2e2e);
    border-radius: 14px;
}

.boxscore-empty i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.boxscore-detail-panel {
    animation: boxscoreFadeIn 0.3s ease;
}

@keyframes boxscoreFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.boxscore-back-btn {
    background: none;
    border: none;
    color: var(--ui-text-muted, #bdbdbd);
    cursor: pointer;
    font-family: 'Montserrat', var(--font-body);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 0;
}

.boxscore-back-btn:hover {
    color: #fff;
}

.boxscore-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.boxscore-detail-header h3 {
    margin: 0;
}

.boxscore-detail-meta {
    color: var(--ui-text-muted, #bdbdbd);
    margin: 0 0 24px;
}

.boxscore-detail-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 28px;
    padding: 24px;
    background: #121212;
    border-radius: 16px;
    border: 1px solid var(--ui-border, #2e2e2e);
}

.boxscore-score-box {
    text-align: center;
    min-width: 80px;
    padding: 16px 20px;
    background: #2a2a2a;
    border-radius: 12px;
}

.boxscore-score-home {
    background: rgba(198, 40, 40, 0.25);
}

.boxscore-score-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ui-text-muted, #bdbdbd);
    margin-bottom: 6px;
}

.boxscore-score-value {
    font-family: 'Bebas Neue', 'Oswald', sans-serif;
    font-size: 2.5rem;
    line-height: 1;
}

.boxscore-score-vs {
    color: var(--ui-text-muted, #bdbdbd);
    font-size: 0.9rem;
}

.boxscore-snapshot-info {
    padding: 20px;
    background: var(--ui-bg, #161616);
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 12px;
}

.boxscore-snapshot-info h4 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.boxscore-snapshot-info ul {
    margin: 0 0 12px;
    padding-left: 20px;
    color: var(--ui-text-muted, #bdbdbd);
}

.boxscore-snapshot-note {
    margin: 0;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

@media (max-width: 640px) {
    .boxscore-create-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .boxscore-category-select {
        width: 100%;
    }
}

/* Premium Create New Game panel */
.boxscore-create-modal-card {
    position: relative;
    width: min(1120px, 96vw);
    max-width: 1120px;
    max-height: 94vh;
    padding: clamp(24px, 3vw, 42px);
    border: 1px solid #e3292f;
    border-radius: 24px;
    background:
        radial-gradient(circle at 88% 20%, rgba(190, 18, 24, .08), transparent 28%),
        linear-gradient(135deg, rgba(20, 23, 26, .98), rgba(8, 10, 12, .99));
    box-shadow: 0 30px 90px rgba(0,0,0,.82), inset 0 0 50px rgba(255,255,255,.018);
}

.boxscore-create-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}
.boxscore-create-heading h3 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); color: #f7f7f7; }
.boxscore-create-heading p { margin: 5px 0 0; color: #aaa; }
.boxscore-create-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border: 2px solid #ef2831;
    border-radius: 50%;
    color: #ef2831;
    font-size: 1.55rem;
}
.boxscore-create-close {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-left: auto;
    border: 1px solid #70757b;
    border-radius: 50%;
    background: rgba(8,10,12,.75);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
}
.boxscore-create-category {
    display: grid !important;
    grid-template-columns: 130px minmax(240px, 390px);
    align-items: center;
    gap: 18px;
    font-size: 1.05rem !important;
}
.boxscore-create-category .boxscore-category-select { width: 100%; min-height: 56px; border-color: #d9232a; font-size: 1rem; }
.boxscore-create-modal-card fieldset {
    position: relative;
    border: 1px solid #54585d;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(20,23,26,.82), rgba(9,11,13,.75));
}
.boxscore-create-modal-card .boxscore-game-type-fieldset,
.boxscore-create-modal-card .boxscore-cubbies-side-fieldset { padding: 22px 30px; margin: 22px 0; }
.boxscore-create-modal-card fieldset legend { padding: 0 14px; color: #f2f2f2; font-size: 1.35rem; font-weight: 700; }
.boxscore-create-modal-card fieldset legend::before { content: ''; display: inline-block; width: 3px; height: 22px; margin-right: 13px; vertical-align: -3px; background: #e31b23; }
.boxscore-create-modal-card .boxscore-radio-label { display: flex; align-items: center; gap: 14px; min-height: 48px; margin: 4px 0; font-size: 1rem; }
.boxscore-create-modal-card input[type="radio"] { width: 25px; height: 25px; accent-color: #ee2028; }
.boxscore-create-modal-card .boxscore-team-fields { gap: 24px; }
.boxscore-create-modal-card .boxscore-team-fields > fieldset { padding: 22px; }
.boxscore-create-modal-card .boxscore-team-fields input[type="text"] { min-height: 54px; padding: 13px 16px; border-color: #4c5157; font-size: 1rem; }
.boxscore-create-modal-card .boxscore-logo-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.boxscore-create-modal-card .boxscore-logo-pick { width: 100%; min-width: 0; height: 136px; border-radius: 14px; }
.boxscore-create-modal-card .boxscore-logo-pick.selected { border-color: #ff3840; box-shadow: 0 0 22px rgba(255,35,45,.45), inset 0 0 22px rgba(255,35,45,.08); }
.boxscore-create-modal-card .boxscore-logo-pick img { width: 90%; height: 90%; object-fit: contain; }
.boxscore-create-modal-card .boxscore-modal-actions { justify-content: flex-end; gap: 20px; }
.boxscore-create-modal-card .boxscore-modal-actions button { min-width: 220px; min-height: 62px; font-size: 1rem; font-weight: 800; letter-spacing: .05em; }
.boxscore-create-modal-card .boxscore-modal-actions .cubbies-btn-primary { background: linear-gradient(135deg, #ec252c, #a50b10); box-shadow: 0 0 25px rgba(235,31,39,.36); }

.boxscore-manager-team-card { max-width: 620px; border-color: rgba(230,35,42,.7); background: #0b0e11; }
.boxscore-manager-team-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.boxscore-manager-team-btn { min-height: 100px; border-radius: 14px; color: #fff; font: 800 1.35rem 'Oswald', sans-serif; letter-spacing: .08em; cursor: pointer; }
.boxscore-manager-team-btn.team-blue { border: 1px solid #3385ff; background: linear-gradient(135deg, #1656b3, #09295f); box-shadow: 0 0 22px rgba(36,111,230,.25); }
.boxscore-manager-team-btn.team-red { border: 1px solid #f0363d; background: linear-gradient(135deg, #bd1117, #69080b); box-shadow: 0 0 22px rgba(230,35,42,.25); }

@media (max-width: 760px) {
    .boxscore-create-modal-card { padding: 20px 16px; border-radius: 16px; }
    .boxscore-create-heading { gap: 12px; }
    .boxscore-create-icon { width: 46px; height: 46px; flex-basis: 46px; }
    .boxscore-create-close { width: 46px; height: 46px; }
    .boxscore-create-category { grid-template-columns: 1fr; gap: 8px; }
    .boxscore-create-modal-card .boxscore-team-fields { grid-template-columns: 1fr; }
    .boxscore-create-modal-card .boxscore-logo-pick { height: 110px; }
    .boxscore-create-modal-card .boxscore-modal-actions { flex-direction: column-reverse; }
    .boxscore-create-modal-card .boxscore-modal-actions button { width: 100%; min-width: 0; }
    .boxscore-manager-team-actions { grid-template-columns: 1fr; }
}

/* Phase 3 — Logo library & create modal */
.boxscore-logo-library {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--ui-bg, #161616);
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 14px;
}

.boxscore-logo-library-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.boxscore-logo-library-header h4 {
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.boxscore-upload-label {
    cursor: pointer;
    margin: 0;
}

.boxscore-logo-drop {
    border: 2px dashed var(--ui-border, #2e2e2e);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: var(--ui-text-muted, #bdbdbd);
    margin-bottom: 16px;
    transition: border-color 0.2s, background 0.2s;
}

.boxscore-logo-drop.drag-over {
    border-color: rgba(198, 40, 40, 0.5);
    background: rgba(198, 40, 40, 0.06);
}

.boxscore-logo-drop i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.boxscore-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.boxscore-logo-item {
    position: relative;
    background: #121212;
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.boxscore-logo-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.boxscore-logo-name {
    display: block;
    font-size: 0.7rem;
    color: #888;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.boxscore-logo-del {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.65rem;
}

.boxscore-logo-empty {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
}

.boxscore-logo-modal-card {
    max-width: min(820px, 96vw);
}

.boxscore-logo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.boxscore-logo-modal-header h3 {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.boxscore-logo-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 999px;
    background: #121212;
    color: #fff;
    cursor: pointer;
}

.boxscore-logo-modal-card .boxscore-logo-library {
    margin-bottom: 0;
}

.boxscore-logo-modal-actions {
    margin-top: 18px;
}

.boxscore-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    padding: 20px;
}

.boxscore-modal-card {
    background: #161616;
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 16px;
    padding: 28px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.boxscore-modal-card h3 {
    margin: 0 0 20px;
}

.boxscore-modal-card label {
    display: block;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.boxscore-team-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.boxscore-team-fields fieldset {
    border: 1px solid var(--ui-border, #2e2e2e);
    border-radius: 10px;
    padding: 14px;
    margin: 0;
}

.boxscore-team-fields legend {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0 6px;
}

.boxscore-team-fields input[type="text"] {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--ui-border, #2e2e2e);
    background: #121212;
    color: #fff;
    font-family: inherit;
}

.boxscore-logo-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.boxscore-logo-pick {
    width: 48px;
    height: 48px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #121212;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boxscore-logo-pick img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.boxscore-logo-pick.selected {
    border-color: #c62828;
}

.boxscore-logo-pick-none span {
    font-size: 0.6rem;
    color: #888;
}

.boxscore-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.boxscore-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .boxscore-team-fields {
        grid-template-columns: 1fr;
    }
}

.boxscore-modal-card.boxscore-create-modal-card {
    width: min(840px, 94vw);
    max-width: 840px;
    max-height: 88vh;
    padding: clamp(18px, 2vw, 26px);
    border-color: #e3292f;
    border-radius: 18px;
    background: radial-gradient(circle at 88% 20%, rgba(190,18,24,.08), transparent 28%), linear-gradient(135deg, #14171a, #080a0c);
}
.boxscore-create-modal-card .boxscore-create-heading { gap: 12px; margin-bottom: 16px; }
.boxscore-create-modal-card .boxscore-create-heading h3 { font-size: clamp(1.45rem,2.2vw,2rem); }
.boxscore-create-modal-card .boxscore-create-icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 1.1rem; }
.boxscore-create-modal-card .boxscore-create-close { width: 42px; height: 42px; font-size: 1rem; }
.boxscore-create-modal-card .boxscore-create-category { grid-template-columns: 105px minmax(220px,330px); gap: 12px; margin-bottom: 10px; }
.boxscore-create-modal-card .boxscore-create-category .boxscore-category-select { min-height: 44px; padding: 8px 12px; font-size: .9rem; }
.boxscore-create-modal-card .boxscore-game-type-fieldset,
.boxscore-create-modal-card .boxscore-cubbies-side-fieldset { padding: 12px 18px; margin: 12px 0; }
.boxscore-create-modal-card fieldset legend { padding: 0 8px; font-size: 1rem; }
.boxscore-create-modal-card fieldset legend::before { height: 16px; margin-right: 8px; vertical-align: -2px; }
.boxscore-create-modal-card .boxscore-radio-label { gap: 10px; min-height: 36px; margin: 1px 0; font-size: .9rem; }
.boxscore-create-modal-card input[type="radio"] { width: 20px; height: 20px; }
.boxscore-create-modal-card .boxscore-team-fields { gap: 14px; margin-bottom: 14px; }
.boxscore-create-modal-card .boxscore-team-fields > fieldset { padding: 14px; }
.boxscore-create-modal-card .boxscore-team-fields input[type="text"] { min-height: 42px; margin-bottom: 8px; padding: 8px 12px; font-size: .9rem; }
.boxscore-create-modal-card .boxscore-logo-picker { gap: 10px; margin-top: 10px; }
.boxscore-create-modal-card .boxscore-logo-pick { height: 88px; border-radius: 10px; }
.boxscore-create-modal-card .boxscore-modal-actions { gap: 12px; }
.boxscore-create-modal-card .boxscore-modal-actions button { min-width: 170px; min-height: 48px; padding: 9px 16px; font-size: .86rem; }
.boxscore-create-heading > h3,
.boxscore-create-heading > div > h3 { margin: 0; }
.boxscore-modal-card.boxscore-manager-team-card { max-width: 620px; border-color: rgba(230,35,42,.7); background: #0b0e11; }
@media (max-width: 760px) {
    .boxscore-modal-card.boxscore-create-modal-card { padding: 20px 16px; border-radius: 16px; }
    .boxscore-create-modal-card .boxscore-create-category { grid-template-columns: 1fr; }
    .boxscore-create-modal-card .boxscore-logo-pick { height: 76px; }
}
