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

body {
    font-family: "Roboto Mono", monospace;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.4;
    padding:0 16px;
    
}

.game-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 18px;
    padding: 20px;   
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    max-width:500px;
    margin: 0 auto;
    
}

.game-header > div {

}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-center {
    display: flex;
    align-items: center;
    text-align:center;
}

.fermi-logo {
    width: 43px;
    height: 43px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-title {
    font-size: 2rem;
    width: 150px;
    font-weight: 600;
    text-decoration:none;
    color:#000;
    
}

.icon-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height:1.1rem;
    color: #333;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #dadfe1;
    transition: background-color 0.2s;
    width:48px;

}

.icon-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

button#stats-btn {
    padding-right: 10px;
}

/* Question Container */
.question-container {
    margin-bottom: 20px;
}

.question-box {
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    background-color: #b5e6fe;
}

.question-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.question-image-container {
    display: none!important; /* Hidden on small screens */
}

.question-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #e9ecef;
    background-color: #f8f9fa;
    display: block;
    display:none;
}

.question-text-container {
    flex: 1;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 13px;
    line-height: 1.5;
    color: #333;
}

.question-category {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.2s;
}

.question-category:hover {
    color: #333;
}

.question-category .arrow {
    display: inline-block;
    transform: rotate(90deg);
}

/* Questions List */
.questions-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.question-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}

.question-item:hover {
    background-color: #e9ecef;
}

.question-item.completed {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.question-item.completed.won {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.question-item.completed.lost {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.question-item.current {
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.question-info {
    flex: 1;
}

.question-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.question-text-small {
    font-size: 1rem;
    color: #333;
    line-height: 1.3;
}

.question-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

.question-status.completed {
    background-color: #28a745;
    color: white;
}

.question-status.won {
    background-color: #28a745;
    color: white;
}

.question-status.lost {
    background-color: #dc3545;
    color: white;
}

.question-status.current {
    background-color: #17a2b8;
    color: white;
}

.question-status.available {
    background-color: #6c757d;
    color: white;
}

/* Guess Counter */
.guess-counter {
    text-align: center;
    margin-bottom: 19px;
    font-size: 1rem;
    color: #333;
}

/* Hint Container */
.hint-container {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Game Result */
.game-result {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 1rem;
    border-radius: 16px;
    padding:10px;

}

.game-result.win {
    background-color: #a3f6a3;
}

.game-result.lose {
    background-color: #fa7f7f;
}

/* New Game Section */
.new-game-section {
    margin-top: 20px;
    text-align: center;
    gap: 10px;
}

.new-game-btn-inline {
    width: 100%;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 14px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.new-game-btn-inline:hover {
    background-color: #2e86c1;
}

/* Share Button */
.share-btn {
    background-color: white;
    color: #333333;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.share-btn:hover {
    background-color: #fbfbfb;
}

.new-game-section .share-btn {
    font-size: 1rem;
    margin-top: 0;
    border-radius: 14px;
    border: 2px solid #eaecef;
}

/* Guesses Container */
.guesses-container {
    margin-bottom: 20px;
}

.guess-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    height:60px;
    gap: 10px;
       position:relative;
}

.guess-field {
    flex: 1;
    background-color: #f6f6f6;
    color: #333;
    padding: 15px;
    border-radius: 13px;
    font-size: 1.2rem;
    text-align: center;
    border: none;
    line-height: normal;

}

.guess-field.empty {
    color: #b8b8b8;
}

.feedback-button {
    width:60px;
    border-radius: 100%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    height:100%;
    cursor: pointer;
    transition: transform 0.2s;
    padding:15px;
    font-family:"Cal Sans", sans-serif;
}

.feedback-button.hidden {
    display: none;
}


.feedback-button {
    /*position: relative;*/
}

/* Custom tooltip for feedback buttons */
.feedback-button::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    right: -78px;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
     font-family: "Roboto Mono", monospace;
     width:110px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
    line-height: 1.5;
}

.feedback-button::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right:19px;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(51, 51, 51, 0.95) transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1000;
}

.feedback-button:hover::after,
.feedback-button:hover::before {
    opacity: 1;
}

/* Programmatically show tooltip without hover (for tutorial) */
.feedback-button.show-tooltip::after,
.feedback-button.show-tooltip::before {
    opacity: 1;
}

.feedback-button.high {
    background-color: #e74c3c;
    color: white;
}

.feedback-button.low {
    background-color: #e74c3c;
    color: white;
}

.feedback-button.close {
    background-color: #f39c12;
    color: white;
}

.feedback-button.correct {
    background-color: #27ae60;
    color: white;
}

/* Input Section */
.input-section {
    margin-top: 20px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-container {
   
}

#number-words-section {
   padding:5px;
}

#number-words {
   color:#555;
   font-size:0.9rem;
}

#guess-input {
    flex: 1;
    background: none;
    font-size: 0.8rem;
    outline: none;
    min-width: 0;
    width: 100%;
    height: 50px;
    display: flex;
    padding:0 10px;
    gap: 8px;
    border-radius: 14px;
    flex: 1;
    border: 2px solid #9bc4df;
}

#guess-input::placeholder {
    color: #999;
}

