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

body {
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, #0a1828 0%, #1a2332 50%, #0f1e2e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #d4af37;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at top, rgba(93, 173, 226, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.game-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
}

/* Header */
.game-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    position: relative;
}

.griffin {
    font-size: 3em;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    animation: float 3s ease-in-out infinite;
}

.griffin.left {
    margin-right: 20px;
}

.griffin.right {
    margin-left: 20px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.game-title {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    color: #d4af37;
    text-shadow:
        0 0 10px rgba(212, 175, 55, 0.8),
        0 0 20px rgba(212, 175, 55, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Main Game Area */
.main-game {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0;
    gap: 20px;
}

/* Guessed Letters Panel */
.guessed-letters-panel, .guesses-panel {
    flex: 0 0 200px;
    text-align: center;
}

.panel-title {
    font-size: 0.9em;
    color: #d4af37;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.letter-circle {
    width: 180px;
    height: 180px;
    border: 3px solid #d4af37;
    border-radius: 50%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: rgba(26, 35, 50, 0.6);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    gap: 8px;
    margin: 0 auto;
}

.guessed-letter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    border: 2px solid #d4af37;
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.guessed-letter.correct {
    border-color: #5dade2;
    color: #5dade2;
    box-shadow: 0 0 15px rgba(93, 173, 226, 0.6);
}

.guessed-letter.wrong {
    border-color: #e74c3c;
    color: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}

/* Hangman Portal */
.hangman-portal {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.portal-frame {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(93, 173, 226, 0.3));
}

.hidden {
    display: none;
}

.ethereal {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Guesses Panel */
.hourglass {
    font-size: 3em;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    animation: float 3s ease-in-out infinite;
}

.guesses-number {
    font-size: 4em;
    font-weight: bold;
    color: #d4af37;
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.8),
        0 0 40px rgba(212, 175, 55, 0.4);
    margin-top: 10px;
}

/* Word Display */
.word-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.word-display {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.letter-box {
    width: 50px;
    height: 60px;
    border: 3px solid #d4af37;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: #d4af37;
    background: rgba(26, 35, 50, 0.6);
    box-shadow:
        0 0 15px rgba(212, 175, 55, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    position: relative;
}

.letter-box::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    pointer-events: none;
}

/* Keyboard */
.keyboard-container {
    margin: 30px 0;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(26, 35, 50, 0.4);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    box-shadow:
        0 0 30px rgba(212, 175, 55, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.key {
    background: linear-gradient(135deg, rgba(74, 111, 165, 0.4), rgba(42, 66, 99, 0.6));
    color: #d4af37;
    border: 2px solid rgba(212, 175, 55, 0.5);
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

.key:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.6), rgba(74, 111, 165, 0.8));
    transform: translateY(-2px);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(93, 173, 226, 0.4);
    border-color: #5dade2;
}

.key:disabled {
    background: rgba(26, 35, 50, 0.6);
    color: rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.2);
    cursor: not-allowed;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Message */
.message {
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    margin: 20px 0;
    min-height: 60px;
    text-shadow: 0 0 10px currentColor;
}

.message.win {
    color: #5dade2;
    animation: glow 1s ease-in-out infinite;
}

.message.lose {
    color: #e74c3c;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px currentColor; }
    50% { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

/* Buttons */
.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.fantasy-button {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(184, 134, 11, 0.5));
    color: #d4af37;
    border: 2px solid #d4af37;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.3);
}

.fantasy-button:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), rgba(184, 134, 11, 0.7));
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(212, 175, 55, 0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-game {
        flex-direction: column;
    }

    .guessed-letters-panel, .guesses-panel {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 1.8em;
    }

    .griffin {
        font-size: 2em;
    }

    .keyboard {
        grid-template-columns: repeat(7, 1fr);
    }

    .letter-box {
        width: 40px;
        height: 50px;
        font-size: 1.5em;
    }

    .key {
        padding: 10px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .keyboard {
        grid-template-columns: repeat(5, 1fr);
    }

    .letter-circle {
        width: 150px;
        height: 150px;
    }

    .guessed-letter {
        width: 30px;
        height: 30px;
        font-size: 0.8em;
    }
}
