@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700&display=swap');

/* Loader Styles */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Use viewport height to ensure full screen coverage */
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background like modals */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Increased z-index to be above everything, including the game title */
    transition: opacity 0.5s ease-out;
    /* Ensure it works on mobile */
    padding: 0;
    margin: 0;
    overflow-y: auto; /* Allow scrolling if needed */
    -webkit-overflow-scrolling: touch; /* Improve mobile scrolling */
}

/* Screen Transition Styles */
#start-screen, #game-container, #result-container {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Active screen state */
.screen-active {
    display: block !important;
    opacity: 1 !important;
}

.loader-content {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 1.0); /* Fully opaque background */
    border-radius: 16px;
    border: 6px solid #e74c3c;
    box-shadow: 0 8px 0 #c0392b, 0 12px 16px rgba(0,0,0,0.5); /* Stronger shadow */
    max-width: 85%;
    width: 280px; /* Smaller width for mobile */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfect centering */
    z-index: 10002; /* Ensure it's above everything else */
}

@media (min-width: 640px) {
    .loader-content {
        padding: 2rem;
        border-radius: 20px;
        border: 8px solid #e74c3c;
        box-shadow: 0 10px 0 #c0392b, 0 15px 20px rgba(0,0,0,0.2);
        width: 400px; /* Larger width for desktop */
    }
}

.loader-animation {
    position: relative;
    height: 120px; /* Smaller for mobile */
    margin-bottom: 1rem;
}

.swiss-cheese {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px; /* Smaller for mobile */
    height: 90px; /* Smaller for mobile */
}