#guess-input:hover {
   border:2px solid #70b4e0;
}

#guess-input:focus {
   border:2px solid #3498db;
}

.submit-btn {
    width: 100px;
    height: 50px;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.765625rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.submit-btn:hover {
    background-color: #2e86c1;
}

.submit-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #f0f0f0;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.modal-content p {
    margin-bottom: 12px;
    line-height: 1.4;
    color: #555;
    font-size: 0.8rem;
}

.new-game-btn, .close-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.new-game-btn:hover, .close-btn:hover {
    background-color: #229954;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.6rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Guess Distribution */
.guess-distribution {
    margin: 25px 0;
}

.guess-distribution h3 {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dist-label {
    font-size: 0.7rem;
    color: #333;
    font-weight: bold;
    min-width: 15px;
}

.dist-bar-container {
    flex: 1;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.dist-bar {
    height: 100%;
    background-color: #27ae60;
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 20px;
}

.dist-count {
    font-size: 0.7rem;
    color: #333;
    font-weight: bold;
    min-width: 20px;
    text-align: right;
}

#help-footer {
   
   margin-bottom:15px;
}

/* Large screens (>768px) - Show images side by side */
@media (min-width: 769px) {
    .question-content {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .question-image-container {
        display: block !important; /* Override JavaScript hide for large screens */
        flex-shrink: 0;
    }
    
    .question-image {
        width: 100px;
        height: 100px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 16px;
        border-radius: 18px;
        box-shadow: 0 0 5px #dcdcdc5e;
    }
    .question-box {
        border-radius: 16px;
        padding: 10px;
    }
    .game-header {
       padding:10px 0;
    }
    
    .game-title {
       font-size:1.8rem;
    }
    
    .feedback-button::before {

      right:10px;
    }
    

    
    #new-game-btn-inline, #share-btn  {
       font-size:0.9rem;
           padding: 10px 25px;
    }
    
    .guess-row {
       height:40px;
    }
    
    .guess-field {
         padding:10px;
         font-size:0.85rem;
      }
    
    .question-container {
    margin-bottom: 12px;
}
    
    .question-text {
       font-size:1.1rem;
    }
    
    .feedback-button {
         font-size:1.8rem;
         width:40px;
    }
    
    .hint-container {
        font-size: 0.8375rem;
    }
    
    .feedback-button {
       padding:10px;
    }
    
    .game-result {
        font-size: 0.8375rem;
    }

}

/* Animation for new guesses
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guess-row {
    animation: slideIn 0.3s ease-out;
}
    */

/* Shake animation for wrong guesses */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
} 
