/* Vocabulary Games Unified CSS */
/* Ray T's Interactive Class Hub */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e8d5c4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Main Container */
.container {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 60px;
}

.header h1 {
    font-size: 3em;
    color: #daa520;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.2em;
    color: #d4af37;
    opacity: 0.9;
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    color: #e8d5c4;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.3);
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 100%);
}

/* Game Selection Menu */
.game-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 600px;
    margin: 0 auto 50px;
}

.game-card {
    background: rgba(26, 26, 46, 0.8);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(218, 165, 32, 0.3);
    border-color: #daa520;
}

.game-card.active {
    border-color: #daa520;
    background: rgba(218, 165, 32, 0.1);
}

.game-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.game-title {
    font-size: 1.5em;
    color: #daa520;
    margin-bottom: 10px;
    font-weight: bold;
}

.game-description {
    font-size: 0.95em;
    color: #d4af37;
    opacity: 0.8;
    line-height: 1.4;
}

/* Game Container */
.game-container {
    display: none;
    background: rgba(26, 26, 46, 0.6);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-container.active {
    display: block;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h2 {
    font-size: 2em;
    color: #daa520;
    margin-bottom: 10px;
}

.game-header p {
    color: #d4af37;
    font-size: 1.1em;
}

/* Score Board */
.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
    background: rgba(218, 165, 32, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.score-label {
    font-size: 0.9em;
    color: #d4af37;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.score-value {
    font-size: 1.5em;
    color: #daa520;
    font-weight: bold;
}

/* Game Controls */
.game-controls {
    text-align: center;
    margin-top: 30px;
}

.control-btn {
    background: linear-gradient(135deg, #daa520 0%, #f4c430 100%);
    color: #1a1a2e;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3);
}

.control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.5);
}

.control-btn:active {
    transform: scale(0.98);
}

/* Word Match Game */
.match-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.match-card {
    background: linear-gradient(135deg, #2d3561 0%, #3a4276 100%);
    border: 2px solid #4a5490;
    border-radius: 15px;
    padding: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.match-card:hover:not(.selected):not(.matched) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.3);
}

.match-card.selected {
    background: linear-gradient(135deg, #daa520 0%, #f4c430 100%);
    color: #1a1a2e;
    transform: scale(1.05);
    border-color: #daa520;
}

.match-card.matched {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border-color: #27ae60;
    animation: matchPulse 0.5s ease;
}

.match-card.wrong {
    animation: wrongShake 0.5s ease;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

@keyframes matchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Heartbeat Words Game */
.hangman-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.lives-display {
    font-size: 3em;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.synonym-hint {
    background: rgba(218, 165, 32, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 1.1em;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.synonym-hint strong {
    color: #daa520;
}

.word-display {
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 10px;
    margin: 30px 0;
    color: #daa520;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.wrong-guesses {
    font-size: 1.1em;
    color: #e74c3c;
    margin-bottom: 20px;
    min-height: 30px;
}

.alphabet-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

.letter-btn {
    background: linear-gradient(135deg, #3a4276 0%, #4a5490 100%);
    color: #e8d5c4;
    border: 2px solid #4a5490;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-btn:hover:not(:disabled) {
    transform: scale(1.1);
    background: linear-gradient(135deg, #daa520 0%, #f4c430 100%);
    color: #1a1a2e;
    border-color: #daa520;
}

.letter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #2a2a3e;
}

.letter-btn.correct {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-color: #27ae60;
}

.letter-btn.wrong {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border-color: #c0392b;
}

/* Result Modal */
.result-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #daa520;
    border-radius: 20px;
    padding: 40px;
    z-index: 2000;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.result-modal.show {
    display: block;
}

.result-modal h2 {
    font-size: 2.5em;
    color: #daa520;
    margin-bottom: 20px;
}

.result-stats {
    margin: 20px 0;
    font-size: 1.2em;
    line-height: 2;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #daa520;
    font-size: 2em;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    transform: scale(1.2);
}

/* Timer */
.timer {
    font-size: 1.5em;
    font-weight: bold;
    color: #daa520;
    text-align: center;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .game-menu {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
    }

    .match-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .match-card {
        font-size: 0.8em;
        padding: 15px 10px;
        min-height: 60px;
    }

    .word-display {
        font-size: 1.8em;
        letter-spacing: 5px;
    }

    .alphabet-buttons {
        gap: 5px;
    }

    .letter-btn {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }

    .result-modal {
        padding: 30px;
    }

    .result-modal h2 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .header {
        padding-top: 40px;
    }

    .game-card {
        padding: 25px;
    }

    .game-icon {
        font-size: 3em;
    }

    .match-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-board {
        gap: 15px;
    }

    .score-item {
        padding: 10px 15px;
    }
}