/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --deep-black: #0a0a0a;
    --soft-black: #151515;
    --dark-gray: #222222;
    --mid-gray: #333333;
    --light-gray: #aaaaaa;
    --accent-red: #ff1a1a;
    --dim-red: rgba(255, 26, 26, 0.1);
    --text-shadow: 0 0 5px rgba(255, 26, 26, 0.5);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--soft-black);
    overflow: hidden;
    position: fixed;
}

#side-menu {
    color: #000000;
    width: 180px;
    height: 100vh;
    flex-shrink: 0;
    padding: 15px;
    background: var(--soft-black);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#version-text {
    position: fixed;
    bottom: 10px;
    left: 0;
    width: 220px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--light-gray);
    text-align: center;
}

 
.level-transition {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff1a1a;
    padding: 20px;
    border-radius: 10px;
    color: #ffffff;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
}

.level-transition h2 {
    color: #ff1a1a;
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 26, 26, 0.5);
}

.level-transition p {
    font-size: 16px;
    margin-bottom: 10px;
    color: #ffffff;
}

.level-stats {
    margin-top: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.level-stats p {
    font-size: 14px;
    color: #00ff00;
    margin: 5px 0;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

.instruction-canvas {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin: 10px 0;
    width: 100%;
    height: 100px;
    font-size: 14px;
}

.instructions-section p {
    margin: 0;
    white-space: pre-line;
    line-height: 1.8;
    font-size: 14px;
    color: #cccccc;
}

#instructions-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    max-height: 80vh;
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 3px solid rgba(139, 0, 0, 0.7);
    border-radius: 15px;
    padding: 20px;
    color: var(--light-gray);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(50, 0, 0, 0.4);
    z-index: 1000;
    overflow-y: auto;
    font-size: 14px;
}

.instructions-content {
    font-family: 'ariel', monospace;
    padding-right: 5px;
    margin-bottom: 2px;
}

.instructions-content h2 {
    font-size: 18px;
    color: var(--bright-red);
    text-shadow: 0 0 15px var(--bright-red);
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
}

.instructions-section {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(34, 34, 34, 0.8);
    border: 1px solid rgba(139, 0, 0, 0.7);
    border-radius: 8px;
}

.instructions-section h3 {
    color: #ff4c4c;
    font-size: 16px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 76, 76, 0.4);
}

.instruction-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1px;
}

/* Scrollbar styling */
#instructions-popup::-webkit-scrollbar {
    width: 8px;
}

#instructions-popup::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#instructions-popup::-webkit-scrollbar-thumb {
    background: #ff4c4c;
    border-radius: 4px;
}

#instructions-popup::-webkit-scrollbar-thumb:hover {
    background: #ff6666;
}

.item-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 12px;
}

.item-preview svg {
    flex-shrink: 0;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 8px;
    margin: 10px 0;
    justify-content: center;
}

.controls-grid div {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.warning {
    color: #ff4c4c;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #ff4c4c;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
}

/* Animation for power-ups */
.item-preview svg {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#right-section {
    color: #ffffff;
    width: 300px;
    height: 100vh;
    flex-shrink: 0;
    padding: 15px;
    background: var(--soft-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Game Frame */
.game-frame {
    background: var(--soft-black);
    position: relative;
    width: 500px;
    height: 500px;
    top: 0;
}

#game-section {
    flex: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: var(--soft-black);
    position: relative;
    padding-top: 20px;
}

canvas {
    display: block;
    background-image: url("12.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
}

.logo-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

#menu-logo {
    width: 150px;
    margin-top: 4px;
    margin-bottom: 4px;
    object-fit: contain;
    cursor: pointer;
}

button {
    width: 90%;
    padding: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    background: var(--dark-gray);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 5px 0;
    flex-shrink: 0;
}

button:hover {
    background: var(--accent-red);
    color: var(--deep-black);
}

.profile-picture-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-image-frame {
    width: 100px;
    height: 100px;
    border: 2px solid var(--accent-red);
    border-radius: 50%;
    overflow: hidden;
    background: var(--dark-gray);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

#profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pic-button {
    width: 80%;
    padding: 5px;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    background: var(--dark-gray);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-pic-button:hover {
    background: var(--accent-red);
    color: var(--dark-gray);
}

#leaderboard-popup {
    font-size: 24px;
    color: var(--accent-red);
    font-family: 'Press Start 2P', monospace;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ff0000;
    padding: 20px;
    z-index: 1000;
    overflow: hidden;
    border-radius: 10px;
}

#close-leaderboard {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #ff0000;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#close-leaderboard:hover {
    transform: scale(1.2);
}

.leaderboard-content {
    text-align: center;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 50px 1fr 100px 80px;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    box-sizing: border-box;
}

.leaderboard-entry:last-child {
    border-bottom: none;
    text-align: center;
}

.leaderboard-entry .rank {
    color: #ff0000;
    text-align: center;
}

.leaderboard-entry .wallet {
    color: #ffffff;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-entry .score {
    color: #00ff00;
    text-align: center;
}

.leaderboard-entry .level {
    color: #ffff00;
    text-align: center;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-header {
    text-align: center;
    display: grid;
    grid-template-columns: 20px 1fr 80px 60px;
    padding: 4px;
    border-bottom: 2px solid #ff0000;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #ff1a1a;
    margin-bottom: 10px;
    margin-top: 10px;
}

.leaderboard-header span {
    text-align: center;
}

/* Scrollbar Styling */
.leaderboard-content::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.8);
}

