:root {
    /* Light Mode Tokens */
    --bg-main: #fffcf5; /* Warm Cream */
    --bg-card: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #4a4a4a;
    --primary-mint: #2ecc71; /* Vibrant Mint */
    --accent-coral: #ff6b6b; /* Watermelon/Coral */
    --accent-red: #ff3b30;
    --border-main: #1a1a1a;
    --border-width: 4px; /* Updated to 4px */
    --radius-bubbly: 25px; /* Updated to 25px */
    --radius-tight: 20px;
    --shadow-pop: 8px 8px 0px #1a1a1a;
    --shadow-pop-hover: 12px 12px 0px #1a1a1a;
    --shadow-pop-small: 4px 4px 0px #1a1a1a;
}

[data-theme='dark'] {
    /* Dark Mode Tokens */
    --bg-main: #1c1c1e; /* Deep Charcoal */
    --bg-card: #2c2c2e;
    --text-main: #f2f2f7;
    --text-muted: #aeaeb2;
    --primary-mint: #4cd964;
    --accent-coral: #ff6b6b;
    --accent-red: #ff453a;
    --border-main: #000000;
}

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

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    padding: 8px 0;
    background: var(--bg-card);
    border-bottom: var(--border-width) solid var(--border-main);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 55px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo:hover img {
    transform: rotate(-5deg) scale(1.1);
}

/* Unified Hamburger Menu */
.hamburger-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 20px;
    right: 20px;
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    box-shadow: var(--shadow-pop);
    padding: 20px;
    z-index: 999;
    transform-origin: top center;
}

.hamburger-dropdown.open {
    display: block;
    animation: liquidExpand 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes liquidExpand {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
        border-radius: 50%;
    }
    50% {
        transform: scale(1.02) translateY(5px);
        border-radius: 15px;
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        border-radius: var(--radius-bubbly);
    }
}

.hamburger-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hamburger-nav ul li a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: var(--radius-tight);
    transition: all 0.3s ease;
    border: 2px dashed transparent;
}

.hamburger-nav ul li a:hover {
    background: rgba(46, 204, 113, 0.1);
    color: var(--primary-mint);
    border-color: var(--primary-mint);
    transform: translateX(10px);
}

/* LIVE CTA Styles */
.live-cta {
    font-weight: 900 !important;
    color: #ff3b30 !important;
    border: 2px solid #ff3b30 !important;
    border-radius: 12px !important;
    padding: 10px 20px !important;
    background: rgba(255, 59, 48, 0.1);
    display: inline-flex !important;
    align-items: center;
}

.live-cta:hover {
    background: #ff3b30 !important;
    color: #ffffff !important;
    border-color: #ff3b30 !important;
    transform: scale(1.05) !important;
}

.pulsing-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #ff3b30;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 0 rgba(255, 59, 48, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Compact Wallet Header */
.compact-wallet {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 3px solid var(--border-main);
    border-radius: 20px;
    padding: 2px 8px;
    font-weight: 800;
    font-size: 0.85rem;
    gap: 6px;
    margin-right: 5px;
    white-space: nowrap;
}

.compact-plus {
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 480px) {
    .wallet-label { display: none; }
}

/* Icons & Buttons */
.btn-icon-cartoon {
    background: var(--bg-main);
    border: 3px solid var(--border-main);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: var(--shadow-pop-small);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.btn-icon-cartoon:active {
    box-shadow: none;
    transform: translate(3px, 3px);
}

/* Profile Menu */
.profile-menu {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 60px;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: var(--shadow-pop);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-tight);
    z-index: 1001;
    overflow: hidden;
    transform-origin: top right;
    animation: dropIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.dropdown-content.show {
    display: block;
}

@keyframes dropIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-weight: 800;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.dropdown-content a i {
    width: 25px;
}

.dropdown-content a:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary-mint);
}

.dropdown-content hr {
    border: 0;
    border-top: var(--border-width) solid var(--border-main);
    margin: 0;
}

.dropdown-content a.danger-link {
    color: var(--accent-coral);
}
.dropdown-content a.danger-link:hover {
    background-color: rgba(255, 107, 107, 0.1);
}


/* Hero Section Redesigned (Full width TV tank) */
.hero {
    padding: 50px 0;
}

.hero-aquarium-frame {
    /* Style the Hero itself to look like an aquarium frame containing its layered bg */
    background: linear-gradient(180deg, var(--bg-main) 0%, rgba(46, 204, 113, 0.1) 100%);
}

