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

/* Navigation Menu */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: #E3F2FD;
    padding: 8px;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #2563A8;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
}

.nav-links li {
    display: inline;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: #E3F2FD;
    color: #2563A8;
}

.nav-links a.active {
    background: #2563A8;
    color: white;
}

/* Body and Container */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #B8D9F0 0%, #8FC0DC 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

body > .container {
    margin: 20px auto;
    flex: 1;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1600px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #2563A8;
    margin-bottom: 20px;
    font-size: 42px;
}

.progress {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
    font-weight: 400;
    opacity: 0.7;
}

/* Toggle Controls */
.toggle-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.toggle-btn {
    padding: 12px 20px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #2563A8;
    background: white;
    color: #2563A8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #E3F2FD;
}

.toggle-btn.active {
    background: #2563A8;
    color: white;
}

/* Main Display Area */
.main-display {
    background: #EDF5FA;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 20px;
    min-height: 500px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Image Section */
.image-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-section img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Game Section - Center */
.game-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.article-hint {
    font-size: 48px;
    font-weight: bold;
    color: #1F5494;
    text-align: center;
}

.scrambled-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 80px;
}

.letter-btn {
    width: 60px;
    height: 60px;
    font-size: 32px;
    font-weight: bold;
    background: #2563A8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.letter-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background: #1F5494;
}

.letter-btn:active:not(:disabled) {
    transform: translateY(0);
}

.letter-btn:disabled,
.letter-btn.used {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.4;
    transform: scale(0.9);
}

.player-answer {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-display {
    font-size: 64px;
    font-weight: bold;
    color: #333;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.answer-display.shake {
    animation: shake 0.5s;
}

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

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #2563A8;
    background: white;
    color: #2563A8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #E3F2FD;
}

.action-btn.primary {
    background: #2563A8;
    color: white;
}

.action-btn.primary:hover {
    background: #1F5494;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.feedback {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    min-height: 40px;
    padding: 10px;
    border-radius: 8px;
}

.feedback.success {
    color: #059669;
    background: #D1FAE5;
}

.feedback.error {
    color: #DC2626;
    background: #FEE2E2;
}

.feedback.info {
    color: #2563A8;
    background: #E3F2FD;
}

.completion-message {
    font-size: 32px;
    font-weight: bold;
    color: #059669;
    text-align: center;
    padding: 40px;
}

/* Translation Section */
.translation-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    justify-content: center;
}

