:root {
    --spotify-black: #191414;
    --spotify-dark-gray: #212121;
    --spotify-green: #1DB954;
    --spotify-white: #FFFFFF;
    --neon-pink: #ff0055;
    --neon-blue: #2e77d0;
    --neon-purple: #b026ff;
    --neon-yellow: #f5c518;
    --warning-red: #b02424;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--spotify-black);
    color: var(--spotify-white);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Ambient Background */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: floatShape 20s infinite alternate ease-in-out;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--spotify-green);
    animation-delay: 0s;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--neon-purple);
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: var(--neon-blue);
    animation-delay: -10s;
}

@keyframes floatShape {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    50% { transform: translate(30px, 20px) rotate(10deg) scale(1.1); }
    100% { transform: translate(-20px, 40px) rotate(-10deg) scale(0.9); }
}

/* Header Bar */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3); /* More transparent */
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.twitter-link {
    color: var(--spotify-white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.ca-address {
    color: #b3b3b3;
    font-family: monospace;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Landing Page Structure */
.landing-container {
    min-height: 100vh;
    padding-top: 80px; /* Space for header */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1; /* Above background */
}

.landing-content {
    text-align: center;
    margin-bottom: 4rem;
    margin-top: 5vh; /* Centered more vertically */
    padding: 0 20px;
}

.title {
    font-size: 6rem; /* Increased size */
    font-weight: 900;
    line-height: 0.85;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -3px;
    text-transform: uppercase;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
}

/* Add a subtle gradient accent to specific words if we split them in HTML, 
   but for now keeping it clean white/silver which looks premium against the colorful bg */

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.wallet-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* More spacing */
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.wallet-input {
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    color: white;
    width: 100%;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.wallet-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.wallet-input:focus {
    outline: none;
    border-color: var(--spotify-green);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(29, 185, 84, 0.2);
}

.submit-btn {
    background-color: var(--spotify-green);
    color: #000; /* Better contrast */
    padding: 1.2rem 3.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 20px rgba(29, 185, 84, 0.3);
}

.submit-btn:hover {
    transform: scale(1.05) translateY(-2px);
    background-color: #1ed760; /* Slightly lighter */
    box-shadow: 0 10px 40px rgba(29, 185, 84, 0.5);
}

/* Recent Wraps Section */
.recent-wraps-section {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    box-sizing: border-box;
    margin-top: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--spotify-white);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.wrapped-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Slightly wider */
    gap: 1.5rem;
}

.wrapped-card-mini {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 1.5rem;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.wrapped-card-mini:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    background: rgba(40, 40, 40, 0.7);
    border-color: rgba(255,255,255,0.2);
}

/* Add some colorful accents to mini cards */
.wrapped-card-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--spotify-green), var(--neon-blue));
    opacity: 0.8;
}

.wallet-preview {
    font-family: monospace;
    color: #ccc;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 6px;
}

.card-stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--spotify-green);
    text-shadow: 0 2px 10px rgba(29, 185, 84, 0.2);
}

.negative-profit {
    color: #ff6b6b !important;
    text-shadow: 0 2px 10px rgba(255, 107, 107, 0.2);
}

/* Loading Animation */
.loading-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #212121, #000);
}

/* Wrapped Story View - Square Layout */
.story-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000; /* Or a subtle gradient */
    position: relative;
}

.square-frame {
    width: 100%;
    max-width: 504px; /* Reduced by 10% more (from 560px) */
    aspect-ratio: 1 / 1;
    position: relative;
    background: #111;
    border-radius: 18px; /* Reduced by 10% */
    overflow: hidden; /* Back to hidden to clip content properly */
    box-shadow: 0 14px 36px rgba(0,0,0,0.5);
}

/* Mobile Adjustment: on very small screens, might need to adjust */
@media (max-width: 500px) {
    .title {
        font-size: 3.5rem;
    }
    .square-frame {
        width: 100vw;
        height: 100vw; /* Force square on mobile width */
        max-height: 100vh;
        border-radius: 0;
    }
}

.story-progress {
    position: absolute;
    top: 10.8px; /* Reduced by 10% more */
    left: 0;
    width: 100%;
    display: flex;
    gap: 2.88px; /* Reduced by 10% more */
    padding: 0 10.8px; /* Reduced by 10% more */
    box-sizing: border-box;
    z-index: 100;
}

.progress-bar {
    flex: 1;
    height: 2.88px; /* Reduced by 10% more */
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    transition: background 0.3s;
}

.progress-bar.active {
    background: white;
}

