* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, #0f172a 0, #020617 55%, #000000 100%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e5e7eb;
}

.app {
    padding: 16px;
}

.card {
    width: 380px;
    max-width: 100%;
    background: linear-gradient(145deg, #020617, #020617 30%, #0b1120 100%);
    border-radius: 24px;
    padding: 18px 18px 20px;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.8),
        0 0 0 1px rgba(37, 99, 235, 0.25);
}

.card-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.lang-switch {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 1px rgba(55, 65, 81, 0.9);
}

.lang-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.lang-btn--active {
    background: radial-gradient(circle at top, #22d3ee 0, #2563eb 50%, #0f172a 100%);
    color: #f9fafb;
}

.avatar-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(94, 234, 212, 0.5);
    box-shadow:
        0 0 0 1px rgba(129, 140, 248, 0.4),
        0 20px 40px rgba(15, 23, 42, 0.7);
    margin-bottom: 14px;
    background: radial-gradient(circle at top, #22d3ee 0, #0f172a 60%, #020617 100%);
}

#avatar {
    display: block;
    width: 100%;
    height: auto;
}

/* Mask equalizer overlay */

.mask-eq {
    position: absolute;
    left: 50%;
    top: 78%;
    transform: translate(-50%, -50%);
    width: 32%;
    height: 18%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* glass panel under cat's head */
.mask-eq::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(
        circle at top center,
        rgba(15, 23, 42, 0.6),
        rgba(15, 23, 42, 0.94)
    );
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.9),
        0 0 26px rgba(56, 189, 248, 0.55);
}

.mask-eq--active {
    opacity: 1;
}

.mask-eq--active {
    opacity: 1;
}

.mask-eq .bar {
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(to top, #22c55e, #eab308, #f97316, #dc2626);
    box-shadow:
        0 0 4px rgba(22, 163, 74, 0.9),
        0 0 8px rgba(249, 115, 22, 0.9),
        0 0 10px rgba(248, 113, 113, 0.9);
    height: 100%;
    transform-origin: bottom;
    transform: scaleY(0.3);
    animation: eqPulse 0.6s ease-in-out infinite;
    animation-play-state: paused;
}

.mask-eq--active .bar {
    animation-play-state: running;
}

.mask-eq .bar-1 { animation-duration: 0.42s; }
.mask-eq .bar-2 { animation-duration: 0.55s; }
.mask-eq .bar-3 { animation-duration: 0.63s; }
.mask-eq .bar-4 { animation-duration: 0.48s; }

@keyframes eqPulse {
    0%, 100% {
        transform: scaleY(0.3);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.bubble {
    background: rgba(15, 23, 42, 0.96);
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(94, 234, 212, 0.4);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.9);
}

.bubble p {
    margin: 0;
}

.topic-panel {
    margin-bottom: 12px;
}

.topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.topic-btn {
    border: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.6);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
        box-shadow 0.2s ease;
}

.topic-btn:hover {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
}

.topic-btn--active {
    background: radial-gradient(circle at top, #22c55e 0, #16a34a 25%, #14532d 100%);
    border-color: rgba(34, 197, 94, 0.9);
    color: #ecfdf5;
}

.translation {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
    min-height: 18px;
}

.input-area {
    margin-top: 4px;
    margin-bottom: 10px;
}

#userInput {
    width: 100%;
    min-height: 70px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    padding: 8px 9px;
    font-size: 13px;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

#userInput:focus {
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.9),
        0 10px 22px rgba(37, 99, 235, 0.6);
}

.buttons {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

button {
    font-family: inherit;
}

#randomButton,
#talkButton {
    flex: 1;
    padding: 9px 10px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.08s ease;
}

#randomButton {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #eef2ff;
    box-shadow:
        0 10px 20px rgba(37, 99, 235, 0.6),
        0 0 0 1px rgba(129, 140, 248, 0.7);
}

#randomButton:hover {
    box-shadow:
        0 14px 26px rgba(37, 99, 235, 0.8),
        0 0 0 1px rgba(191, 219, 254, 0.9);
}

#talkButton {
    background: linear-gradient(135deg, #0f172a, #020617);
    color: #e5e7eb;
    box-shadow:
        0 10px 20px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(55, 65, 81, 0.9);
}

#talkButton:hover {
    box-shadow:
        0 14px 26px rgba(15, 23, 42, 1),
        0 0 0 1px rgba(148, 163, 184, 1);
}

#randomButton:active,
#talkButton:active {
    transform: translateY(1px);
    box-shadow: none;
}

.status {
    margin-top: 6px;
    font-size: 11px;
    color: #9ca3af;
    min-height: 14px;
}


.back-main-button {
    margin-top: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 999px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #020617, #020617 40%, #0b1120 100%);
    color: #e5e7eb;
    box-shadow:
        0 10px 20px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(55, 65, 81, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.08s ease;
}

.back-main-button:hover {
    box-shadow:
        0 14px 26px rgba(15, 23, 42, 1),
        0 0 0 1px rgba(148, 163, 184, 1);
}

.back-main-button:active {
    transform: translateY(1px);
    box-shadow: none;
}