.translation-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.translation-label {
    font-size: 18px;
    color: #999;
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.translation-text {
    font-size: 28px;
    color: #333;
    font-weight: 600;
}

/* Navigation Controls */
.controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.btn {
    flex: 1;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.btn:hover:not(:disabled) {
    background: #e9ecef;
    color: #333;
    opacity: 1;
    border-color: #ccc;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563A8;
    color: white;
    border-color: #2563A8;
    opacity: 0.9;
}

.btn-primary:hover:not(:disabled) {
    background: #1F5494;
    opacity: 1;
}

/* Instructions */
.instructions {
    text-align: center;
    color: #666;
    font-size: 16px;
    line-height: 1.8;
    margin-top: 20px;
}

.instructions p {
    margin: 5px 0;
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a2332 0%, #0f1823 100%);
}

body.dark-mode .navbar {
    background: #1e2936;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .logo-text {
    color: #5ba3d1;
}

body.dark-mode .logo-img {
    background: #2a3441;
}

body.dark-mode .nav-links a {
    color: #d4dfe8;
}

body.dark-mode .nav-links a:hover {
    background: #2a3441;
    color: #5ba3d1;
}

body.dark-mode .nav-links a.active {
    background: #2563A8;
    color: white;
}

body.dark-mode .container {
    background: #1e2936;
}

body.dark-mode h1 {
    color: #5ba3d1;
}

body.dark-mode .progress {
    color: #8a9db0;
}

body.dark-mode .toggle-btn {
    background: #2a3441;
    color: #5ba3d1;
    border-color: #3d4f62;
}

body.dark-mode .toggle-btn:hover {
    background: #1e2936;
}

body.dark-mode .toggle-btn.active {
    background: #2563A8;
    color: white;
}

body.dark-mode .main-display {
    background: #2a3441;
}

body.dark-mode .article-hint {
    color: #5ba3d1;
}

body.dark-mode .letter-btn {
    background: #3d4f62;
    color: #d4dfe8;
}

body.dark-mode .letter-btn:hover:not(:disabled) {
    background: #2563A8;
}

body.dark-mode .letter-btn:disabled,
body.dark-mode .letter-btn.used {
    background: #1e2936;
    color: #5a6c7d;
}

body.dark-mode .answer-display {
    background: #1e2936;
    color: #d4dfe8;
}

body.dark-mode .action-btn {
    background: #2a3441;
    color: #5ba3d1;
    border-color: #3d4f62;
}

body.dark-mode .action-btn:hover {
    background: #1e2936;
}

body.dark-mode .action-btn.primary {
    background: #2563A8;
    color: white;
}

body.dark-mode .action-btn.primary:hover {
    background: #1F5494;
}

body.dark-mode .feedback.success {
    color: #10b981;
    background: #1e3a32;
}

body.dark-mode .feedback.error {
    color: #f87171;
    background: #3a1e1e;
}

body.dark-mode .feedback.info {
    color: #5ba3d1;
    background: #1e2e3a;
}

body.dark-mode .translation-box {
    background: #1e2936;
}

body.dark-mode .translation-text {
    color: #d4dfe8;
}

body.dark-mode .btn {
    background: #2a3441;
    color: #a8b8c8;
    border-color: #3d4f62;
}

body.dark-mode .btn:hover:not(:disabled) {
    background: #1e2936;
    color: #d4dfe8;
}

body.dark-mode .btn-primary {
    background: #2563A8;
    color: white;
}

body.dark-mode .btn-primary:hover:not(:disabled) {
    background: #1F5494;
}

body.dark-mode .instructions {
    color: #a8b8c8;
}

body.dark-mode .completion-message {
    color: #10b981;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-display {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .translation-section {
        flex-direction: row;
        justify-content: center;
    }
}

/* Tablet optimization */
@media (max-width: 768px) {
    .nav-container {
        padding: 12px 25px;
        flex-direction: column;
        gap: 15px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links a {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .container {
        padding: 25px;
    }
    
    h1 {
        font-size: 32px;
    }
    
    .main-display {
        padding: 25px;
        min-height: 400px;
    }
    
    .article-hint {
        font-size: 36px;
    }
    
    .letter-btn {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    
    .answer-display {
        font-size: 48px;
    }
    
    .action-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .feedback {
        font-size: 20px;
    }
    
    .translation-text {
        font-size: 24px;
    }
    
    .toggle-btn {
        padding: 10px 16px;
        font-size: 16px;
    }
    
    .image-section img {
        max-height: 300px;
    }
}

/* Mobile phone optimization */
@media (max-width: 480px) {
    .nav-container {
        padding: 10px 15px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-img {
        width: 35px;
        height: 35px;
    }
    
    .nav-links {
        gap: 8px;
    }
    
    .nav-links a {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    body > .container {
        margin: 10px auto;
    }
    
    .container {
        padding: 15px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .main-display {
        padding: 20px;
        min-height: auto;
        gap: 15px;
    }
    
    .article-hint {
        font-size: 28px;
    }
    
    .letter-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .answer-display {
        font-size: 32px;
        min-height: 60px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .action-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .feedback {
        font-size: 16px;
    }
    
    .translation-box {
        padding: 15px;
    }
    
    .translation-text {
        font-size: 20px;
    }
    
    .toggle-controls {
        gap: 6px;
    }
    
    .toggle-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .controls {
        gap: 6px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .instructions {
        font-size: 14px;
    }
    
    .image-section img {
        max-height: 200px;
    }
    
    .completion-message {
        font-size: 24px;
        padding: 20px;
    }
}
