/* General background and font */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #f6ffe6;
    font-family: 'Source Code Pro', monospace, sans-serif;
    color: #6d3fa9;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Affirmation at top center */
#affirmationBox {
    position: fixed;
    left: 30px;
    right: 30px;
    bottom: 160px; /* space above the buttons */
    text-align: center;
    font-size: 1.4rem;
    color: #6d3fa9;
    font-weight: 400;
    z-index: 11;
    letter-spacing: 0.01em;
    pointer-events: none; /* so it doesn't block button clicks */
    padding: 0 30px;
    cursor: pointer;
    transition: opacity 0.3s;
}

/* Centered input/question */
.center-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}
.center-input-container label {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #6d3fa9;
    font-weight: 500;
}
.center-input-container input[type="text"] {
    padding: 12px 20px;
    font-size: 1.1rem;
    border-radius: 20px;
    border: 1.5px solid #b6fcb6;
    outline: none;
    margin-bottom: 16px;
    font-family: inherit;
    background: #fff;
    color: #6d3fa9;
}
.main-action-btn {
    padding: 14px 32px;
    font-size: 1.1rem;
    border-radius: 24px;
    border: none;
    background: #6d3fa9;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(109,63,169,0.08);
    transition: background 0.2s;
}
.main-action-btn:hover {
    background: #4e2c7a;
}

/* Emotion buttons - pastel, animated */
#emotions {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 2;
}
.emotion-btn {
    position: absolute;
    min-width: 90px;
    min-height: 38px;
    padding: 8px 18px;
    font-size: 1.05rem;
    font-family: inherit;
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.3s, transform 0.2s;
    font-weight: 500;
}
.emotion-btn:nth-child(1) { background: #f7b6d2; color: #6d3fa9; }
.emotion-btn:nth-child(2) { background: #b6fcb6; color: #1e1e1e; }
.emotion-btn:nth-child(3) { background: #ffe37b; color: #6d3fa9; }
.emotion-btn:nth-child(4) { background: #e0ffe0; color: #1e1e1e; }
.emotion-btn:nth-child(5) { background: #fffbe8; color: #6d3fa9; }
.emotion-btn:nth-child(6) { background: #e0d6ff; color: #6d3fa9; }
.emotion-btn:nth-child(7) { background: #f7b6d2; color: #6d3fa9; }
.emotion-btn:nth-child(8) { background: #b6fcb6; color: #1e1e1e; }
.emotion-btn:nth-child(9) { background: #ffe37b; color: #6d3fa9; }
.emotion-btn:nth-child(10) { background: #e0ffe0; color: #1e1e1e; }
.emotion-btn:nth-child(11) { background: #fffbe8; color: #6d3fa9; }
.emotion-btn:nth-child(12) { background: #e0d6ff; color: #6d3fa9; }
.emotion-btn.selected {
    border: 2px solid #6d3fa9;
    background: #6d3fa9;
    color: #fff;
    transform: scale(1.08) rotate(-3deg);
}
.emotion-btn:hover {
    filter: brightness(1.1);
}

/* Result area (image/placeholder) */
#resultArea {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 320px;
    height: 480px; /* 2:3 aspect ratio */
    background: none;
    margin-bottom: 32px;
    position: relative;
}
#imagePlaceholder {
    width: 100%;
    height: 100%;
    background: #eaeaea;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6d3fa9;
    font-size: 1.1rem;
    font-style: italic;
    letter-spacing: 0.01em;
}

/* Save/Start Over buttons */
#bottomButtons {
    position: fixed;
    left: 32px;
    bottom: 32px;
    z-index: 10;
    display: flex;
    gap: 16px;
}
#saveImageBtn, .secondary-btn {
    padding: 10px 24px;
    font-size: 1.1rem;
    border-radius: 20px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.3s;
}
#saveImageBtn {
    background: #6d3fa9;
    color: #EEF8DC;
}
#saveImageBtn:hover {
    background: #4e2c7a;
}
.secondary-btn {
    background: #EEF8DC;
    color: #6d3fa9;
    border: 2px solid #6d3fa9;
}
.secondary-btn:hover {
    background: #f7b6d2;
    color: #6d3fa9;
}

#homeScreen {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    z-index: 3;
}

#homeScreen label {
    font-size: 1.35rem;
    margin-bottom: 22px;
    color: #6d3fa9;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.01em;
}

#homeScreen input[type="text"] {
    padding: 14px 20px;
    font-size: 1.1rem;
    border-radius: 24px;
    border: 2px solid #6d3fa9;
    outline: none;
    margin-bottom: 24px;
    font-family: inherit;
    background: #f6ffe6;
    color: #6d3fa9;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    transition: border 0.2s;
}

#homeScreen input[type="text"]::placeholder {
    color: #b39ddb;
    opacity: 1;
    font-style: italic;
}

#homeScreen .main-action-btn {
    padding: 18px 0;
    width: 100%;
    font-size: 1.2rem;
    border-radius: 32px;
    border: none;
    background: #6d3fa9;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(109,63,169,0.08);
    transition: background 0.2s;
    letter-spacing: 0.01em;
}

#homeScreen .main-action-btn:hover {
    background: #4e2c7a;
}

/* Loading screen */
#loadingScreen {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6ffe6;
    z-index: 10;
}
.loading-text {
    font-size: 2rem;
    color: #6d3fa9;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Result screen */
#resultScreen {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f6ffe6;
    z-index: 10;
}
#generatedImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 2/3;
    border-radius: 18px;
    display: block;
    background: none;
}

#bottomButtons.centered-bottom {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
  .center-input-container {
    padding-left: 5vw;
    padding-right: 5vw;
    max-width: 100%;
    box-sizing: border-box;
  }
  #affirmationBox {
    font-size: 1.2rem;
    bottom: 150px;
    padding: 0 8vw;
  }
}