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

:root {
    --user-primary-color: #f8f9fa;
    --user-secondary-color: #f1f3f4;
    --user-accent-color: #6c757d;
    --user-gradient: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--user-gradient);
    min-height: 100vh;
    color: #333;
    transition: background 0.5s ease;
}

.container {
    max-width: 1750px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.9);
    min-height: calc(100vh - 4rem);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.5s ease;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--user-accent-color) 0%, rgba(0,0,0,0.1) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    transition: background 0.5s ease;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.current-player-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    margin-bottom: 1rem;
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.current-player-label {
    font-size: 1.1rem;
    margin-right: 0.5rem;
    opacity: 0.9;
}

.current-player-name {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

.user-selector {
    position: absolute;
    top: 1rem;
    right: 2rem;
}

.user-selector label {
    margin-right: 0.5rem;
    font-weight: bold;
}

.user-selector select {
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    background: white;
    color: #333;
    font-size: 1rem;
}

.nav-tabs {
    display: flex;
    background: var(--user-primary-color);
    border-bottom: 2px solid var(--user-accent-color);
    transition: all 0.5s ease;
}

.nav-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--user-secondary-color);
}

.nav-btn.active {
    background: var(--user-accent-color);
    color: white;
}

.section {
    display: none;
    padding: 2rem;
}

.section.active {
    display: block;
}

.section h2 {
    margin-bottom: 2rem;
    color: var(--user-accent-color);
    font-size: 2rem;
    text-align: center;
    transition: color 0.5s ease;
}

/* Cardle Styles */
.cardle-grid {
    background: linear-gradient(135deg, var(--user-primary-color) 0%, rgba(255,255,255,0.8) 100%);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid rgba(0,0,0,0.05);
    transition: all 0.5s ease;
}

.grid-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
}

.cardle-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cardle-cell {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cardle-cell.correct {
    background-color: #28a745;
    border-color: #28a745;
}

.cardle-cell.incorrect {
    background-color: #dc3545;
    border-color: #dc3545;
}

.cardle-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cardle-controls button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

#add-row {
    background: #28a745;
    color: white;
}

#add-row:hover {
    background: #218838;
}

#remove-row {
    background: #dc3545;
    color: white;
}

#remove-row:hover {
    background: #c82333;
}

#submit-cardle {
    background: #007bff;
    color: white;
}

#submit-cardle:hover {
    background: #0056b3;
}

