/* ========== Baseball Diamond ========== */
.baseball-diamond {
    flex-shrink: 0;
    position: relative;
    width: 160px;
    height: 160px;
}

.baseball-diamond img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.baseball-diamond img:hover {
    transform: scale(1.05);
}

/* ========== Sudoku Grid ========== */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    background: linear-gradient(145deg, #1e3a5f, #2c4e70);
    padding: 8px;
    margin: 0 auto 10px;
    max-width: 480px;
    aspect-ratio: 1;
    border-radius: 20px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        inset 0 -2px 5px rgba(255, 255, 255, 0.1);
    position: relative;
    transform: perspective(1000px) rotateX(2deg);
}

.sudoku-cell {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: 800;
    cursor: pointer;
    color: #1e3a5f;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
    transform-style: preserve-3d;
    min-height: 40px;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Baseball diamond pattern for cells */
.sudoku-cell::after {
    content: '';
    position: absolute;
    inset: 15%;
    background: linear-gradient(45deg, transparent 45%, rgba(143, 188, 143, 0.1) 45%, rgba(143, 188, 143, 0.1) 55%, transparent 55%);
    transform: rotate(45deg);
    border-radius: 2px;
    opacity: 0.5;
    pointer-events: none;
}

.sudoku-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: linear-gradient(145deg, transparent, rgba(255,255,255,0.5));
    opacity: 0;
    transition: opacity 0.3s;
}

.sudoku-cell:hover:not(.fixed)::before {
    opacity: 1;
}

.sudoku-cell:active {
    transform: scale(0.95) translateZ(-5px);
}

.sudoku-cell:hover:not(.fixed) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 0 0 2px rgba(33, 150, 243, 0.3);
    z-index: 10;
}

.sudoku-cell.selected {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 
        0 0 0 3px #2196F3,
        0 0 30px rgba(33, 150, 243, 0.6),
        inset 0 1px 3px rgba(255, 255, 255, 0.3);
    animation: selectedPulse 1.5s ease-in-out infinite;
    transform: scale(1.05);
}

@keyframes selectedPulse {
    0%, 100% { 
        transform: scale(1.05);
        box-shadow: 
            0 0 0 3px #2196F3,
            0 0 30px rgba(33, 150, 243, 0.6),
            inset 0 1px 3px rgba(255, 255, 255, 0.3);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 
            0 0 0 5px #2196F3,
            0 0 40px rgba(33, 150, 243, 0.8),
            inset 0 1px 3px rgba(255, 255, 255, 0.3);
    }
}

.sudoku-cell.fixed {
    background: linear-gradient(145deg, #eceff1, #cfd8dc);
    color: #455a64;
    cursor: default;
    font-weight: 900;
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.1),
        inset -2px -2px 5px rgba(255, 255, 255, 0.7);
}

.sudoku-cell.error {
    background: linear-gradient(145deg, #ff5252, #f44336);
    color: white;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    box-shadow: 
        0 0 20px rgba(244, 67, 54, 0.6),
        inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px) rotate(-2deg); }
    20%, 40%, 60%, 80% { transform: translateX(5px) rotate(2deg); }
}

