:root {
    --primary-color: #9146FF;
    --secondary-color: #772CE8;
    --background-color: #0E0E10;
    --surface-color: #18181B;
    --text-primary: #FFFFFF;
    --text-secondary: #ADADB8;
    --error-color: #FF6B6B;
    --border-color: #2F2F35;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

.main-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(145, 70, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(119, 44, 232, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(92, 22, 197, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: auto;
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 
        0 10px 30px var(--shadow-color),
        0 0 0 1px rgba(145, 70, 255, 0.1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    animation: containerFadeIn 0.6s ease-out;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

h1::before {
    content: '🎮';
    position: absolute;
    left: -50px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(145, 70, 255, 0.3));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

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

.search-section {
    margin-bottom: 40px;
    position: relative;
}

.search-section::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

#searchForm {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

#usernameInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#usernameInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.2);
}

#searchButton {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#searchButton {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#searchButton::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

#searchButton:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 5px 15px rgba(145, 70, 255, 0.4),
        0 10px 30px rgba(145, 70, 255, 0.2);
}

#searchButton:hover::before {
    width: 300px;
    height: 300px;
}

#searchButton:active {
    transform: translateY(0);
}

#searchButton.loading {
    pointer-events: none;
    opacity: 0.8;
}

#searchButton.loading .button-text {
    opacity: 0;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-right-color: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

#searchButton.loading .loading-spinner {
    opacity: 1;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.info-section {
    margin-top: 40px;
    animation: infoFadeIn 0.8s ease-out 0.2s both;
    margin-bottom: 40px;
}

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

.info-box {
    background: rgba(145, 70, 255, 0.05);
    border: 1px solid rgba(145, 70, 255, 0.2);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(5px);
}

.info-box h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.info-box > p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(145, 70, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(145, 70, 255, 0.08);
    border-color: rgba(145, 70, 255, 0.3);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.how-to-use {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
}

.how-to-use h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.how-to-use ol {
    color: var(--text-secondary);
    padding-left: 25px;
    line-height: 1.8;
}

.how-to-use li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .info-section {
        margin-top: 30px;
    }
    
    .info-box {
        padding: 20px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .info-box h2 {
        font-size: 1.3rem;
    }
}

.error-message {
    max-width: 500px;
    margin: 0 auto 20px;
    padding: 15px 20px;
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

.badge-results {
    display: none;
}

.badge-results.show {
    display: block;
    animation: resultsFadeIn 0.6s ease;
}

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

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

.channel-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: 
        linear-gradient(135deg, rgba(145, 70, 255, 0.15) 0%, rgba(119, 44, 232, 0.15) 100%),
        radial-gradient(circle at top right, rgba(145, 70, 255, 0.1), transparent 70%);
    border-radius: 16px;
    border: 1px solid rgba(145, 70, 255, 0.3);
    position: relative;
    overflow: hidden;
    animation: headerGlow 0.6s ease-out;
}

@keyframes headerGlow {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.channel-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(145, 70, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
}

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

.channel-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.channel-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.badges-section {
    margin-bottom: 40px;
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    animation: slideIn 0.5s ease-out;
}

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

.tier-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    animation: expandWidth 0.8s ease-out;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100px;
    }
}

.tier-label {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tier-badge-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, var(--background-color), rgba(145, 70, 255, 0.1));
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tier-header:hover .tier-badge-count {
    transform: scale(1.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.badge-card {
    background: 
        linear-gradient(135deg, var(--background-color) 0%, rgba(145, 70, 255, 0.05) 100%),
        var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    position: relative;
    overflow: hidden;
    animation: badgeFadeIn 0.5s ease-out backwards;
}

.badge-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

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

.badges-grid .badge-card:nth-child(1) { animation-delay: 0.05s; }
.badges-grid .badge-card:nth-child(2) { animation-delay: 0.1s; }
.badges-grid .badge-card:nth-child(3) { animation-delay: 0.15s; }
.badges-grid .badge-card:nth-child(4) { animation-delay: 0.2s; }
.badges-grid .badge-card:nth-child(5) { animation-delay: 0.25s; }
.badges-grid .badge-card:nth-child(6) { animation-delay: 0.3s; }
.badges-grid .badge-card:nth-child(7) { animation-delay: 0.35s; }
.badges-grid .badge-card:nth-child(8) { animation-delay: 0.4s; }

.badge-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(145, 70, 255, 0.3),
        0 5px 15px var(--shadow-color);
    border-color: transparent;
}

.badge-card:hover::before {
    opacity: 1;
}

.badge-card:hover .badge-image img {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 5px 15px rgba(145, 70, 255, 0.5));
}

.badge-card:hover .badge-tier {
    transform: scale(1.1);
    opacity: 1;
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.badge-card:hover .badge-months {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.badge-tier {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.badge-image {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px var(--shadow-color));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.badge-months {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 8px;
}

.no-badges {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    animation: fadeIn 0.5s ease;
}

.no-badges-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

@media (max-width: 600px) {
    .main-wrapper {
        padding: 20px 15px;
    }
    
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    #searchForm {
        flex-direction: column;
    }
    
    #searchButton {
        width: 100%;
    }
    
    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background-color: rgba(14, 14, 16, 0.8);
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}