.leaderboard-content::-webkit-scrollbar-thumb {
    background: #ff0000;
    border-radius: 4px;
}

.leaderboard-content::-webkit-scrollbar-thumb:hover {
    background: #ff5555;
}

.leaderboard-content::-webkit-scrollbar {
    height: 8px;
}

.leaderboard-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.8);
}

.leaderboard-content::-webkit-scrollbar-thumb {
    background: #ff0000;
    border-radius: 4px;
}

.leaderboard-content::-webkit-scrollbar-thumb:hover {
    background: #ff5555;
}

..scanline {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 2px;
   background: rgba(255, 0, 0, 0.1);
   animation: scan 6s linear infinite;
}

@keyframes scan {
   0% {
       top: 0;
   }

   100% {
       top: 100%;
   }
}
.profile-item.bonus-nft {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    animation: bonusPulse 2s infinite;
}

.profile-item.bonus-nft .bonus-value {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

@keyframes bonusPulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
    }
}
.profile-container {
   width: 100%;
   margin: 6px 0;
   background: rgba(0, 0, 0, 0.9);
   border: 1px solid var(--accent-red);
   padding: 15px;
   position: relative;
   box-shadow: 0 0 20px rgba(255, 0, 0, 0.3), inset 0 0 10px rgba(255, 0, 0, 0.4);
   animation: profilePulse 2.5s infinite ease-in-out;
}

.profile-header h3 {
   color: var(--accent-red);
   font-family: 'Press Start 2P', monospace;
   font-size: 14px;
   text-align: center;
   margin-bottom: 20px;
   padding-bottom: 12px;
   text-transform: uppercase;
   border-bottom: 2px solid rgba(255, 0, 0, 0.4);
   text-shadow: 0 0 7px rgba(255, 0, 0, 0.6);
   position: relative;
}

