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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
    background: #f0f0ff;
}

.tab-btn.active {
    color: white;
    background: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

h3 {
    color: #444;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

input[type="text"],
input[type="date"],
select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    flex: 1;
    min-width: 200px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-remove {
    background: #dc3545;
    padding: 8px 16px;
}

.btn-remove:hover {
    background: #c82333;
}

.btn-team {
    flex: 1;
    background: white;
    color: #333;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-team:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.btn-team.selected {
    background: #28a745;
    color: white;
    border: 3px solid #1e7e34;
    font-weight: bold;
}

.btn-team.selected:hover {
    background: #218838;
    border-color: #1e7e34;
}

.btn-team img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.btn-edit {
    background: #ffc107;
    color: #333;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-toggle {
    background: #17a2b8;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-toggle:hover {
    background: #138496;
}

.card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.card strong {
    font-size: 1.1em;
    color: #333;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 {
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.board-status {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-weight: bold;
}

.board-status.completed {
    background: #d4edda;
    color: #155724;
}

.board-status.incomplete {
    background: #fff3cd;
    color: #856404;
}

.user-info {
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

.user-info div {
    margin: 5px 0;
}

.user-info a {
    color: #667eea;
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
}

.game-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.game-input input {
    flex: 1;
}

.game-input span {
    color: #666;
    font-weight: bold;
}

.games-list {
    margin-top: 15px;
}

.game-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 3px solid #dee2e6;
    transition: all 0.3s ease;
}

.game-item:has(.result-correct) {
    border: 4px solid #28a745;
    background: linear-gradient(to right, #d4edda 0%, white 10%, white 90%, #d4edda 100%);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.game-item:has(.result-incorrect) {
    border: 4px solid #dc3545;
    background: linear-gradient(to right, #f8d7da 0%, white 10%, white 90%, #f8d7da 100%);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.bowl-name-display {
    font-size: 0.95em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

.game-teams {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.winner {
    color: #28a745;
    font-weight: bold;
    margin-top: 5px;
}

.my-pick {
    color: #667eea;
    font-weight: bold;
    margin-top: 5px;
}

.my-pick.locked {
    color: #dc3545;
}

.pick-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.board-date {
    color: #666;
    margin-bottom: 15px;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.board-header h3 {
    margin: 0;
}

.board-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: bold;
}

.board-status.status-open {
    background: #d4edda;
    color: #155724;
}

.board-status.status-locked {
    background: #fff3cd;
    color: #856404;
}

.board-status.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.score-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.score-card.highlight {
    background: #e7f3ff;
    border-color: #667eea;
}

.rank {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    min-width: 50px;
}

.score-info {
    flex: 1;
}

.score-info strong {
    display: block;
    margin-bottom: 5px;
}

.percentage {
    font-size: 1.5em;
    font-weight: bold;
    color: #28a745;
}

.pick-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
}

.message {
    display: none;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
    }

    .form-group {
        flex-direction: column;
    }

    input[type="text"],
    input[type="date"],
    select {
        width: 100%;
    }

    .score-card {
        flex-wrap: wrap;
    }

    .game-input {
        flex-wrap: wrap;
    }
}

/* Team Picker Styles */
.team-picker {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.team-picker input {
    width: 100%;
    padding-left: 45px;
}

.team-logo-preview {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.team-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.team-option {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.team-option:hover {
    background: #f0f0ff;
}

.team-option img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.team-option.custom {
    background: #fff3cd;
    font-style: italic;
}

.team-vs-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    vertical-align: middle;
    margin: 0 5px;
}

.game-matchup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-matchup img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-primary {
    background: #667eea;
}

.btn-primary:hover {
    background: #5568d3;
}

/* Lock Button */
.btn-lock {
    background: #6c757d;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-lock.locked {
    background: #dc3545;
}

.btn-lock:hover {
    opacity: 0.8;
}

.locked-status {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Pick Status Cards */
.pick-status-card {
    border-left: 4px solid #28a745;
}

.pick-status-card.needs-picks {
    border-left-color: #dc3545;
}

.pick-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.board-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
}

.pick-status-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pick-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s;
}

.last-access {
    font-size: 0.9em;
    color: #666;
}

.needs-reminder {
    margin-top: 10px;
    padding: 8px;
    background: #fff3cd;
    color: #856404;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}

.all-done {
    margin-top: 10px;
    padding: 8px;
    background: #d4edda;
    color: #155724;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}

/* Audit Log */
.audit-entry {
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    margin-bottom: 10px;
}

.audit-entry.access {
    border-left-color: #17a2b8;
}

.audit-entry.pick-made {
    border-left-color: #28a745;
}

.audit-entry.pick-changed {
    border-left-color: #ffc107;
}

.audit-time {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.audit-info {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.audit-action {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
}

.audit-details {
    color: #666;
    font-size: 0.95em;
}

/* Game Result Controls */
.game-result-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.result-select {
    flex: 1;
    min-width: 150px;
}

.btn-set-result {
    background: #28a745;
    padding: 8px 16px;
    white-space: nowrap;
}

.btn-set-result:hover {
    background: #218838;
}

/* Game Details Display */
.game-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.game-details.result-correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 3px solid #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.game-details.result-incorrect {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 3px solid #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.matchup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-details.result-correct .matchup {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #f0fdf4 100%);
    border: 2px solid #28a745;
}

.game-details.result-incorrect .matchup {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 50%, #fef2f2 100%);
    border: 2px solid #dc3545;
}

.team-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: #333;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    flex: 1;
    justify-content: center;
    border: 3px solid transparent;
}

.team-display.user-picked {
    background: linear-gradient(135deg, #cfe2ff 0%, #e7f3ff 100%);
    border: 3px solid #0d6efd;
    color: #084298;
}

.team-display.winner-team {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 3px solid #155724;
    color: white;
    font-weight: bolder;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
}

.team-display.loser-team {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    opacity: 0.7;
    color: #6c757d;
    text-decoration: line-through;
    border: 3px solid #adb5bd;
}

.team-display.winner-team.user-picked {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 3px solid #ffff00;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 4px 12px rgba(40, 167, 69, 0.5);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 4px 12px rgba(40, 167, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 6px 16px rgba(40, 167, 69, 0.7);
    }
}

.team-display.loser-team.user-picked {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: 3px solid #721c24;
    color: white;
    text-decoration: line-through;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
}

.pick-indicator {
    font-size: 1.2em;
    margin-left: 5px;
}

.winner-indicator {
    font-size: 1.3em;
    margin-left: 5px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.vs-text {
    color: #666;
    font-size: 0.9em;
    font-weight: bold;
    padding: 0 10px;
}

.user-pick-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 1.05em;
}

.user-pick-result.correct {
    background: #28a745;
    color: white;
    border: 3px solid #1e7e34;
    font-weight: bold;
}

.user-pick-result.incorrect {
    background: #dc3545;
    color: white;
    border: 3px solid #c82333;
    font-weight: bold;
}

.user-pick-result.pending {
    background: #ffc107;
    color: #333;
    border: 2px solid #e0a800;
    font-weight: bold;
}

.user-pick-result.no-pick {
    background: #6c757d;
    color: white;
    border: 2px solid #545b62;
}

.result-icon {
    font-size: 1.8em;
    line-height: 1;
}

.result-text {
    flex: 1;
}

.user-pick {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}

.user-pick.correct {
    background: #d4edda;
    color: #155724;
}

.user-pick.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.user-pick.no-pick {
    background: #fff3cd;
    color: #856404;
}

.user-pick:not(.correct):not(.incorrect):not(.no-pick) {
    background: #e7f3ff;
    color: #004085;
}

.winner-display {
    padding: 8px 12px;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 6px;
    font-weight: bold;
    color: #155724;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