.cheese-wheel {
    width: 100%;
    height: 100%;
    background-color: #F9D923;
    border-radius: 50%;
    position: relative;
    animation: rotate 4s infinite linear;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.cheese-holes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.cheese-hole {
    position: absolute;
    background-color: #ffd54f;
    border-radius: 50%;
}

.hole1 {
    width: 18px; /* Smaller for mobile */
    height: 18px; /* Smaller for mobile */
    top: 20%;
    left: 30%;
}

.hole2 {
    width: 15px; /* Smaller for mobile */
    height: 15px; /* Smaller for mobile */
    top: 60%;
    left: 20%;
}

.hole3 {
    width: 22px; /* Smaller for mobile */
    height: 22px; /* Smaller for mobile */
    top: 40%;
    left: 60%;
}

.hole4 {
    width: 12px; /* Smaller for mobile */
    height: 12px; /* Smaller for mobile */
    top: 25%;
    left: 70%;
}

.hole5 {
    width: 14px; /* Smaller for mobile */
    height: 14px; /* Smaller for mobile */
    top: 70%;
    left: 65%;
}

.swiss-flag {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px; /* Smaller for mobile */
    height: 60px; /* Smaller for mobile */
    background-color: #D52B1E;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation: wave 2s infinite ease-in-out;
}

.flag-cross {
    position: relative;
    width: 38px; /* Smaller for mobile */
    height: 38px; /* Smaller for mobile */
    background-color: white;
}

.flag-cross::before, .flag-cross::after {
    content: '';
    position: absolute;
    background-color: #D52B1E;
}

.flag-cross::before {
    width: 22px; /* Smaller for mobile */
    height: 8px; /* Smaller for mobile */
    top: 15px;
    left: 8px;
}

.flag-cross::after {
    width: 8px; /* Smaller for mobile */
    height: 22px; /* Smaller for mobile */
    top: 8px;
    left: 15px;
}

/* Desktop sizes */
@media (min-width: 640px) {
    .loader-animation {
        height: 150px;
        margin-bottom: 1.5rem;
    }

    .swiss-cheese {
        width: 120px;
        height: 120px;
    }

    .hole1 {
        width: 25px;
        height: 25px;
    }

    .hole2 {
        width: 20px;
        height: 20px;
    }

    .hole3 {
        width: 30px;
        height: 30px;
    }

    .hole4 {
        width: 15px;
        height: 15px;
    }

    .hole5 {
        width: 18px;
        height: 18px;
    }

    .swiss-flag {
        width: 80px;
        height: 80px;
        border-radius: 5px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }

    .flag-cross {
        width: 50px;
        height: 50px;
    }

    .flag-cross::before {
        width: 30px;
        height: 10px;
        top: 20px;
        left: 10px;
    }

    .flag-cross::after {
        width: 10px;
        height: 30px;
        top: 10px;
        left: 20px;
    }
}

.loader-text {
    font-size: 1.4rem; /* Smaller for mobile */
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 0.3rem;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.loader-subtext {
    font-size: 1rem; /* Smaller for mobile */
    color: #666;
    font-style: italic;
}

/* Desktop text sizes */
@media (min-width: 640px) {
    .loader-text {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    }

    .loader-subtext {
        font-size: 1.2rem;
    }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

body {
    font-family: 'Baloo 2', cursive;
    background-color: #ffd54f;
    background-image:
        radial-gradient(circle at 25px 25px, #ff6b6b 2px, transparent 0),
        radial-gradient(circle at 75px 75px, #4ecdc4 2px, transparent 0);
    background-size: 100px 100px;
    overflow-x: hidden;
    padding: 0.75rem; /* Default padding for all screen sizes */
}

/* Responsive padding for different screen sizes */
@media (max-width: 374px) {
    body {
        padding: 0.5rem; /* Smaller padding for very small screens */
    }
}

@media (min-width: 430px) {
    body {
        padding: 1rem; /* Medium padding for larger phones */
    }
}

@media (min-width: 640px) {
    body {
        padding: 1.5rem; /* Larger padding for tablets and desktops */
    }
}

/* Swiss cross styling */
.swiss-cross-container {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.swiss-cross {
    display: inline-block;
    width: 30px;
    height: 30px;
    position: relative;
    background-image: url('../images/swiss-cross.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Add shadow for better visibility */
    /* Größe wird durch Inline-Styles oder Tailwind-Klassen im Template definiert */
}

/* Cow joker styling */
.cow-joker {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin: 0 3px;
    background-image: url('../images/cow.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); /* Add shadow for better visibility */
    position: relative;
}

/* Empty cow styling */
.cow-joker.empty {
    opacity: 0.5;
    filter: grayscale(100%) drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.game-container {
    background-color: #ffffff;
    border: 8px solid #e74c3c;
    border-radius: 20px;
    box-shadow: 0 10px 0 #c0392b, 0 15px 20px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    padding: 0.5rem 0.75rem 0.75rem; /* Reduced top padding */
    width: 100%; /* Ensure full width */
    box-sizing: border-box; /* Include padding and border in the width */
}

/* Add responsive padding for different screen sizes */
@media (max-width: 374px) {
    .game-container {
        padding: 0.3rem 0.5rem 0.5rem; /* Smaller padding for very small screens, reduced top */
    }
}

@media (min-width: 430px) {
    .game-container {
        padding: 0.5rem 1rem 1rem; /* Medium padding for larger phones, reduced top */
    }
}

@media (min-width: 640px) {
    .game-container {
        padding: 0.75rem 1.5rem 1.5rem; /* Larger padding for desktop, reduced top */
    }
}

/* Level selection styles */
.level-btn {
    transition: all 0.3s ease;
    transform: translateY(0);
    position: relative;
    overflow: visible;
    /* Padding, Textausrichtung, Rundung, Rahmen, Hintergrund und Hover-Effekte werden durch Tailwind-Klassen im Template definiert */
}

.level-btn:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.level-btn.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.level-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

.lock-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    z-index: 10;
}

.hourglass-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    z-index: 10;
}

.game-container::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0) 10px,
        rgba(255, 255, 255, 0) 20px
    );
    z-index: -1;
}

.game-title {
    text-shadow: 3px 3px 0 #c0392b, 5px 5px 0 rgba(0,0,0,0.1);
    color: #e74c3c;
    transform: rotate(-2deg);
    /* Schriftgröße, Schriftgewicht, Textausrichtung und Margin werden durch Tailwind-Klassen im Template definiert */
    /* Visibility is controlled by the loader script */
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.game-title a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.game-title a:hover {
    text-shadow: 4px 4px 0 #c0392b, 6px 6px 0 rgba(0,0,0,0.1);
}

/* Responsive styles for very small screens */
@media (max-width: 374px) {
    .game-title {
        font-size: 2.2rem;
        text-shadow: 2px 2px 0 #c0392b, 3px 3px 0 rgba(0,0,0,0.1);
    }

    h2 {
        font-size: 1.4rem !important;
    }

    p {
        font-size: 0.9rem !important;
    }

    .level-btn {
        padding: 0.5rem !important;
    }

    .level-btn h4 {
        font-size: 1rem !important;
    }

    .level-btn p {
        font-size: 0.8rem !important;
    }
}

/* Responsive styles for small screens */
@media (min-width: 375px) and (max-width: 429px) {
    .game-title {
        font-size: 2.3rem;
        text-shadow: 2px 2px 0 #c0392b, 3px 3px 0 rgba(0,0,0,0.1);
    }

    h2 {
        font-size: 1.5rem !important;
    }
}

/* Responsive styles for medium screens */
@media (max-width: 640px) {
    .game-title {
        font-size: 2.5rem;
        text-shadow: 2px 2px 0 #c0392b, 3px 3px 0 rgba(0,0,0,0.1);
    }

    .swiss-cross {
        width: 20px;
        height: 20px;
    }
}

.swiss-word-container {
    background-color: #f8d7da;
    border: 4px solid #e74c3c;
    border-radius: 15px;
    box-shadow: 0 6px 0 #c0392b;
    transform: rotate(1deg);
    transition: all 0.3s ease;
    /* Padding, Margin und Text-Ausrichtung werden durch Tailwind-Klassen im Template definiert */
}

.swiss-word-container:hover {
    transform: rotate(-1deg) scale(1.02);
}

@media (max-width: 640px) {
    .swiss-word-container {
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.swiss-word {
    color: #e74c3c;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    /* Schriftgröße wird durch Tailwind-Klassen im Template definiert */
}

.option-btn {
    background-color: #f8f9fa;
    border: 2px solid #6c757d;
    border-radius: 10px;
    box-shadow: 0 2px 0 #495057;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    margin-bottom: 2px;
    text-align: left;
    padding: 10px 12px;
    min-height: 42px;
}

@media (max-width: 640px) {
    .option-btn {
        padding: 0.4rem !important;
        min-height: 25px;
        display: flex;
        align-items: center;
    }
}

.option-btn:hover:not([disabled]) {
    transform: translateY(-3px);
    box-shadow: 0 4px 0 #495057;
}

.option-btn:active:not([disabled]) {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #495057;
    margin-top: 2px;
    margin-bottom: 8px;
}

.option-btn.correct {
    background-color: #2ecc71;
    border-color: #27ae60;
    color: white;
    box-shadow: 0 5px 0 #27ae60;
    animation: pulse 0.5s infinite alternate;
}

.option-btn.incorrect {
    background-color: #e74c3c;
    border-color: #c0392b;
    color: white;
    box-shadow: 0 5px 0 #c0392b;
    animation: shake 0.5s;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.nav-btn {
    transition: all 0.2s ease;
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}

@media (max-width: 640px) {
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

.nav-btn:hover:not([disabled]) {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 rgba(0,0,0,0.2);
}

.nav-btn:active:not([disabled]) {
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
}

.progress-container {
    background-color: #f8f9fa;
    border: 2px solid #6c757d;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    /* Margin und Breite werden durch Tailwind-Klassen im Template definiert */
}

.progress-bar {
    background: linear-gradient(90deg, #e74c3c, #f39c12, #e74c3c);
    background-size: 200% 100%;
    animation: gradient 2s ease infinite;
    height: 100%;
    border-radius: 8px;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.confetti {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: #f00;
    animation: fall 3s ease-in infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.result-container {
    background-color: #ffffff;
    border: 8px solid #f39c12; /* Orange statt Blau */
    border-radius: 20px;
    box-shadow: 0 10px 0 #d35400, 0 15px 20px rgba(0,0,0,0.2); /* Dunkleres Orange */
    padding: 0.75rem; /* Default padding for all screen sizes */
    width: 100%; /* Ensure full width */
    box-sizing: border-box; /* Include padding and border in the width */
    transition: opacity 0.3s ease; /* Smooth transition for opacity changes */
}

/* Add responsive padding for result container */
@media (max-width: 374px) {
    .result-container {
        padding: 0.5rem; /* Smaller padding for very small screens */
    }
}

@media (min-width: 430px) {
    .result-container {
        padding: 1rem; /* Medium padding for larger phones */
    }
}

@media (min-width: 640px) {
    .result-container {
        padding: 1.5rem; /* Larger padding for desktop */
    }
}

.score-display {
    font-size: 3.2rem;
    color: #333; /* Dunkelgrau statt Blau */
    text-shadow: none; /* Kein Schatten */
}

@media (max-width: 640px) {
    .score-display {
        font-size: 3rem;
    }
}

.restart-btn {
    background-color: #f39c12; /* Orange statt Blau */
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 0 #d35400; /* Dunkleres Orange für Schatten */
    transition: all 0.2s ease;
    /* Padding, Schriftgröße, Schriftgewicht, Textfarbe und Margin werden durch Tailwind-Klassen im Template definiert */
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 #d35400;
}

.restart-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #d35400;
}

/* Swiss cross is now implemented as SVG background image */

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 8px;
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

@media (max-width: 640px) {
    .share-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin: 0 4px;
    }
}

.share-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 7px 10px rgba(0,0,0,0.2);
}

.facebook {
    background-color: #3b5998;
}

.twitter {
    background-color: #1da1f2;
}

.whatsapp {
    background-color: #25d366;
}

.email {
    background-color: #ea4335;
}

.share-container {
    position: relative;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 15px;
    border: 3px dashed #3498db;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .share-container {
        padding: 15px 10px;
    }
}

.share-container::before {
    content: "Teile dein Ergebnis!";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0 10px;
    font-weight: bold;
    color: #3498db;
}

/* Bonus question styling */
.bonus-question-container {
    background-color: #9b59b6;
    border: 4px solid #8e44ad;
    border-radius: 15px;
    box-shadow: 0 6px 0 #6c3483;
    transform: rotate(-1deg);
    position: relative;
    overflow: hidden;
}

.bonus-question-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0) 10px,
        rgba(255, 255, 255, 0) 20px
    );
    z-index: 0;
}

.bonus-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #f1c40f;
    color: #7f5006;
    padding: 5px 15px;
    border-radius: 0 15px 0 15px;
    font-weight: bold;
    transform: rotate(5deg);
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
    z-index: 1;
}

@media (max-width: 640px) {
    .bonus-badge {
        top: 0;
        right: 0;
        font-size: 0.9rem;
        padding: 4px 12px;
    }
}

.bonus-word {
    color: white;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    /* Schriftgröße, Schriftgewicht und Margin werden durch Tailwind-Klassen im Template definiert */
}

/* Floating code button */
.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2c3e50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-btn:hover {
    transform: translateY(-5px) rotate(10deg);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

/* Modal styling */
.modal {
    display: none !important; /* Wichtig, um sicherzustellen, dass es beim Laden nicht angezeigt wird */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch; /* Improve mobile scrolling */
}

.modal.show {
    display: flex !important; /* Override display:none when showing */
}

.modal-content {
    background-color: #fff;
    padding: 24px;
    width: 95%;
    max-width: 600px; /* Default width for game modals */
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
    border: 2px solid #e74c3c; /* Red border to match site */
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    margin: 2rem 0;
    -webkit-overflow-scrolling: touch; /* Improve mobile scrolling */
    z-index: 10; /* Ensure content is above modal background */
    pointer-events: auto; /* Ensure clicks are captured */
}

/* Content modals (kontakt, impressum, etc.) */
#kontaktModal .modal-content,
#impressumModal .modal-content,
#fehlerModal .modal-content,
#woerterModal .modal-content {
    max-width: 1200px; /* Wider for content modals */
}

@media (max-width: 640px) {
    .modal-content {
        padding: 20px;
        width: 95%;
        margin: 1rem auto;
        max-height: 85vh; /* Limit height on mobile */
        overflow-y: auto; /* Ensure scrolling works on mobile */
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-btn:hover {
    color: #333;
}

.code-container {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: monospace;
    white-space: pre;
    line-height: 1.5;
    position: relative;
}

/* Animation for floating button */
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.floating-btn {
    animation: float 3s ease-in-out infinite;
}

/* Sound toggle button */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px; /* Links statt rechts */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

@media (max-width: 640px) {
    .sound-toggle {
        bottom: 20px; /* Bleibt unten */
        left: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Copy button styling */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    z-index: 10;
}

.copy-btn:hover {
    background-color: #2980b9;
}

.copy-btn.copied {
    background-color: #27ae60;
}


/* Mini confetti for correct answers */
.mini-confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
    animation: mini-fall 1.5s ease-in forwards;
}

@keyframes mini-fall {
    to {
        transform: translateY(100px) rotate(720deg);
        opacity: 0;
    }
}
.copy-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    z-index: 10;
}

.copy-btn:hover {
    background-color: #2980b9;
}

.copy-btn.copied {
    background-color: #27ae60;
}

/* Sound toggle Styles */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sound-toggle:hover {
    transform: translateY(-4px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.4);
}

.sound-toggle.muted {
    background-color: #95a5a6;
}

/* Mini confetti for correct answers */
.mini-confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
    animation: mini-fall 1.5s ease-in forwards;
}

@keyframes mini-fall {
    to {
        transform: translateY(100px) rotate(720deg);
        opacity: 0;
    }
}

/* Bonus countdown styling */
#bonus-countdown {
    font-size: 1.6rem;
    font-weight: bold;
    color: #f1c40f; /* Yellow color */
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
    margin-top: 12px;
}

/* Audio button styling */
.audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: none;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 14px;
    z-index: 10;
}

.audio-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.audio-btn:active {
    transform: scale(0.95);
}

.swiss-word-container .audio-btn {
    background-color: #c0392b; /* Dunkleres Grau für den Sound-Button */
}

.swiss-word-container .audio-btn:hover {
    background-color: #a82315; /* Noch dunkleres Grau beim Hover */
}

/* Disabled audio button */
.audio-btn:disabled,
.audio-btn.audio-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.audio-btn:disabled:hover,
.audio-btn.audio-btn-disabled:hover {
    transform: none;
    background-color: #3498db;
}

.swiss-word-container .audio-btn:disabled:hover,
.swiss-word-container .audio-btn.audio-btn-disabled:hover {
    background-color: #e74c3c;
}

.option-btn .audio-btn:disabled:hover,
.option-btn .audio-btn.audio-btn-disabled:hover {
    background-color: #95a5a6;
}

/* Smaller, gray audio buttons for answer options */
.option-btn .audio-btn {
    width: 22px;
    height: 22px;
    background-color: #95a5a6;
    font-size: 11px;
    opacity: 0.7;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-right: 4px;
    margin-left: 0;
}

.option-btn .audio-btn:hover {
    background-color: #7f8c8d;
    opacity: 1;
}

/* Audio button container in option buttons */
.audio-btn-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

/* Option content */
.option-content {
    padding-right: 8px;
    flex: 1;
    width: 100%;
    cursor: pointer;
    display: block;
}

.word-with-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Bonus points message */
#bonus-points-message, #bonus-points-message-desktop {
    animation: fadeInOut 3s ease-in-out;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform-origin: center;
    position: absolute;
    width: 100%;
    text-align: center;
    pointer-events: none; /* Prevent interaction with the message */
    height: 0; /* Prevent taking up space in the layout */
    overflow: visible; /* Allow content to be visible outside the element */
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-5px) scale(0.8); }
    10% { opacity: 1; transform: translateY(0) scale(1.1); }
    20% { transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: translateY(-5px) scale(0.8); }
}

