/* CSS Variables */
:root {
    --dark-bg: #1e1e1e;
    --darker-bg: #282828;
    --darker-dark-bg: #1c1c1c; /* Added this variable */
    --light-text: #e0e0e0;
    --muted-text: #f5f5f5;
    --blue: #7a7aff;
    --dark-blue: #44448b;
    --darker-blue: #333333;
    --star-filled: #7a7aff;
    --star-light: #dddddd;
    --disabled-text: #555555;
    --button-hover-bg: #6a6aff;
    --button-disabled-bg: transparent;
    --gradient-bg: linear-gradient(to right, #6a6aff, #44448b);
}

/* Global Styles */
body {
    font-family: Arial, sans-serif;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    width: 100vw;
    background-color: var(--dark-bg);
    background-image: linear-gradient(135deg, var(--darker-dark-bg) 25%, transparent 25%), 
                      linear-gradient(225deg, var(--darker-dark-bg) 25%, transparent 25%), 
                      linear-gradient(45deg, var(--darker-dark-bg) 25%, transparent 25%), 
                      linear-gradient(315deg, var(--darker-dark-bg) 25%, var(--dark-bg) 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 20px 20px;
    background-repeat: repeat;
    color: var(--light-text);
    max-width: 400px;
    margin: 0 auto; /* Center the div */
    overflow: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
.main-content {
    width: 100%;
}

.logo {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 100px;
    height: auto;
    z-index: 1000;
    cursor: pointer;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 5%;
}

.header {
    margin-top: 20px;
    margin-bottom: 3%;
    position: relative;
    justify-content: center;
    align-items: center;
}

#target-number {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

#target-number-box {
    display: inline-block;
    padding: 10px;
    background-color: var(--darker-bg);
    border: 2px solid var(--blue);
    border-radius: 5px;
    font-size: 40px;
    margin: 0;
    color: var(--light-text);
}

#undo-box {
    text-align: center;
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -25%);
    padding: 1%;
    background: var(--gradient-bg);
    color: var(--muted-text);
    cursor: pointer;
    border-radius: 5px;
    width: 50%;
    max-width: 300px;
    text-align: center;
    display: block;
    margin-left: auto;
    margin-right: auto;
    font-size: 25px;
    margin-top: 2%;
}

.number-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: clamp(75px, 5vw, 100px) clamp(50px, 5vw, 100px);
    grid-row-gap: 20px;
    gap: 15%;
    margin: 0 auto;
    height: 200px;
    max-width: 600px;
    margin-left,margin-right: 10px;
    justify-content: center;
    /*align-content: center;*/
}

.number-button {
    width: clamp(75px, 5vw, 100px);
    height: clamp(75px, 5vw, 100px);
    font-size: 250%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dark-blue);
    color: var(--muted-text);
    cursor: pointer;
    user-select: none;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 2px;
    margin:  6px;
    border: 3px solid var(--dark-bg);
}
.number-button.highlight {
    border: 3px solid #44A0A0; /* Blue border for highlighting */
}

.operation-popup {
    display: none;
    position: absolute;
    background: var(--darker-blue);
    border: 1px solid var(--dark-blue);
    border-radius: 5px;
    padding: 1%;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    font-size: 2vw;
    text-align: center;
    gap: 10px;
    flex-direction: column;
    align-items: center;
}

.popup-values {
    margin-bottom: 10px;
    font-size: 4vw;
    font-weight: bold;
    color: var(--muted-text);
}

.popup-operations {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.popup-operations button {
    background: var(--dark-blue);
    border: none;
    color: var(--muted-text);
    padding: 1%;
    border-radius: 5px;
    cursor: pointer;
    font-size: clamp(10px, 4vw, 50px);
    width: 16vw;
    height: 16vw;
    max-width: 50px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#operations-display {
    margin-top: 2%;
    font-size: 2vw;
    color: var(--light-text);
}

#screen-dimensions {
    font-size: 1vw;
    position: fixed;
    bottom: 0;
    right: 0;
    padding: 10px;
    background: var(--darker-blue);
    color: var(--muted-text);
    border-top: 1px solid var(--dark-blue);
    box-shadow: 0px -2px 5px rgba(0, 0, 0, 0.5);
}