/* OSRS Styles */
.osrs-input {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.osrs-input label {
    display: block;
    margin-bottom: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.osrs-input input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.osrs-input button {
    padding: 1rem 2rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background 0.3s ease;
}

.osrs-input button:hover {
    background: #0056b3;
}

/* All Scores Display */
.all-scores {
    background: #e8f4fd;
    border: 2px solid #007bff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.all-scores h3 {
    color: #007bff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.scores-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.player-scores {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid #dee2e6;
}

.player-scores.current-player {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

.player-scores h4 {
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.player-scores.current-player h4 {
    color: #007bff;
    border-bottom-color: #007bff;
}

.score-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #dee2e6;
    flex-wrap: wrap;
}

.score-entry.today {
    background: #d4edda;
    border-left-color: #28a745;
}

.score-entry.current-player {
    background: #e3f2fd;
    border-left-color: #007bff;
}

.score-date {
    font-weight: bold;
    color: #666;
}

.score-value {
    font-weight: bold;
}

.score-details {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.score-item {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    border: 1px solid #007bff;
    font-size: 0.9rem;
    font-weight: bold;
}

.cardle-grid-mini {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
    flex-direction: column;
}

.cardle-row-mini {
    display: flex;
    gap: 1px;
}

.cardle-cell-mini {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cardle-cell-mini.correct {
    background-color: #28a745;
}

.cardle-cell-mini.incorrect {
    background-color: #dc3545;
}

.cardle-cell-mini.empty {
    background-color: #e9ecef;
}

/* Today's Score Display */
.today-score {
    background: #e8f4fd;
    border: 2px solid #007bff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.today-score h3 {
    color: #007bff;
    margin-bottom: 1rem;
}

.score-display {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.score-item {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid #007bff;
    font-weight: bold;
}

/* Leaderboard Styles */
.leaderboard-tabs {
    display: flex;
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.leaderboard-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.leaderboard-btn:hover {
    background: #e9ecef;
}

.leaderboard-btn.active {
    background: #28a745;
    color: white;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.leaderboard-table th {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.leaderboard-table tr:hover {
    background: #f8f9fa;
}

.rank-1 {
    background: linear-gradient(45deg, #ffd700, #ffed4e) !important;
    font-weight: bold;
}

.rank-2 {
    background: linear-gradient(45deg, #c0c0c0, #e2e2e2) !important;
    font-weight: bold;
}

.rank-3 {
    background: linear-gradient(45deg, #cd7f32, #deb887) !important;
    font-weight: bold;
}

/* Today's Scores Section */
.today-scores-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid #007bff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.today-scores-section h4 {
    color: #007bff;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
}

.today-scores-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.today-score-entry {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    border-left-width: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.today-score-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.today-score-entry.current-player {
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4);
    border-color: #007bff;
}

.today-score-entry.rank-first {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1)) !important;
    border-left-color: #ffd700 !important;
}

.today-score-entry.rank-second {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1)) !important;
    border-left-color: #c0c0c0 !important;
}

.today-score-entry.rank-third {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1)) !important;
    border-left-color: #cd7f32 !important;
}

.today-score-entry .rank {
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 1rem;
    min-width: 50px;
    text-align: center;
}

.today-score-entry .player-name {
    flex: 1;
    font-weight: bold;
    font-size: 1.1rem;
}

.today-score-entry .score-value {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

/* Calendar Section */
.calendar-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid #28a745;
}

.calendar-section h4 {
    color: #28a745;
    margin-bottom: 1rem;
    text-align: center;
}

.calendar-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.calendar-header h5 {
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.calendar-grid {
    max-width: 400px;
    margin: 0 auto;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1px;
}

.calendar-weekdays div {
    text-align: center;
    font-weight: bold;
    padding: 0.5rem;
    background: #007bff;
    color: white;
    font-size: 0.9rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.calendar-day {
    position: relative;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.day-number {
    font-weight: bold;
}

.player-indicators {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.player-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid white;
}

.calendar-day:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    background: transparent;
    transform: none;
}

.calendar-day.has-data {
    background: #d4edda;
    color: #155724;
    font-weight: bold;
}

.calendar-day.has-data:hover {
    background: #c3e6cb;
}

.calendar-day.today {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.calendar-day.today:hover {
    background: #0056b3;
}

.calendar-day.selected {
    background: #28a745;
    color: white;
    font-weight: bold;
    transform: scale(1.1);
}

.data-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #007bff;
    border-radius: 50%;
}

.calendar-day.today .data-indicator {
    background: #ffc107;
}

/* Selected Day Scores */
.selected-day-scores {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid #28a745;
}

.selected-day-scores h5 {
    color: #28a745;
    margin-bottom: 1rem;
    text-align: center;
}

.day-score-entry {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    border-left-width: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.day-score-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.day-score-entry.current-player {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.4);
}

.day-score-entry .rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
    margin-right: 1rem;
    min-width: 40px;
    text-align: center;
}

.day-score-entry .player-name {
    flex: 1;
    font-weight: bold;
}

.day-score-entry .score-value {
    font-weight: bold;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }
    
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .user-selector {
        position: static;
        margin-top: 1rem;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .section {
        padding: 1rem;
    }
    
    .cardle-row {
        justify-items: center;
    }
    
    .cardle-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .score-display {
        justify-content: center;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
    }
    
    .scores-comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .current-player-display {
        margin-bottom: 0.5rem;
    }
    
    .current-player-name {
        font-size: 1.3rem;
    }
    
    /* Calendar responsive styles */
    .calendar-grid {
        max-width: 100%;
    }
    
    .calendar-day {
        padding: 0.5rem 0.25rem;
        min-height: 35px;
        font-size: 0.9rem;
    }
    
    .calendar-weekdays div {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .today-score-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .today-score-entry .rank {
        margin-right: 0;
    }
    
    .day-score-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .day-score-entry .rank {
        margin-right: 0;
    }
}
