/* ===== COSMIC CAT STYLESHEET ===== */
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Fredoka+One&family=Comic+Neue:wght@400;700&display=swap');

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

:root {
    --hot-pink: #ff2d95;
    --electric-blue: #00d4ff;
    --acid-green: #39ff14;
    --purple-rain: #b026ff;
    --yolk-yellow: #ffe600;
    --bg-dark: #0a0a1a;
    --card-bg: #1a1a3e;
    --love-color: #ff4d6d;
    --meh-color: #ffa94d;
    --hate-color: #845ef7;
}

body {
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    background: var(--bg-dark);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.sparkle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(2px 2px at 20% 30%, var(--hot-pink), transparent),
        radial-gradient(2px 2px at 40% 70%, var(--electric-blue), transparent),
        radial-gradient(2px 2px at 60% 20%, var(--acid-green), transparent),
        radial-gradient(2px 2px at 80% 60%, var(--purple-rain), transparent),
        radial-gradient(2px 2px at 10% 80%, var(--yolk-yellow), transparent),
        radial-gradient(2px 2px at 50% 50%, var(--hot-pink), transparent),
        radial-gradient(2px 2px at 70% 90%, var(--electric-blue), transparent),
        radial-gradient(2px 2px at 30% 10%, var(--acid-green), transparent),
        radial-gradient(2px 2px at 90% 40%, var(--purple-rain), transparent),
        radial-gradient(1px 1px at 15% 55%, #fff, transparent),
        radial-gradient(1px 1px at 45% 85%, #fff, transparent),
        radial-gradient(1px 1px at 75% 15%, #fff, transparent),
        radial-gradient(1px 1px at 95% 75%, #fff, transparent),
        radial-gradient(1px 1px at 5% 95%, #fff, transparent);
    animation: sparkle 4s ease-in-out infinite alternate;
}

@keyframes sparkle {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

/* ===== HEADER ===== */
header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(176, 38, 255, 0.3), rgba(255, 45, 149, 0.3), rgba(0, 212, 255, 0.3));
    border-bottom: 4px solid var(--hot-pink);
}

h1 {
    font-family: 'Bangers', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: 0.1em;
    background: linear-gradient(90deg, var(--hot-pink), var(--yolk-yellow), var(--acid-green), var(--electric-blue), var(--purple-rain));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-text 3s ease-in-out infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(255, 45, 149, 0.5));
}

@keyframes rainbow-text {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.tagline {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--yolk-yellow);
    margin-top: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.5);
}

.sub-tagline {
    font-size: 0.95rem;
    color: #aaa;
    margin-top: 0.3rem;
    font-style: italic;
}

/* ===== NAV ===== */
nav {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
    background: rgba(10, 10, 26, 0.8);
    border-bottom: 2px solid var(--purple-rain);
}

.nav-btn {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
    border: 2px solid var(--electric-blue);
    background: transparent;
    color: var(--electric-blue);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--electric-blue);
    color: var(--bg-dark);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.nav-btn.active {
    background: var(--hot-pink);
    border-color: var(--hot-pink);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 45, 149, 0.5);
}

/* ===== VIEWS ===== */
.view {
    display: none;
    position: relative;
    z-index: 1;
    padding: 2rem 1rem;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CAT CARD ===== */
.cat-arena {
    text-align: center;
}

.cat-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid var(--purple-rain);
    box-shadow: 0 0 30px rgba(176, 38, 255, 0.3);
    max-width: 500px;
    margin: 0 auto 2rem;
    position: relative;
}

.cat-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.cat-card:hover img {
    transform: scale(1.02);
}

.cat-name {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    padding: 0.8rem;
    color: var(--yolk-yellow);
    background: rgba(0, 0, 0, 0.5);
    letter-spacing: 0.05em;
}

/* ===== LOADING ===== */
.loading {
    padding: 4rem 2rem;
    text-align: center;
}

.spinner {
    font-size: 4rem;
    animation: spin 1s linear infinite;
    display: inline-block;
    color: var(--electric-blue);
}

.spinner .mdi {
    font-size: 4rem;
}

@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.2); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(0.8); }
    100% { transform: rotate(360deg) scale(1); }
}

.loading p {
    margin-top: 1rem;
    color: var(--electric-blue);
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== RATING ZONE ===== */
.rating-zone h2 {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem;
    color: var(--acid-green);
    margin-bottom: 0.3rem;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.instruction {
    color: #bbb;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* ===== SLIDER ===== */
.slider-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid var(--acid-green);
}

#cattiness-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #666, var(--acid-green));
    outline: none;
    cursor: pointer;
}

#cattiness-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--yolk-yellow);
    cursor: pointer;
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.6);
}

#cattiness-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--yolk-yellow);
    cursor: pointer;
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.6);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #888;
}

.cattiness-display {
    margin-top: 1rem;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    color: var(--yolk-yellow);
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.3);
}

/* ===== VIBE BUTTONS ===== */
.vibe-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.vibe-btn {
    font-family: 'Fredoka One', cursive;
    border: 3px solid;
    border-radius: 20px;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    background: var(--card-bg);
    transition: all 0.3s ease;
    min-width: 150px;
    text-align: center;
}

.vibe-btn .vibe-emoji {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.3rem;
}

.vibe-btn .vibe-emoji .mdi {
    font-size: 2.5rem;
}

.vibe-btn .vibe-text {
    display: block;
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.vibe-btn .vibe-sub {
    display: block;
    font-size: 0.75rem;
    font-family: 'Comic Neue', cursive;
    opacity: 0.7;
}

.vibe-btn.love {
    border-color: var(--love-color);
    color: var(--love-color);
}
.vibe-btn.love:hover {
    background: var(--love-color);
    color: #fff;
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 0 30px rgba(255, 77, 109, 0.5);
}

.vibe-btn.meh {
    border-color: var(--meh-color);
    color: var(--meh-color);
}
.vibe-btn.meh:hover {
    background: var(--meh-color);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 169, 77, 0.5);
}