.tv-frame {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    border-radius: var(--radius-bubbly);
    border: 8px solid var(--border-main); /* Thicker TV/Tank border */
    overflow: hidden;
    box-shadow: var(--shadow-pop), inset 0px 0px 40px rgba(0,0,0,0.5); /* Inner shadow for depth */
    margin-bottom: 30px;
}

.tv-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Hero Bottom Area */
.hero-bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 30px;
    margin-top: 30px;
    position: relative; /* Above background animations */
    z-index: 10;
}

/* Premium IoT Arcade Dashboard */
.arcade-dashboard {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    padding: 25px;
    box-shadow: var(--shadow-pop);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.iot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.btn-iot {
    position: relative;
    flex: 1 1 90px;
    padding: 15px 5px;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    border-radius: 20px;
    color: var(--text-main);
}

.btn-iot:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-pop);
}

.btn-iot:active {
    transform: translateY(2px);
    box-shadow: none;
}

.iot-icon {
    font-size: 2.2rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.btn-text {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.price-tag {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary-mint);
    color: var(--border-main);
    border: 3px solid var(--border-main);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 900;
    transform: rotate(15deg);
    box-shadow: 3px 3px 0px var(--border-main);
    z-index: 2;
}

.iot-food .price-tag { background: var(--accent-coral); color: white; }
.iot-light .price-tag { background: #f1c40f; }

/* Vibrant Button Backgrounds */
.iot-screenshot { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
.iot-food { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); }
.iot-light { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); }
.iot-bubbles { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); }
.iot-music { background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); }

.coming-soon-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    background: var(--bg-main);
    color: var(--text-main);
    padding: 5px 10px;
    border: 3px solid var(--border-main);
    font-weight: 900;
    font-size: 0.75rem;
    z-index: 10;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 2px 2px 0px var(--border-main);
}

.disabled-btn {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(0.5);
}

.donate-hero-cta {
    font-size: 1.3rem;
    padding: 20px;
}

[data-theme='dark'] .btn-iot {
    color: #000;
}

/* Community Leaderboard */
.leaderboard-panel {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    overflow: hidden;
    box-shadow: var(--shadow-pop);
    display: flex;
    flex-direction: column;
}

.leaderboard-header {
    background: #f1c40f; /* Gold accent */
    padding: 15px 20px;
    border-bottom: var(--border-width) solid var(--border-main);
    color: #000;
    text-align: center;
}

.leaderboard-header h3 {
    font-size: 1.2rem;
    font-weight: 900;
}

.leaderboard-list {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.leader-rank {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 2px dashed rgba(0,0,0,0.1);
}
[data-theme='dark'] .leader-rank {
    border-bottom: 2px dashed rgba(255,255,255,0.1);
}

.leader-rank:last-child {
    border-bottom: none;
}

.medal {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
}

.medal.num {
    font-size: 1.2rem;
    font-weight: 900;
    background: var(--bg-main);
    height: 35px;
    width: 35px;
    border-radius: 50%;
    border: 2px solid var(--border-main);
    color: var(--text-main);
}

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

.user-name {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--text-main);
}

.user-score {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 800;
}

/* Base Buttons */
.btn {
    font-family: inherit;
    font-weight: 900;
    text-transform: uppercase;
    padding: 16px 24px;
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-tight);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-bouncing:hover {
    transform: scale(1.05) translateY(-5px);
}

.btn-mint {
    background-color: var(--primary-mint);
    color: #fff;
    box-shadow: var(--shadow-pop-small);
}

.btn-mint:hover {
    box-shadow: var(--shadow-pop);
}

.btn-coral {
    background-color: var(--accent-coral);
    color: #fff;
    box-shadow: var(--shadow-pop-small);
}

.btn-coral:hover {
    box-shadow: var(--shadow-pop);
}

.btn-outline-red {
    background-color: transparent;
    color: var(--accent-red);
    border-color: var(--accent-red);
    border-style: dashed;
}

.btn-outline-red:hover {
    background-color: rgba(255, 59, 48, 0.1);
    transform: translateY(-2px);
}

.btn-wide {
    width: 100%;
    font-size: 1.1rem;
}

/* Custom Chat Section */
.chat-section {
    padding-bottom: 60px;
}

.chat-bubble-container {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    padding: 10px;
    position: relative;
    box-shadow: var(--shadow-pop);
}

.chat-bubble-container::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid var(--border-main);
}

.chat-header {
    background: var(--primary-mint);
    padding: 15px 30px;
    border-radius: 17px 17px 0 0;
    border-bottom: var(--border-width) solid var(--border-main);
    margin: -10px -10px 0 -10px;
}

.chat-header h3 {
    color: #fff;
    font-weight: 900;
}