.bottom-buttons {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

#show-answer-button, #new-game-button {
    padding: 10px 20px;
    border: 1px solid var(--blue);
    border-radius: 10px;
    background: var(--button-disabled-bg);
    color: var(--blue);
    cursor: pointer;
    white-space: nowrap; /* Prevent text from wrapping */
    font-size: 20px;
}

#show-answer-button:disabled {
    background-color: var(--button-disabled-bg);
    color: var(--disabled-text);
    cursor: not-allowed;
}

.difficulty-rating {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 1px;
}

.star {
    font-size: 16px;
    color: var(--star-light);
}

.star.filled {
    color: var(--star-filled);
}


.daily-puzzle {
    position: fixed;
    top: 50px;
    right: 10px;
    width: 100px;
    height: auto;
    z-index: 1000;
    color: white;
    font-size: 10px;
    font-weight: bold;
    z-index: 1000; /* Ensure it stays above other content */
    text-align: center;
    white-space: nowrap; /* Prevent text wrapping */
    display: none;
}

.daily-puzzle .icon {
    margin-left: 5px;
    font-size: 10px;
}

.daily-puzzle .text {
    font-size: 10px;
}

.help {
    padding-top: 10px;
    font-size: 10px;
    height: 15px;
    font-family: 'Roboto', sans-serif
}


/* Popup Styles */
.info-popup {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(3px); /* Blur the background */
    background: rgba(0, 0, 0, 0.5); /* Slightly dimmed */
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.info-popup-content {
    background: linear-gradient(to right, #44448b, #4a4a99);
    color: #dcdce6;
    padding: 5px;
    border-radius: 4px;
    text-align: center;
    padding-left: 10px;
    position: relative;
    width: 300px;
    max-width: 90%;
    padding-right: 35px;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    margin-left: 5%;
    margin-right: 5%;
}

.close-btn {
    background: transparent;
    color: white;
    border: none;
    font-size: 35px;
    cursor: pointer;
    position: absolute;
    top: 0px;
    right: 0px;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background: var(--blue);
}

.about-popup-content {
    height: 70%;
    padding-top: 20px;
}

.about-text {
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
    padding-left: 3%;
    width: 100%;
    text-align: left;
}

h1 {
    text-align: center;
    font-size: 20px;
}

h2 {
    font-size: 14px;
}


/* Finger animation styles */
.finger {
    position: absolute;
    font-size: 30px; /* Set size for the finger icon */
    pointer-events: none; /* Ensure it doesn't block interactions */
    transition: transform 0.3s ease-in-out;
}

/* Apply this animation to the finger */
.finger.animate {
    animation: drag-animation 1.5s infinite forwards; /* Adjust duration as needed */
}

/* You can also adjust the finger icon size and transition effects here */
.finger i {
    color: #f5f5f5; /* Optional: Customize the finger color */
}

@media (max-width: 600px) and (min-height: 530px) {
    #target-number {
        padding-top:  35px;
        font-size: 40px;
    }
    #target-number-box {
        font-size: 40px;
    }
    .container {
        margin-top: 20px;
    }
    .number-buttons {
        margin-top: 40px;
    }
    .number-button {
        width: 75px;
        height: 75px;
        font-size: 38px;
    }
    .operation-popup {
        font-size: 4vw;
    }
    .popup-values {
        font-size: 8vw;
    }
    .popup-operations button {
        width: 12vw;
        height: 12vw;
        font-size: 8vw;
    }
    #operations-display {
        font-size: 24px;
    }
    #undo-box {
        background-color: #7b00dd;
        color: white;
        cursor: pointer;
        border-radius: 5px;
        width: 50%;
        font-size: 40px;
    }
}