:root {
    --fire-color: #ff5722;
    --water-color: #2196f3;
    --earth-color: #795548;
    --air-color: #90caf9;
    --boss-color: #9c27b0;
    --magic-gold: #ffd700;
    --magic-violet: #8a2be2;
    --convergence-color: #ff6f6f;
}

html,
body {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;

}

* {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.games-plugin-container {
    touch-action: manipulation;
    max-width: 1200px;
    margin: 16px auto 30px auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    border: 3px solid #333;
    border-radius: 10px;
    transition: all 0.5s ease;
    position: relative;
}

.game-over,
.game-win {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.games-plugin-header {
    text-align: center;
    margin-bottom: 30px;
    background-color: #e0e0e0;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.5s ease;
}

.games-plugin-header h2,
.games-plugin-header p {
    transition: color 0.5s ease;
}

.games-plugin-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.games-plugin-option {
    flex: 1 0 200px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.games-plugin-option-inner {
    padding: 15px;
}

.games-plugin-option.selected {
    border-color: #4CAF50;
    background-color: #e8f5e9;
}

.games-plugin-topic-selection .games-plugin-option.selected {
    border-color: #2196F3;
    background-color: #e3f2fd;
}

.games-plugin-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.games-plugin-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.games-plugin-loader {
    margin-top: 15px;
    font-weight: bold;
    color: #333;
}

.theme-space-battle .games-plugin-loader,
.theme-elemental-battle .games-plugin-loader {
    color: white !important;
}


.theme-space-battle .games-plugin-selections-summary h3,
.theme-space-battle .games-plugin-difficulty-selection h3,
.theme-space-battle .games-plugin-game-selection h3,
.theme-space-battle .games-plugin-topic-selection h3,
.theme-space-battle .games-plugin-questions-results h3,
.theme-space-battle .games-plugin-questions-header h3,
.theme-elemental-battle .games-plugin-selections-summary h3,
.theme-elemental-battle .games-plugin-difficulty-selection h3,
.theme-elemental-battle .games-plugin-game-selection h3,
.theme-elemental-battle .games-plugin-questions-results h3,
.theme-elemental-battle .games-plugin-questions-header h3,
.theme-elemental-battle .games-plugin-topic-selection h3 {
    color: white !important
}

#games-plugin-questions-container {
    margin-top: 30px;
}

.games-plugin-selections-summary {
    background-color: #f1f1f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
    transition: all 0.5s ease;
}

.games-plugin-selections-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.games-plugin-selections-summary li {
    margin-bottom: 10px;
    font-size: 16px;
}

.games-plugin-selections-summary span {
    font-weight: bold;
    color: #2196F3;
    transition: color 0.5s ease;
}

.games-plugin-notice {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.games-plugin-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

h3 {
    margin-top: 25px;
    border-bottom: 2px solid #ccc;
    padding-bottom: 5px;
    transition: all 0.5s ease;
}

.games-plugin-questions {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
}

.games-plugin-question {
    margin-bottom: 25px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
}

.games-plugin-option-label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.games-plugin-option-label input {
    margin-right: 10px;
}

.games-plugin-option-label.correct {
    background-color: #e8f5e9;
    border-color: #4CAF50;
}

.games-plugin-option-label.incorrect {
    background-color: #ffebee;
    border-color: #f44336;
}

.games-plugin-source-info {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 10px;
    font-style: italic;
}

/* Space Battle Theme */
.theme-space-battle {
    background-color: #0a1128;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 100 100"><rect width="100" height="100" fill="%230a1128"/><circle cx="10" cy="20" r="0.5" fill="white"/><circle cx="25" cy="50" r="0.3" fill="white"/><circle cx="40" cy="30" r="0.4" fill="white"/><circle cx="60" cy="10" r="0.2" fill="white"/><circle cx="80" cy="40" r="0.3" fill="white"/><circle cx="95" cy="70" r="0.5" fill="white"/><circle cx="75" cy="85" r="0.2" fill="white"/><circle cx="50" cy="90" r="0.4" fill="white"/><circle cx="30" cy="75" r="0.3" fill="white"/><circle cx="15" cy="95" r="0.2" fill="white"/><circle cx="35" cy="5" r="0.2" fill="%234fc3f7"/><circle cx="85" cy="15" r="0.4" fill="%234fc3f7"/><circle cx="55" cy="30" r="0.5" fill="%234fc3f7"/></svg>');
    color: #f0f0f0;
    border-color: #1a428a;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    background-attachment: fixed;
}

.theme-space-battle .games-plugin-header {
    background-color: rgba(26, 66, 138, 0.8);
    color: white;
    border: 1px solid #3c7dd9;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.theme-space-battle .games-plugin-header h2,
.theme-space-battle .games-plugin-header p {
    color: white;
}

.theme-space-battle h3 {
    color: #4fc3f7;
    border-bottom-color: #3c7dd9;
    text-shadow: 0 0 5px rgba(79, 195, 247, 0.5);
}

.theme-space-battle .games-plugin-option {
    background-color: rgba(18, 30, 64, 0.8);
    border-color: #3c7dd9;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.theme-space-battle .games-plugin-option h4,
.theme-space-battle .games-plugin-option p {
    color: white;
}

.theme-space-battle .games-plugin-option:hover {
    background-color: #1a428a;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.theme-space-battle .games-plugin-option.selected {
    border-color: #4fc3f7;
    background-color: rgba(26, 66, 138, 0.8);
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.7);
}

.theme-space-battle .games-plugin-topic-selection .games-plugin-option.selected {
    border-color: #4fc3f7;
    background-color: rgba(20, 72, 112, 0.8);
}

.theme-space-battle .games-plugin-selections-summary {
    background-color: rgba(18, 30, 64, 0.8);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.theme-space-battle .games-plugin-selections-summary span {
    color: #4fc3f7;
    text-shadow: 0 0 5px rgba(79, 195, 247, 0.7);
}

.theme-space-battle .games-plugin-button {
    background: linear-gradient(to bottom, #3c7dd9, #185092);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 10px rgba(60, 125, 217, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.question-timer,
.elemental-question-timer {
    position: absolute;
    right: 20px;
    top: 10px;
    background-color: #4ade80;
    color: #0a0e17;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 16px;
}

.elemental-question-timer {
    right: 0px;
    top: 35px;
}

#level-screen .level-header {
    position: relative;
}

.question-timer.warning,
.elemental-question-timer.warning {
    background-color: #facc15;
}

.question-timer.danger,
.elemental-question-timer.danger {
    background-color: #f87171;
}

.theme-space-battle .games-plugin-button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #4fc3f7, #0288d1);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(79, 195, 247, 0.6);
}

.maf_hidden {
    display: none !important;
}

.theme-space-battle .games-plugin-questions {
    background-color: rgba(18, 30, 64, 0.8);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    z-index: 99999999;
    position: relative;
    margin-bottom: 0;
}

.theme-space-battle .games-plugin-question {
    background-color: rgba(10, 17, 40, 0.8);
    border: 1px solid #3c7dd9;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.theme-space-battle .games-plugin-question-text {
    color: white;
    margin-bottom: 10px;
}

.theme-space-battle .games-plugin-option-label {
    background-color: rgba(18, 30, 64, 0.7);
    border-color: #3c7dd9;
    color: white;
}

.theme-space-battle .games-plugin-option-label:hover {
    background-color: rgba(26, 66, 138, 0.7);
}

.theme-space-battle .games-plugin-source-info {
    color: #4fc3f7;
}

.theme-space-battle .games-plugin-option-label.correct {
    background-color: rgb(74, 222, 128);
    border-color: #4CAF50;
    color: white;
}

.boss-health-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    text-align: center;
    z-index: 20;
}

.boss-health-label {
    color: #ef4444;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    margin-bottom: 5px;
}

.boss-health-bar {
    width: 100%;
    height: 15px;
    background-color: #f87171;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

#level-transition,
.maf-notice-sceen {
    z-index: 9999;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #171e34e3;
    padding: 20px;
    border-radius: 10px;
}

.boss-health-fill {
    height: 100%;
    background-color: #22c55e;
    width: 100%;
    transition: width 0.3s ease;
}

.theme-space-battle .games-plugin-option-label.incorrect {
    background-color: rgb(248, 113, 113);
    border-color: #f44336;
    color: white;
}

/* Elemental Battle Theme - Enhanced mystical version */
.theme-elemental-battle {
    background: linear-gradient(135deg, #0c0a1f, #2b0a3a, #1a173b);
    color: #e0e0e0;
    border-color: #8a4fbf;
    box-shadow: 0 0 30px rgba(138, 79, 191, 0.4);
    position: relative;
    overflow: hidden;
}

.theme-elemental-battle:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><radialGradient id="rgrad" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"><stop offset="0%" style="stop-color:rgb(255,255,255);stop-opacity:0.1" /><stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0" /></radialGradient></defs><rect width="100" height="100" fill="none"/><circle cx="20" cy="30" r="0.8" fill="url(%23rgrad)" /><circle cx="80" cy="40" r="0.6" fill="url(%23rgrad)" /><circle cx="50" cy="70" r="1" fill="url(%23rgrad)" /><circle cx="30" cy="10" r="0.7" fill="url(%23rgrad)" /><circle cx="70" cy="90" r="0.9" fill="url(%23rgrad)" /></svg>');
    background-size: 300px 300px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.theme-elemental-battle .games-plugin-header {
    background: linear-gradient(to right, #3a1a5a, #5a2a8a);
    color: white;
    border: 1px solid #8a4fbf;
    box-shadow: 0 0 15px rgba(138, 79, 191, 0.5);
    position: relative;
    overflow: hidden;
}

.theme-elemental-battle .games-plugin-header:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 65%, rgba(255, 255, 255, 0.1) 67.5%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 4s infinite linear;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.theme-elemental-battle .games-plugin-header h2,
.theme-elemental-battle .games-plugin-header p {
    color: white;
    position: relative;
    z-index: 1;
}

.theme-elemental-battle .games-plugin-header h2 {
    text-shadow: 0 0 10px rgba(138, 79, 191, 0.7);
}

.theme-elemental-battle h3 {
    color: #d0a9ff !important;
    border-bottom: 2px solid rgba(138, 79, 191, 0.4) !important;
    text-shadow: 0 0 5px rgba(138, 79, 191, 0.5) !important;
}

.theme-elemental-battle .games-plugin-option {
    background: linear-gradient(to bottom, rgba(58, 26, 90, 0.9), rgba(42, 18, 66, 0.9));
    border: 2px solid rgba(138, 79, 191, 0.6);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    position: relative;
    overflow: hidden;
}

.theme-elemental-battle .games-plugin-option::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(208, 169, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.theme-elemental-battle .games-plugin-option:hover::after {
    opacity: 1;
}

.theme-elemental-battle .games-plugin-option h4,
.theme-elemental-battle .games-plugin-option p {
    color: #e0e0e0;
    position: relative;
    z-index: 1;
}

.theme-elemental-battle .games-plugin-option:hover {
    border-color: rgba(208, 169, 255, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(138, 79, 191, 0.5);
}

.theme-elemental-battle .games-plugin-option.selected {
    border-color: #d0a9ff;
    background: linear-gradient(to bottom, rgba(70, 34, 110, 0.9), rgba(54, 26, 86, 0.9));
    box-shadow: 0 0 20px rgba(138, 79, 191, 0.6);
    position: relative;
}

.theme-elemental-battle .games-plugin-option.selected::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(208, 169, 255, 0.5);
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(208, 169, 255, 0.5) inset;
    pointer-events: none;
}

.theme-elemental-battle .games-plugin-topic-selection .games-plugin-option.selected {
    border-color: #d0a9ff;
    background: linear-gradient(to bottom, rgba(70, 34, 110, 0.9), rgba(54, 26, 86, 0.9));
}

.theme-elemental-battle .magic-sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: #d0a9ff;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: float-up 3s ease-out forwards;
}

@keyframes float-up {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.theme-elemental-battle .games-plugin-selections-summary {
    background: linear-gradient(to bottom, rgba(58, 26, 90, 0.9), rgba(42, 18, 66, 0.9));
    color: #e0e0e0;
    border: 1px solid rgba(138, 79, 191, 0.6);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.theme-elemental-battle .games-plugin-selections-summary::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 65%, rgba(208, 169, 255, 0.1) 67.5%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 8s infinite linear;
    pointer-events: none;
}

.theme-elemental-battle .games-plugin-selections-summary span {
    color: #d0a9ff;
    text-shadow: 0 0 5px rgba(138, 79, 191, 0.5);
    position: relative;
}

.theme-elemental-battle .games-plugin-button {
    background: linear-gradient(to bottom, #8a4fbf, #5a2a8a);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(138, 79, 191, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.theme-elemental-battle .games-plugin-button::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(208, 169, 255, 0.4) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.theme-elemental-battle .games-plugin-button:hover:not(:disabled)::before {
    opacity: 1;
}

.theme-elemental-battle .games-plugin-button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #9a5fcf, #6a3a9a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(138, 79, 191, 0.6);
}

.theme-elemental-battle .games-plugin-questions {
    background: linear-gradient(to bottom, rgba(58, 26, 90, 0.9), rgba(42, 18, 66, 0.9));
    color: #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(138, 79, 191, 0.4);
}

.theme-elemental-battle .games-plugin-question {
    background: rgba(26, 10, 46, 0.8);
    border: 1px solid rgba(138, 79, 191, 0.4);
    color: #e0e0e0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    backdrop-filter: blur(5px);
}

.theme-elemental-battle .games-plugin-question::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(138, 79, 191, 0.1), transparent 70%);
    pointer-events: none;
}

.theme-elemental-battle .games-plugin-question-text {
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    margin-bottom: 10px;

}


.theme-elemental-battle .games-plugin-option-label {
    background: rgba(42, 18, 66, 0.8);
    border-color: rgba(138, 79, 191, 0.4);
    color: #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-elemental-battle .games-plugin-option-label::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(208, 169, 255, 0.1), transparent);
    transition: left 0.3s ease;
}

.theme-elemental-battle .games-plugin-option-label:hover::after {
    left: 100%;
}

.theme-elemental-battle .games-plugin-option-label:hover {
    background: rgba(54, 26, 86, 0.8);
    border-color: rgba(138, 79, 191, 0.6);
    transform: translateX(5px);
}

.theme-elemental-battle .games-plugin-source-info {
    color: rgba(208, 169, 255, 0.7);
}

.theme-elemental-battle .games-plugin-option-label.correct {
    background: linear-gradient(to right, rgba(46, 125, 50, 0.5), rgba(76, 175, 80, 0.3));
    border-color: rgba(76, 175, 80, 0.8);
    color: #e0e0e0;
    position: relative;
}

.theme-elemental-battle .games-plugin-option-label.correct::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(76, 175, 80, 0.3), transparent 70%);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.theme-elemental-battle .games-plugin-option-label.incorrect {
    background: linear-gradient(to right, rgba(183, 28, 28, 0.5), rgba(198, 40, 40, 0.3));
    border-color: rgba(244, 67, 54, 0.8);
    color: #e0e0e0;
}

/* Full Immersion Mode */
.games-plugin-immersion-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    z-index: 100;
    transition: all 0.3s ease;
}

/* Disabled state for immersion toggle */
.games-plugin-immersion-toggle:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Full screen mode styles */
body.full-immersion {
    margin: 0;
    padding: 0;
    transition: all 0.5s ease;
}

body.full-immersion.space-battle-theme {
    background-color: #0a1128;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 100 100"><rect width="100" height="100" fill="%230a1128"/><circle cx="10" cy="20" r="0.5" fill="white"/><circle cx="25" cy="50" r="0.3" fill="white"/><circle cx="40" cy="30" r="0.4" fill="white"/><circle cx="60" cy="10" r="0.2" fill="white"/><circle cx="80" cy="40" r="0.3" fill="white"/><circle cx="95" cy="70" r="0.5" fill="white"/><circle cx="75" cy="85" r="0.2" fill="white"/><circle cx="50" cy="90" r="0.4" fill="white"/><circle cx="30" cy="75" r="0.3" fill="white"/><circle cx="15" cy="95" r="0.2" fill="white"/><circle cx="35" cy="5" r="0.2" fill="%234fc3f7"/><circle cx="85" cy="15" r="0.4" fill="%234fc3f7"/><circle cx="55" cy="30" r="0.5" fill="%234fc3f7"/></svg>');
    color: white;
    background-attachment: fixed;
}

body.full-immersion.elemental-battle-theme {
    background: linear-gradient(135deg, #0c0a1f, #2b0a3a, #1a173b);
    color: white;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body.full-immersion.elemental-battle-theme::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><radialGradient id="rgrad" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"><stop offset="0%" style="stop-color:rgb(255,255,255);stop-opacity:0.1" /><stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0" /></radialGradient></defs><rect width="100" height="100" fill="none"/><circle cx="20" cy="30" r="0.8" fill="url(%23rgrad)" /><circle cx="80" cy="40" r="0.6" fill="url(%23rgrad)" /><circle cx="50" cy="70" r="1" fill="url(%23rgrad)" /><circle cx="30" cy="10" r="0.7" fill="url(%23rgrad)" /><circle cx="70" cy="90" r="0.9" fill="url(%23rgrad)" /></svg>');
    background-size: 300px 300px;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

body.full-immersion.elemental-battle-theme::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(138, 79, 191, 0.1), transparent 60%),
        radial-gradient(circle at 70% 20%, rgba(208, 169, 255, 0.1), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

body.full-immersion #wpadminbar,
body.full-immersion #adminmenumain,
body.full-immersion .wp-toolbar,
body.full-immersion header:not(.games-plugin-header),
body.full-immersion footer,
body.full-immersion .site-header,
body.full-immersion .site-footer,
body.full-immersion .main-navigation,
body.full-immersion .entry-header,
body.full-immersion .entry-footer,
body.full-immersion .sidebar,
body.full-immersion aside,
body.full-immersion .widget-area {
    display: none !important;
}

body.full-immersion .games-plugin-container {
    max-width: 90%;
    width: 90%;
    margin: 16px auto 20px auto;
    min-height: 90vh;
}

body.full-immersion.space-battle-theme .games-plugin-immersion-toggle {
    background-color: #3c7dd9;
}

body.full-immersion.elemental-battle-theme .games-plugin-immersion-toggle {
    background: linear-gradient(to bottom, #8a4fbf, #5a2a8a);
    border: 1px solid rgba(208, 169, 255, 0.5);
    box-shadow: 0 0 10px rgba(138, 79, 191, 0.5);
}

/* Menu visibility fixes for immersion mode */
body.full-immersion .site-title a,
body.full-immersion .site-description,
body.full-immersion .menu-item a,
body.full-immersion .nav-menu a,
body.full-immersion .menu a,
body.full-immersion .main-menu a,
body.full-immersion .page-title,
body.full-immersion .entry-title,
body.full-immersion h1,
body.full-immersion h2,
body.full-immersion h3,
body.full-immersion h4,
body.full-immersion h5,
body.full-immersion h6,
body.full-immersion p {
    color: white !important;
}

/* Theme transition elements */
.theme-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}

.space-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%233c7dd9" d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4M15,6.5L13.5,8V10H11.5V9H10V11H11.5V13H13.5V15H12V16.5H15V13H14V11.5H15.5V10H17V8.5H15V6.5M8,9A1,1 0 0,0 7,10A1,1 0 0,0 8,11A1,1 0 0,0 9,10A1,1 0 0,0 8,9M7.5,12A1.5,1.5 0 0,0 6,13.5A1.5,1.5 0 0,0 7.5,15A1.5,1.5 0 0,0 9,13.5A1.5,1.5 0 0,0 7.5,12Z" /></svg>');
}

.elemental-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%238a4fbf" d="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z" /></svg>');
}

/* Elemental Battle magical effects */
.magical-particles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.magical-particle {
    position: fixed;
    background-color: #d0a9ff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(208, 169, 255, 0.8);
}

.magical-orb {
    position: fixed;
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #d0a9ff, #8a4fbf);
    box-shadow: 0 0 15px rgba(208, 169, 255, 0.8);
    opacity: 0.7;
    pointer-events: none;
    transition: all 2s ease;
    animation: float-around 25s infinite ease-in-out, pulse-light 4s infinite alternate;
}

.magical-rune {
    position: fixed;
    z-index: 1;
    opacity: 0.3;
    pointer-events: none;
    width: 60px;
    height: 60px;
    transform-origin: center;
    animation: rotate-slow 30s infinite linear, float-gentle 15s infinite ease-in-out;
}

@keyframes float-around {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(100px, 50px) rotate(90deg);
    }

    50% {
        transform: translate(50px, 100px) rotate(180deg);
    }

    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

@keyframes pulse-light {
    0% {
        box-shadow: 0 0 15px rgba(208, 169, 255, 0.5);
    }

    100% {
        box-shadow: 0 0 25px rgba(208, 169, 255, 0.9);
    }
}

@keyframes rotate-slow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes float-gentle {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Space Battle enhancements */
.space-particles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.space-particle {
    position: fixed;
    background-color: #4fc3f7;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.8);
}

.space-ship {
    position: fixed;
    z-index: 2;
    transition: all 2s ease;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(20px, 10px) rotate(2deg);
    }

    50% {
        transform: translate(0, 15px) rotate(0deg);
    }

    75% {
        transform: translate(-15px, 5px) rotate(-2deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 0.3;
    }
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(80px) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translateX(80px) rotate(-360deg);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px rgba(199, 169, 111, 0.5);
    }

    100% {
        box-shadow: 0 0 20px rgba(199, 169, 111, 0.8);
    }
}

@keyframes flicker {
    0% {
        opacity: 0.8;
        height: 12px;
    }

    100% {
        opacity: 1;
        height: 15px;
    }
}





#space-battle-game {
    color: white;
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: #0a1128;
    border-radius: 10px;
}

#space-battle-game .game-header {
    text-align: center;
    margin-bottom: 20px;
}

#space-battle-game .game-header h3 {
    color: #4fc3f7;
    margin-bottom: 10px;
    font-size: 24px;
}

#space-battle-game .game-area {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-color: #0a0e17;
    border: 2px solid #3c7dd9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

#space-battle-game .stars-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0e17;
    background-image: radial-gradient(white 1px, transparent 0);
    background-size: 40px 40px;
    z-index: 1;
}

