@font-face {
    font-family: 'Mojangles';
    src: url('mojangles.ttf') format('truetype');
}

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

body {
    font-family: 'Mojangles', Arial, sans-serif;
    background: #1a1a1a url('mcbedwarsback.png') center/cover fixed;
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: -1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.container.with-results {
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    padding-top: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.centered header {
    margin-bottom: 4rem;
}

.container.with-results header {
    margin-bottom: 2rem;
}

header h1 {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.with-results header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.3rem;
    color: #e2e8f0;
    font-weight: 400;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.with-results header p {
    font-size: 1.1rem;
}

.search-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.centered .search-section {
    margin-bottom: 0;
    transform: scale(1.1);
}

.container.with-results .search-section {
    margin-bottom: 2rem;
    transform: scale(1);
}

#usernameInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    outline: none;
    font-weight: 500;
}

#usernameInput:focus {
    border-color: rgba(255,255,255,0.8);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

#usernameInput::placeholder {
    color: #718096;
}

#searchBtn {
    padding: 1rem 2.5rem;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 8px 15px rgba(66, 153, 225, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#searchBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(66, 153, 225, 0.4);
    background: #3182ce;
}

#searchBtn:active {
    transform: translateY(-1px);
}

.loading {
    text-align: center;
    color: white;
    margin: 3rem 0;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    margin: 1.5rem 0;
    border: 2px solid #fc8181;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(197, 48, 48, 0.15);
}

.player-data {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(25px);
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    margin-top: 2rem;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: center;
}

.skin-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    min-height: 200px;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skin-placeholder {
    text-align: center;
    color: #718096;
    font-weight: 500;
}

.skin-placeholder p {
    font-size: 1rem;
    margin: 0;
}

.player-info h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: #1a202c;
    letter-spacing: -0.02em;
}

.player-info p {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.player-info span {
    font-weight: 700;
    color: #2d3748;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
}

.stats-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(248, 250, 252, 0.95);
    padding: 1.5rem;
    border-radius: 20px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.stat-btn {
    padding: 1rem 2rem;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s ease;
    background: white;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.stat-btn:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    background: #f7fafc;
}

.stat-btn.active {
    background: #4299e1;
    color: white;
    border-color: #3182ce;
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.3);
    transform: translateY(-2px);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.98);
    padding: 2rem;
    border-radius: 20px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.stat-card.excellent::before {
    background: #48bb78;
}

.stat-card.good::before {
    background: #4299e1;
}

.stat-card.neutral::before {
    background: #ed8936;
}

.stat-card.poor::before {
    background: #f56565;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: #cbd5e0;
}

.stat-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #1a202c;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-card .label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
    text-transform: lowercase;
}

.ratio-breakdown {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.ratio-item {
    text-align: center;
    flex: 1;
}

.ratio-item .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.ratio-item div:last-child {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .search-section {
        flex-direction: column;
        max-width: 100%;
        gap: 0.75rem;
    }
    
    #usernameInput {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    #searchBtn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .player-header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .skin-container {
        margin: 0 auto;
        max-width: 300px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .player-info h2 {
        font-size: 2.5rem;
    }
    
    .player-data {
        padding: 2rem;
        border-radius: 20px;
        margin: 0 0.5rem;
    }
    
    .stats-buttons {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
        padding: 1.25rem;
    }
    
    .stat-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .player-info h2 {
        font-size: 2rem;
    }
    
    .player-data {
        padding: 1.5rem;
        margin: 0 0.25rem;
    }
    
    .stats-buttons {
        gap: 0.5rem;
        padding: 1rem;
        grid-template-columns: repeat(2, 1fr);
        display: grid;
    }
    
    .stat-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.7rem;
        min-width: unset;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-card .value {
        font-size: 2rem;
    }
    
    .ratio-breakdown {
        gap: 1rem;
        flex-direction: column;
    }
    
    .ratio-item {
        text-align: left;
    }
    
    .player-info p {
        font-size: 1.1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .skin-container {
        max-width: 250px;
        padding: 1.5rem;
    }
}