.custom-chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 350px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar styling for chat */
.chat-messages::-webkit-scrollbar {
    width: 12px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    border-left: var(--border-width) solid var(--border-main);
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-mint);
    border-radius: 10px;
    border: var(--border-width) solid var(--border-main);
}

.chat-msg {
    background: var(--bg-main);
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    border: 3px solid var(--border-main);
    box-shadow: 2px 2px 0px var(--border-main);
    width: fit-content;
    max-width: 85%;
}

.msg-author {
    font-weight: 900;
    color: var(--primary-mint);
    margin-right: 5px;
}

.system-msg {
    background: transparent;
    border: 2px dashed var(--text-muted);
    box-shadow: none;
    text-align: center;
    font-weight: 800;
    color: var(--text-muted);
    margin: 0 auto;
}

.chat-input-area {
    padding: 15px;
    border-top: var(--border-width) dashed var(--border-main);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-bubbly) var(--radius-bubbly);
}

#custom-chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-cartoon {
    font-family: inherit;
    font-weight: 600;
    padding: 12px 15px;
    border: var(--border-width) solid var(--border-main);
    border-radius: 15px;
    background: var(--bg-main);
    color: var(--text-main);
    outline: none;
    transition: box-shadow 0.2s ease;
}

.input-cartoon:focus {
    box-shadow: var(--shadow-pop-small);
}

.input-small {
    flex: 0 0 150px;
}

.input-large {
    flex: 1;
}

.btn-send {
    padding: 12px 20px;
    border-radius: 15px;
    font-size: 1rem;
}

/* Voting Section (Mixed Media) */
.vote-section {
    padding: 60px 0;
    position: relative;
    background-color: transparent;
}

.deadline-badge {
    display: inline-block;
    background: var(--accent-coral);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    border: 3px solid var(--border-main);
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 4px 4px 0px var(--border-main);
    letter-spacing: 0.5px;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    font-weight: 900;
}

.voting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 40px;
}

/* Crowdfunding Section */
.crowdfund-section {
    padding: 60px 0;
}

.crowdfund-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

.crowdfund-card {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-pop);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    text-align: center;
}

.crowdfund-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-pop-hover);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    background: var(--bg-main);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: var(--border-width) solid var(--border-main);
    box-shadow: var(--shadow-pop-small);
}

.crowdfund-card .card-content {
    padding: 0;
    width: 100%;
}

.vote-card {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-pop);
}

.vote-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-pop-hover);
}

/* Mixed media framing: White border resembling a polaroid/photo inside the cartoon frame */
.card-img.mixed-media {
    height: 200px;
    background: #ffffff;
    border-bottom: var(--border-width) solid var(--border-main);
    padding: 8px; /* The white border around the realistic photo */
}

.card-img.mixed-media img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* High-quality realistic fit */
    border: 2px solid #000; /* Subtle realistic frame inside the cartoon card */
    border-radius: 8px; /* Slight rounding for the photo */
}

.card-content {
    padding: 24px;
    text-align: center;
}

.card-content h3 {
    font-weight: 900;
    margin-bottom: 15px;
}

.progress-container {
    height: 20px;
    background: #eee;
    border: var(--border-width) solid var(--border-main);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

[data-theme='dark'] .progress-container {
    background: #444;
}

.progress-bar {
    height: 100%;
    background: var(--primary-mint);
    border-right: var(--border-width) solid var(--border-main);
}

.vote-stats {
    margin-bottom: 15px;
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Ad Slot 1 (Thematic Banner) */
.ad-banner-section {
    padding: 0 0 60px 0;
}

.bubbly-billboard {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    padding: 4px; /* Reduced to almost zero for realistic ad framing */
    position: relative;
    box-shadow: var(--shadow-pop);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Cartoon "Ropes" holding the sign */
.bubbly-billboard::before,
.bubbly-billboard::after {
    content: '';
    position: absolute;
    top: -30px;
    width: 6px;
    height: 50px;
    background: var(--border-main);
    border-radius: 3px;
    z-index: -1;
}

.bubbly-billboard::before { left: 40px; }
.bubbly-billboard::after { right: 40px; }

.ad-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--border-main);
    color: var(--bg-main);
    padding: 2px 10px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 0 0 10px 0;
}

.ad-placeholder-horizontal {
    width: 100%;
    max-width: 728px;
    height: auto;
    aspect-ratio: 728/90;
    border-radius: 20px; /* Adapted to new padding */
    display: flex;
    overflow: hidden;
}

.ad-placeholder-horizontal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ad Slot 2 (Native Grid Ad) */
.vote-card.sponsored-card {
    border-color: #f1c40f; /* Gold border */
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(241, 196, 15, 0.1) 100%);
    position: relative;
    box-shadow: 8px 8px 0px #f1c40f;
}