.maf_manage_ship_speed_parent {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: space-evenly;
    align-items: baseline;
}

.maf_manage_ship_speed_parent label {
    color: white !important
}

#maf_manage_ship_speed {
    width: 30%;
    background: #364366bd;
    color: white;
    border: 1px solid #364366bd;
    border-radius: 5px;
}

#space-battle-game #player {
    position: absolute;
    width: 60px;
    height: 40px;
    /* background-color: #3c7dd9; */
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath d='M30,0 L10,30 L0,35 L10,40 L50,40 L60,35 L50,30 Z' fill='%234169e1' stroke='%237b91ff' stroke-width='1'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    /* clip-path: polygon(0% 20%, 40% 20%, 50% 0%, 60% 20%, 100% 20%, 100% 70%, 80% 100%, 20% 100%, 0% 70%); */
}

#space-battle-game #shield {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(123, 145, 255, 0.6);
    box-shadow: 0 0 10px rgba(123, 145, 255, 0.4);
    bottom: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9;
}

#space-battle-game .status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

#space-battle-game .health-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#space-battle-game .health-bar {
    width: 200px;
    height: 20px;
    background-color: #f87171;
    border-radius: 10px;
    overflow: hidden;
}

#space-battle-game .health-fill {
    height: 100%;
    background-color: #4ade80;
    width: 100%;
    transition: width 0.3s ease;
}

