#puzzleModal .modal-content {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 2px solid #b8860b;
    /* Golden border */
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

#puzzleModal .modal-header {
    border-bottom: 1px solid rgba(184, 134, 11, 0.3);
    padding: 1.5rem;
}

#puzzleModal .modal-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #ffd700;
    /* Gold text */
    letter-spacing: 0.5px;
}

#puzzleModal .modal-footer {
    border-top: 1px solid rgba(184, 134, 11, 0.3);
    padding: 1.25rem;
}

#puzzleBoardContainer {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    background-color: #ebecd0;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    transition: transform 0.3s ease;
}

#puzzleBoardContainer:hover {
    transform: scale(1.01);
}



#puzzleBoard {
    width: 100%;
    cursor: pointer;
    touch-action: none;
}

/* Premium Button Styles */
#puzzleModal .btn-primary {
    background: linear-gradient(135deg, #b8860b 0%, #ffd700 100%);
    border: none;
    color: #000;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(184, 134, 11, 0.3);
}

#puzzleModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(184, 134, 11, 0.5);
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    color: #000;
}

#puzzleModal .btn-secondary {
    background: #444;
    border: 1px solid #666;
    color: #fff;
    transition: all 0.2s ease;
}

#puzzleModal .btn-secondary:hover {
    background: #555;
    transform: translateY(-1px);
}

#puzzleModal .btn-outline-secondary {
    color: #aaa;
    border-color: #444;
}

#puzzleModal .btn-outline-secondary:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #666;
}

/* Force pieces to NOT be silhouetted by global styles */
#puzzleBoard svg .piece * {
    fill: initial !important;
    stroke: initial !important;
}

/* Reset any global SVG silhouetting */
#puzzleBoard svg {
    color: transparent !important;
}

#puzzleBoard .piece {
    fill: none !important;
}

#puzzleBoard .board-border {
    fill: #1a1a1a !important;
}

.puzzle-feedback {
    min-height: 28px;
    font-weight: 500;
    margin-top: 15px;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.puzzle-feedback.success {
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.puzzle-feedback.error {
    color: #ff5252;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.3);
}

#puzzleModal .btn-close {
    filter: invert(1) brightness(1.5);
    opacity: 0.7;
    transition: opacity 0.2s;
}

#puzzleModal .btn-close:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    #puzzleModal .modal-dialog {
        margin: 0.5rem;
    }

    #puzzleBoardContainer {
        max-width: 100%;
    }
}

/* Marker Styles for Highlight */
.marker-frame {
    stroke: #ffd700 !important;
    stroke-width: 4px !important;
    opacity: 0.8 !important;
    fill: none !important;
}