/* Desktop Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #f5f5f5;
    line-height: 1.6;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.title-block {
    margin: 0;
}

.title-block h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 32px;
}

.title-block p {
    margin: 5px 0 0 0;
    color: #7f8c8d;
    font-size: 18px;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.game-select {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-select:hover {
    border-color: #45a049;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.new-game-btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.new-game-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Info Button Style */
.info-btn {
    padding: 10px;
    font-size: 18px;
    cursor: pointer;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Instructions Styles */
.instructions {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.instructions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 5px;
}

.instructions-header:hover {
    background: #f8f9fa;
    border-radius: 4px;
}

.instructions-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: #2c3e50;
}

.instructions-content {
    margin-top: 15px;
    display: none;
    color: #555;
    line-height: 1.6;
}

.instructions-content.show {
    display: block;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

/* Level Info Styles */
#level-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    border-left: 4px solid #e74c3c;
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
}

/* Game Container Styles */
#game-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    min-height: 200px;
    line-height: 1.8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Word Styles */
.word {
    display: inline-block;
    padding: 2px 7px;
    margin: 2px 1px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.word:hover { 
    background: #f0f0f0; 
}

.word.correct {
    background: #d4edda !important;
    color: #155724;
}

.word.incorrect {
    background: #f8d7da !important;
    color: #721c24;
    text-decoration: underline wavy red;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background: white;
    padding: 28px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.instructions-box {
    max-width: 600px;
}

.instructions-box h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-message {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
    color: #2c3e50;
    text-align: center;
}

.modal-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: block;
    margin: 15px auto 0;
}

.modal-button:hover {
    background: #2980b9;
}

/* Styles für Spielauswahl-Buttons */
.game-select-button {
    padding: 12px 16px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    background-color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: left;
}

.game-select-button:hover {
    background-color: #f0f8f0;
    border-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.game-select-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

/* Confetti Styles */
.confetti {
    position: fixed;
    width: 8px;
    height: 16px;
    pointer-events: none;
    z-index: 9999;
}

@keyframes confetti-fall {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x), var(--end-y)) rotate(var(--rotation));
        opacity: 0;
    }
}

/* Textarea and text container styles from min_styles.css */
textarea {
    width: 100%;
    height: 100px;
    margin: 10px 0;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
}

.text-container {
    line-height: 1.8;
    margin: 20px 0;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.treasure-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 18px;
    background-color: #ffd700;
    border: 2px solid #b8860b;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.3s ease;
}

.treasure-button.active {
    opacity: 1;
    pointer-events: auto;
    animation: glow 2s infinite;
}

.treasure-button.active:hover {
    transform: scale(1.05);
    background-color: #ffed4a;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px #ffd700; }
    50% { box-shadow: 0 0 20px #ffd700; }
    100% { box-shadow: 0 0 5px #ffd700; }
}

/* Responsive styles */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin: 10px 0;
    }
    
    .word {
        padding: 6px 8px;
        margin: 3px;
    }
    
    .text-container {
        padding: 12px;
        line-height: 2;
    }
}

/* Level code styling */
#level-code {
    background-color: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border: 1px dashed #e74c3c;
    color: #e74c3c;
    cursor: pointer;
    transition: all 0.2s ease;
}

#level-code:hover {
    background-color: #ffeaea;
    transform: scale(1.05);
}

/* Code entry button */
.code-entry-button {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e74c3c;
    border-radius: 5px;
    background-color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    color: #e74c3c;
    font-weight: bold;
}

.code-entry-button:hover {
    background-color: #fef5f5;
    border-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.code-entry-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

/* Code input field */
.code-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 2px solid #3498db;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.code-input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
}

/* Cancel button */
.cancel-button {
    background-color: #7f8c8d !important;
}

.cancel-button:hover {
    background-color: #6c7a7d !important;
}

/* Error message */
.error-message {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Code entry box specific styling */
.code-entry-box {
    max-width: 400px;
}