#space-battle-game .special-attack,
#space-battle-game .fire-btn {
    position: absolute;
    top: 10px;
    padding: 10px 15px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 20;
    cursor: pointer;
}

#space-battle-game .special-attack {
    right: 10px;
    background-color: #4ade80;
}

#space-battle-game .fire-btn {
    right: 250px;
    background-color: #ff4500;
}

#space-battle-game .hidden {
    display: none;
}

#space-battle-game .game-button {
    background-color: #3c7dd9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

#space-battle-game .alien {
    position: absolute;
    width: 40px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 5;
}

#space-battle-game .laser {
    position: absolute;
    width: 4px;
    height: 15px;
    background-color: #4fc3f7;
    z-index: 6;
}

#space-battle-game .boss-laser {
    background-color: #eab308;
    width: 8px;
    height: 20px;
}

#space-battle-game .explosion {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: #f97316;
    border-radius: 50%;
    opacity: 0.8;
    animation: explode 0.5s ease-out forwards;
    z-index: 7;
}

#space-battle-game .nova-wave {
    position: absolute;
    width: 70px;
    height: 70px;
    background-color: rgba(79, 195, 247, 0.3);
    border: 2px solid #4fc3f7;
    border-radius: 50%;
    animation: nova 1.5s ease-out forwards;
    z-index: 8;
}