/* Score highlight effect */
.highlight-score {
    animation: pulseScore 1.5s ease-in-out;
    position: relative;
    z-index: 10;
}

@keyframes pulseScore {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(66, 153, 225, 0.7); }
    20% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(66, 153, 225, 0); }
    40% { transform: scale(1.05); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(66, 153, 225, 0); }
}

/* Joker button styling */
.joker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    text-align: center;
    /* Farben, Schriftgröße, Schriftgewicht, Padding und Rundung werden durch Tailwind-Klassen im Template definiert */
}

.joker-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.joker-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.joker-btn i {
    color: #f39c12;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Joker message styling */
#joker-message, #joker-message-desktop {
    animation: fadeInOut 3s ease-in-out;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform-origin: center;
    position: absolute;
    width: 100%;
    text-align: center;
    pointer-events: none; /* Prevent interaction with the message */
    height: 0; /* Prevent taking up space in the layout */
    overflow: visible; /* Allow content to be visible outside the element */
}

/* Highlight effect for joker count */
.highlight-joker {
    animation: pulseJoker 1.5s ease-in-out;
    position: relative;
    z-index: 10;
}

@keyframes pulseJoker {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(246, 173, 85, 0.7); }
    20% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(246, 173, 85, 0); }
    40% { transform: scale(1.05); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(246, 173, 85, 0); }
}

