:root {
    --bg-color: #05070a;
    --primary: #f72585;
    --primary-hover: #b5179e;
    --secondary: #ff9e00;
    --accent: #4cc9f0;
    --danger: #f72585;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 10px 25px rgba(247, 37, 133, 0.1);
    --glow: 0 0 15px rgba(247, 37, 133, 0.3);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top, rgba(247, 37, 133, 0.1), transparent 70%);
    color: var(--text-main);
    min-height: 100vh;
    display: block;
    overflow-x: hidden;
}

header {
    background: radial-gradient(circle at top, rgba(247, 37, 133, 0.2), transparent 70%);
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 3rem;
}

header h1 {
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

footer {
    margin-top: 5rem;
    padding: 3rem;
    background: #05070a;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    margin-bottom: 1rem;
    text-shadow: var(--glow);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

#game-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 800px;
    box-shadow: var(--card-shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
    font-family: 'Outfit', sans-serif;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.4);
}

.btn-next {
    margin-top: 20px;
    background-color: var(--secondary);
    box-shadow: 0 4px 6px rgba(255, 158, 0, 0.3);
}

.btn-next:hover {
    background-color: #e68a00;
    box-shadow: 0 6px 12px rgba(255, 158, 0, 0.4);
}

.hidden {
    display: none !important;
}

/* Drag & Drop - Level 1 */
.drag-drop-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.draggables, .dropzones {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 250px;
}

.draggable {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--primary);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.draggable:active {
    cursor: grabbing;
}

.draggable.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.dropzone {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, border-color 0.3s;
    position: relative;
    color: var(--text-main);
}

.dropzone.drag-over {
    background: rgba(247, 37, 133, 0.1);
    border-color: var(--primary);
}

.dropzone.correct {
    border: 2px solid var(--secondary);
    background: rgba(255, 158, 0, 0.15);
}

.dropzone .dropzone-label {
    font-size: 0.9rem;
    color: #ffffff;
    pointer-events: none;
    margin-bottom: 5px;
    opacity: 0.8;
}

/* Quiz - Level 2 */
.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.btn-quiz {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
}

.btn-quiz:hover {
    border-color: var(--primary);
    background: rgba(247, 37, 133, 0.1);
}

.btn-quiz.correct {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.btn-quiz.wrong {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    animation: shake 0.4s;
}

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

/* Sortable - Level 3 */
.sortable-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.sortable-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    cursor: grab;
    display: flex;
    align-items: center;
    font-weight: 500;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sortable-item.dragging {
    opacity: 0.5;
}

.sortable-item strong {
    color: var(--primary);
    margin-right: 10px;
}

.sortable-item::before {
    content: "↕";
    margin-right: 15px;
    color: #9CA3AF;
    font-size: 1.2rem;
}

/* Feedback messages */
.feedback {
    margin-top: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    min-height: 24px;
}
.feedback.success { color: var(--secondary); }
.feedback.error { color: var(--danger); }

/* Victory Screen */
.victory-icon {
    font-size: 5rem;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-30px);}
    60% {transform: translateY(-15px);}
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    z-index: 1000;
    pointer-events: none;
}

/* Hangman - Level 5 */
.hangman-stats {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary);
}

.hangman-drawing-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

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

.hangman-letter {
    width: 40px;
    height: 50px;
    border-bottom: 3px solid var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-main);
    text-transform: uppercase;
}

.keyboard {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.key:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.key:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.key.correct {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.key.wrong {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

#hangman-def-popup {
    background: rgba(255, 255, 255, 0.05);
    border-left: 5px solid var(--secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    animation: fadeIn 0.5s ease;
    color: white;
}

#hangman-def-popup.failed {
    border-left-color: var(--danger);
}

#def-title {
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .quiz-options {
        grid-template-columns: 1fr;
    }
}
