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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    background: #ffffff;
    color: #333333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Logo — centered by default */
#logo {
    width: 160px;
    height: 160px;
    cursor: pointer;
    user-select: none;
    transition: all 0.6s ease;
    z-index: 10;
}

#logo:hover {
    opacity: 0.85;
}

#logo:focus-visible {
    outline: 2px solid #2abfbf;
    outline-offset: 6px;
    border-radius: 50%;
}

/* ── Voice selector ─────────────────────────────────── */
#voice-selector-wrap {
    margin-top: 18px;
}

#voice-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    color: #333333;
    border: 1.5px solid #cccccc;
    border-radius: 8px;
    padding: 8px 36px 8px 14px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    min-width: 260px;
    max-width: 80vw;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s;
}

#voice-select:hover {
    border-color: #2abfbf;
}

#voice-select:focus-visible {
    outline: 2px solid #2abfbf;
    outline-offset: 2px;
    border-radius: 8px;
    border-color: #2abfbf;
}

/* Breathing animation when active */
#logo.active {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

/* Logo moves to top-center when image is shown */
#app.image-shown {
    justify-content: flex-start;
    padding-top: 40px;
    overflow-y: auto;
}

#app.image-shown #logo {
    width: 80px;
    height: 80px;
}

/* Generated image container */
#image-container {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
}

#app.image-shown #image-container {
    display: flex;
}

#generated-image {
    max-width: 80vw;
    max-height: 70vh;
    border-radius: 8px;
    object-fit: contain;
}

#app.image-shown #generated-image {
    max-height: 100%;
}

#app.image-shown #status {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    padding-bottom: 20px;
}

/* Status text */
#status {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #666;
    text-align: center;
    max-width: 80vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#status.hidden {
    display: none;
}

/* Bottom-left links */
#links {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 20;
}

#links a {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

#links a:hover {
    color: #333;
}

#links a:focus-visible {
    outline: 2px solid #2abfbf;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Download button — bottom-right, hidden until image is shown */
#download-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2abfbf;
    color: #ffffff;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background 0.2s, transform 0.15s;
    z-index: 20;
}

#download-btn:hover {
    background: #22a8a8;
    transform: scale(1.08);
}

#download-btn:focus-visible {
    outline: 2px solid #2abfbf;
    outline-offset: 3px;
}

#app.image-shown #download-btn {
    display: flex;
}
