/* Custom cursor everywhere */
*, html, body {
    cursor: url('../images/cursor.png') 0 0, auto !important;
}

/* RESET */
body {
    margin: 0;
    background: #000;
    font-family: Arial, Helvetica, sans-serif;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sparkle overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(200,150,255,0.4), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(200,150,255,0.3), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 180px 50px, rgba(180,130,220,0.3), transparent);
    background-size: 200px 150px;
    pointer-events: none;
    z-index: 0;
    animation: sparkle 4s ease-in-out infinite alternate;
}

@keyframes sparkle {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* FLOATING GLOWING DOTS */
.floating-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.dot {
    position: absolute;
    width: 60px;
    height: 60px;
    background: url('../images/purp-star.png') no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 0 10px rgba(200, 150, 255, 0.6));
    animation: floatDot 8s ease-in-out infinite;
}

.dot:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 7s; }
.dot:nth-child(2) { left: 25%; top: 60%; animation-delay: -1s; animation-duration: 9s; width: 45px; height: 45px; }
.dot:nth-child(3) { left: 45%; top: 80%; animation-delay: -2s; animation-duration: 6s; }
.dot:nth-child(4) { left: 70%; top: 30%; animation-delay: -3s; animation-duration: 10s; width: 80px; height: 80px; }
.dot:nth-child(5) { left: 85%; top: 70%; animation-delay: -4s; animation-duration: 8s; width: 40px; height: 40px; }
.dot:nth-child(6) { left: 60%; top: 10%; animation-delay: -5s; animation-duration: 7s; }
.dot:nth-child(7) { left: 5%; top: 85%; animation-delay: -6s; animation-duration: 9s; width: 55px; height: 55px; }
.dot:nth-child(8) { left: 90%; top: 45%; animation-delay: -7s; animation-duration: 6s; }
.dot:nth-child(9) { left: 65%; top: 65%; animation-delay: -7s; animation-duration: 6s; }
.dot:nth-child(10) { left: 8%; top: 45%; animation-delay: -2s; animation-duration: 8s; width: 50px; height: 50px; }

@keyframes floatDot {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-30px) translateX(10px);
        opacity: 1;
    }
    50% {
        transform: translateY(-15px) translateX(-10px);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-40px) translateX(5px);
        opacity: 1;
    }
}

/* MAIN WRAPPER */
.container {
    width: 100%;
    text-align: center;
    padding-top: 40px;
    position: relative;
}

/* TITLE IMAGE */
.title-img {
    max-width: 700px;
    width: 90%;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 25px rgba(200, 150, 255, 0.6))
            drop-shadow(0 0 50px rgba(200, 150, 255, 0.4));
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { 
        filter: drop-shadow(0 0 15px rgba(200, 150, 255, 0.4))
                drop-shadow(0 0 30px rgba(200, 150, 255, 0.2));
    }
    100% { 
        filter: drop-shadow(0 0 35px rgba(200, 150, 255, 0.8))
                drop-shadow(0 0 70px rgba(200, 150, 255, 0.5));
    }
}

/* STAR IMAGES */
.stars {
    position: absolute;
    top: 20px;
    width: 350px;
    opacity: 0.9;
    pointer-events: none;
}

.stars.left {
    left: 0;
}

.stars.right {
    right: 0;
}

/* BANNER BAR */
.banner {
    width: 100%;
    padding: 10px 0;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
    margin: 20px 0 60px 0;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 28px;
    letter-spacing: 2px;
    background: rgba(124, 58, 120, 0.25);
}

/* GAME BOX ROW */
.games {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding-bottom: 80px;
    flex-wrap: wrap;
}

/* GAME BOXES */
.game {
    width: 220px;
    height: 180px;
    background: #7c3a78;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-family: 'VT323', monospace;
    letter-spacing: 1px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    text-decoration: none;
    color: white;
    /* Retro 3D button effect */
    border: 3px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    box-shadow: 
        4px 4px 0 #2a0a28,
        inset 2px 2px 0 rgba(255, 255, 255, 0.1);
}

.game:hover {
    background: #8e4489;
    border-color: #b865b4 #5a2a58 #5a2a58 #b865b4;
}

.game:active {
    border-color: #4a1a48 #a855a4 #a855a4 #4a1a48;
    box-shadow: 
        2px 2px 0 #2a0a28,
        inset 2px 2px 0 rgba(0, 0, 0, 0.1);
    transform: translate(2px, 2px);
}

/* GAME WITH THUMBNAIL */
.game-with-thumb {
    flex-direction: column;
    padding: 10px;
    gap: 8px;
}

