* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%; /* Add this to ensure no element exceeds its container */
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    direction: rtl;
    padding: 10px;
}

.game-container {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    padding-top: 20px;
    width: 100%;
    max-width: none;
    position: relative;
    overflow: hidden;
    min-height: 85vh; /* Add this to set a minimum height */
    height: 100%; /* Add this to fill available height */
    box-sizing: border-box; /* Ensure padding is included in the height/width */
}

.header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-right: 50px;
    padding-top: 10px;
}

.title {
    font-size: 28px;
    color: #4a4a4a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 120px; /* Give enough space for coins container */max-width: 70%; /* Limit title width */
    flex-shrink: 1; /* Allow title to shrink */
    
}

.coins-container {
    background: linear-gradient(45deg, #FFD700, #FFC107);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px; /* Increased from 8px to create more space */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-left: auto; /* Push to the right */
    min-width: 90px; /* Ensure minimum width */
    justify-content: center; /* Center the content */
    flex-shrink: 0; /* Prevent shrinking */
    min-width: 100px; /* Ensures the container has enough width */
    
     /* Position this element in the top-right of the header */
     position: absolute;
     top: 0px;
     right: 0px;
     /* Make sure it appears above other elements */
     z-index: 10;
}

.coins {
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 20px;
    display: inline-block;
}

.progress-container {
    background-color: #f1f1f1;
    border-radius: 20px;
    height: 20px;
    margin-bottom: 30px;
    position: relative;
}

.progress-bar {
    background: linear-gradient(45deg, #36D1DC, #5B86E5);
    border-radius: 20px;
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.treasure {
    position: absolute;
    right: 5px;
    top: -10px;
    font-size: 24px;
}

.question-container {
    margin-bottom: 20px;
    width: 100%; /* Ensure it takes full width */
}

.question {
    font-size: 30px;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.emoji {
    font-size: 32px;
}

.answer-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 18.5%; /* Ensure it takes full width */
}

input {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 30px;        
    flex-grow: 1;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #5B86E5;
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(45deg, #5B86E5, #36D1DC);
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(91, 134, 229, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(91, 134, 229, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(91, 134, 229, 0.3);
}

.buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.hint-btn, .explanation-btn {
    background: linear-gradient(45deg, #FF9800, #F44336);
    
}

.hint, .explanation {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border-right: 4px solid #5B86E5;
    display: none;
    font-size: 30px; /* Add this to match the question font size */
    line-height: 1.5; /* Add this for consistent spacing */
}

.coin {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #FFD700;
    border-radius: 50%;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) 3;
    background-color: #ffecec;
    border-color: #f44336;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.next-btn {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
     display: none;
    /* nextButton.disabled = true; */
}

.restart-btn {
    background: linear-gradient(45deg, #9C27B0, #673AB7);
    display: none;
    margin: 0 auto;
}

.buttons-container {
    display: flex;
    justify-content: center;
}

.sound-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    box-shadow: none;
    font-size: 24px;
    padding: 5px;
    cursor: pointer;
}

.sound-btn:hover {
    transform: scale(1.1);
    box-shadow: none;
}

.version-display {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 12px;
    color: #888;
    opacity: 0.8;
}

/* אנימציית נקודות טעינה */
.loading-dots {
    display: inline-block;
    width: 60px;
    height: 20px;
    text-align: left;
}

.loading-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #5B86E5;
    margin-right: 5px;
    opacity: 0;
    animation: loadingDots 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDots {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

#coin-icon {
    margin-right: 15px; /* Add space between the icon and counter */
}

/* If needed, you can also adjust the counter */
#coin-counter {
    min-width: 20px; /* Ensures there's enough space for the counter */
    text-align: right;
}