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

body {
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* Animated stars background */
.stars, .twinkling {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.stars {
    background: #000 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"><circle cx="50" cy="50" r="1" fill="white"/><circle cx="150" cy="80" r="0.5" fill="white"/><circle cx="250" cy="120" r="1.5" fill="white"/><circle cx="350" cy="60" r="0.8" fill="white"/><circle cx="100" cy="200" r="1" fill="white"/><circle cx="300" cy="180" r="0.6" fill="white"/><circle cx="200" cy="300" r="1.2" fill="white"/><circle cx="80" cy="350" r="0.7" fill="white"/><circle cx="320" cy="320" r="1" fill="white"/><circle cx="180" cy="150" r="0.5" fill="white"/></svg>') repeat;
    z-index: -2;
}

.twinkling {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><circle cx="30" cy="30" r="1" fill="rgba(255,255,255,0.8)"/><circle cx="170" cy="50" r="0.8" fill="rgba(255,255,255,0.6)"/><circle cx="100" cy="150" r="1.2" fill="rgba(255,255,255,0.7)"/></svg>') repeat;
    z-index: -1;
    animation: twinkle 8s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Glitch effect for title */
.header {
    text-align: center;
    margin-bottom: 50px;
}

.glitch {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00;
    animation: glitch 725ms infinite;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00;
    }
    15% {
        text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00;
    }
    16% {
        text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff, -0.05em -0.05em 0 #fffc00;
    }
    49% {
        text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff, -0.05em -0.05em 0 #fffc00;
    }
    50% {
        text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff, 0 -0.04em 0 #fffc00;
    }
    99% {
        text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff, 0 -0.04em 0 #fffc00;
    }
    100% {
        text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff, -0.04em -0.025em 0 #fffc00;
    }
}

.subtitle {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    color: #00fffc;
    margin-top: 15px;
    animation: pulse 2s infinite;
}

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

/* Selector */
.selector-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 252, 0.3);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 255, 252, 0.1);
}

.selector-container label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #fc00ff;
}

#insultSelect {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-family: 'Orbitron', sans-serif;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00fffc;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

#insultSelect:hover, #insultSelect:focus {
    border-color: #fc00ff;
    box-shadow: 0 0 20px rgba(252, 0, 255, 0.5);
}

#insultSelect option {
    background: #1a0a2e;
    color: #fff;
}

.analyze-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 30px auto 0;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #fc00ff 0%, #00fffc 100%);
    border: none;
    border-radius: 50px;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.analyze-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(252, 0, 255, 0.6);
}

.analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Terminal */
.terminal {
    background: #0d0d0d;
    border-radius: 10px;
    overflow: hidden;
    font-family: 'Roboto Mono', monospace;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.2);
    margin-bottom: 30px;
}

.terminal-header {
    background: #333;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.terminal-header span:last-child {
    margin-left: 10px;
    font-size: 0.8rem;
    color: #888;
}

.terminal-body {
    padding: 20px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

.terminal-line {
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.terminal-line.success { color: #27ca40; }
.terminal-line.error { color: #ff5f56; }
.terminal-line.warning { color: #ffbd2e; }
.terminal-line.info { color: #00fffc; }
.terminal-line.loading { color: #fc00ff; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 252, 0.3);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transform: scale(0);
    animation: popIn 0.5s forwards;
}

@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fc00ff, #00fffc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 10px;
}

/* World Responses */
.world-responses {
    margin-bottom: 30px;
}

.world-responses h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #00fffc;
}

.responses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.response-card {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #fc00ff;
    padding: 15px;
    border-radius: 0 10px 10px 0;
    transform: translateX(-50px);
    opacity: 0;
    animation: slideIn 0.5s forwards;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.response-card .country {
    font-weight: 700;
    color: #fffc00;
    margin-bottom: 5px;
}

.response-card .message {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #ccc;
}

/* Final Result */
.final-result {
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    border: 2px solid #fc00ff;
    animation: resultAppear 1s ease-out;
}

@keyframes resultAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0);
    }
}

.result-title {
    font-size: 2rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fc00ff, #fffc00, #00fffc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 2s linear infinite;
}

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.result-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.result-box p {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #fff;
}

.restart-btn {
    padding: 15px 40px;
    font-size: 1rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    background: transparent;
    border: 2px solid #00fffc;
    border-radius: 50px;
    color: #00fffc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    background: #00fffc;
    color: #000;
    box-shadow: 0 0 30px rgba(0, 255, 252, 0.5);
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00fffc;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #fc00ff, #00fffc);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 600px) {
    .glitch {
        font-size: 1.3rem;
    }
    
    .selector-container {
        padding: 25px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
}
