@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Color Palette - Dark & Vibrant */
    --bg-main: #0f172a;
    /* Deep Slate */
    --bg-card: rgba(30, 41, 59, 0.7);
    /* Translucent Slate */
    --bg-grid: #1e293b;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    /* Cube Colors */
    --cube-red: #ef4444;
    --cube-blue: #3b82f6;
    --cube-green: #22c55e;
    --cube-orange: #f97316;
    --cube-yellow: #eab308;
    --cube-white: #ffffff;

    /* GFX */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--cube-orange);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(160px, auto);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.bento-card {
    padding: 1.5rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.bento-card.large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-card.tall {
    grid-row: span 2;
}

.bento-card.wide {
    grid-column: span 2;
}

/* Stats Styling */
.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

/* Glow Effects */
.glow-orange {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
}

.glow-blue {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.glow-green {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--cube-orange);
    color: white;
}

.btn-primary:hover {
    background: #ea580c;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 5rem;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Cube 3D Visualization */
.cube-visual {
    width: 280px;
    height: 280px;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
}

@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }

    /* Stack everything vertically on mobile/tablet */
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        /* Increased spacing as requested */
    }

    /* Force cards to take full width */
    .bento-card.large,
    .bento-card.wide,
    .bento-card.tall {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    /* Force full height on mobile to prevent internal scrolling */
    .rankings-container {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    .medals-list {
        max-height: none !important;
        overflow-y: visible !important;
        flex-grow: 0 !important;
        padding-right: 0;
    }

    .bento-card {
        display: flex;
        flex-direction: column;
        height: auto !important;
        padding: 1.5rem;
    }

    /* Medals styling fixes for mobile */
    .medal-entry {
        display: flex;
        align-items: center;
        padding: 0.75rem 0;
        /* Slightly more breathing room */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .medal-icon {
        font-size: 1.2rem;
        margin-right: 1rem;
        min-width: 30px;
        /* constant width for alignment */
    }

    .medal-info {
        display: flex;
        flex-direction: column;
    }

    .medal-event {
        font-weight: 600;
        color: white;
        font-size: 1rem;
    }

    .medal-comp {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }
}