/* Sudoku-specific styles */

.sudoku-game {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.game-info {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.info-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.info-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
}

.players-online {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 600;
}

.vs {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
}

/* Sudoku Board */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(99, 102, 241, 0.5);
    border-radius: 12px;
    padding: 8px;
    margin: 0 auto 20px;
    max-width: 500px;
    aspect-ratio: 1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sudoku-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.5em;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sudoku-cell:hover:not(.fixed):not(.error) {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.sudoku-cell.selected {
    background: rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.sudoku-cell.fixed {
    background: rgba(255, 255, 255, 0.1);
    color: #a5b4fc;
    cursor: default;
    font-weight: 700;
}

.sudoku-cell.user-input {
    color: #60a5fa;
}

.sudoku-cell.error {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    animation: shake 0.3s;
}

.sudoku-cell.correct {
    background: rgba(34, 197, 94, 0.3);
    animation: pulse 0.5s;
}

.sudoku-cell.highlight {
    background: rgba(99, 102, 241, 0.15);
}

.sudoku-cell.opponent-move {
    animation: opponentPulse 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes opponentPulse {
    0%, 100% { background: rgba(168, 85, 247, 0.2); }
    50% { background: rgba(168, 85, 247, 0.5); }
}

/* 3x3 box borders */
.sudoku-cell:nth-child(3n) {
    border-right: 2px solid rgba(99, 102, 241, 0.4);
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid rgba(99, 102, 241, 0.4);
}

/* Notes mode */
.sudoku-cell .notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    font-size: 0.35em;
    color: rgba(255, 255, 255, 0.6);
    position: absolute;
    inset: 2px;
    pointer-events: none;
}

.sudoku-cell .notes span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* Number Pad */
.number-pad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.number-btn {
    aspect-ratio: 1;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1.3em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.number-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.number-btn:active {
    transform: scale(0.95);
}

.number-btn.selected {
    background: rgba(99, 102, 241, 0.6);
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Game Controls */
.game-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    padding: 12px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background: rgba(168, 85, 247, 0.4);
    border-color: rgba(168, 85, 247, 0.6);
}

/* Difficulty Buttons */
.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.difficulty-btn {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.difficulty-btn .mode-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.difficulty-btn h3 {
    font-size: 1.3em;
    margin: 10px 0 5px;
}

.difficulty-btn p {
    font-size: 0.9em;
    opacity: 0.7;
    margin: 0;
}

.difficulty-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.difficulty-btn.easy {
    border-color: rgba(34, 197, 94, 0.5);
}

.difficulty-btn.easy:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.8);
}

.difficulty-btn.medium {
    border-color: rgba(59, 130, 246, 0.5);
}

.difficulty-btn.medium:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.8);
}

.difficulty-btn.hard {
    border-color: rgba(251, 146, 60, 0.5);
}

.difficulty-btn.hard:hover {
    background: rgba(251, 146, 60, 0.1);
    border-color: rgba(251, 146, 60, 0.8);
}

.difficulty-btn.expert {
    border-color: rgba(239, 68, 68, 0.5);
}

.difficulty-btn.expert:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.8);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .sudoku-game {
        padding: 10px;
    }
    
    .game-info {
        padding: 10px;
        gap: 5px;
    }
    
    .info-label {
        font-size: 0.75em;
    }
    
    .info-value {
        font-size: 1em;
    }
    
    .sudoku-board {
        padding: 4px;
        max-width: 100%;
    }
    
    .sudoku-cell {
        font-size: 1.2em;
    }
    
    .number-pad {
        gap: 5px;
    }
    
    .number-btn {
        font-size: 1.1em;
        border-radius: 8px;
    }
    
    .game-controls {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .control-btn {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .difficulty-btn {
        padding: 20px;
    }
    
    .difficulty-btn .mode-icon {
        font-size: 2em;
    }
    
    .difficulty-btn h3 {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .sudoku-cell {
        font-size: 1em;
    }
    
    .sudoku-cell .notes {
        font-size: 0.3em;
    }
    
    .number-btn {
        font-size: 1em;
    }
    
    .game-controls {
        grid-template-columns: 1fr;
    }
}

/* Waiting Room */
.party-code-display {
    text-align: center;
    margin: 20px 0;
}

.party-code-display p {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.party-code-large {
    font-size: 3em;
    font-weight: 700;
    color: #fff;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.5);
    border-radius: 16px;
    padding: 20px;
    letter-spacing: 8px;
    margin: 10px 0;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
}

.player-icon {
    font-size: 1.5em;
}

.player-name {
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
}

.player-role {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

.difficulty-btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
    font-weight: 600;
}

.difficulty-btn-small .diff-icon {
    font-size: 1.5em;
}

.difficulty-btn-small:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.difficulty-btn-small.easy {
    border-color: rgba(34, 197, 94, 0.5);
}

.difficulty-btn-small.easy:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.8);
}

.difficulty-btn-small.medium {
    border-color: rgba(59, 130, 246, 0.5);
}

.difficulty-btn-small.medium:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.8);
}

.difficulty-btn-small.hard {
    border-color: rgba(251, 146, 60, 0.5);
}

.difficulty-btn-small.hard:hover {
    background: rgba(251, 146, 60, 0.1);
    border-color: rgba(251, 146, 60, 0.8);
}

.difficulty-btn-small.expert {
    border-color: rgba(239, 68, 68, 0.5);
}

.difficulty-btn-small.expert:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.8);
}

.difficulty-display {
    text-align: center;
    margin: 20px 0;
    font-size: 1.1em;
}

.difficulty-display strong {
    color: #6366f1;
    font-size: 1.2em;
}

.ready-status {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.ready-item {
    text-align: center;
}

.ready-item span {
    font-size: 1.1em;
    font-weight: 600;
}

/* Countdown */
.countdown-container {
    text-align: center;
    padding: 60px 20px;
}

.countdown-container h2 {
    font-size: 2.5em;
    color: #fff;
    margin-bottom: 40px;
}

.countdown-number {
    font-size: 8em;
    font-weight: 700;
    color: #6366f1;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
    animation: countdownPulse 1s infinite;
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Mobile adjustments for waiting room */
@media (max-width: 768px) {
    .party-code-large {
        font-size: 2em;
        letter-spacing: 4px;
        padding: 15px;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
    }
    
    .countdown-number {
        font-size: 5em;
    }
    
    .countdown-container h2 {
        font-size: 1.8em;
    }
}

/* Hearts Display */
.hearts-display {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.heart {
    font-size: 1.3em;
    animation: heartBeat 0.3s;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
