/* Scorekeeper-specific styles */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.scorekeeper-container {
    max-width: 1200px;
    padding: 2rem 1rem;
    flex: 1;
}

/* Setup View */
#setup-view {
    max-width: 600px;
    margin: 0 auto;
}

.section-intro {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
}

.player-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.player-name-input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.3s;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.player-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.player-controls {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--background-light);
    border-color: var(--primary-color);
}

.btn-icon.btn-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-icon.btn-danger:hover {
    background: #dc3545;
    color: white;
}

.setup-actions {
    margin-top: 2rem;
    text-align: center;
}

/* House Rules Checkboxes */
.house-rules-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.house-rule-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.house-rule-checkbox:hover {
    background-color: var(--background-light);
    border-color: var(--primary-color);
}

.house-rule-checkbox input[type="checkbox"] {
    margin-top: 0.25rem;
    cursor: pointer;
}

.house-rule-checkbox .rule-name {
    font-weight: 600;
    color: var(--text-color);
    display: block;
}

.house-rule-checkbox .rule-brief {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Score View */
.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.score-actions {
    display: flex;
    gap: 0.5rem;
}

.score-grid-container {
    overflow-x: auto;
    margin-bottom: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.score-table th,
.score-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.score-table th {
    background: var(--primary-color);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    color: var(--white);
}

.round-header {
    text-align: center;
    vertical-align: middle;
    line-height: 1.3;
}

.dealer-initials {
    display: inline-block;
    background: var(--accent-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 2px;
}

.score-table tbody tr:hover {
    background: var(--background-light);
}

.player-name {
    text-align: left;
    font-weight: 500;
    min-width: 120px;
}

.editable-name {
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.editable-name:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}

.editable-name:hover::after {
    content: '✏️';
    position: absolute;
    right: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

.name-edit-input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    background-color: var(--background-light);
    color: var(--text-color);
    font-weight: 500;
}

.name-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.score-input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--background-light);
    color: var(--text-color);
}

.score-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.score-input:disabled {
    background: var(--background-darker);
    cursor: not-allowed;
    opacity: 0.6;
}

.total-col {
    background: rgba(102, 126, 234, 0.2);
    font-weight: bold;
    color: var(--primary-color);
}

.score-legend {
    padding: 1rem;
    background: var(--background-light);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.score-legend p {
    margin: 0.5rem 0;
}
.score-legend {
    padding: 1rem;
    background: var(--background-light);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.score-legend p {
    margin: 0.5rem 0;
}

.score-legend strong {
    color: var(--text-primary);
}

.winner-announcement h3 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
}

.winner-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

/* History View */
#game-history-list {
    display: grid;
    gap: 1rem;
}

.history-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
}

.badge.in-progress {
    background: var(--accent-color);
    margin-left: .5rem;
}

.history-players {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.house-rules-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rule-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    cursor: help;
    transition: transform 0.2s;
}

.rule-badge:hover {
    transform: scale(1.05);
}

.winner {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0.5rem 0;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 2px solid var(--primary-color);
    background: var(--card-bg);
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-small:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--glow);
}

.btn-small.btn-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-small.btn-danger:hover {
    background: #dc3545;
    color: white;
}

.no-games {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
    font-style: italic;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--glow);
}

.btn-secondary {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--background-light);
    border-color: var(--primary-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .score-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .score-actions {
        width: 100%;
        justify-content: stretch;
    }

    .score-actions button {
        flex: 1;
    }

    .score-table th,
    .score-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.9rem;
    }

    .score-input {
        width: 50px;
        padding: 0.4rem;
        font-size: 0.9rem;
    }

    .dealer-initials {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .winner-announcement h3 {
        padding: 1px 4px;
    }

    .winner-announcement h3 {
        font-size: 1.5rem;
    }

    .winner-name {
        font-size: 1.2rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .score-header,
    .score-actions,
    .score-legend,
    .winner-announcement button,
    .history-actions {
        display: none;
    }

    .score-table {
        page-break-inside: avoid;
    }

    .score-input {
        border: none;
        background: transparent;
    }
}