.profile-header h3::after {
   content: '';
   position: absolute;
   bottom: -3px;
   left: 50%;
   transform: translateX(-50%);
   width: 60%;
   height: 3px;
   background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

.profile-item {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 10px;
   margin: 8px 0;
   background: rgba(255, 0, 0, 0.07);
   border: 1px solid rgba(255, 0, 0, 0.25);
   border-radius: 4px;
   transition: all 0.3s ease;
   box-shadow: 0 0 5px rgba(255, 0, 0, 0.2);
}

.profile-item:hover {
   background: rgba(255, 0, 0, 0.15);
   border-color: rgba(255, 0, 0, 0.4);
   transform: translateX(8px);
   box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.profile-item .label {
   font-family: 'Press Start 2P', monospace;
   font-size: 11px;
   color: var(--light-gray);
   text-transform: uppercase;
   text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}

.profile-item .value {
   font-family: 'Press Start 2P', monospace;
   font-size: 12px;
   color: var(--accent-green);
   text-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

.profile-item .high-score {
   color: var(--accent-blue);
   text-shadow: 0 0 7px rgba(0, 204, 255, 0.6);
   animation: scoreGlow 1.8s infinite alternate;
}

@keyframes profilePulse {
   0% {
       box-shadow: 0 0 15px rgba(255, 0, 0, 0.3), inset 0 0 8px rgba(255, 0, 0, 0.4);
   }

   50% {
       box-shadow: 0 0 25px rgba(255, 0, 0, 0.4), inset 0 0 12px rgba(255, 0, 0, 0.5);
   }

   100% {
       box-shadow: 0 0 15px rgba(255, 0, 0, 0.3), inset 0 0 8px rgba(255, 0, 0, 0.4);
   }
}

@keyframes scoreGlow {
   from {
       text-shadow: 0 0 5px rgba(0, 204, 255, 0.5);
   }

   to {
       text-shadow: 0 0 12px rgba(0, 204, 255, 0.8);
   }
}

@keyframes profilePulse {
   0% {
       box-shadow: 0 0 15px rgba(255, 0, 0, 0.2), inset 0 0 8px rgba(255, 0, 0, 0.3);
   }

   50% {
       box-shadow: 0 0 20px rgba(255, 0, 0, 0.3), inset 0 0 12px rgba(255, 0, 0, 0.4);
   }

   100% {
       box-shadow: 0 0 15px rgba(255, 0, 0, 0.2), inset 0 0 8px rgba(255, 0, 0, 0.3);
   }
}

@keyframes scoreGlow {
   from {
       text-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
   }

   to {
       text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
   }
}

#plays-left {
    font-family: 'ariel', monospace;
    font-size: 12px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.9);
  
    text-align: left;
v}

.nft-benefits {
   background: rgba(0, 0, 0, 0.8);
   border: 1px solid var(--accent-red);
   border-radius: 4px;
   padding: 15px;
   margin: 10px 0;
   font-family: 'Press Start 2P', monospace;
   font-size: 12px;
}

.nft-benefits h3 {
   color: var(--accent-red);
   margin-bottom: 10px;
   font-size: 12px;
}

.nft-benefits p {
   color: var(--light-gray);
   margin: 5px 0;
   font-size: 10px;
}

.nfts-container {
  width: 100%;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
  background: var(--deep-black);
  border: 1px solid var(--accent-red);
  border-radius: 4px;
  position: relative;
}

.nft-item {
  background: var(--dark-gray);
  border: 1px solid var(--mid-gray);
  padding: 2px;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.nft-item:hover {
  border-color: var(--accent-red);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(255, 0, 0, 0.2);
}

.nft-image-container {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--mid-gray);
  overflow: hidden;
  position: relative;
}

.nft-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nft-counter {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: var(--accent-red);
  font-size: 7px;
  padding: 1px 2px;
  font-family: 'Press Start 2P', monospace;
}

/* Tooltip styles for NFT details */
.nft-item {
  position: relative;  /* Ensure relative positioning */
}

.nft-tooltip {
  display: none;
  position: fixed;  /* Changed to fixed positioning */
  background: rgba(0, 0, 0, 0.95);
  color: var(--accent-red);
  font-size: 8px;
  padding: 4px 6px;
  border-radius: 2px;
  white-space: nowrap;
  z-index: 1000;  /* Increased z-index */
  font-family: 'Press Start 2P', monospace;
  border: 1px solid var(--accent-red);
  pointer-events: none;  /* Prevent tooltip from interfering with hover */
  box-shadow: 0 2px 4px rgba(255, 0, 0, 0.3);
}

/* Scrollbar styles */
.nfts-container::-webkit-scrollbar {
  width: 2px;
}

.nfts-container::-webkit-scrollbar-track {
  background: var(--deep-black);
}

.nfts-container::-webkit-scrollbar-thumb {
  background: var(--accent-red);
}

/* Hide full info and show on hover */
.nft-info {
  display: none;
}
.splash-screen {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: var(--deep-black);
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center;
   z-index: 1000;
   transition: opacity 0.5s ease-out;
}

.splash-screen::before {
   content: '';
   position: absolute;
   width: 100%;
   height: 100%;
   background: repeating-linear-gradient( 0deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px );
   animation: scanline 10s linear infinite;
   pointer-events: none;
}

.splash-screen.fade-out {
   opacity: 0;
   pointer-events: none;
}

.splash-logo {
   width: 200px;
   height: auto;
   margin-bottom: 20px;
   animation: logoFloat 3s ease-in-out infinite;
   filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5));
}

.press-start-text {
   font-family: 'Press Start 2P', monospace;
   font-size: 16px;
   color: var(--accent-red);
   text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
   animation: pulseText 2s ease-in-out infinite;
   position: relative;
}

.press-start-text::after {
   content: '';
   position: absolute;
   bottom: -10px;
   left: 0;
   width: 100%;
   height: 2px;
   background: var(--accent-red);
   transform-origin: center;
   animation: lineWidth 2s ease-in-out infinite;
}

@keyframes scanline {
   0% {
       transform: translateY(0);
   }

   100% {
       transform: translateY(100%);
   }
}

@keyframes logoFloat {
   0%, 100% {
       transform: translateY(0);
   }

   50% {
       transform: translateY(-15px);
   }
}

@keyframes pulseText {
   0%, 100% {
       opacity: 1;
       transform: scale(1);
   }

   50% {
       opacity: 0.7;
       transform: scale(1.05);
   }
}

@keyframes lineWidth {
   0%, 100% {
       transform: scaleX(1);
       opacity: 1;
   }

   50% {
       transform: scaleX(0.5);
       opacity: 0.5;
   }
}

.splash-screen:hover .press-start-text {
   animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}

@keyframes glitch {
   0% {
       transform: translate(0);
   }

   20% {
       transform: translate(-2px, 2px);
   }

   40% {
       transform: translate(-2px, -2px);
   }

   60% {
       transform: translate(2px, 2px);
   }

   80% {
       transform: translate(2px, -2px);
   }

   100% {
       transform: translate(0);
   }
}

#countdown-overlay {
   position: fixed;
   top: 45%;
   left: 45%;
   transform: translate(-50%, -50%);
   width: 500px;
   height: 500px;
   display: flex;
   justify-content: center;
   align-items: center;
   z-index: 1000;
   background: var(--soft-black);
}

#countdown-number {
   font-family: 'Press Start 2P', monospace;
   font-size: 72px;
   color: #ff1a1a;
   text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
   margin-bottom: 20px;
}

#countdown-text {
   font-family: 'Press Start 2P', monospace;
   font-size: 18px;
   color: #ffffff;
   text-transform: uppercase;
   letter-spacing: 2px;
   text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.hidden {
   display: none !important;
}