.sudoku-cell.highlight {
    background: linear-gradient(145deg, #fff9c4, #fff59d);
    box-shadow: 
        0 0 15px rgba(255, 235, 59, 0.3),
        inset 0 1px 3px rgba(255, 255, 255, 0.6);
}

/* MAXIMUM SPECIFICITY POSITION HIGHLIGHTING - ALWAYS OVERRIDES EVERYTHING */
.sudoku-cell.position-highlight,
.sudoku-cell.position-highlight.fixed,
.sudoku-cell.position-highlight.highlight,
.sudoku-cell.fixed.position-highlight,
body .sudoku-cell.position-highlight,
html body .sudoku-cell.position-highlight {
    background: linear-gradient(145deg, var(--league-color, #f92f60), var(--league-color-dark, #e8294d)) !important;
    color: white !important;
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    box-shadow: 
        0 0 25px var(--league-color, #f92f60) !important,
        0 0 15px var(--league-color-light, rgba(249, 47, 96, 0.6)) !important,
        inset 0 2px 4px rgba(255, 255, 255, 0.4) !important;
    border: 3px solid white !important;
    animation: positionHighlightPulse 2s ease-in-out infinite !important;
    transform: scale(1.02) !important;
    z-index: 50 !important;
}

@keyframes positionHighlightPulse {
    0%, 100% { 
        box-shadow: 
            0 0 25px var(--league-color, #f92f60),
            0 0 15px var(--league-color-light, rgba(249, 47, 96, 0.6)),
            inset 0 2px 4px rgba(255, 255, 255, 0.4);
        transform: scale(1.02);
    }
    50% { 
        box-shadow: 
            0 0 35px var(--league-color, #f92f60),
            0 0 25px var(--league-color-light, rgba(249, 47, 96, 0.8)),
            inset 0 2px 4px rgba(255, 255, 255, 0.5);
        transform: scale(1.03);
    }
}

.sudoku-cell.hint-available {
    background: linear-gradient(145deg, #fff59d, #ffeb3b);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        inset 0 1px 3px rgba(255, 255, 255, 0.8);
    border: 2px solid #ffd700;
    cursor: pointer;
    animation: hintPulse 1.5s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.6),
            inset 0 1px 3px rgba(255, 255, 255, 0.8);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.8),
            inset 0 1px 3px rgba(255, 255, 255, 0.8);
    }
}

.sudoku-cell.notes-mode {
    background: linear-gradient(145deg, #e8f5e8, #f0f8f0);
    border: 2px solid #4CAF50;
    cursor: crosshair;
}

.sudoku-cell.notes-selected {
    background: linear-gradient(145deg, #c8e6c9, #a5d6a7) !important;
    border: 3px solid #4CAF50 !important;
    transform: scale(1.05) !important;
    z-index: 20;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8) !important;
    position: relative;
}

.sudoku-cell.pop-in {
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(90deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Thicker borders for 3x3 sections */
.sudoku-cell:nth-child(3n) {
    margin-right: 4px;
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    margin-bottom: 4px;
}

/* ========== Notes System ========== */
.cell-notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    width: 100%;
    height: 100%;
    padding: 2px;
    font-size: 0.4em;
    font-weight: 600;
    color: #666;
}

.note-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.note-item:hover {
    background: rgba(76, 175, 80, 0.3);
    color: #2e7d32;
    transform: scale(1.1);
}

.note-item.active {
    background: #4CAF50;
    color: white;
    font-weight: 800;
}

/* ========== Position Selector ========== */
.position-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    position: relative;
}

.position-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.position-btn {
    padding: 12px 16px;
    border: 3px solid #1e3a5f;
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e3a5f;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Baseball stitching effects */
.position-btn::after {
    display: none;
}

/* Second stitch line */
.position-btn::before {
    display: none;
}

.position-btn:hover:not(.disabled) {
    background: linear-gradient(145deg, #1e3a5f, #2e4a7f);
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 28px rgba(0, 0, 0, 0.3),
        0 6px 15px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(255, 255, 255, 0.8);
    border-color: #ffffff;
}

.position-btn:hover:not(.disabled)::after {
    opacity: 0.8;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        #ffd700 3px,
        #ffd700 5px,
        transparent 5px,
        transparent 8px
    );
}

.position-btn:hover:not(.disabled)::before {
    opacity: 0.8;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        #ffd700 3px,
        #ffd700 5px,
        transparent 5px,
        transparent 8px
    );
}

.position-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: perspective(500px) rotateX(5deg) scale(0.95);
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1);
    filter: grayscale(0.8);
}

.position-btn.disabled:hover {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #1e3a5f;
    transform: perspective(500px) rotateX(5deg) scale(0.95);
}

/* Notes mode ON - all balls get green stroke/text */
.notes-mode-active .position-btn:not(.disabled) {
    border: 3px solid #4CAF50 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.6) !important;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        0 0 0 1px #ffffff,
        0 0 15px rgba(76, 175, 80, 0.4) !important;
}

/* Ball clicked/selected - solid green with white elements */
.position-btn.notes-active {
    background: linear-gradient(145deg, #4CAF50, #45a049) !important;
    border: 3px solid #ffffff !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 0 0 2px #4CAF50,
        0 0 25px rgba(76, 175, 80, 0.8) !important;
    transform: scale(1.15);
    animation: notesActivePulse 1.5s ease-in-out infinite;
}

@keyframes notesActivePulse {
    0%, 100% { 
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.2),
            0 3px 8px rgba(0, 0, 0, 0.15),
            inset 0 2px 4px rgba(255, 255, 255, 0.9),
            0 0 0 2px #ffffff,
            0 0 20px rgba(76, 175, 80, 0.6);
    }
    50% { 
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.2),
            0 3px 8px rgba(0, 0, 0, 0.15),
            inset 0 2px 4px rgba(255, 255, 255, 0.9),
            0 0 0 2px #ffffff,
            0 0 30px rgba(76, 175, 80, 0.9);
    }
} 