.game-thumbnail {
    width: 100%;
    flex: 1;
    object-fit: cover;
    border: 2px solid rgba(200, 150, 255, 0.4);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.game-with-thumb:hover .game-thumbnail {
    border-color: rgba(200, 150, 255, 0.8);
    box-shadow: 0 0 15px rgba(200, 150, 255, 0.4);
}

.game-label {
    font-family: 'VT323', monospace;
    font-size: 20px;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* NEW BADGE */
.new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff3366;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    animation: blink 1s ease-in-out infinite;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.6);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* RANDOM GAME BUTTON */
button.game {
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.random-game-btn {
    flex-direction: column;
    gap: 10px;
    min-width: 260px;
    min-height: 220px;
}

.random-icon {
    font-size: 60px;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* DRAWING PANEL */
.draw-panel {
    position: absolute;
    left: 40px;
    top: 400px;
    background: rgba(80, 30, 78, 0.95);
    border: 3px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    box-shadow: 4px 4px 0 #2a0a28;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.draw-title {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: white;
    margin: 0;
    letter-spacing: 2px;
}

#drawCanvas {
    border: 2px solid rgba(200, 150, 255, 0.5);
    background: #1a0a1a;
}

.draw-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker {
    width: 40px;
    height: 30px;
    border: 2px solid rgba(200, 150, 255, 0.5);
    background: none;
    cursor: pointer;
}

.clear-btn {
    font-family: 'VT323', monospace;
    font-size: 14px;
    padding: 6px 12px;
    background: #4a1a48;
    color: white;
    border: 2px solid;
    border-color: #a855a4 #2a0a28 #2a0a28 #a855a4;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-btn:hover {
    background: #5a2a58;
}

.clear-btn:active {
    border-color: #2a0a28 #a855a4 #a855a4 #2a0a28;
}

/* Draw panel decorations */
.draw-decor {
    position: absolute;
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 230, 100, 0.8));
    animation: starFloat 3s ease-in-out infinite;
}

.draw-decor.top-left {
    top: -45px;
    left: -50px;
    transform: rotate(-15deg);
}

@keyframes starFloat {
    0%, 100% {
        transform: rotate(-15deg) translateY(0);
        filter: drop-shadow(0 0 15px rgba(255, 230, 100, 0.6));
    }
    50% {
        transform: rotate(-15deg) translateY(-10px);
        filter: drop-shadow(0 0 25px rgba(255, 230, 100, 1));
    }
}

/* ROTATING CD */
.cd-link {
    position: absolute;
    left: 100px;
    top: 850px;
    display: block;
}

.cd-emoji {
    font-size: 100px;
    display: block;
    animation: spinCD 4s linear infinite;
    filter: drop-shadow(0 0 10px rgba(155, 89, 182, 0.6));
}

.cd-emoji:hover {
    animation-duration: 1s;
    filter: drop-shadow(0 0 20px rgba(155, 89, 182, 1));
}

@keyframes spinCD {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* RANDOM GAME BUTTON DECOR */
.random-game-btn {
    position: relative;
    overflow: visible;
}

.random-game-decor-link {
    position: absolute;
    top: -25px;
    right: -25px;
    z-index: 2;
}

.random-game-decor {
    width: 90px;
    height: 90px;
    object-fit: contain;
    animation: randomFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(200, 150, 255, 0.6));
}

@keyframes randomFloat {
    0%, 100% { transform: translateY(0) rotate(8deg); }
    50% { transform: translateY(-8px) rotate(8deg); }
}

/* MYSTERY BOX DECORATION */
.mystery-decor {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: mysteryFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(200, 150, 255, 0.6));
    z-index: 10;
}

@keyframes mysteryFloat {
    0%, 100% {
        transform: translateY(0) rotate(15deg) scaleX(-1);
    }
    50% {
        transform: translateY(-10px) rotate(15deg) scaleX(-1);
    }
}

/* MINI STAR CLICKER GAME */
.mini-game-panel {
    position: absolute;
    right: 40px;
    top: 400px;
    background: rgba(80, 30, 78, 0.95);
    border: 3px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    box-shadow: 4px 4px 0 #2a0a28;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 100;
    box-sizing: border-box;
}

.mini-game-title {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: white;
    margin: 0;
    letter-spacing: 2px;
}

