.page-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary, #3498db) 0%, var(--primary-dark, #2980b9) 100%);
    border-radius: 16px;
    color: #fff;
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0 0 10px;
    font-size: 32px;
}

.page-header p {
    margin: 0;
    opacity: 0.9;
}

.no-tournaments {
    text-align: center;
    padding: 60px 20px;
}

.no-tournaments .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.no-tournaments h2 {
    margin: 0 0 10px;
}

.no-tournaments p {
    color: var(--text-muted, #666);
}

.tournaments-list {
    display: grid;
    gap: 20px;
}

.tournament-card {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tournament-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tournament-type {
    display: flex;
    gap: 8px;
}

.type-badge,
.difficulty-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.type-badge {
    background: #e3f2fd;
    color: #1565c0;
}

.difficulty-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

.tournament-name {
    margin: 0 0 10px;
    font-size: 22px;
}

.tournament-desc {
    color: var(--text-muted, #666);
    margin: 0 0 15px;
}

.tournament-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted, #666);
}

.meta-value {
    font-weight: 700;
    font-size: 18px;
}

.tournament-dates {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-label {
    font-size: 12px;
    color: var(--text-muted, #666);
}

.date-value {
    font-weight: 600;
}

.my-progress {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-stats {
    margin-top: 10px;
    text-align: center;
}

.tournament-actions {
    display: flex;
    gap: 10px;
}

.tournament-detail-page {
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--primary, #3498db);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.tournament-header-section {
    margin-bottom: 30px;
}

.tournament-title-area h1 {
    margin: 0 0 15px;
    font-size: 28px;
}

.tournament-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tournament-description {
    margin-top: 15px;
    color: var(--text-muted, #666);
}

.tournament-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.info-card {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.info-card .info-icon {
    font-size: 28px;
}

.info-card .info-value {
    font-size: 24px;
    font-weight: 700;
}

.info-card .info-label {
    font-size: 13px;
    color: var(--text-muted, #666);
}

.tournament-dates-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.date-card {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.date-icon {
    font-size: 28px;
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.join-section,
.my-section {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.join-section h2,
.my-section h2 {
    margin: 0 0 15px;
}

.join-section p {
    color: var(--text-muted, #666);
    margin-bottom: 20px;
}

.progress-container {
    text-align: left;
}

.progress-bar.large {
    height: 12px;
    margin-bottom: 15px;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.stats-row .stat {
    text-align: center;
}

.stats-row .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
}

.stats-row .stat-label {
    font-size: 13px;
    color: var(--text-muted, #666);
}

.completed-badge {
    background: #d4edda;
    color: #155724;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
}

.leaderboard-section {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.leaderboard-section h2 {
    margin: 0 0 20px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.leaderboard-table th {
    font-weight: 600;
    color: var(--text-muted, #666);
    font-size: 13px;
}

.leaderboard-table .rank {
    font-size: 20px;
}

.leaderboard-table .player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-table .score {
    font-size: 18px;
}

.leaderboard-table.full {
    font-size: 14px;
}

.tournament-play-page {
    max-width: 600px;
    margin: 0 auto;
}

.play-header {
    margin-bottom: 20px;
}

.play-header h1 {
    margin: 10px 0;
}

.match-info {
    display: flex;
    justify-content: space-between;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.match-number strong {
    font-size: 20px;
}

.match-stats span {
    margin-left: 20px;
}

.progress-bar-container {
    margin-bottom: 20px;
}

#game-container {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.loading-game {
    text-align: center;
    padding: 60px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary, #3498db);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.timer {
    font-size: 32px;
    font-weight: 700;
    font-family: monospace;
}

.game-stats span {
    margin-left: 20px;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(var(--size), 1fr);
    gap: 0;
    background: #fff;
    padding: 0;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 3px solid #333;
}

.sudoku-grid .cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    background: var(--cell-bg, #fff);
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

/* 3x3 (9x9) - Her 3. sütun ve satır kalın çizgi */
.sudoku-grid.grid-3x3 .cell:nth-child(3n) {
    border-right: 2px solid #333;
}
.sudoku-grid.grid-3x3 .cell:nth-child(9n) {
    border-right: none;
}
.sudoku-grid.grid-3x3 .cell:nth-child(n+19):nth-child(-n+27),
.sudoku-grid.grid-3x3 .cell:nth-child(n+46):nth-child(-n+54),
.sudoku-grid.grid-3x3 .cell:nth-child(n+73):nth-child(-n+81) {
    border-bottom: 2px solid #333;
}
.sudoku-grid.grid-3x3 .cell:nth-child(n+73) {
    border-bottom: none;
}

/* 2x3 (6x6) - Her 3. sütun ve 2. satır kalın çizgi */
.sudoku-grid.grid-2x3 .cell:nth-child(3n) {
    border-right: 2px solid #333;
}
.sudoku-grid.grid-2x3 .cell:nth-child(6n) {
    border-right: none;
}
.sudoku-grid.grid-2x3 .cell:nth-child(n+7):nth-child(-n+12),
.sudoku-grid.grid-2x3 .cell:nth-child(n+19):nth-child(-n+24),
.sudoku-grid.grid-2x3 .cell:nth-child(n+31):nth-child(-n+36) {
    border-bottom: 2px solid #333;
}
.sudoku-grid.grid-2x3 .cell:nth-child(n+31) {
    border-bottom: none;
}

/* 2x2 (4x4) - Her 2. sütun ve satır kalın çizgi */
.sudoku-grid.grid-2x2 .cell:nth-child(2n) {
    border-right: 2px solid #333;
}
.sudoku-grid.grid-2x2 .cell:nth-child(4n) {
    border-right: none;
}
.sudoku-grid.grid-2x2 .cell:nth-child(n+5):nth-child(-n+8),
.sudoku-grid.grid-2x2 .cell:nth-child(n+13):nth-child(-n+16) {
    border-bottom: 2px solid #333;
}
.sudoku-grid.grid-2x2 .cell:nth-child(n+13) {
    border-bottom: none;
}

.sudoku-grid .cell.highlighted {
    background: #e3f2fd;
}

.sudoku-grid .cell.error {
    background: #ffebee;
    color: #c62828;
}

.sudoku-grid .cell.correct {
    background: #e8f5e9;
}

.sudoku-grid .cell.hint {
    background: #fff3e0;
}

.sudoku-grid .puzzle-cell {
    background: #f5f5f5;
    color: #333;
}

.sudoku-grid .player-cell {
    cursor: pointer;
}

.sudoku-grid .player-cell:focus {
    outline: 2px solid var(--primary, #3498db);
    outline-offset: -2px;
}

.game-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin: 0 0 20px;
}

.score-display {
    margin: 20px 0;
}

.score-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted, #666);
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary, #3498db);
}

.modal-content .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-content .stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.modal-content .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.modal-content .stat-label {
    font-size: 12px;
    color: var(--text-muted, #666);
}

.total-score {
    font-size: 18px;
    margin-bottom: 15px;
}

.progress-info {
    color: var(--text-muted, #666);
    margin-bottom: 20px;
}

.all-done {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tournament-leaderboard-page {
    max-width: 800px;
    margin: 0 auto;
}

.tournament-info-compact {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.my-rank-card {
    background: linear-gradient(135deg, var(--primary, #3498db), var(--primary-dark, #2980b9));
    color: #fff;
    padding: 20px 40px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.my-rank-card .rank-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
}

.my-rank-card .rank-value {
    font-size: 36px;
    font-weight: 700;
}

.leaderboard-table-container {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow-x: auto;
}

@media (max-width: 768px) {
    .tournament-info-grid {
        grid-template-columns: 1fr;
    }
    
    .tournament-dates-section {
        grid-template-columns: 1fr;
    }
    
    .tournament-meta {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .match-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .match-stats span {
        margin: 0 10px;
    }
}