/* Dialect selector styling */
#dialect-selector {
    transition: all 0.2s ease;
    min-width: 200px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

#dialect-selector:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#dialect-selector:focus {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.language-selection {
    background-color: #f0f9ff;
    border: 2px dashed #93c5fd;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

/* Language toggle button styling */
#language-toggle {
    position: absolute;
    right: 0;
    top: 20px;
    z-index: 10;
}

.language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    background-color: #ffffff;
}

.language-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.flag-icon {
    display: inline-flex;
    border-radius: 50%;
    overflow: hidden;
    width: 24px;
    height: 24px;
}

.flag-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 640px) {
    #language-toggle {
        display: none !important; /* Hide only the language toggle on mobile */
    }

    .flag-icon {
        width: 20px;
        height: 20px;
    }
}

/* Language link styling - visible on all devices */
.language-link {
    display: block;
    margin-bottom: 1rem;
    text-align: center;
}

/* Footer styling */
footer {
    margin-top: 0;
    padding: 0.25rem 0;
    background: none;
    border: none;
}

.footer-links a {
    color: #000000 !important;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: opacity 0.2s;
    background: none;
    padding: 0;
    border: none;
    font-weight: 500;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Results chart styling */
.score-display {
    min-height: 250px; /* Ensure enough space for the pie chart */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* New pie chart styling with legend */
.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    max-width: 300px;
}

.pie-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(#2ecc71 var(--correct-percentage, 50%), #e74c3c 0);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.results-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: #333; /* Dunkle Textfarbe statt Blau */
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
}

.legend-color-correct {
    background-color: #2ecc71;
}

.legend-color-incorrect {
    background-color: #e74c3c;
}

.legend-text {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.legend-percentage {
    font-weight: bold;
}

@media (max-width: 640px) {
    .pie-chart {
        width: 150px;
        height: 150px;
    }

    .legend-item {
        font-size: 14px;
    }

    .legend-color {
        width: 16px;
        height: 16px;
    }
}

/* Modal form styling */
.modal .form-group {
    margin-bottom: 0.75rem; /* Reduced bottom margin */
    text-align: left;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.25rem; /* Reduced bottom margin */
    font-weight: 600;
    color: #2d3748;
}

.modal .form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 2px solid #cbd5e0;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal .form-control:focus {
    border-color: #4299e1;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.25);
}

.modal .form-check {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal .form-check-input {
    margin-top: 0.3rem;
    margin-left: -1.5rem;
}

.modal .form-check-label {
    font-weight: normal;
}

.modal .btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
    margin-left: 0.75rem;
}

.modal .btn-primary {
    color: #fff;
    background-color: #e74c3c; /* Changed to red to match site */
    border-color: #e74c3c;
}

.modal .btn-primary:hover {
    background-color: #c0392b; /* Darker red */
    border-color: #c0392b;
}

.modal .btn-secondary {
    color: #fff;
    background-color: #f39c12; /* Changed to orange to match site */
    border-color: #f39c12;
}

.modal .btn-secondary:hover {
    background-color: #d35400; /* Darker orange */
    border-color: #d35400;
}

.modal .alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
}

