/* ═══════════════════════════════════════════════════════════════════════════════
   OPENPUNK - 7777 Generative Art CSS
   ═══════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --neon-green: #39ff14;
    --neon-orange: #ff6600;
    --neon-yellow: #ffff00;
    --dark-purple: #0a1a2e;
    --darker-purple: #050d15;
    --grid-color: rgba(0, 255, 255, 0.2);
    --base-blue: #0052ff;
    --punk-accent: #ff00ff;
}

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

body {
    font-family: 'Press Start 2P', cursive;
    background: var(--darker-purple);
    min-height: 100vh;
    overflow-x: hidden;
    color: white;
    position: relative;
}

/* CRT Effect */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1000;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1),
            rgba(0, 0, 0, 0.1) 1px,
            transparent 1px,
            transparent 2px);
    z-index: 1001;
}

/* Main Container */
.arcade-cabinet {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    background:
        linear-gradient(180deg, var(--dark-purple) 0%, var(--darker-purple) 100%),
        repeating-linear-gradient(0deg,
            transparent,
            transparent 50px,
            var(--grid-color) 50px,
            var(--grid-color) 51px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 50px,
            var(--grid-color) 50px,
            var(--grid-color) 51px);
    border-left: 4px solid var(--neon-pink);
    border-right: 4px solid var(--neon-cyan);
    position: relative;
}

/* Title */
.title-section {
    text-align: center;
    margin-bottom: 20px;
}

h1.glitch {
    font-size: 2.2rem;
    color: var(--neon-cyan);
    text-shadow:
        0 0 10px var(--neon-cyan),
        0 0 20px var(--base-blue),
        4px 4px 0 var(--punk-accent);
    animation: glitch 2s infinite;
    letter-spacing: 2px;
}

@keyframes glitch {

    0%,
    90%,
    100% {
        transform: translate(0);
    }

    92% {
        transform: translate(-2px, 1px);
    }

    94% {
        transform: translate(2px, -1px);
    }

    96% {
        transform: translate(-1px, 2px);
    }

    98% {
        transform: translate(1px, -2px);
    }
}

.subtitle {
    font-size: 0.6rem;
    color: var(--neon-cyan);
    margin-top: 10px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--neon-pink);
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.5rem;
}

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

.label {
    color: var(--neon-cyan);
}

.bar-container {
    width: 80px;
    height: 12px;
    background: #333;
    border: 2px solid #666;
    border-radius: 2px;
    overflow: hidden;
}

.bar {
    height: 100%;
    transition: width 0.5s ease;
}

