* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e8e8e8;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 500px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    margin: 0 0 5px 0;
    font-size: 2.5em;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #aaa;
    margin: 0 0 25px 0;
    font-size: 0.95em;
}

.game-area {
    margin-bottom: 20px;
}

.clue-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #f39c12;
}

.clue-label {
    font-size: 0.8em;
    color: #f39c12;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.definition {
    font-size: 1.1em;
    line-height: 1.5;
    color: #fff;
    font-style: italic;
}

.word-display {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.letter-box {
    width: 45px;
    height: 55px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    transition: all 0.3s;
}

.letter-box.revealed {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #27ae60;
    animation: pop 0.3s ease;
}

.letter-box.hint {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-color: #f39c12;
    animation: pop 0.3s ease;
}

.letter-box.first {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-color: #3498db;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    50% { transform: scale(1.1) rotate(3deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.shake {
    animation: shake 0.4s ease;
}

.celebrate {
    animation: celebrate 0.5s ease;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#guess {
    flex: 1;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    outline: none;
    transition: border-color 0.3s;
}

#guess:focus {
    border-color: #f39c12;
}

#guess::placeholder {
    color: #777;
}

#submit-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.4);
}

#submit-btn:active {
    transform: translateY(0);
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.hint-btn, .skip-btn {
    flex: 1;
    padding: 12px;
    font-size: 0.9em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.hint-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

.hint-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.skip-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
    color: #f39c12;
}

.message {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    min-height: 30px;
    margin: 10px 0;
    transition: color 0.3s;
}

.message.success {
    color: #2ecc71;
}

.message.error {
    color: #e74c3c;
}

.message.info {
    color: #3498db;
}

.settings {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.settings label {
    color: #aaa;
    font-size: 0.9em;
}

#difficulty {
    padding: 8px 15px;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
}

#theme-toggle {
    padding: 8px 15px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.instructions {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 0.85em;
}

.instructions h3 {
    margin: 0 0 10px 0;
    color: #f39c12;
    font-size: 1em;
}

.instructions ul {
    margin: 0;
    padding-left: 20px;
    color: #aaa;
}

.instructions li {
    margin-bottom: 5px;
}

.music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    font-size: 0.85em;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.music-controls button {
    padding: 8px 12px;
    font-size: 0.9em;
    margin: 3px;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.music-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.music-controls .song-name {
    font-size: 0.8em;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

/* Light theme */
body.light {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    color: #333;
}

body.light .container {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

body.light h1 {
    background: linear-gradient(135deg, #e67e22, #d35400);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light .subtitle {
    color: #666;
}

body.light .clue-card {
    background: rgba(0, 0, 0, 0.05);
}

body.light .definition {
    color: #333;
}

body.light .letter-box {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

body.light #guess {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

body.light #guess::placeholder {
    color: #999;
}

body.light .stat {
    background: rgba(0, 0, 0, 0.05);
}

body.light .stat-label {
    color: #666;
}

body.light #difficulty {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

body.light #theme-toggle,
body.light .skip-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #666;
}

body.light .instructions {
    background: rgba(0, 0, 0, 0.05);
}

body.light .instructions ul {
    color: #666;
}

body.light .music-controls {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light .music-controls button {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #666;
}

body.light .music-controls button:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Mobile responsive */
@media (max-width: 520px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 2em;
    }

    .letter-box {
        width: 38px;
        height: 48px;
        font-size: 1.3em;
    }

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

    .input-area {
        flex-direction: column;
    }

    #submit-btn {
        width: 100%;
    }

    .controls {
        flex-direction: column;
    }

    .music-controls {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}
