/* Basic page setup */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Helvetica, sans-serif;
    color: #2b1714;

    background:
        linear-gradient(rgba(120, 0, 0, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 0, 0, 0.08) 1px, transparent 1px),
        #f4e6cf;

    background-size: 40px 40px;
}


/* Page heading */

header {
    text-align: center;
    padding: 60px 20px 30px;
    background-color: #b5121b;
    border-bottom: 6px solid #d5a021;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
}

header h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.7rem;
    letter-spacing: 3px;
    color: #fff4d6;
    text-shadow: 3px 3px 0 #6e080d;
}

header p {
    max-width: 550px;
    margin: 15px auto 0;
    color: #f8dbc1;
    line-height: 1.6;
}


/* Main content */

main {
    display: flex;
    justify-content: center;
    padding: 50px 20px 80px;
}


/* Main fortune teller box */

.fortune-container {
    width: 100%;
    max-width: 700px;
    padding: 40px;

    background-color: #fff9eb;

    border: 4px solid #a80f17;
    border-radius: 18px;

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.25),
        0 0 0 8px #d5a021;
}


/* Form */

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

label {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    font-weight: bold;
    color: #7a0b10;
}

input {
    width: 100%;
    padding: 15px 17px;

    border: 2px solid #c59a3d;
    border-radius: 8px;

    background-color: #fffdf7;
    color: #321b17;

    font-size: 1rem;
    outline: none;
}

input::placeholder {
    color: #9a8375;
}

input:focus {
    border-color: #b5121b;
    box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.15);
}


/* Fortune button */

button {
    margin-top: 8px;
    padding: 16px 20px;

    border: 3px solid #73090e;
    border-radius: 8px;

    background-color: #b5121b;
    color: #fff5d8;

    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

button:hover {
    background-color: #d21b26;
    transform: translateY(-2px);

    box-shadow: 0 6px 15px rgba(100, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
}


/* Error message */

#error-message {
    min-height: 20px;
    margin: 0;
    color: #b5121b;
    font-weight: bold;
}


/* Fortune result */

.result {
    margin-top: 35px;
    padding-top: 35px;

    text-align: center;

    border-top: 3px double #c59a3d;
}

.result[hidden] {
    display: none;
}

.result-name {
    margin-bottom: 10px;

    color: #a50d15;

    font-weight: bold;
    font-size: 0.95rem;

    text-transform: uppercase;
    letter-spacing: 2px;
}

.result h2 {
    margin: 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;

    color: #6e080d;
}

.fortune-text {
    max-width: 560px;

    margin: 25px auto 35px;
    padding: 22px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    line-height: 1.4;

    color: #3c2018;

    background-color: #fff4d6;

    border-left: 6px solid #b5121b;
    border-right: 6px solid #b5121b;

    border-radius: 6px;
}


/* Lucky number and lucky color area */

.details {
    display: flex;
    gap: 18px;
}

.detail-card {
    flex: 1;

    padding: 22px;

    background-color: #b5121b;

    border: 3px solid #d5a021;
    border-radius: 10px;

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.detail-card h3 {
    margin: 0 0 12px;

    font-size: 0.8rem;

    text-transform: uppercase;
    letter-spacing: 1.5px;

    color: #ffe6a6;
}

.detail-card p {
    margin: 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.9rem;
    font-weight: bold;

    color: #ffffff;
}


/* Small message under result */

.try-again {
    margin: 28px 0 0;

    color: #8c5b4b;
    font-size: 0.9rem;
    font-style: italic;
}


/* Mobile styling */

@media (max-width: 600px) {

    header {
        padding-top: 45px;
    }

    header h1 {
        font-size: 2.7rem;
    }

    .fortune-container {
        padding: 28px 22px;
    }

    .fortune-text {
        font-size: 1.6rem;
    }

    .details {
        flex-direction: column;
    }
}
/* -------------------------------- */
/* NAME REQUIRED POPUP */
/* -------------------------------- */

.popup-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;

    background-color: rgba(25, 0, 0, 0.78);

    z-index: 1000;
}


/* Hidden must override the flex display above */

.popup-overlay[hidden] {
    display: none;
}


.popup-box {
    width: 100%;
    max-width: 430px;

    padding: 35px;

    text-align: center;

    background-color: #fff4d6;

    border: 5px solid #b5121b;
    border-radius: 15px;

    box-shadow:
        0 0 0 7px #d5a021,
        0 20px 50px rgba(0, 0, 0, 0.5);
}


.popup-symbol {
    margin: 0 0 10px;

    font-size: 3rem;

    color: #b5121b;
}


.popup-box h2 {
    margin: 0 0 15px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;

    color: #8c0d14;
}


.popup-box p {
    margin-bottom: 25px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    line-height: 1.6;

    color: #4b2a20;
}


.popup-box button {
    width: 100%;

    background-color: #b5121b;
    color: #fff4d6;

    border: 3px solid #72090e;
}


.popup-box button:hover {
    background-color: #d21b26;
}