.mobile-controls {
    display: none;
    width: 100%;
    height: 120px;
    position: relative;
    margin-bottom: 15px;
}



.joystick-base {
    position: absolute;
    left: 20%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background-color: rgba(65, 105, 225, 0.2);
    border: 2px solid rgba(65, 105, 225, 0.5);
    border-radius: 50%;
}

.joystick-stick {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(65, 105, 225, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(123, 145, 255, 0.6);
}

.mobile-buttons {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 50%;
    gap: 5px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.fire-attack-btn {
    background-color: rgba(255, 69, 0, 0.8);
    border: 2px solid rgba(255, 69, 0, 0.5);
}

.mobile-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
}

.nova-attack-btn {
    background-color: rgba(74, 222, 128, 0.8);
    border: 2px solid rgba(74, 222, 128, 0.5);
    animation: pulse 1.5s infinite;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: block;
    }
}

@media (max-width: 480px) {

    /* @media (max-width: 768px) { */
    .joystick-base {
        border: 3px solid rgba(65, 105, 225, 0.8);
    }

    /* } */
}

@media (max-width: 480px) {

    /* @media (max-width: 768px) { */
    .joystick-stick {
        border: 2px solid rgba(123, 145, 255, 0.8);
    }

    /* } */
}

@media (max-width: 480px) {

    /* @media (max-width: 768px) { */
    .mobile-btn {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        font-weight: bold;
    }

    /* } */
}

@media (max-width: 480px) {

    /* @media (max-width: 768px) { */
    .mobile-btn {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        font-weight: bold;
    }

    /* } */
}


/* Mobile media query */
@media screen and (max-width: 768px) {
    .game-area {
        order: 2;
    }

    .status-bar {
        order: 1;
        margin-bottom: 15px;
    }

    .mobile-controls {
        order: 3;
    }

    #space-battle-game,
    .elemental-battle-game {
        display: flex;
        flex-direction: column;
    }

    #space-battle-game {
        padding: 0px;
    }

    .games-plugin-container,
    .games-plugin-questions {
        padding: 10px;
    }

    #game-over p {
        width: 90%;
    }
    #game-over h2 {
        color: white !important;
    }

    #level-transition {
        width: 90%;
    }

    #space-battle-game .status-bar {
        margin-top: 10px;
        gap: 10px;
    }

    .maf_manage_ship_speed_parent {
        flex-direction: column;
        gap: 10px;
    }

    #space-battle-game .game-button {
        margin-bottom: 10px;
    }

    #maf_manage_ship_speed {
        width: 100%;
    }
}