.modal .alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.modal .alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0.75rem 1.5rem; /* Reduced vertical padding */
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem; /* Reduced bottom margin */
}

.modal .modal-title {
    margin-bottom: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c; /* Changed to red to match site */
}

.modal a {
    color: #e74c3c; /* Red links to match site */
    text-decoration: none;
}

.modal a:hover {
    color: #c0392b; /* Darker red on hover */
    text-decoration: underline;
}

.modal .modal-body {
    padding: 0 1.5rem 0.75rem 1.5rem; /* Reduced bottom padding */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal p {
    margin-bottom: 0.75rem; /* Reduced bottom margin */
}

.modal br {
    display: block;
    content: "";
    margin-top: 0.25rem; /* Reduced top margin */
}

.modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem; /* Reduced vertical padding */
    border-top: 1px solid #e2e8f0;
    margin-top: 0.75rem; /* Reduced top margin */
}

.modal .close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    position: relative;
    right: 0;
}

.modal .close:hover {
    color: #000;
    text-decoration: none;
    opacity: .75;
}

.modal .close:focus {
    outline: none;
}

/* Fix for modal dialog */
.modal-dialog {
    position: relative;
    width: 95%;
    margin: 1rem auto;
    pointer-events: auto; /* Changed from none to auto to allow clicks */
    max-width: 600px; /* Default width for game modals */
}

/* Content modals (kontakt, impressum, etc.) */
#kontaktModal .modal-dialog,
#impressumModal .modal-dialog,
#fehlerModal .modal-dialog,
#woerterModal .modal-dialog {
    max-width: 1200px; /* Wider for content modals */
}

@media (min-width: 576px) {
    .modal-dialog {
        width: 90%; /* Default width on desktop */
        margin: 2rem auto;
    }

    /* Content modals (kontakt, impressum, etc.) */
    #kontaktModal .modal-dialog,
    #impressumModal .modal-dialog,
    #fehlerModal .modal-dialog,
    #woerterModal .modal-dialog {
        width: 80%; /* 80% width on desktop for content modals */
    }
}