body {
    font-family: 'Verdana', sans-serif;
    background-color: #f7f9fc;
    margin: 0;
    padding: 20px;
    color: #333;
}

h1, h2, h3 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 10px;
}

.animated-border-container {
    background: linear-gradient(-45deg, #2d9cdb, #2ecc71, #f39c12, #9b59b6);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    padding: 20px;
    border-radius: 15px;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-title {
    animation: pulseTitle 3s infinite;
}

@keyframes pulseTitle {
    0%,100% { transform: scale(1); color:#333; }
    50% { transform: scale(1.05); color:#2d9cdb; }
}

#gameArea {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    margin: auto;
    max-width: 1000px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    min-height: 80vh;
    overflow-y: auto;
}

.card {
    background: #fefefe;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: left;
    margin-bottom: 20px;
}

.customization-screen {
    text-align: center;
    width: 300px;
}

.settings-group {
    margin: 10px 0;
}

.title-row {
    text-align: center;
    margin-bottom: 30px;
}

.container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.place-value-exp {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
}

.input-buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.primary-btn, .secondary-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.primary-btn {
    background-color: #2d9cdb;
    color: #fff;
}
.primary-btn:hover {
    background-color: #1b7aad;
    transform: scale(1.05);
}

.secondary-btn {
    background-color: #ccc;
    color: #333;
}
.secondary-btn:hover {
    background-color: #bbb;
    transform: scale(1.05);
}

.guess-btn:hover {
    animation: bounce 0.5s;
}
@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.small-btn {
    font-size: 12px;
    padding: 5px 10px;
}

#feedback {
    margin-top: 20px;
    font-weight: bold;
    color: #d9534f;
    animation: fadeIn 1s, popUp 0.5s ease;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.guess-table {
    margin-top: 30px;
    border-collapse: collapse;
    width: 100%;
    font-size: 16px;
}

.guess-table th, .guess-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.guess-table th {
    background-color: #f2f2f2;
}

.guess-row {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.6s, transform 0.6s;
}

.guess-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.feedback-green {
    color: #28a745;
    font-weight: bold;
}

.feedback-yellow {
    color: #ffc107;
    font-weight: bold;
}

.feedback-gray {
    color: #6c757d;
    font-weight: bold;
}

.decimal-display {
    color: #333;
    font-weight: bold;
}

.win-message {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.hint-card {
    margin-top: 20px;
    text-align: center;
}

.hint-card p {
    margin-bottom: 10px;
}

.slide-in {
    animation: slideIn 0.5s forwards;
}

@keyframes slideIn {
    from {transform: translateY(-20px); opacity:0;}
    to {transform: translateY(0); opacity:1;}
}

.digit-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
}

.digit-input {
    width: 40px;
    font-size: 24px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 50px;
    transition: all 0.2s ease;
}

.digit-input:focus {
    outline: none;
    border-color: #2d9cdb;
    box-shadow: 0 0 8px rgba(45,156,219,0.5);
    transform: scale(1.05);
}

.decimal-point-display {
    font-size: 24px;
    font-weight: bold;
    margin: 0 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 100px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    margin: auto;
    max-width: 500px;
    position: relative;
    animation: fadeInModal 0.5s ease;
    text-align: left;
    background: #fff;
}

@keyframes fadeInModal {
    from {transform: translateY(-30px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

.question-block {
    margin: 15px 0;
}

.fade-in-question {
    animation: fadeInQ 0.5s;
}

@keyframes fadeInQ {
    from {opacity:0; transform: translateY(-10px);}
    to {opacity:1; transform: translateY(0);}
}

.quiz-feedback {
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
    color: #d9534f;
    transition: all 0.3s ease;
}

.quiz-feedback:empty {
    margin-top: 0;
}

.quiz-feedback:contains("Excellent!") {
    color: #28a745;
}

.option-label {
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.option-label:hover {
    color: #2d9cdb;
    text-shadow: 0 0 5px rgba(45,156,219,0.3);
}

.quiz-number {
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    animation: fadeInNumber 1s ease;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

@keyframes fadeInNumber {
    from {opacity:0; transform: translateY(-10px);}
    to {opacity:1; transform: translateY(0);}
}

.question-section {
    margin-bottom: 20px;
}

.question-section h3 {
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

/* Hide submit button smoothly on success */
#submitQuizButton {
    transition: opacity 0.5s ease;
}