.life-bar {
    background: linear-gradient(90deg, var(--neon-green), #00ff00);
    box-shadow: 0 0 10px var(--neon-green);
    width: 82%;
}

.money {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.mood-text {
    color: var(--neon-yellow);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Main Containers */
.lobster-container {
    position: relative;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.pixel-lobster {
    position: relative;
    filter: drop-shadow(0 0 20px var(--neon-cyan));
}

.tamagotchi-lobster {
    width: 120px;
    height: 100px;
    position: relative;
    animation: tamagotchiBounce 1.5s ease-in-out infinite;
}

.lobster-body {
    width: 60px;
    height: 80px;
    background: #ff4d4d;
    border-radius: 30px 30px 10px 10px;
    position: absolute;
    left: 30px;
    top: 10px;
    box-shadow:
        inset -8px 0 rgba(0, 0, 0, 0.2),
        0 8px 0 #cc0000;
    z-index: 2;
    animation: breathe 2s ease-in-out infinite;
}

.eye {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 20px;
    animation: blink 4s infinite;
}

.eye::after {
    content: '';
    width: 6px;
    height: 6px;
    background: black;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

.eye.left {
    left: 10px;
}

.eye.right {
    right: 10px;
}

.pincer {
    width: 35px;
    height: 40px;
    background: #ff4d4d;
    border-radius: 20px 20px 5px 5px;
    position: absolute;
    top: -5px;
    box-shadow: inset -4px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.pincer.left {
    left: -20px;
    transform: rotate(-30deg);
    animation: snapLeft 1s ease-in-out infinite;
}

.pincer.right {
    right: -20px;
    transform: rotate(30deg);
    animation: snapRight 1s ease-in-out infinite;
}

.pincer::before {
    content: '';
    width: 15px;
    height: 20px;
    background: #ff3333;
    position: absolute;
    top: 5px;
    left: 10px;
    border-radius: 50%;
}

.antennae {
    width: 2px;
    height: 30px;
    background: #cc0000;
    position: absolute;
    top: -20px;
    left: 30px;
    box-shadow: 20px 0 0 #cc0000;
    animation: antennaWag 2s ease-in-out infinite;
}

.legs {
    position: absolute;
    width: 100%;
    height: 20px;
    bottom: -10px;
}

.legs::before,
.legs::after {
    content: '///   ///';
    color: #cc0000;
    font-size: 20px;
    letter-spacing: 5px;
    font-weight: bold;
}

/* Animations */
@keyframes tamagotchiBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes blink {

    0%,
    95%,
    100% {
        transform: scaleY(1);
    }

    97% {
        transform: scaleY(0.1);
    }
}

@keyframes snapLeft {

    0%,
    100% {
        transform: rotate(-30deg);
    }

    50% {
        transform: rotate(-45deg);
    }
}

@keyframes snapRight {

    0%,
    100% {
        transform: rotate(30deg);
    }

    50% {
        transform: rotate(45deg);
    }
}

@keyframes antennaWag {

    0%,
    100% {
        transform: skewX(5deg);
    }

    50% {
        transform: skewX(-5deg);
    }
}

.floating-items {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.float-item {
    position: absolute;
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.float-item.coin {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.float-item.heart {
    top: 20%;
    right: 15%;
    animation-delay: 0.5s;
}

.float-item.code {
    bottom: 20%;
    left: 15%;
    animation-delay: 1s;
}

.float-item.star {
    bottom: 10%;
    right: 10%;
    animation-delay: 1.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
        opacity: 1;
    }
}

/* Speech Bubble */
.speech-bubble {
    background: white;
    color: #333;
    padding: 15px 20px;
    border-radius: 10px;
    position: relative;
    margin: 20px auto;
    max-width: 90%;
    font-size: 0.6rem;
    line-height: 1.8;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.arcade-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
}

.arcade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.5);
}

.arcade-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.arcade-btn.feed {
    background: linear-gradient(180deg, var(--neon-green), #00cc00);
    color: #000;
}

.arcade-btn.hire {
    background: linear-gradient(180deg, var(--neon-cyan), #0099cc);
    color: #000;
}

.arcade-btn.follow {
    background: linear-gradient(180deg, var(--neon-pink), #cc00cc);
    color: #fff;
}

.arcade-btn.close {
    background: #666;
    color: white;
    margin-top: 15px;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Daily Cost */
.daily-cost {
    text-align: center;
    font-size: 0.5rem;
    color: var(--neon-yellow);
    margin: 20px 0;
}

.cost {
    color: var(--neon-green);
}

.days-left {
    margin-top: 5px;
    color: var(--neon-orange);
}

/* Services Menu */
.services-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--dark-purple);
    border: 4px solid var(--neon-cyan);
    border-radius: 10px;
    padding: 20px;
    z-index: 2000;
    min-width: 300px;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

.services-menu h3 {
    text-align: center;
    color: var(--neon-cyan);
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 15px;
    border: 2px solid var(--neon-pink);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.5rem;
    transition: all 0.2s;
}

.service-item:hover {
    background: rgba(255, 0, 255, 0.2);
    transform: scale(1.02);
}

.service-icon {
    font-size: 1.2rem;
}

.service-price {
    color: var(--neon-green);
}

.arcade-btn.gallery {
    background: linear-gradient(180deg, var(--neon-cyan), #00cccc);
    color: #000;
}

/* Gallery Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 5, 21, 0.95);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.gallery-content {
    background: var(--dark-purple);
    border: 4px solid var(--neon-cyan);
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-header {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-header h2 {
    color: var(--neon-pink);
    font-size: 1.2rem;
    text-shadow: 0 0 10px var(--neon-pink);
    margin-bottom: 10px;
}

.gallery-subtitle {
    font-size: 0.5rem;
    color: var(--neon-cyan);
}

.art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    margin-bottom: 30px;
}

.art-item {
    background: black;
    border: 2px solid var(--neon-cyan);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s;
}

.art-item:hover {
    transform: scale(1.05);
    border-color: var(--neon-pink);
}

.art-image {
    width: 100%;
    image-rendering: pixelated;
    /* Crucial for pixel art */
    border: 1px solid #333;
}

.art-info {
    font-size: 0.4rem;
    text-align: center;
}

.art-title {
    color: var(--neon-yellow);
    margin-bottom: 5px;
}

.art-date {
    color: #666;
}

/* Scrollbar for Gallery */
.gallery-content::-webkit-scrollbar {
    width: 8px;
}

.gallery-content::-webkit-scrollbar-track {
    background: var(--darker-purple);
}

.gallery-content::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
}

/* Footer */
.arcade-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.4rem;
    color: #666;
}

.blink {
    animation: blink 1s infinite;
    color: var(--neon-yellow);
    margin-top: 10px;
}

@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

/* Game Over State */
body.game-over .arcade-cabinet {
    filter: grayscale(100%);
}

body.game-over .pixel-lobster {
    animation: none;
    transform: rotate(180deg);
    filter: grayscale(100%);
}

body.game-over::after {
    content: 'GAME OVER';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Press Start 2P', cursive;
    font-size: 3rem;
    color: red;
    text-shadow: 0 0 20px red;
    z-index: 3000;
    animation: gameOverPulse 0.5s infinite;
}

@keyframes gameOverPulse {

    0%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Responsive */
@media (max-width: 480px) {
    h1.glitch {
        font-size: 1.8rem;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
        font-size: 0.4rem;
    }

    .arcade-btn {
        font-size: 0.5rem;
        padding: 10px 15px;
    }

    .pixel-lobster {
        font-size: 80px;
    }

    .art-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MASTERPIECE VIEW - ELEGANT GALLERY
   ═══════════════════════════════════════════════════════════════════════════════ */

.masterpiece-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    padding: 20px;
    animation: fadeIn 1.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.elegant-frame {
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg, #ffd700, #fcf6ba, #b38728, #fbf5b7, #daa520);
    box-shadow:
        0 0 30px rgba(191, 149, 63, 0.4),
        0 0 60px rgba(0, 0, 0, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    max-width: 80vh;
    width: 90%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.elegant-frame video,
.elegant-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 5px solid #000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    background: #000;
}

.masterpiece-info {
    margin-top: 40px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.masterpiece-title {
    font-size: 1.5rem;
    color: #fcf6ba;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(252, 246, 186, 0.5);
    margin-bottom: 10px;
}

.masterpiece-desc {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 0.2rem;
}

.exit-masterpiece {
    margin-top: 50px;
    background: transparent;
    color: #666;
    border: 1px solid #333;
    padding: 10px 20px;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.1rem;
    font-family: 'Press Start 2P', cursive;
}

.exit-masterpiece:hover {
    color: #fcf6ba;
    border-color: #fcf6ba;
    background: rgba(191, 149, 63, 0.1);
}

/* Update Arcade for toggle */
.arcade-cabinet.hidden {
    display: none;
}

.elegant-frame iframe {
    width: 100%;
    height: 100%;
    border: 5px solid #000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    background: #000;
}
/* integration of OpenPunk #7777 Image into the Tamagotchi */
.lobster-sprite-7777 {
    position: absolute;
    width: 60px;
    height: 60px;
    top: 20px;
    left: 30px;
    z-index: 3;
    image-rendering: pixelated;
    pointer-events: none;
    animation: imageBreathe 2s ease-in-out infinite;
    mix-blend-mode: multiply; /* Optional: adjust based on how it looks on the red body */
}

.tamagotchi-lobster {
    transform: scale(1.5); /* Make it bigger for better visibility */
}

@keyframes imageBreathe {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Standalone style for User Artwork */
.lobster-sprite-7777.standalone {
    position: static;
    width: 150px;
    height: 150px;
    mix-blend-mode: normal;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 15px var(--neon-cyan));
    animation: floatingArt 3s ease-in-out infinite;
}

.tamagotchi-lobster {
    transform: none; /* Reset scaling as the image is now bigger */
}

@keyframes floatingArt {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}