@keyframes explode {
    0% {
        transform: scale(0.1);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes nova {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
    }
}

































/* Elemental Game's CSS */


.game-container {
    width: 100%;
    height: 95vh;
    height: calc(var(--vh, 1vh) * 95);
    position: relative;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

#intro-screen {
    overflow: hidden;
}

.title {
    font-size: 2.5em !important;
    margin-bottom: 20px !important;
    color: white !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3) !important;
    animation: titleGlow 2s ease-in-out infinite alternate;
    line-height: 1.5 !important;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.subtitle {
    font-size: 1.5em !important;
    margin-bottom: 30px;
    color: #bbb !important;
    line-height: 1.5 !important;
}

.description {
    /* max-width: 600px; */
    margin-bottom: 20px;
    line-height: 1.6;
}

button {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    position: relative;
    overflow: hidden;
    /* Increase tap target size for mobile */
    min-height: 44px;
    min-width: 44px;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

button:hover::before,
button:active::before {
    width: 100px;
    height: 100px;
}

button:active {
    background-color: white;
    color: #16213e;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.difficulty-select {
    margin-top: 20px;
    margin-bottom: 30px;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.difficulty-button {
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 44px;
    /* Better touch target */
}

.difficulty-button:active {
    transform: scale(1.05);
}

.difficulty-button.selected {
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.easy-button {
    background-color: #4caf50;
    color: white;
}

.medium-button {
    background-color: #ff9800;
    color: white;
}

.hard-button {
    background-color: #f44336;
    color: white;
}

.expert-button {
    background-color: #9c27b0;
    color: white;
}

.difficulty-info {
    font-size: 0.9em;
    margin-top: 15px;
    color: #bbb;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    display: inline-block;
}

.level-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 30px;
    position: relative;
}

.level-header {
    text-align: center;
    margin-bottom: 20px;
}

.level-title {
    font-size: 2em !important;
    margin-bottom: 10px;
    margin-top: 20px;
    animation: levelAppear 0.5s ease-out;
    color: white !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3) !important;
}


.screen {
    overflow: hidden;
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 20px;
    transition: transform 0.8s ease, opacity 0.8s ease;
    transform-style: preserve-3d;
    background-size: cover;
    background-position: center;
    overflow: hidden !important;
}

.hidden {
    opacity: 0;
    transform: translateY(50px) rotateX(10deg);
    pointer-events: none;
}


@keyframes titleGlow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
    }

    to {
        text-shadow: 0 0 20px rgba(255, 223, 0, 0.8), 0 0 30px rgba(255, 255, 255, 0.5);
    }
}


@keyframes levelAppear {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.question-container {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.question {
    font-size: 1.3em;
    margin-bottom: 20px;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 44px;
    /* Improving touch target size */
}

.option:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.option.selected {
    border: 1px solid white;
    background-color: rgba(255, 255, 255, 0.3);
    animation: selectPulse 1s ease-in-out infinite;
}

@keyframes selectPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(255, 255, 255, 0);
    }
}

.option.correct {
    border: 1px solid #4caf50;
    background-color: rgba(76, 175, 80, 0.3);
    animation: correctPulse 0.5s ease-in-out 3;
}

@keyframes correctPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.option.incorrect {
    border: 1px solid #f44336;
    background-color: rgba(244, 67, 54, 0.3);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.feedback {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px;
    transform: translateY(100px);
    transition: all 0.5s ease;
    z-index: 1000;
    opacity: 0;
}

.feedback.visible {
    opacity: 1;
    transform: translateY(0);
}

.stats-container {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 20px;
    z-index: 5;
    /* Ensure visibility */
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 15px;
    backdrop-filter: blur(3px);
}

.elements-container {
    position: absolute;
    top: 5px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 5;
    /* Ensure visibility */
}

.element {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    filter: brightness(1.5);
    opacity: 0;
    transform: scale(1.2);
    transition: all 0.3s ease;
}

.element:hover::before,
.element:active::before {
    opacity: 0.3;
    transform: scale(1);
}

.fire {
    background-color: var(--fire-color) !important;
    box-shadow: 0 0 10px rgba(255, 87, 34, 0.5) !important;
}

.water {
    background-color: var(--water-color) !important;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5) !important;
}

.earth {
    background-color: var(--earth-color) !important;
    box-shadow: 0 0 10px rgba(121, 85, 72, 0.5) !important;
}

.air {
    background-color: var(--air-color) !important;
    box-shadow: 0 0 10px rgba(144, 202, 249, 0.5) !important;
}

.boss-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(to bottom, #000, #16213e);
    overflow-y: auto;
    /* Allow scrolling */
}

.boss-header {
    text-align: center;
    padding: 20px;
}

.battle-area {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 0 50px;
    margin: 10px 0;
    position: relative;
}

.player,
.boss {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.character {
    width: 150px;
    height: 150px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}


.player .character {
    border: 2px solid #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.boss .character {
    border: 2px solid var(--boss-color);
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.3);
}

.attack-animation {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    opacity: 0;
    z-index: 10;
}

.no_margins {
    margin: 0 !important;
}

.fire-animation {
    background: radial-gradient(circle, #ff9500, #ff5722);
    box-shadow: 0 0 20px #ff5722;
    /* animation: fireAttackAnimation 1s ease-out forwards; */
}

.water-animation {
    background: radial-gradient(circle, #64b5f6, #2196f3);
    box-shadow: 0 0 20px #2196f3;
    animation: waterAttackAnimation 1s ease-out forwards;
}

.earth-animation {
    background: radial-gradient(circle, #a1887f, #795548);
    box-shadow: 0 0 20px #795548;
    animation: earthAttackAnimation 1s ease-out forwards;
}

.air-animation {
    background: radial-gradient(circle, #e3f2fd, #90caf9);
    box-shadow: 0 0 20px #90caf9;
    animation: airAttackAnimation 1s ease-out forwards;
}

.special-animation {
    background: radial-gradient(circle, white, gold);
    box-shadow: 0 0 30px gold;
    animation: specialAttackAnimation 1.5s ease-out forwards;
}

.boss-attack-animation {
    background: radial-gradient(circle, #ce93d8, #9c27b0);
    box-shadow: 0 0 20px #9c27b0;
    animation: bossAttackAnimation 1s ease-out forwards;
}

@keyframes specialAttackAnimation {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    10% {
        opacity: 0.3;
        transform: scale(1);
    }

    30% {
        opacity: 0.8;
        transform: scale(3);
    }

    50% {
        opacity: 1;
        transform: scale(5);
    }

    70% {
        opacity: 0.5;
        transform: scale(6);
    }

    100% {
        opacity: 0;
        transform: scale(8);
    }
}

.character.hit {
    animation: hitAnimation 0.5s ease forwards;
}

@keyframes hitAnimation {
    0% {
        transform: translateX(0);
        background-color: rgba(255, 0, 0, 0.3);
    }

    25% {
        transform: translateX(-10px);
    }

    50% {
        transform: translateX(10px);
        background-color: rgba(255, 0, 0, 0.5);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.health-bar {
    width: 100%;
    height: 10px;
    background-color: #444;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
    position: relative;
}

.health-fill {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.health-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: healthBarShine 2s linear infinite;
}

@keyframes healthBarShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.boss-health-fill {
    background-color: var(--boss-color);
}

.boss-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.element-attack {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    /* Better touch target */
}

.element-attack::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.element-attack:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 1;
    }

    20% {
        transform: scale(25, 25);
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

.fire-attack {
    background-color: var(--fire-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.water-attack {
    background-color: var(--water-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.earth-attack {
    background-color: var(--earth-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.air-attack {
    background-color: var(--air-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.special-attack {
    background-color: gold;
    color: black;
    animation: pulse 1.5s infinite;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    }
}

.message-log {
    height: 100px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    margin: 10px 10px 0;
    backdrop-filter: blur(3px);
}

.log-message {
    margin-bottom: 5px;
    font-size: 0.9em;
    opacity: 0;
    transform: translateY(10px);
    animation: messageAppear 0.3s ease-out forwards;
}

@keyframes messageAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-icon,
.boss-icon {
    font-size: 3em;
}

.player-icon {
    animation: wizardFloat 2s ease-in-out infinite;
}

@keyframes wizardFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.boss-icon {
    animation: bossFloat 1.5s ease-in-out infinite;
}

@keyframes bossFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-15px) scale(1.1);
    }
}

.fire-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(255, 87, 34, 0.2)), url('data:image/svg+xml,');
    background-color: rgba(255, 87, 34, 0.1);
}

.water-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(33, 150, 243, 0.2)), url('data:image/svg+xml,');
    background-color: rgba(33, 150, 243, 0.1);
}

.earth-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(121, 85, 72, 0.2)), url('data:image/svg+xml,');
    background-color: rgba(121, 85, 72, 0.1);
}

.air-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(144, 202, 249, 0.2)), url('data:image/svg+xml,');
    background-color: rgba(144, 202, 249, 0.1);
}

.boss-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(156, 39, 176, 0.2)), url('data:image/svg+xml,');
    background-color: rgba(156, 39, 176, 0.1);
}

/* Hide characters on non-boss screens */
#level-screen .character,
#level-screen .player,
#level-screen .boss,
#level-screen .player-icon,
#level-screen .boss-icon {
    display: none !important;
}

