:root {
    --primary-color: #be0111;
    --secondary-color: #cc6d7b;
    --background-color: #ce3030;
    --text-color: #58688b;
    --white-color: #e9dbdb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family: 'Poppins', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background-color: var(--white-color);
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    width: 100%;
    max-width: 600px;
    text-align: center;
    transition: all 0.3s ease;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

header p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}
#calculate-btn {
    padding: 15px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.4);
}

#processing-area {
    margin-top: 30px;
}

.name-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.name-box {
    display: flex;
    gap: 5px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 10px;
}

.name-box span {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-weight: 600;
    background-color: var(--white-color);
    border-radius: 5px;
    transition: all 0.5s ease;
    text-transform: uppercase;
}

.name-box span.strike {
    text-decoration: line-through;
    background-color: #e0e0e0;
    color: #aaa;
    transform: scale(0.9);
}

.count-display {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.count-display.visible {
    opacity: 1;
    transform: translateY(0);
}

#count-value {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.flames-container {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.flames-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.flames-box {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.flames-box span {
    display: inline-block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    text-align: center;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    border-radius: 50%;
    transition: all 0.5s ease;
}

.flames-box span.strike {
    background: #e0e0e0;
    color: #aaa;
    transform: scale(0);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--white-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    width: 90%;
    max-width: 400px;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--primary-color);
}

#result-title {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 15px;
    animation: pop-in 0.6s ease-out;
}

#result-meaning {
    font-size: 1.1rem;
}

.hidden {
    display: none;
}

@keyframes pop-in {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