.vote-card.sponsored-card:hover {
    box-shadow: 12px 12px 0px #f1c40f;
}

.sponsor-tag-banner {
    position: absolute;
    top: 15px;
    left: -5px;
    background: #f1c40f;
    color: #000;
    padding: 5px 15px;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.75rem;
    border: var(--border-width) solid var(--border-main);
    border-radius: 5px;
    transform: rotate(-3deg);
    z-index: 2;
    box-shadow: var(--shadow-pop-small);
}

.ad-card-padding {
    padding-top: 50px; /* Make room for the tag */
}

.ad-placeholder-square {
    width: 100%;
    aspect-ratio: 300/250;
    border-radius: 15px;
    display: flex;
    overflow: hidden;
    border: var(--border-width) solid var(--border-main);
}

.ad-placeholder-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-gold {
    background-color: #f1c40f;
    color: #000;
    box-shadow: var(--shadow-pop-small);
}

.btn-gold:hover {
    box-shadow: var(--shadow-pop);
}

/* Custom Modal for Screenshot Preview */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    padding: 30px;
    width: 90%;
    max-width: 600px;
    box-shadow: 15px 15px 0px rgba(0,0,0,0.5);
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 20px;
}

.modal-image-preview {
    width: 100%;
    height: 300px;
    background: #000;
    border: var(--border-width) solid var(--border-main);
    border-radius: 15px;
    margin-bottom: 25px;
    overflow: hidden;
    position: relative;
}

.modal-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-btn-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* User Gallery Section (Carousel) */
.gallery-section {
    padding: 80px 0;
    background: var(--bg-main);
}

.carousel-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.carousel-track-wrapper {
    overflow: hidden;
    border: var(--border-width) solid var(--border-main);
    border-radius: var(--radius-bubbly);
    background: var(--bg-card);
    box-shadow: var(--shadow-pop);
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.carousel-slide-inner {
    background: #fff;
    padding: 10px;
    border: var(--border-width) dashed var(--border-main);
    border-radius: 15px;
    height: 400px;
}

.carousel-slide-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #000;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-mint);
    border: var(--border-width) solid var(--border-main);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-pop-small);
    z-index: 10;
    transition: all 0.2s;
}

.carousel-btn:hover {
    box-shadow: var(--shadow-pop);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    box-shadow: none;
    transform: translateY(calc(-50% + 4px)) translateX(4px);
}

.carousel-btn.prev {
    left: -25px;
}

.carousel-btn.next {
    right: -25px;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.carousel-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--border-main);
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-dot.active {
    background: var(--primary-mint);
    transform: scale(1.3);
}

/* Footer */
.cartoon-footer {
    background: var(--bg-card);
    border-top: var(--border-width) solid var(--border-main);
    padding: 50px 0 30px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-main);
    font-weight: 800;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.social-icons {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.social-btn {
    background: var(--bg-main);
    border: var(--border-width) solid var(--border-main);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: var(--shadow-pop-small);
    transition: transform 0.1s;
}

.social-btn:hover {
    background: var(--primary-mint);
    color: white;
}

.social-btn:active {
    box-shadow: none;
    transform: translate(3px, 3px);
}

.footer-credits {
    text-align: center;
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.powered-by {
    margin-top: 5px;
    color: var(--text-main);
}
.powered-by strong {
    color: var(--accent-coral);
    font-weight: 900;
}

/* =========================================
   ANIMATED BACKGROUNDS (Performance Optimized)
   ========================================= */

.with-anim-bg {
    position: relative;
    overflow: hidden;
}

.section-content {
    position: relative;
    z-index: 10;
}

.bg-anim-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Background 1: Light Rays (Hero) */
.bg-ray {
    position: absolute;
    top: -50%;
    width: 15vh;
    height: 200%;
    background: linear-gradient(to right, rgba(0, 255, 255, 0), rgba(0, 255, 255, 0.05), rgba(255, 255, 180, 0.1), rgba(0, 255, 255, 0));
    transform-origin: top center;
    transform: rotate(25deg);
    animation: pulseRay 8s infinite alternate ease-in-out;
}

@keyframes pulseRay {
    0% { opacity: 0.3; transform: rotate(25deg) scaleX(1); }
    100% { opacity: 0.8; transform: rotate(28deg) scaleX(1.5); }
}

[data-theme='light'] .bg-ray {
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 200, 0, 0.1), rgba(255, 255, 255, 0));
}

