* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #006400 0%, #D4AF37 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    padding: 20px;
    text-align: center;
    border: 3px solid #D4AF37;
}

h1 {
    color: #006400;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 2.5rem;
}

.start-screen {
    padding: 30px;
}

.start-screen p {
    margin-bottom: 25px;
    font-size: 18px;
    color: #333;
}

.btn {
    padding: 12px 25px;
    margin: 10px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-start {
    background: linear-gradient(to right, #006400, #008000);
    color: white;
    border: 2px solid #D4AF37;
}

.btn-how {
    background: linear-gradient(to right, #D4AF37, #FFD700);
    color: #006400;
    border: 2px solid #006400;
}

.btn-ok {
    left: 50%;
    background: linear-gradient(to right, #006400, #008000);
    color: white;
    padding: 10px 20px;
    margin-top: 20px;
    border: 2px solid #D4AF37;
}

.btn-fact {
    background: linear-gradient(to right, #D4AF37, #FFD700);
    color: #006400;
    padding: 10px 20px;
    margin-top: 20px;
    border: 2px solid #006400;
    font-weight: bold;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-screen {
    display: none;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f1f8ff;
    border-radius: 10px;
    background: linear-gradient(to right, #e8f5e8, #fff9e6);
    border: 2px solid #D4AF37;
}

.info-item {
    font-size: 18px;
    font-weight: bold;
    color: #006400;
}

.game-board {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 3px solid #006400;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tamtam {
    position: absolute;
    width: 25px;
    height: 25px;
    background: url('/assets/images/avatars/base/avatarbase.png') no-repeat center/contain;
    transition: transform 0.2s;
    pointer-events: none;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.tamtam:hover {
    transform: scale(1.1);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 300;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: left;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    border: 3px solid #D4AF37;
    background: linear-gradient(to bottom, #ffffff, #f8f8f8);
}

.modal h2 {
    color: #006400;
    margin-bottom: 15px;
    border-bottom: 2px solid #D4AF37;
    padding-bottom: 10px;
}

.modal h3 {
    color: #D4AF37;
    margin-bottom: 15px;
    background-color: #006400;
    padding: 10px;
    border-radius: 8px;
    color: white;
}

.modal p {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 18px;
    color: #333;
}

.close-btn {
    padding: 8px 20px;
    background: linear-gradient(to right, #006400, #008000);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 10px;
    border: 2px solid #D4AF37;
}

.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 50px;
    font-weight: bold;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 200;
}

.correct {
    background: linear-gradient(to right, #006400, #008000);
    color: white;
    border: 2px solid #D4AF37;
}

.wrong {
    background: linear-gradient(to right, #8B0000, #FF0000);
    color: white;
    border: 2px solid #D4AF37;
}

.time-change {
    position: absolute;
    font-weight: bold;
    font-size: 18px;
    pointer-events: none;
    animation: fadeUp 1s forwards;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes fadeUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}

.tamtam-preview {
    width: 100px;
    height: 100px;
    margin: 15px auto;
    background: url('/assets/images/avatars/base/avatarbase.png') no-repeat center/contain;
    border: 3px solid #006400;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #fff9e6;
}

.fact-text {
    font-style: italic;
    color: #006400;
    background-color: #fff9e6;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #D4AF37;
    font-size: 16px;
    line-height: 1.5;
}

.fact-text strong {
    font-weight: bold;
    color: #006400;
}

strong {
    font-weight: bold;
    color: #006400;
}

.sound-control {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 300;
    border: 2px solid #D4AF37;
}

/* High Scores Styles */
.high-scores {
    position: absolute;
    top: 20px;
    left: 20px;
    margin: 0;
    padding: 15px;
    background: linear-gradient(to right, #e8f5e8, #fff9e6);
    border-radius: 10px;
    border: 2px solid #D4AF37;
    width: 300px;
    max-height: 550px;
    overflow-y: auto;
    z-index: 200;
}

.high-scores h2 {
    color: #006400;
    margin-bottom: 15px;
    border-bottom: 2px solid #D4AF37;
    padding-bottom: 5px;
}

#highScoresList {
    text-align: left;
}

.high-score-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    margin-bottom: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    border-left: 4px solid #D4AF37;
}

.high-score-rank {
    font-weight: bold;
    color: #006400;
    min-width: 30px;
}

.high-score-name {
    flex-grow: 1;
    text-align: left;
    padding: 0 10px;
}

.high-score-value {
    font-weight: bold;
    color: #006400;
    min-width: 40px;
}

#playerName {
    padding: 10px 15px;
    border: 2px solid #D4AF37;
    border-radius: 50px;
    margin-right: 10px;
    font-size: 16px;
    width: 200px;
    text-align: center;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .high-scores {
        position: relative;
        width: 100%;
        max-width: 400px;
        margin: 0 auto 20px;
        top: 0;
        left: 0;
    }
}

@media screen and (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .start-screen {
        padding: 20px 15px;
    }
    
    .start-screen p {
        font-size: 16px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-board {
        height: 350px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal h2 {
        font-size: 1.5rem;
    }
    
    .modal p {
        font-size: 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    #playerName {
        width: 150px;
        margin-right: 5px;
    }
}

@media screen and (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .container {
        width: 95%;
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .game-board {
        height: 300px;
    }
    
    .tamtam-preview {
        width: 80px;
        height: 80px;
    }
    
    .high-scores {
        max-height: 300px;
    }
    
    .high-score-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .high-score-name {
        text-align: center;
    }
    
    .btn-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        margin: 5px 0;
    }
    
    .sound-control {
        width: 35px;
        height: 35px;
        top: 5px;
        right: 5px;
    }
    
    .message {
        width: 90%;
        text-align: center;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    #playerName {
        width: 100%;
        margin: 0 0 10px 0;
    }
}

@media screen and (max-width: 400px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .game-board {
        height: 250px;
    }
    
    .info-item {
        font-size: 16px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal h2 {
        font-size: 1.3rem;
    }
    
    .modal p {
        font-size: 14px;
    }
    
    .fact-text {
        font-size: 14px;
        padding: 10px;
    }
    
    .tamtam-preview {
        width: 60px;
        height: 60px;
    }
}

/* Orientation-specific adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
    }
    
    .container {
        max-width: 90%;
        padding: 15px;
    }
    
    .game-board {
        height: 250px;
    }
    
    .high-scores {
        max-height: 200px;
    }
}

/* Prevent text size adjustment on mobile */
@media screen and (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .tamtam:hover {
        transform: none;
    }
    
    .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}