/* Boss phase styles */
.boss-phase-1 {
    filter: brightness(1);
}

.boss-phase-2 {
    filter: brightness(1.3) saturate(1.5);
}

.boss-phase-3 {
    filter: brightness(1.6) saturate(2) hue-rotate(45deg);
}

.boss-phase-4 {
    filter: brightness(1.9) saturate(2.5) hue-rotate(90deg);
}

.boss-phase-5 {
    filter: brightness(2) saturate(3) hue-rotate(180deg);
    animation: bossEvolve 1s ease;
}

@keyframes bossEvolve {
    0% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.victory-screen,
.defeat-screen {
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-y: auto;
    /* Allow scrolling */
}

.result-icon {
    font-size: 1em;
    margin-right: 20px;
    margin-bottom: 20px;
    animation: resultIconAppear 0.5s ease-out;
}

@keyframes resultIconAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.victory-screen .result-icon {
    color: gold;
    animation: victoryPulse 1s ease-in-out infinite;
}

@keyframes victoryPulse {

    0%,
    100% {
        text-shadow: 0 0 10px gold;
    }

    50% {
        text-shadow: 0 0 30px gold, 0 0 40px rgba(255, 215, 0, 0.5);
    }
}

.defeat-screen .result-icon {
    color: #f44336;
}

.result-text {
    display: flex;
    font-size: 3em !important;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    line-height: 1.2 !important;
}

.score-text {
    font-size: 1.5em;
    margin-bottom: 30px;
}

.restart-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.restart-button:active {
    background-color: #45a049;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.wizard-portrait {
    font-size: 2em;
    margin-bottom: 0px;
    animation: float 3s ease-in-out infinite;
    line-height: 1 !important;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Magical particle effects */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    /* Ensure particles are below UI elements */
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) translateX(var(--drift-x));
        opacity: 0;
    }
}

.particle:nth-child(2n) {
    animation: particleFloat 8s linear infinite;
    animation-delay: -2s;
}

.particle:nth-child(3n) {
    animation: particleFloat 12s linear infinite;
    animation-delay: -4s;
}

.particle:nth-child(4n) {
    animation: particleFloat 9s linear infinite;
    animation-delay: -1s;
}

/* Screen transitions */
.screen-transition {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-100%);
    pointer-events: none;
}

.screen.transitioning .screen-transition {
    animation: screenWipe 0.5s ease-out;
}

@keyframes screenWipe {
    to {
        transform: translateX(100%);
    }
}

/* Environment effects */
.environment-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
    /* Behind content */
}

.fire-effect {
    background: linear-gradient(transparent, rgba(255, 87, 34, 0.2), transparent);
    animation: fireRipple 4s ease-in-out infinite;
}

@keyframes fireRipple {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.water-effect {
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 20px,
            rgba(33, 150, 243, 0.1) 20px,
            rgba(33, 150, 243, 0.1) 40px);
    animation: waterFlow 10s linear infinite;
}

@keyframes waterFlow {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-40px, -40px);
    }
}

.earth-effect {
    background: radial-gradient(circle at 50% 100%, rgba(121, 85, 72, 0.2), transparent 60%);
    animation: earthPulse 3s ease-in-out infinite;
}

@keyframes earthPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.air-effect {
    background: linear-gradient(90deg, transparent, rgba(144, 202, 249, 0.2), transparent);
    animation: airBreeze 7s ease-in-out infinite;
}

@keyframes airBreeze {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(50px);
    }
}

.boss-level {
    display: inline-block;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 15px;
    margin-left: 10px;
    font-size: 0.9em;
    color: #ffd700;
}

@keyframes healthRestore {
    0% {
        color: white;
    }

    50% {
        color: #4caf50;
        transform: scale(1.2);
    }

    100% {
        color: white;
        transform: scale(1);
    }
}

/* Fullscreen button */
.fullscreen-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 20;
}

.fullscreen-button:hover,
.fullscreen-button:active {
    background: rgba(0, 0, 0, 0.7);
}

/* Only show fullscreen button on devices that support it */
@supports not (display: fullscreen) {
    .fullscreen-button {
        display: none;
    }
}

/* New styles for achievements and combo system */
.achievement-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid gold;
    border-radius: 10px;
    padding: 10px 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.achievement-popup.show {
    opacity: 1;
    animation: achievementAppear 3s ease forwards;
}

@keyframes achievementAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.achievement-icon {
    font-size: 1.5em;
    color: gold;
}

.achievement-text {
    font-size: 0.9em;
    color: white;
}

.combo-counter {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.combo-counter.active {
    opacity: 1;
}

.combo-text {
    font-weight: bold;
    color: #ff9800;
}

.combo-multiplier {
    font-weight: bold;
    color: #ffd700;
}

.combo-icon {
    font-size: 1.2em;
    animation: comboIconPulse 1s ease-in-out infinite;
}

@keyframes comboIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Hint system */
.hint-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 20;
    transition: all 0.3s ease;
}

