:root {
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(35, 37, 56) 0%, rgb(18, 12, 33) 90%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --primary-color: #a8edea;
    --text-main: #ffffff;
    --text-sec: #b0b0b0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    overflow-x: hidden;
    padding: 20px;
}

.background-orb {
    position: absolute;
    width: 300px;
    height: 300px;
    background: #6a11cb;
    filter: blur(100px);
    border-radius: 50%;
    z-index: -1;
    top: 10%;
    left: 20%;
    opacity: 0.4;
    animation: float 10s infinite alternate;
}

.orb-2 {
    background: #2575fc;
    top: 60%;
    left: 60%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.main-container {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-sec);
}

.display-window {
    width: 100%;
    min-height: 280px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#placeholder {
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

.content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#resultImage {
    max-width: 100%;
    max-height: 400px;
    display: none;
    border-radius: 8px;
    animation: fadein 0.5s ease;
}

#resultText {
    display: none;
    padding: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    color: #fff;
    font-style: italic;
    animation: fadein 0.5s ease;
}

.loader {
    position: absolute;
    width: 35px;
    height: 35px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    z-index: 2;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.one-col {
    grid-template-columns: 1fr;
}

button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-color: var(--primary-color);
}

.btn-text {
    background: rgba(168, 237, 234, 0.1);
    border-color: rgba(168, 237, 234, 0.2);
}

footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-sec);
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal {
    margin-top: 5px;
    line-height: 1.5;
}

.legal span {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.3);
    transition: color 0.2s;
}

.legal span:hover {
    color: #fff;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

.modal-box {
    border-radius: 16px;
    padding: 25px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    animation: fadein 0.3s ease;
}

.modal-box.large {
    max-width: 700px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    overflow: hidden;
}

.modal-header {
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header button {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    padding: 0;
    width: auto;
    color: #fff;
    box-shadow: none;
    transform: none;
}

.modal-content {
    padding: 25px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: #d1d5db;
    line-height: 1.7;
}

.modal-content h4 {
    color: #fff;
    margin: 15px 0 8px 0;
}

.close-modal {
    margin-top: 15px;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
}

.h-captcha {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}