/* ===== Sherlock Card Game Styles ===== */

/* ===== Game Board Layout ===== */
#game-board {
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

#game-board.active {
    display: flex;
}

/* ===== Instructions Panel ===== */
.instructions-panel {
    background: linear-gradient(135deg, #7A9CB8 0%, #6B8BA8 100%);
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.instructions-panel:hover {
    background: linear-gradient(135deg, #8AACC8 0%, #7B9BB8 100%);
}

.instruction-text {
    color: white;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== Circular Card Container ===== */
.cards-circle {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    min-height: 0;
}

.circle-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: min(500px, 80vw);
    max-height: min(500px, 80vh);
    aspect-ratio: 1;
}

/* ===== Sherlock Card Styles ===== */
.sherlock-card {
    position: absolute;
    width: 100px;
    height: 140px;
    cursor: pointer;
    transition: all 0.3s ease;
    transform-origin: center center;
}

.sherlock-card .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.sherlock-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.sherlock-card .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Card Back */
.sherlock-card .card-back {
    background: linear-gradient(135deg, #7A9CB8 0%, #6B8BA8 100%);
    font-size: 48px;
}

/* Card Front */
.sherlock-card .card-front {
    background: white;
    transform: rotateY(180deg);
    padding: 10px;
    gap: 8px;
}

.sherlock-card .card-front img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.card-clue {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.card-arrow {
    font-size: 28px;
}

.card-number {
    font-size: 28px;
    color: var(--secondary-color);
}

/* ===== Card States ===== */
.sherlock-card:hover:not(.flipped) {
    transform: scale(1.1) translateZ(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.sherlock-card.active {
    z-index: 10;
    animation: pulse 1.5s ease-in-out infinite;
}

.sherlock-card.target {
    z-index: 9;
    animation: highlight-pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 139, 106, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 139, 106, 0);
    }
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(122, 156, 184, 0.9);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(122, 156, 184, 0);
        transform: scale(1.15);
    }
}

/* ===== Guess Panel (Bottom) ===== */
.guess-panel {
    background: white;
    border-top: 3px solid var(--secondary-color);
    padding: 12px 15px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
    max-height: 30vh;
    overflow-y: auto;
}

.guess-panel.hidden {
    display: none;
}

.guess-header {
    text-align: center;
    margin-bottom: 10px;
}

.guess-prompt {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

.guess-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
}

.guess-option {
    width: 70px;
    height: 70px;
    border: 3px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    background: #f5f5f5;
}

.guess-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guess-option:hover {
    border-color: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.guess-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Feedback Animations ===== */
.sherlock-card.correct-guess {
    animation: correct-flash 0.6s ease;
}

.sherlock-card.wrong-guess {
    animation: wrong-shake 0.6s ease;
}

@keyframes correct-flash {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.5) drop-shadow(0 0 20px rgba(76, 175, 80, 0.8));
    }
}

@keyframes wrong-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ===== Responsive Styles ===== */

/* Tablet */
@media (max-width: 1024px) {
    .circle-wrapper {
        max-width: min(450px, 80vw);
        max-height: min(450px, 60vh);
    }

    .sherlock-card {
        width: 85px;
        height: 119px;
    }

    .sherlock-card .card-front img {
        width: 60px;
        height: 60px;
    }

    .card-clue {
        font-size: 20px;
    }

    .card-arrow,
    .card-number {
        font-size: 24px;
    }

    .guess-panel {
        max-height: 32vh;
    }

    .guess-option {
        width: 65px;
        height: 65px;
    }

    .guess-prompt {
        font-size: 18px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .cards-circle {
        padding: 15px 10px;
    }

    .circle-wrapper {
        max-width: min(400px, 80vw);
        max-height: min(400px, 50vh);
    }

    .sherlock-card {
        width: 70px;
        height: 98px;
    }

    .sherlock-card .card-back {
        font-size: 36px;
    }

    .sherlock-card .card-front img {
        width: 50px;
        height: 50px;
    }

    .card-clue {
        font-size: 18px;
        gap: 5px;
    }

    .card-arrow,
    .card-number {
        font-size: 20px;
    }

    .guess-panel {
        padding: 10px;
        max-height: 35vh;
    }

    .guess-prompt {
        font-size: 16px;
    }

    .guess-options {
        gap: 8px;
    }

    .guess-option {
        width: 60px;
        height: 60px;
    }

    .instruction-text {
        font-size: 18px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .circle-wrapper {
        max-width: min(350px, 85vw);
        max-height: min(350px, 45vh);
    }

    .sherlock-card {
        width: 60px;
        height: 84px;
    }

    .sherlock-card .card-front img {
        width: 40px;
        height: 40px;
    }

    .card-clue {
        font-size: 16px;
    }

    .card-arrow,
    .card-number {
        font-size: 18px;
    }

    .guess-panel {
        max-height: 40vh;
    }

    .guess-option {
        width: 50px;
        height: 50px;
    }

    .guess-prompt {
        font-size: 14px;
    }

    .instruction-text {
        font-size: 16px;
    }
}