.hint-button:hover,
.hint-button:active {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.hint-container {
    position: absolute;
    bottom: 70px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    width: 250px;
    max-width: 80vw;
    z-index: 20;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.hint-container.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.hint-text {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.hint-cost {
    font-size: 0.8em;
    color: #ff9800;
}

.elemental-combos-info {
    position: absolute;
    bottom: 70px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    width: 250px;
    max-width: 80vw;
    z-index: 20;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.elemental-combos-info.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.combo-info-title {
    font-size: 1em;
    color: #ffd700;
    margin-bottom: 10px;
}

.combo-list {
    font-size: 0.8em;
}

.combo-item {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.combo-item-name {
    font-weight: bold;
    color: #ff9800;
}

/* Badges for showing achievements */
.achievements-button {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 20;
    transition: all 0.3s ease;
}

.achievements-button:hover,
.achievements-button:active {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.achievements-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 1);
    border: 2px solid gold;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.achievements-panel.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.achievements-title {
    font-size: 1.5em;
    color: gold;
}

.close-achievements {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    margin: 0;
    padding: 0;
    min-height: auto;
    min-width: auto;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.achievement-badge {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-badge.unlocked {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid gold;
}

.achievement-badge.locked {
    filter: grayscale(100%);
    opacity: 0.5;
}

.achievement-badge-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.achievement-badge-name {
    font-size: 0.9em;
    margin-bottom: 5px;
    font-weight: bold;
}

.achievement-badge-desc {
    font-size: 0.8em;
    color: #bbb;
}

/* Boss weakness indicator */
.boss-weakness {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 0.8em;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 5px;
}

.weakness-text {
    color: #ff9800;
}

.weakness-element {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7em;
    animation: weaknessPulse 1.5s ease-in-out infinite;
}

@keyframes weaknessPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.7);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
    }
}

/* Progress bar for game completion */
.progress-container {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 300px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    z-index: 20;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #ffd700);
    width: 0%;
    transition: width 0.5s ease;
}

/* Elemental combo indicators */
.combo-effect {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    font-size: 1.5em;
    opacity: 0;
}

.combo-effect.fire-water {
    color: #ff9800;
    animation: comboSteam 2s ease-out forwards;
}

.combo-effect.fire-earth {
    color: #ff5722;
    animation: comboLava 2s ease-out forwards;
}

.combo-effect.water-earth {
    color: #8bc34a;
    animation: comboPlant 2s ease-out forwards;
}

.combo-effect.air-fire {
    color: #ff5252;
    animation: comboCombustion 2s ease-out forwards;
}

@keyframes comboSteam {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }

    30% {
        opacity: 1;
        transform: translateY(-50px) scale(1.5);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
}

@keyframes comboLava {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }

    80% {
        opacity: 1;
        transform: translateX(-50%) scale(1.5);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) scale(1.8);
    }
}

@keyframes comboPlant {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateY(-40px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

@keyframes comboCombustion {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.5);
    }
}

/* Critical hit effect */
.critical-hit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 0 0 10px #ff0000;
    z-index: 25;
    opacity: 0;
    animation: criticalHitAnimation 1s ease-out forwards;
}

@keyframes criticalHitAnimation {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.8);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* Tutorial overlay */
.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tutorial-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.tutorial-container {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid gold;
    border-radius: 10px;
    padding: 20px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tutorial-title {
    font-size: 1.5em;
    color: gold;
}

.close-tutorial {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    margin: 0;
    padding: 0;
    min-height: auto;
    min-width: auto;
}

.tutorial-content {
    margin-bottom: 20px;
}

.tutorial-step {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.step-number {
    background: gold;
    color: black;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
}

.tutorial-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-button:hover,
.tutorial-button:active {
    background: rgba(255, 255, 255, 0.2);
}

.tutorial-dot-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-dot.active {
    background: gold;
    transform: scale(1.2);
}

/* Seasonal theme toggle */
.theme-toggle {
    position: absolute;
    bottom: 15px;
    left: 70px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 20;
    transition: all 0.3s ease;
}

.theme-toggle:hover,
.theme-toggle:active {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Boss character options */
.boss-selection {
    display: none;
    margin-top: 20px;
    margin-bottom: 20px;
}

.boss-selection.visible {
    display: block;
}



.boss-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.elemental-game-action-buttons {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 20px;
}

.boss-option {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* width: 80px; */
    /* height: 80px; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.boss-option:hover,
.boss-option:active {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

.boss-option.selected {
    border-color: gold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.boss-icon-select {
    font-size: 2em;
    margin-bottom: 5px;
}

.boss-name {
    font-size: 0.8em;
}

.elementor-element-f577542 {
    justify-content: center;
}

.elementor-location-footer .elementor-social-icon svg {
    fill: #fff !important;
}

.elementor-icon-list-item a,
.elementor-icon-list-item a .elementor-icon-list-text {
    color: #fff !important;
}

.elementor-icon-list-item a .elementor-icon-list-icon svg {
    fill: #fff !important;
}

.ha-post-title {
    display: none;
}

.elementor-element-4a7a7c3d a {
    color: #fff !important;
}

.elementor-widget-container,
.elementor-widget-theme-post-content {
    width: 100% !important;
}

/* Responsive styles for different screen sizes */
@media (max-width: 768px) {
    .game-container {
        width: 100%;
        height: 95vh;
        height: calc(var(--vh, 1vh) * 95);
        max-height: none;
        border-radius: 8px;
    }

    .wizard-portrait {
        font-size: 2em !important;
    }

    .title {
        font-size: 2em !important;
    }

    .character {
        width: 100px;
        height: 100px;
    }

    .subtitle {
        font-size: 1.2em !important;
    }

    .description {
        font-size: 0.9em !important;
        padding: 0 15px;
    }

    .options-container {
        grid-template-columns: 1fr !important;
        /* Single column for options on mobile */
    }

    .option {
        padding: 12px !important;
        font-size: 0.9em !important;
    }

    .battle-area {
        padding: 0 20px !important;
    }

    .boss-controls {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .element-attack {
        width: 80% !important;
        /* Wider buttons for easier tapping */
        padding: 12px !important;
    }

    .stats-container,
    .elements-container {
        font-size: 0.8em !important;
    }

    .level-title {
        font-size: 1.7em !important;
    }

    .element {
        width: 35px !important;
        height: 35px !important;
    }

    .difficulty-buttons {
        flex-wrap: wrap !important;
    }

    .wizard-portrait {
        font-size: 4em !important;
    }
}

/* For very small screens */

@media (max-width: 480px) {

    /* #level-title {
        margin-top: 40px !important;
        font-size: 1.6em !important;
        line-height: 1.4 !important;
    }

    .elements-container {
        top: 0px;
        right: -20px;
    }

    .stats-container {
        left: -15px;
        top: 0px;
        z-index: 8;
        flex-direction: column;
    }

    .wizard-portrait {
        font-size: 2em !important;
    }

    .title {
        font-size: 1.6em !important;
    }

    .element {
        width: 30px !important;
        height: 30px !important;
    }

    .difficulty-button {
        padding: 8px 12px !important;
        font-size: 0.8em !important;
    }

    .question {
        font-size: 1.1em !important;
    }

    .element-attack {
        width: 90% !important;
        padding: 10px !important;
        font-size: 0.9em !important;
    }

    .player-icon,
    .boss-icon {
        font-size: 2.5em !important;
    }

    #intro-screen,
    .game-container {
        min-height: 700px;
    }

    #intro-screen .description {
        margin-bottom: 0 !important;
    }

    #level-description {
        margin-bottom: 0 !important;
        font-size: 1em !important;
        line-height: 1.3 !important;
    }

    .level-header {
        margin-bottom: 10px !important;
    }

    .question-container {
        padding: 0 10px !important;
    } */
    #intro-screen {
        min-height: 700px;
    }

    #intro-screen .description {
        margin-bottom: 0 !important;
    }

    .elements-container {
        gap: 7px !important;
        right: -7px !important;
        top: 10px !important;
    }

    .title {
        gap: 10px;
        font-size: 1.6em !important;
        margin-bottom: 0px !important;
    }

    .subtitle {
        margin-bottom: 0px !important;
    }

    .boss-selection {
        margin-top: 0px !important;
    }

    .wizard-portrait {
        font-size: 1em !important;
    }

    .screen {
        padding: 0px !important;
    }

    .stats-container .stats {
        padding: 5px 0px 5px 10px !important;
    }

    .stats-container {
        gap: 6px !important;
        left: 5px !important;
    }

    .level-title {
        font-size: 1.2em !important;
    }

    .level-container {
        padding: 30px 10px !important;
    }

    .game-container {
        min-height: 700px;
        height: unset !important;
        max-height: unset !important;
    }

    .question-container {
        padding: 20px 13px !important;
    }

    #level-description {
        margin-bottom: 0px;
    }

    .boss-controls {
        flex-direction: row !important;
    }

    .boss-controls button {
        flex: 1 0 45%;
    }

    #combos-info-button {
        background-color: #10182e7a !important;
    }

    @keyframes fireAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5) rotate(0deg);
        }

        50% {
            opacity: 1;
            transform: translateX(80px) scale(1.5) rotate(90deg);
        }

        100% {
            opacity: 0;
            transform: translateX(160px) scale(0.5) rotate(360deg);
        }
    }

    @keyframes waterAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(80px) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(160px) scale(0.5);
        }
    }

    @keyframes earthAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(80px) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(160px) scale(0.5);
        }
    }

    @keyframes airAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(80px) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(160px) scale(0.5);
        }
    }

    @keyframes bossAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(-80px) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(-160px) scale(0.5);
        }
    }
}

