:root {
    --glass-bg: rgba(20, 20, 35, 0.4);
    --glass-border: rgba(255, 255, 255, 0.15);
    --holo-gradient: linear-gradient(120deg, transparent 20%, rgba(255,215,0,0.3) 40%, rgba(255,255,255,0.6) 50%, rgba(255,215,0,0.3) 60%, transparent 80%);
}

* { -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    padding: 30px 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(-45deg, #0b0f19, #1a1a2e, #16213e, #0f3460);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.profile-section { text-align: center; }

.profile-pic {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
    background-color: #000;
}

h1 { margin: 12px 0 4px 0; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
p.tagline { margin: 0; color: #a0a0b0; font-size: 0.9rem; }

.links-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.social-btn {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%; height: 100%;
    background: var(--holo-gradient);
    transition: left 0.6s ease;
}

.youtube:hover { box-shadow: 0 0 15px rgba(255, 0, 0, 0.4); border-color: #ff0000; }
.instagram:hover { box-shadow: 0 0 15px rgba(225, 48, 108, 0.4); border-color: #e1306c; }
.tiktok:hover { box-shadow: 0 0 15px rgba(0, 242, 254, 0.4); border-color: #00f2fe; }
.facebook:hover { box-shadow: 0 0 15px rgba(24, 119, 242, 0.4); border-color: #1877f2; }
.social-btn:hover { transform: translateY(-2px); }
.social-btn:hover::before { left: 100%; }

.carousel-container {
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
    position: relative;
    white-space: nowrap;
}

.carousel-track {
    display: inline-flex;
    gap: 40px;
    align-items: center;
    animation: scroll 15s linear infinite;
}

.carousel-logo { height: 35px; width: auto; object-fit: contain; }

img[alt="One Piece"] { filter: invert(1); }

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 20px)); } 
}

.media-row {
    width: 100%;
    display: flex;
    flex-direction: row; 
    align-items: stretch;
    justify-content: center;
    gap: 10px;
}

.video-card {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
    backdrop-filter: blur(10px);
}

.video-card h3 { margin: 0 0 8px 0; font-size: 0.95rem; color: #fff; }
#latest-rip-frame { height: 260px; }

.tamagotchi-box {
    flex: 1;
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid #3a3f58;
    border-radius: 14px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    position: relative; /* Allows positioning of the globe icon */
}

.pet-title {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

#rayquaza-sprite {
    width: 130px; 
    max-width: 100%;
    cursor: pointer;
    transition: transform 0.1s, filter 0.3s;
    image-rendering: pixelated; 
    user-select: none;
    -webkit-user-drag: none;
    outline: none; 
}

#rayquaza-sprite:active { transform: scale(0.92); }

.stats { 
    margin-top: 15px; 
    font-family: 'Courier New', Courier, monospace; 
    font-size: 1rem; 
    text-align: center;
}
#pet-count { font-size: 1.4rem; }

/* --- Globe Icon Button --- */
.stats-icon-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 4px;
}
.stats-icon-btn:hover, .stats-icon-btn.active {
    color: #4ade80;
    transform: scale(1.15);
}

/* --- Full-Width Stats Dropdown --- */
.stats-container {
    display: none; 
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}
.stats-container.show { display: block; }

.stats-overview {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    color: #4ade80;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 10px;
}

.stats-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.country-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.country-row:last-child { border-bottom: none; }

.shiny-alert {
    position: fixed;
    top: -80px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(90deg, #b8860b, #ffd700, #b8860b);
    color: #000; padding: 14px 28px; border-radius: 30px;
    font-size: 1.1rem; font-weight: 800;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    z-index: 1000; transition: top 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid #fff; white-space: nowrap;
}
.shiny-alert.show { top: 25px; }
.shiny-text { color: #facc15; font-weight: bold; text-shadow: 0 0 8px rgba(250, 204, 21, 0.5); }

.toast {
    position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
    background: rgba(220, 38, 38, 0.95); color: #fff;
    padding: 12px 24px; border-radius: 30px;
    font-size: 0.9rem; font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    z-index: 1000; transition: top 0.4s ease, opacity 0.4s ease;
    opacity: 0; pointer-events: none;
}
.toast.show { top: 20px; opacity: 1; }

@media (min-width: 768px) {
    .container { max-width: 800px; gap: 30px; }
    h1 { font-size: 2.2rem; margin: 16px 0 8px 0; }
    p.tagline { font-size: 1.1rem; }
    .profile-pic { width: 140px; height: 140px; }
    .social-btn { font-size: 1.1rem; padding: 16px; }
    .carousel-logo { height: 45px; }
    .media-row { gap: 20px; }
    .video-card { padding: 16px; }
    .video-card h3 { font-size: 1.1rem; margin-bottom: 12px;}
    #latest-rip-frame { height: 380px; }
    .tamagotchi-box { padding: 20px; }
    .pet-title { font-size: 1.2rem; }
    #rayquaza-sprite { width: 170px; }
    .stats { font-size: 1.2rem; margin-top: 25px; }
    #pet-count { font-size: 2rem; }
    .stats-icon-btn { font-size: 1.5rem; bottom: 16px; right: 16px; }
    .stats-container { padding: 30px; }
    .stats-header { font-size: 1rem; }
    .stats-list { font-size: 1.05rem; max-height: 300px; }
    .stats-overview { font-size: 1.1rem; padding: 16px; }
}
