:root {
    --bg-primary: #0d0d0f;
    --bg-secondary: #1a1a1f;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --border: #2a2a35;
    --glow: rgba(99, 102, 241, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --repeat: #8b5cf6;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 0.5rem 0;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-5%, 5%) rotate(5deg); }
}

.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s ease-in-out infinite;
    z-index: 0;
}

.particle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { top: 40%; right: 30%; animation-delay: 3s; }
.particle:nth-child(3) { bottom: 30%; left: 40%; animation-delay: 6s; }
.particle:nth-child(4) { top: 60%; right: 20%; animation-delay: 9s; }
.particle:nth-child(5) { bottom: 20%; right: 40%; animation-delay: 12s; }

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
    50% { transform: translateY(-50px) translateX(30px); opacity: 0.6; }
}

.container {
    max-width: 560px;
    width: 90%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem;
    position: relative;
    z-index: 1;
    animation: fadeIn 1s ease-out;
}

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

/* ── Profile ── */
.profile {
    text-align: center;
    padding: 1rem 0 1.2rem;
    animation: slideDown 0.8s ease-out 0.2s both;
    flex-shrink: 0;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 0.7rem;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 0 10px 40px var(--glow);
    position: relative;
    overflow: hidden;
    animation: pulse 3s ease-in-out infinite;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 40px var(--glow); }
    50% { transform: scale(1.05); box-shadow: 0 15px 60px var(--glow); }
}

.avatar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.profile h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

/* ── Social Links ── */
.social-links {
    display: flex;
    gap: 0.7rem;
    justify-content: center;
    margin-bottom: 1.4rem;
    flex-shrink: 0;
}

.social-icon {
    width: 42px;
    height: 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
    opacity: 0.2;
}

.social-icon:hover::before { width: 100%; height: 100%; }
.social-icon:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--glow);
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.social-icon:hover svg {
    fill: var(--accent);
    transform: scale(1.1);
}

/* ── YouTube Section ── */
.youtube-section {
    margin-bottom: 1.2rem;
    animation: fadeInUp 0.8s ease-out 0.3s both;
    flex-shrink: 0;
}

.youtube-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.youtube-label svg {
    width: 14px;
    height: 14px;
    fill: #ff4444;
    flex-shrink: 0;
}

.youtube-wrapper {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    transition: border-color 0.3s, box-shadow 0.3s;
    /* 16:9 aspect ratio */
    aspect-ratio: 16 / 9;
}

.youtube-wrapper:hover {
    border-color: #ff4444;
    box-shadow: 0 12px 40px rgba(255,68,68,0.2);
}

.youtube-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Key Form — COMPACT ── */
.key-form-section {
    /* flex-shrink: 0; */
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

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

.key-form-container {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.key-form-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--repeat));
}

.form-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.key-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.25s;
    outline: none;
}

.key-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.45;
}

.key-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
    background: rgba(255,255,255,0.05);
}

.submit-button {
    padding: 0.6rem 1.1rem;
    background: linear-gradient(135deg, var(--accent), var(--repeat));
    border: none;
    border-radius: 9px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    box-shadow: 0 3px 12px var(--glow);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.4s;
}

.submit-button:hover::before { left: 100%; }
.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow);
}
.submit-button:active { transform: translateY(0); }

.button-icon { font-size: 1rem; }

.result-message {
    margin-top: 0.7rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.result-message.hidden { display: none; }

.result-message.success {
    background: rgba(16,185,129,0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.result-message.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Ripple ── */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to { transform: scale(4); opacity: 0; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .container { padding: 1rem; }
    .profile h1 { font-size: 1.35rem; }
    .avatar { width: 62px; height: 62px; font-size: 1.5rem; }
    .form-group { flex-direction: column; }
    .submit-button { width: 100%; justify-content: center; }
    .key-input { width: 100%; }
}