.mini-game-area {
    width: 150px;
    height: 150px;
    background: #1a0a1a;
    border: 2px solid rgba(200, 150, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.bouncing-star {
    position: absolute;
    font-size: 30px;
    cursor: pointer;
    animation: bounceStar 1s ease-in-out infinite;
    user-select: none;
    left: 50px;
    top: 50px;
}

.bouncing-star:hover {
    transform: scale(1.2);
}

@keyframes bounceStar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mini-game-score {
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: white;
}

.mini-game-msg {
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: #ffeb3b;
    min-height: 24px;
}

.mini-game-decor {
    position: absolute;
    top: -30px;
    right: -40px;
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: mysteryFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(200, 150, 255, 0.6));
    z-index: 10;
}

/* ABOUT ME PANEL */
.about-panel {
    position: absolute;
    top: 730px;
    right: 60px;
    width: 180px;
    background: rgba(80, 30, 78, 0.95);
    border: 3px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    box-shadow: 4px 4px 0 #2a0a28;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 100;
    box-sizing: border-box;
}

.about-panel::before,
.about-panel::after {
    content: "❤";
    position: absolute;
    font-size: 14px;
    color: #c896ff;
    opacity: 0.6;
}

.about-panel::before {
    top: 6px;
    left: 8px;
}

.about-panel::after {
    bottom: 6px;
    right: 8px;
}

.about-title {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: white;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(200, 150, 255, 0.5);
}

.about-content {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    line-height: 1.5;
}

.about-content p {
    margin: 4px 0;
}

.about-emoji {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(200, 150, 255, 0.6));
}

@media (max-width: 1200px) {
    .mini-game-panel {
        display: none;
    }
    
    .about-panel {
        display: none;
    }
}

@media (max-width: 1000px) {
    .draw-panel {
        display: none;
    }
}

/* ==========================================
   GAME PAGE STYLES
   ========================================== */

/* BACK BUTTON */
.back-btn {
    display: inline-block;
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    margin-bottom: 20px;
    background: rgba(124, 58, 120, 0.4);
    border: 2px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    transition: all 0.15s ease;
}

.back-btn:hover {
    background: rgba(124, 58, 120, 0.6);
    border-color: #b865b4 #5a2a58 #5a2a58 #b865b4;
}

.back-btn:active {
    border-color: #4a1a48 #a855a4 #a855a4 #4a1a48;
    transform: translate(2px, 2px);
}

/* GAME TITLE */
.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.octo-icon {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(200, 150, 255, 0.6));
}

.octo-icon.left {
    transform: rotate(-15deg);
    animation: octoWiggleLeft 2s ease-in-out infinite;
}

.octo-icon.right {
    transform: scaleX(-1) rotate(-15deg);
    animation: octoWiggleRight 2s ease-in-out infinite;
}

@keyframes octoWiggleLeft {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(-5deg); }
}

@keyframes octoWiggleRight {
    0%, 100% { transform: scaleX(-1) rotate(-15deg); }
    50% { transform: scaleX(-1) rotate(-5deg); }
}

.game-title {
    font-family: 'VT323', monospace;
    font-size: 60px;
    color: white;
    margin: 0;
    text-shadow: 
        0 0 20px rgba(200, 150, 255, 0.6),
        0 0 40px rgba(200, 150, 255, 0.4);
    letter-spacing: 8px;
}

/* GAME CONTAINER */
.game-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.game-screen {
    width: 800px;
    max-width: 95%;
    height: 500px;
    background: #1a0a1a;
    border: 4px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    box-shadow: 
        6px 6px 0 #2a0a28,
        inset 0 0 50px rgba(200, 150, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-iframe {
    width: 800px;
    height: 400px;
    border: none;
    background: #1a0a1a;
}

.game-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    border: 4px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    box-shadow: 6px 6px 0 #2a0a28;
    background: #1a0a1a;
    margin: 0 auto;
}

.game-placeholder {
    font-family: 'VT323', monospace;
    font-size: 32px;
    color: rgba(200, 150, 255, 0.5);
    letter-spacing: 4px;
}

/* INSTRUCTIONS */
.instructions {
    margin: 40px auto;
    padding: 25px 40px;
    max-width: 500px;
    background: rgba(124, 58, 120, 0.25);
    border: 2px solid;
    border-color: #a855a4 #4a1a48 #4a1a48 #a855a4;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.instructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: none;
}

.instructions:hover {
    border-color: #b865b4 #5a2a58 #5a2a58 #b865b4;
    box-shadow: 0 0 20px rgba(200, 150, 255, 0.4);
}

.instructions:hover::before {
    animation: shimmer 0.8s ease;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.instructions h2 {
    font-family: 'VT323', monospace;
    font-size: 28px;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 4px;
    color: white;
    text-shadow: 0 0 10px rgba(200, 150, 255, 0.5);
}

.instructions p {
    font-family: 'VT323', monospace;
    font-size: 22px;
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.85);
}

/* Responsive */
@media (max-width: 900px) {
    .stars {
        width: 250px;
        opacity: 0.6;
    }
}

@media (max-width: 600px) {
    .stars {
        width: 180px;
        opacity: 0.4;
    }
    
    .game {
        width: 260px;
        height: 180px;
    }
    
    .game-title {
        font-size: 40px;
    }
    
    .game-screen {
        height: 350px;
    }
    
    .instructions {
        padding: 20px;
        margin: 30px 15px;
    }
}
