body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: top;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

#kaboom-container {
    width: 400px;
    height: 210px;
    overflow: hidden;
    max-width: 100%;
}


#problem-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0.8rem 0;
}

#problem {
    font-size: 2rem;
}

#input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#input {
    font-size: 2rem;
    padding: 0.5rem;
    width: 60px;
    height: 2.5rem;
    border: 2px solid #333;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#result-icon {
    font-size: 2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

#result-icon.visible {
    opacity: 1;
}

#result-icon.correct {
    color: #4CAF50;
}

#result-icon.incorrect {
    color: #f44336;
}

#help-button {
    font-size: 2rem;
    margin-left: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
}


#problem-container button {
    margin-right: 0.2rem;
}

#keyboard {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    justify-content: center;
    gap: 10px;
}

.key {
    font-size: 1.4rem;
    padding: 18px;
    background-color: #fff;
    border: 2px solid #888;
    border-radius: 10px;
    cursor: pointer;
}
@media screen and (max-width: 400px) {
    .key {
        padding: 10px;
        color: #000;
        font-size: 1.2rem;
        font-weight: bold;
    }
    #problem { font-size: 1.4rem; height: 1.8rem;}
    #input { font-size: 1.4rem; }
    #result-icon { font-size: 1.4rem; }
}


.key:hover {
    background-color: #ddd;
}

.key-enter {
    background-color: #4CAF50;
    color: white;
}

.key-clear {
    background-color: orange;
    color: white;
}

#helpPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#helpPopupContent {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-height: 90vh;
    overflow: auto;
}

#helpPopup table {
    border-collapse: collapse;
    margin: auto;
}

#helpPopup th, #helpPopup td {
    border: 1px solid #444;
    padding: 5px 10px;
    text-align: center;
}

#helpPopup .highlight-row {
    background-color: #ffeb3b;
}

#helpPopup .highlight-col {
    background-color: #ffeb3b;
}

#helpPopup .highlight-cell {
    background-color: #ffc107;
}

#helpPopup button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
}

#history-container {
    width: 360px;
    margin: 0 20px;
    min-height: 20px;
    padding: 5px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
}

.history-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.history-item.correct {
    color: #4CAF50;
}

.history-item.incorrect {
    color: #f44336;
}

.history-item .strikethrough {
    text-decoration: line-through;
    margin-right: 4px;
}

.history-item .correct-answer {
    color: #4CAF50;
}

#debug-info {
    display: none;
    width: 400px;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-top: 10px;
    font-family: monospace;
}

#difficulty-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.difficulty-content {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.difficulty-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.difficulty-buttons button {
    width: 160px;
    height: 60px;
    font-size: 1.2rem;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.difficulty-buttons button:hover {
    background-color: #45a049;
} 