* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 1.25rem;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9375rem;
    margin-bottom: 0.625rem;
}

.logo i {
    font-size: 2.5rem;
    color: #4CAF50;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0.125rem 0.125rem 0.25rem rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Worlds Section */
.worlds-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1.25rem;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 0.3125rem 1.25rem rgba(0,0,0,0.1);
}

.worlds-section h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.875rem;
    text-align: center;
}

.worlds-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.875rem;
}

.world-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.world-card:hover {
    background: #e9ecef;
    border-color: #4CAF50;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(76, 175, 80, 0.2);
}

.world-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25rem;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.world-card:hover::before {
    opacity: 1;
}

.world-info h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.world-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.world-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #4CAF50;
    font-weight: 500;
}

.world-actions i {
    font-size: 1.2rem;
}

.worlds-actions {
    text-align: center;
}

.no-worlds {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-worlds i {
    font-size: 4rem;
    color: #4CAF50;
    margin-bottom: 1rem;
}

.no-worlds h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

/* Upload Section */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
}

.upload-area {
    background: rgba(255, 255, 255, 0.95);
    border: 0.1875rem dashed #4CAF50;
    border-radius: 1.25rem;
    padding: 3.75rem 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #45a049;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.1);
}

.upload-area.dragover {
    background: rgba(76, 175, 80, 0.1);
    border-color: #45a049;
}

.upload-icon i {
    font-size: 4rem;
    color: #4CAF50;
    margin-bottom: 1.25rem;
}

.upload-area h2 {
    font-size: 2rem;
    margin-bottom: 0.625rem;
    color: #333;
}

.upload-area p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.875rem;
}

#file-input, #stats-input {
    display: none;
}

.upload-buttons {
    display: flex;
    gap: 0.9375rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.9375rem 1.875rem;
    border: none;
    border-radius: 0.625rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.3125rem 0.9375rem rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #1976D2, #1565C0);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.3125rem 0.9375rem rgba(33, 150, 243, 0.4);
}

.btn-outline {
    background: transparent;
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.btn-outline:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.3125rem 0.9375rem rgba(76, 175, 80, 0.4);
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
    gap: 1.25rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.9375rem;
    padding: 1.875rem;
    box-shadow: 0 0.3125rem 1.25rem rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-0.3125rem);
}

.info-card i {
    font-size: 2rem;
    color: #4CAF50;
    margin-bottom: 0.9375rem;
}

.info-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.9375rem;
    color: #333;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.info-card li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #4CAF50;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 5rem 1.25rem;
    color: white;
}

.loading-spinner {
    margin-bottom: 1.875rem;
}

.spinner {
    width: 3.75rem;
    height: 3.75rem;
    border: 0.25rem solid rgba(255,255,255,0.3);
    border-top: 0.25rem solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-section h2 {
    font-size: 2rem;
    margin-bottom: 0.625rem;
}

/* Results Section */
.results-section {
    color: white;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.875rem;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.results-header h2 {
    font-size: 2.5rem;
    color: white;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.9375rem;
    padding: 1.5625rem;
    text-align: center;
    box-shadow: 0 0.3125rem 1.25rem rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25rem;
    background: linear-gradient(45deg, #4CAF50, #45a049);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 0.9375rem;
    color: #4CAF50;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.3125rem;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* Detailed Stats */
.detailed-stats {
    display: grid;
    gap: 1.875rem;
}

.stats-category {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.9375rem;
    overflow: hidden;
    box-shadow: 0 0.3125rem 1.25rem rgba(0,0,0,0.1);
}

.category-header {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 1.25rem 1.5625rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.category-content {
    padding: 1.5625rem;
}

.stats-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
    gap: 0.9375rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.9375rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    transition: background 0.3s ease;
}

.stat-item:hover {
    background: #e9ecef;
}

.stat-name {
    font-weight: 500;
    color: #333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-amount {
    font-weight: 600;
    color: #4CAF50;
}

/* Top Players */
.player-list {
    display: grid;
    gap: 15px;
}

.player-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.player-card:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.player-rank {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #4CAF50;
}

.player-skin {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.player-stats {
    color: #666;
    font-size: 0.9rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .worlds-section {
        padding: 1.5rem;
    }
    
    .worlds-list {
        grid-template-columns: 1fr;
    }
    
    .world-card {
        padding: 1.25rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .results-header {
        flex-direction: column;
        text-align: center;
    }
    
    .results-header h2 {
        font-size: 2rem;
    }
    
    .results-actions {
        justify-content: center;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-list {
        grid-template-columns: 1fr;
    }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Achievement Badges */
.achievement {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.achievement i {
    font-size: 1rem;
}

.achievements-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

/* Subcategory Styles */
.subcategory {
    margin-bottom: 25px;
}

.subcategory-header {
    color: #4CAF50;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e9ecef;
}

.item-count {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    font-weight: normal;
}

/* Enhanced Achievement Tooltips */
.achievement {
    position: relative;
    cursor: help;
}

.achievement:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.achievement:hover::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
    z-index: 1000;
}

/* Expandable Stats */
.expandable-stat {
    flex-direction: column !important;
    align-items: stretch !important;
    min-width: 0;
    width: 100%;
}

.stat-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.9375rem;
    transition: all 0.3s ease;
    min-width: 0;
}

.stat-main:hover {
    background: #dee2e6;
}

.stat-value-container {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.expand-icon {
    font-size: 0.8rem;
    color: #4CAF50;
    transition: transform 0.3s ease;
}

.expandable-stat.expanded .expand-icon {
    transform: rotate(180deg);
}

.player-breakdown {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 10px 15px;
    animation: slideDown 0.3s ease;
}

.player-breakdown.hidden {
    display: none;
}

.breakdown-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.player-breakdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
}

.player-breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-rank {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.breakdown-avatar {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.breakdown-name {
    font-weight: 500;
    color: #333;
    flex: 1;
    font-size: 0.9rem;
}

.breakdown-value {
    font-weight: 600;
    color: #4CAF50;
    font-size: 0.9rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* Item Icons Styles */
.item-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.item-icon-large {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.item-icon-small {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.stat-icon .item-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.breakdown-icon {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    flex-shrink: 0;
}

.stat-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.stat-name {
    display: flex;
    align-items: center;
    flex: 1;
    margin-right: 16px;
}

/* For Font Awesome icons (custom stats) */
.fa-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon .fa-icon {
    width: 40px;
    height: 40px;
    font-size: 24px;
    margin-bottom: 8px;
} 