@media (max-width: 320px) {
    .stats-container {
        flex-direction: column;
    }
}

/* For tablets in landscape mode */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .game-container {
        width: 100%;
        /* max-width: 900px; */
        /* height: 85vh; */
        /* height: calc(var(--vh, 1vh) * 85); */
        height: 95vh;
        height: calc(var(--vh, 1vh) * 95);
    }

    .element-attack {
        font-size: 1.1em;
        padding: 12px 24px;
    }

    .battle-area {
        padding: 0 80px;
    }
}

/* For desktop */
@media (min-width: 1023px) {
    .game-container {
        /* width: 800px; */
        /* height: 600px; */
        height: 95vh;
        height: calc(var(--vh, 1vh) * 95);
    }

    /* Desktop-specific styles */
    button:hover {
        background-color: white;
        color: #16213e;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }

    .difficulty-button:hover {
        transform: scale(1.05);
    }

    .option:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }

    .restart-button:hover {
        background-color: #45a049;
        transform: scale(1.05);
        box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
    }

    /* Desktop animations */
    @keyframes fireAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5) rotate(0deg);
        }

        25% {
            opacity: 1;
            transform: translateX(100px) scale(1) rotate(45deg);
        }

        50% {
            opacity: 1;
            transform: translateX(200px) scale(1.5) rotate(90deg);
        }

        80% {
            opacity: 0.8;
            transform: translateX(400px) scale(2) rotate(180deg);
        }

        100% {
            opacity: 0;
            transform: translateX(400px) scale(0.5) rotate(360deg);
        }
    }

    @keyframes waterAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) translateY(0) scale(0.5);
        }

        20% {
            opacity: 0.7;
            transform: translateX(80px) translateY(-20px) scale(1);
        }

        50% {
            opacity: 1;
            transform: translateX(200px) translateY(-20px) scale(1.5);
        }

        80% {
            opacity: 0.8;
            transform: translateX(350px) translateY(0) scale(2);
        }

        100% {
            opacity: 0;
            transform: translateX(400px) translateY(0) scale(0.5);
        }
    }

    @keyframes earthAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) translateY(0) scale(0.5);
        }

        25% {
            opacity: 1;
            transform: translateX(100px) translateY(20px) scale(1.2);
        }

        50% {
            opacity: 1;
            transform: translateX(200px) translateY(-10px) scale(1.5);
        }

        75% {
            opacity: 0.8;
            transform: translateX(300px) translateY(20px) scale(1.8);
        }

        100% {
            opacity: 0;
            transform: translateX(400px) translateY(0) scale(0.5);
        }
    }

    @keyframes airAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        25% {
            opacity: 0.7;
            transform: translateX(100px) translateY(-20px) scale(1);
        }

        50% {
            opacity: 1;
            transform: translateX(200px) translateY(15px) scale(1.5);
        }

        75% {
            opacity: 0.7;
            transform: translateX(300px) translateY(-10px) scale(1);
        }

        100% {
            opacity: 0;
            transform: translateX(400px) translateY(0) scale(0.5);
        }
    }

    @keyframes bossAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(-200px) scale(1.5);
        }

        80% {
            opacity: 0.8;
            transform: translateX(-400px) scale(2);
        }

        100% {
            opacity: 0;
            transform: translateX(-400px) scale(0.5);
        }
    }
}

/* Tablet and mobile animations */
@media (max-width: 1024px) {
    @keyframes fireAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5) rotate(0deg);
        }

        50% {
            opacity: 1;
            transform: translateX(125px) scale(1.5) rotate(90deg);
        }

        100% {
            opacity: 0;
            transform: translateX(250px) scale(0.5) rotate(360deg);
        }
    }

    @keyframes waterAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) translateY(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(125px) translateY(-15px) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(250px) translateY(0) scale(0.5);
        }
    }

    @keyframes earthAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) translateY(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(125px) translateY(0) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(250px) translateY(0) scale(0.5);
        }
    }

    @keyframes airAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(125px) translateY(0) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(250px) translateY(0) scale(0.5);
        }
    }

    @keyframes bossAttackAnimation {
        0% {
            opacity: 0;
            transform: translateX(0) scale(0.5);
        }

        50% {
            opacity: 1;
            transform: translateX(-125px) scale(1.5);
        }

        100% {
            opacity: 0;
            transform: translateX(-250px) scale(0.5);
        }
    }
}