/* Background 2: Bubbles (Banner & Chat) */
.bg-bubble {
    position: absolute;
    bottom: -100px; /* Start off-screen */
    background: transparent;
    border: var(--border-width) solid var(--border-main);
    border-radius: 50%;
    box-shadow: inset 5px 5px 0px rgba(255,255,255,0.3);
    animation: riseBubble linear infinite;
}

@keyframes riseBubble {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-120vh) scale(1.2); opacity: 0; }
}

[data-theme='dark'] .bg-bubble {
    box-shadow: inset 5px 5px 0px rgba(255,255,255,0.05);
}

/* Background 3: Swimming Fish (Voting Section) */
.bg-fish-silhouette {
    position: absolute;
    font-size: 8rem;
    color: var(--border-main);
    opacity: 0.15;
    animation: swimFish linear infinite;
}

@keyframes swimFish {
    0% { transform: translateX(-20vw); }
    100% { transform: translateX(120vw); }
}

/* Background 4: Moving Waves (Gallery Section) */
.bg-wave {
    position: absolute;
    left: 0;
    width: 200%;
    height: 60px;
    background-image: radial-gradient(circle at 30px 0, transparent 32px, var(--bg-main) 33px);
    background-size: 60px 100%;
    background-repeat: repeat-x;
    z-index: 5;
    pointer-events: none;
}

.wave-top {
    /* Changed to be near the bottom of the hero but facing up to create a scalloped floor effect */
    bottom: 50px;
    transform: rotate(180deg);
    animation: rollWaveRight 6s linear infinite;
    opacity: 0.5;
}

.wave-bottom {
    bottom: -1px;
    animation: rollWaveLeft 6s linear infinite;
}

@keyframes rollWaveLeft {
    0% { background-position-x: 0; }
    100% { background-position-x: -60px; }
}

@keyframes rollWaveRight {
    0% { background-position-x: 0; }
    100% { background-position-x: 60px; }
}

/* Responsive */
@media (max-width: 900px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px 25px;
    }
    
    .section-title {
        font-size: 2rem;
    }

    .hero-bottom-grid {
        grid-template-columns: 1fr;
    }
    
    .arcade-dashboard {
        grid-template-columns: 1fr 1fr;
        padding: 15px;
    }
    
    #custom-chat-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-small {
        flex: none;
        width: 100%;
    }
    
    .carousel-btn.prev {
        left: 10px;
    }
    .carousel-btn.next {
        right: 10px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .ad-placeholder-horizontal {
        height: auto;
        aspect-ratio: 728/90;
        min-height: 50px;
    }
}

/* Smooth Scrolling & Globals */
html {
    scroll-behavior: smooth;
}

/* FAB Back to Top */
.fab-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-coral);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    border: 4px solid var(--border-main);
    box-shadow: var(--shadow-pop);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.fab-back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-pop-hover);
}

/* Gallery Like Button */
.gallery-like-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 3px solid var(--border-main);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    box-shadow: var(--shadow-pop-small);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, background 0.2s, color 0.2s;
}

.gallery-like-btn:hover {
    transform: scale(1.1);
}

.gallery-like-btn.liked {
    background: var(--accent-coral);
    color: #fff;
}

.gallery-like-btn.liked i {
    animation: heartBeat 0.5s ease-in-out;
    color: #fff !important;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Universal Modal Close Icon */
.modal-close-icon {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--bg-main);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid var(--border-main);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-pop-small);
    transition: transform 0.2s;
    z-index: 10;
}

.modal-close-icon:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Music Modal List */
.song-list {
    text-align: left;
    background: var(--bg-main);
    border: 3px solid var(--border-main);
    border-radius: 15px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin: 15px 0;
}

.song-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 2px dashed rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background 0.2s;
}

.song-option:last-child {
    border-bottom: none;
}

.song-option:hover {
    background: rgba(255,255,255,0.5);
}

.song-option input {
    margin-right: 15px;
    transform: scale(1.5);
    cursor: pointer;
}

.song-option label {
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
}

/* Dual Ranking System */
.ranking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.monthly-panel {
    border-color: #3498db !important;
    box-shadow: 10px 10px 0px rgba(52, 152, 219, 0.4);
}

.monthly-header {
    background: rgba(52, 152, 219, 0.1) !important;
}

@media (max-width: 900px) {
    .ranking-grid {
        grid-template-columns: 1fr;
    }
}
/* E-Commerce Store Overrides and Components */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-coral);
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 900;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border-main);
    z-index: 10;
}

.product-card {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 12px 12px 0px rgba(0,0,0,0.1);
}

.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 2px dashed rgba(0,0,0,0.1);
}

.cart-item-row:last-child {
    border-bottom: none;
}