.story-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.story-slide.active {
    display: block;
    opacity: 1;
}

.content {
    width: 100%;
    height: 100%;
    padding: 1.08rem 0.9rem; /* Reduced by 10% more */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Default to centered */
    align-items: center;
    text-align: center;
    overflow: hidden; /* Changed from overflow-y: auto to prevent scrollbars */
    /* Background color is set inline per slide */
}

/* Only align to top for specific complex lists, otherwise center */
.content.has-list {
    justify-content: flex-start;
    padding-top: 2.16rem; /* Reduced by 10% more */
}

/* Move single metrics down a bit */
.content.offset-down {
    justify-content: center;
    padding-top: 10.8%; /* Reduced by 10% more */
}

/* For standard slides with less content, make elements bigger */
.content.standard-card .big-emoji {
    font-size: 4.32rem !important; /* Reduced by 10% more */
    margin-bottom: 0.72rem; /* Reduced by 10% more */
}

.content.standard-card .slide-title {
    font-size: 1.8rem !important; /* Reduced by 10% more */
}

.content.standard-card .stat-number {
    font-size: 2.88rem !important; /* Reduced by 10% more */
}

.content.standard-card .sub-stat {
    font-size: 1.584rem !important; /* Reduced by 10% more */
}

/* Typography inside slides - Reduced by 10% more */
.content h1 { font-size: 2.52rem; font-weight: 900; margin: 0; line-height: 1; }
.content h2 { font-size: 1.44rem; font-weight: 900; margin-bottom: 0.72rem; }
.content p { font-size: 0.864rem; font-weight: 500; }

.slide-title {
    font-size: 1.44rem; /* Reduced by 10% more */
    margin-bottom: 0.36rem;
    line-height: 1.1;
}

.stat-number {
    font-size: 2.16rem; /* Reduced by 10% more */
    font-weight: 900;
    margin: 0.36rem 0;
    line-height: 1;
    word-break: break-word;
}

.sub-stat {
    font-size: 1.296rem; /* Reduced by 10% more */
    font-weight: 800;
    opacity: 0.9;
}

.breakdown {
    font-size: 0.864rem; /* Reduced by 10% more */
    margin-top: 0.72rem;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    white-space: pre-wrap;
}

.description {
    margin-top: auto; /* Push to bottom if needed, or just spacing */
    font-size: 0.72rem; /* Reduced by 10% more */
    opacity: 0.8;
    max-width: 90%;
    margin-bottom: 1.44rem; /* Reduced by 10% more */
}

.big-emoji {
    font-size: 3.24rem; /* Reduced by 10% more */
    margin-bottom: 0.36rem; /* Reduced margin */
    filter: drop-shadow(0 3.6px 7.2px rgba(0,0,0,0.2));
}

/* Intro Slide specific */
.intro-slide {
    background: radial-gradient(circle at center, var(--neon-purple), var(--spotify-black));
}

/* Summary Slide specific */
.summary-slide {
    background: #121212;
}

.summary-grid {
    width: 100%;
    display: grid;
    gap: 0.72rem; /* Reduced by 10% more */
    margin: 1.44rem 0; /* Reduced by 10% more */
}

.summary-item {
    background: rgba(255,255,255,0.1);
    padding: 0.72rem; /* Reduced by 10% more */
    border-radius: 9px; /* Reduced by 10% */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.792rem; /* Reduced by 10% more */
}

.nav-btn-text {
    display: inline-block;
    margin-top: 0.72rem; /* Reduced by 10% more */
    padding: 0.72rem 1.44rem; /* Reduced by 10% more */
    background: white;
    color: black;
    font-weight: 900;
    text-decoration: none;
    border-radius: 50px;
    text-transform: uppercase;
    font-size: 0.792rem; /* Reduced by 10% more */
}

/* Invisible Nav Areas */
.nav-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    z-index: 50;
    cursor: pointer;
}

.nav-area.prev { left: 0; }
.nav-area.next { right: 0; }

.error-message {
    color: var(--warning-red);
    background: rgba(176, 36, 36, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 1.3em;
    font-weight: 700;
    text-align: center;
}

.gate-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
    font-weight: 500;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Sorting Controls */
.sort-controls {
    display: flex;
    gap: 10px;
}

.sort-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sort-btn.active {
    background: #1ed760;
    border-color: #1ed760;
    color: #000;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .sort-controls {
        flex-direction: column;
        width: 100%;
    }
    .sort-btn {
        width: 100%;
    }
}
