/* css/hockey-multiple-choice.css */
/* Styles for the Multiple Choice Vocabulary Game - Version 2.0 */

/* --- CSS Variables for easy theming --- */
:root {
    --mc-primary-bg: #f9f9f9;
    --mc-card-bg: #ffffff;
    --mc-card-flipped-bg: #4a0e4a; /* Darker purple for the back */
    --mc-text-color: #333;
    --mc-button-bg: #800080;
    --mc-button-hover-bg: #6a0dad;
    --mc-correct-color: #28a745;
    --mc-incorrect-color: #dc3545;
    --mc-border-radius: 8px;
}

/* --- Base Wrapper --- */
.hockey-mc-game-wrapper {
    padding: 20px;
    margin: 25px auto;
    border: 1px solid #e0e0e0;
    border-radius: var(--mc-border-radius);
    background-color: var(--mc-primary-bg);
    color: var(--mc-text-color);
    width: 100%;
    max-width: 600px; /* A bit wider for better layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Title --- */
.hockey-mc-game-wrapper .hockey-mc-game-title {
    color: var(--mc-text-color);
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8em;
    font-weight: 600;
}

/* --- Card Flip Container --- */
.hockey-mc-game-wrapper .hmc-card-container {
    width: 100%;
    max-width: 500px;
    margin-bottom: 25px;
    perspective: 1000px; /* Enables 3D space for the flip effect */
}

.hockey-mc-game-wrapper .hmc-card-viewport {
    width: 100%;
    min-height: 180px;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d; /* Important for keeping children in 3D space */
    border-radius: 15px;
}

.hmc-card-container.is-flipped .hmc-card-viewport {
    transform: rotateY(180deg);
}

/* --- Card Front & Back --- */
.hockey-mc-game-wrapper .hmc-card-front,
.hockey-mc-game-wrapper .hmc-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hides the back of the element when flipped */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 25px;
    box-sizing: border-box;
    text-align: center;
}

.hockey-mc-game-wrapper .hmc-card-front {
    background-color: var(--mc-card-bg);
    z-index: 2;
}

.hockey-mc-game-wrapper .hmc-card-back {
    background-color: var(--mc-card-flipped-bg);
    color: white;
    transform: rotateY(180deg);
    z-index: 1;
    font-size: 1.5em;
    font-weight: bold;
}

.hockey-mc-game-wrapper .hmc-definition-display {
    font-size: 1.2em;
    line-height: 1.6;
    color: var(--mc-text-color);
    backface-visibility: hidden; /* Keep this for good measure */
}

.endgame-message {
    font-size: 1.5em;
    font-weight: bold;
}

.final-score {
    display: block;
    font-size: 1.1em; /* Larger font for the score */
    margin-top: 15px; /* Add space between message and score */
    font-weight: normal;
}

/* --- Choices Container --- */
.hockey-mc-game-wrapper .hmc-choices-container {
    width: 100%;
    max-width: 500px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    min-height: 130px; /* Set a minimum height to prevent collapsing */
    transition: min-height 0.3s ease-in-out; /* Smooth transition if height changes */
}

/* --- Choice Buttons --- */
.hockey-mc-game-wrapper .hmc-choice-button {
    padding: 14px 18px !important;
    background-color: var(--mc-button-bg) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 1em !important;
    border-radius: var(--mc-border-radius) !important;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.hockey-mc-game-wrapper .hmc-choice-button:hover:not(:disabled) {
    background-color: var(--mc-button-hover-bg) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.hockey-mc-game-wrapper .hmc-choice-button:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.hockey-mc-game-wrapper .restart-button {
    grid-column: 1 / -1; /* Span the full grid area */
    justify-self: center; /* Center the button within the grid area */
    width: 50%; /* Make the button a more reasonable size */
    max-width: 250px; /* Set a max-width */
    margin-top: 15px;
}

/* --- Feedback Animations --- */
.hmc-choice-button.correct-flash {
    animation: mc-button-flash 0.8s ease forwards;
    animation-fill-mode: both;
    background-color: var(--mc-correct-color) !important;
}

.hmc-choice-button.incorrect-flash {
    animation: mc-button-flash 0.8s ease forwards;
    animation-fill-mode: both;
    background-color: var(--mc-incorrect-color) !important;
}

.hmc-card-viewport.correct-glow {
    animation: mc-glow-correct 0.8s ease;
}

.hmc-card-viewport.incorrect-shake {
    animation: mc-shake-incorrect 0.6s ease;
}

@keyframes mc-button-flash {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes mc-glow-correct {
    0%, 100% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); }
    50% { box-shadow: 0 0 25px 5px rgba(40, 167, 69, 0.5); }
}

@keyframes mc-shake-incorrect {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* --- Feedback & Progress Areas --- */
.hockey-mc-game-wrapper .hmc-feedback-area {
    min-height: 24px;
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.hockey-mc-game-wrapper .hmc-progress-area {
    margin-top: 10px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* --- Error/Notice Messages --- */
.hockey-mc-error,
.hockey-mc-notice {
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
    padding: 15px;
    border: 1px solid;
    border-radius: var(--mc-border-radius);
}
.hockey-mc-error {
    color: var(--mc-incorrect-color);
    border-color: var(--mc-incorrect-color);
    background-color: #f8d7da;
}
.hockey-mc-notice {
     color: #555;
     border-color: #ccc;
     background-color: #f0f0f0;
}

/* --- Fix for flipped text visibility --- */
.hmc-card-container.is-flipped .hmc-definition-display {
    visibility: hidden;
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    .hockey-mc-game-wrapper .hmc-choices-container {
        grid-template-columns: repeat(2, 1fr); /* Two columns on mobile */
        min-height: 120px; /* Adjust min-height for two rows of buttons */
    }
    .hockey-mc-game-wrapper .hmc-card-viewport {
        min-height: 150px;
    }
    .hockey-mc-game-wrapper .hmc-definition-display {
        font-size: 1.1em;
    }
    .endgame-message {
        font-size: 1.2em; /* Reduce font size on mobile */
    }
    .final-score {
        font-size: 1em; /* Reduce font size on mobile */
    }
}