.vibe-btn.hate {
    border-color: var(--hate-color);
    color: var(--hate-color);
}
.vibe-btn.hate:hover {
    background: var(--hate-color);
    color: #fff;
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 0 30px rgba(132, 94, 247, 0.5);
}

/* ===== RESULTS ===== */
.results-container, .donated-container {
    text-align: center;
}

.results-container h2, .donated-container h2 {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: var(--electric-blue);
    margin-bottom: 0.3rem;
}

.results-subtitle, .donated-subtitle {
    color: #999;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stat {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    min-width: 100px;
    border: 2px solid #333;
    transition: transform 0.3s;
}

.stat:hover {
    transform: scale(1.05);
}

.love-stat { border-color: var(--love-color); }
.meh-stat { border-color: var(--meh-color); }
.hate-stat { border-color: var(--hate-color); }
.donated-stat { border-color: var(--acid-green); }

.stat-emoji {
    display: block;
    font-size: 2rem;
}

.stat-emoji .mdi {
    font-size: 2rem;
}

.stat-num {
    display: block;
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: var(--yolk-yellow);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 0.1em;
}

.avg-cattiness {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid var(--acid-green);
}

.avg-cattiness h3 {
    font-family: 'Fredoka One', cursive;
    color: var(--acid-green);
    font-size: 1.3rem;
}

.avg-cattiness p {
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* ===== RESULTS GRID ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.result-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #333;
    transition: transform 0.3s, box-shadow 0.3s;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.result-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.result-info {
    padding: 0.8rem;
}

.result-name {
    font-family: 'Fredoka One', cursive;
    font-size: 0.9rem;
    color: var(--yolk-yellow);
    margin-bottom: 0.3rem;
}

.result-cattiness {
    font-size: 0.8rem;
    color: var(--acid-green);
}

.result-vibe {
    font-size: 1.5rem;
    margin-top: 0.3rem;
}

.result-card.love-card { border-color: var(--love-color); }
.result-card.meh-card { border-color: var(--meh-color); }
.result-card.hate-card { border-color: var(--hate-color); }

.result-donated-badge {
    background: var(--acid-green);
    color: var(--bg-dark);
    font-family: 'Fredoka One', cursive;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    display: inline-block;
    margin-top: 0.3rem;
}

.empty-state {
    grid-column: 1 / -1;
    color: #666;
    font-size: 1.1rem;
    padding: 2rem;
}

/* ===== DONATION BANNER ===== */
.donation-banner {
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.15), rgba(176, 38, 255, 0.15));
    border: 2px dashed var(--acid-green);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.banner-emoji {
    font-size: 2rem;
}

.banner-emoji .mdi {
    font-size: 2rem;
    margin: 0 0.15rem;
}

.donation-banner p {
    color: var(--acid-green);
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    max-width: 400px;
}

/* ===== POPUP ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: var(--card-bg);
    border: 3px solid var(--hate-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes popIn {
    from { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.popup-content h2 {
    font-family: 'Bangers', cursive;
    color: var(--hot-pink);
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-1deg); }
    75% { transform: translateX(5px) rotate(1deg); }
}

.popup-cat img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--hate-color);
    margin-bottom: 1rem;
}

.popup-text {
    font-family: 'Fredoka One', cursive;
    color: var(--yolk-yellow);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.popup-subtext {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.popup-receipt {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed #555;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.popup-receipt h3 {
    text-align: center;
    color: var(--electric-blue);
    font-family: 'Fredoka One', cursive;
    margin-bottom: 0.5rem;
}

.popup-receipt p {
    color: #ccc;
    font-size: 0.85rem;
    margin: 0.3rem 0;
}

.popup-close {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--hot-pink), var(--purple-rain));
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.popup-close:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 45, 149, 0.5);
}

/* ===== FOOTER ===== */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 2px solid #333;
    background: rgba(10, 10, 26, 0.9);
}

footer p {
    color: #666;
    font-size: 0.85rem;
    margin: 0.3rem 0;
}

footer a {
    color: var(--electric-blue);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--hot-pink);
    text-decoration: underline;
}

.footer-disclaimer {
    font-size: 0.7rem !important;
    color: #444 !important;
    margin-top: 0.8rem !important;
    font-style: italic;
}

/* ===== CONFETTI ===== */
.confetti {
    position: fixed;
    top: -10px;
    z-index: 999;
    pointer-events: none;
    font-size: 1.5rem;
    animation: confettiFall linear forwards;
}

.confetti .mdi {
    font-size: 1.5rem;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== MDI ICON HELPERS ===== */
h1 .mdi { font-size: inherit; }
h2 .mdi { font-size: inherit; }
h3 .mdi { font-size: inherit; }
.nav-btn .mdi { vertical-align: middle; margin-right: 0.2rem; }
.result-vibe .mdi { font-size: 1.5rem; vertical-align: middle; }
.result-donated-badge .mdi { vertical-align: middle; }
.popup-close .mdi { vertical-align: middle; }
.footer-disclaimer .mdi { vertical-align: middle; }
.empty-state .mdi { vertical-align: middle; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .vibe-buttons {
        flex-direction: column;
        align-items: center;
    }

    .vibe-btn {
        width: 80%;
    }

    .cat-card img {
        height: 280px;
    }

    .stats-bar {
        gap: 0.8rem;
    }

    .stat {
        min-width: 80px;
        padding: 0.8rem 1rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
