@-webkit-keyframes animLand {
   0% { background-position: 0px 0px; }
   100% { background-position: -700px 0px; }
}
@-moz-keyframes animLand {
   0% { background-position: 0px 0px; }
   100% { background-position: -700px 0px; }
}
@-o-keyframes animLand {
   0% { background-position: 0px 0px; }
   100% { background-position: -700px 0px; }
}
@keyframes animLand {
   0% { background-position: 0px 0px; }
   100% { background-position: -700px 0px; }
}

@-webkit-keyframes animSky {
   0% { background-position: 0px 100%; }
   100% { background-position: -788px 100%; }
}
@-moz-keyframes animSky {
   0% { background-position: 0px 100%; }
   100% { background-position: -788px 100%; }
}
@-o-keyframes animSky {
   0% { background-position: 0px 100%; }
   100% { background-position: -788px 100%; }
}
@keyframes animSky {
   0% { background-position: 0px 100%; }
   100% { background-position: -788px 100%; }
}

@-webkit-keyframes animBird {
   0% { transform: none; }
   100% { transform: none; }
}
@-moz-keyframes animBird {
   0% { transform: none; }
   100% { transform: none; }
}
@-o-keyframes animBird {
   0% { transform: none; }
   100% { transform: none; }
}
@keyframes animBird {
   0% { transform: none; }
   100% { transform: none; }
}

@-webkit-keyframes animPipe {
   0% { transform: translateX(1550px); }
   100% { transform: translateX(-100px); }
}
@-moz-keyframes animPipe {
   0% { transform: translateX(1550px); }
   100% { transform: translateX(-100px); }
}
@-o-keyframes animPipe {
   0% { transform: translateX(1550px); }
   100% { transform: translateX(-100px); }
}
@keyframes animPipe {
   0% { transform: translateX(1550px); }
   100% { transform: translateX(-100px); }
}

@-webkit-keyframes animCeiling {
   0% { background-position: 0px 0px; }
   100% { background-position: -63px 0px; }
}
@-moz-keyframes animCeiling {
   0% { background-position: 0px 0px; }
   100% { background-position: -63px 0px; }
}
@-o-keyframes animCeiling {
   0% { background-position: 0px 0px; }
   100% { background-position: -63px 0px; }
}
@keyframes animCeiling {
   0% { background-position: 0px 0px; }
   100% { background-position: -63px 0px; }
}

/* Bird flap animation - ALL frames are in the SECOND ROW of the sprite */
@-webkit-keyframes birdFlap {
  0% { background-position: -46px -69px; }
  33.33% { background-position: -138px -69px; }
  66.66% { background-position: -230px -69px; }
  100% { background-position: -322px -69px; }
}

@keyframes birdFlap {
  0% { background-position: -46px -69px; }
  33.33% { background-position: -138px -69px; }
  66.66% { background-position: -230px -69px; }
  100% { background-position: -322px -69px; }
}

/* Simplified bird hover animation */
@-webkit-keyframes birdHover {
  0% { -webkit-transform: translateY(0px) scaleX(-1); transform: translateY(0px) scaleX(-1); }
  50% { -webkit-transform: translateY(3px) scaleX(-1); transform: translateY(3px) scaleX(-1); }
  100% { -webkit-transform: translateY(0px) scaleX(-1); transform: translateY(0px) scaleX(-1); }
}

@keyframes birdHover {
  0% { transform: translateY(0px) scaleX(-1); }
  50% { transform: translateY(3px) scaleX(-1); }
  100% { transform: translateY(0px) scaleX(-1); }
}

*,
*:before,
*:after
{
   /* border box */
   -moz-box-sizing: border-box;
   -webkit-box-sizing: border-box;
   box-sizing: border-box;
   /* gpu acceleration */
   -webkit-transition: translate3d(0,0,0);
   /* select disable */
   -webkit-touch-callout: none;
   -webkit-user-select: none;
   -khtml-user-select: none;
   -moz-user-select: none;
   -ms-user-select: none;
   user-select: none;
}

#gamecontainer
{
   touch-action: manipulation;
   position: relative;
   width: 100%;
   height: 100%;
   min-height: 525px;
   overflow: hidden;
}
 

/*
Screen - Game
*/
#gamescreen
{
   position: relative;
   width: 100%;
   height: 100%;
}

#sky
{
   position: absolute;
   top: 0;
   width: 100%;
   height: 83%;
   background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(26, 31, 58, 0.6)),url('../assets/sky.png');
   background-repeat: repeat-x;
   background-position: 0px 100%;
   background-color: #1a1f3a;
   will-change: background-position;
   box-shadow: inset 0 -10px 30px rgba(100, 200, 230, 0.3);

   -webkit-animation: animSky 7s linear infinite;
   animation: animSky 7s linear infinite;
}

#flyarea
{
   position: absolute;
   bottom: 0;
   height: 420px;
   width: 100%;
   top: 16px;
}

#ceiling
{
   position: absolute;
   top: 0px;
   height: 16px;
   width: 100%;
   background: linear-gradient(to right, 
      #1a1f3a,
      #2d325c 8px,
      #1a1f3a 8px,
      #2d325c 16px
   );
   background-repeat: repeat-x;
   will-change: background-position;
   border-bottom: 1px solid #64c8e6;
   box-shadow: 0 0 8px #64c8e6, inset 0 0 10px rgba(30, 64, 144, 0.4);
   z-index: 10;

   -webkit-animation: animCeiling 481ms linear infinite;
   animation: animCeiling 481ms linear infinite;
}

#land
{
   border-top: 2px solid #64c8e6;
   position: absolute;
   bottom: 0;
   width: 100%;
   height: 17%;
   background-image: linear-gradient(rgba(26, 31, 58, 0.8), rgba(45, 50, 92, 0.9)), url('../assets/land.png');
   background-repeat: repeat-x;
   background-position: 0px 0px;
   background-color: #1a1f3a;
   will-change: background-position;
   box-shadow: 0 0 15px #64c8e6, inset 0 5px 10px rgba(30, 64, 144, 0.4);

   -webkit-animation: animLand 3s linear infinite;
   animation: animLand 3s linear infinite;
}

#bigscore
{
   position: absolute;
   top: 20px;
   left: 25px;
   z-index: 100;
}

#bigscore img
{
   display: inline-block;
   padding: 1px;
}

#splash, #scoreboard {
   position: absolute;
   z-index: 2;
   text-align: center;
   border: 2px solid #64c8e6;
   border-radius: 5px;
   background: linear-gradient(145deg, rgba(26, 31, 58, 0.9), rgba(20, 24, 45, 0.95));
   box-shadow: 0 0 20px rgba(100, 200, 230, 0.5), inset 0 0 30px rgba(30, 64, 144, 0.4);
   overflow: hidden;
   animation: borderGlow 3s infinite alternate;
}

@keyframes borderGlow {
   0% { box-shadow: 0 0 15px rgba(100, 200, 230, 0.4), inset 0 0 30px rgba(30, 64, 144, 0.4); border-color: #64c8e6; }
   100% { box-shadow: 0 0 25px rgba(100, 200, 230, 0.7), inset 0 0 40px rgba(30, 64, 144, 0.6); border-color: #8ee6ff; }
}

#splash {
   padding: 20px;
   transform: translateX(-50%) translateY(-50%);
   opacity: 0;
   top: 58%;
   left: 50%;
   width: 75%;
   height: 98%;
}

#scoreboard {
   display: none;
   opacity: 0;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: 280px;
   height: 170px;
   z-index: 1000;
}

/* Enhanced grid pattern for UI backgrounds */
#splash::before, #scoreboard::before {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-image: 
     linear-gradient(to bottom, transparent, transparent 4px, rgba(100, 200, 230, 0.15) 4px, transparent 6px),
     linear-gradient(to right, transparent, transparent 8px, rgba(100, 200, 230, 0.1) 8px, transparent 10px);
   background-size: 16px 16px, 24px 24px;
   background-position: center;
   opacity: 0.4;
   z-index: -1;
   pointer-events: none;
   animation: gridPulse 8s infinite alternate;
}

@keyframes gridPulse {
   0% { opacity: 0.3; }
   50% { opacity: 0.4; }
   100% { opacity: 0.5; }
}

/* Add cyberpunk corner accents to splash and scoreboard */
#splash::after, #scoreboard::after {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-image: 
     linear-gradient(135deg, #64c8e6 0%, transparent 2.5%),
     linear-gradient(225deg, #64c8e6 0%, transparent 2.5%),
     linear-gradient(315deg, #64c8e6 0%, transparent 2.5%),
     linear-gradient(45deg, #64c8e6 0%, transparent 2.5%);
   background-size: 100% 100%;
   background-repeat: no-repeat;
   background-position: top left, top right, bottom right, bottom left;
   pointer-events: none;
   z-index: 2;
}

/* Style for splash screen content with enhanced typography */
#splash h2 {
   margin-top: 10px;
   margin-bottom: 20px;
   font-family: 'Silkscreen', sans-serif;
   color: white;
   text-shadow: 0 0 8px #64c8e6;
   letter-spacing: 1px;
   animation: titlePulse 4s infinite alternate;
}

@keyframes titlePulse {
   0% { text-shadow: 0 0 8px #64c8e6; }
   100% { text-shadow: 0 0 15px #8ee6ff; }
}

#splash h3 {
   margin-bottom: 20px;
   font-family: 'Silkscreen', sans-serif;
   color: #a0dfff;
   letter-spacing: 0.5px;
}

#splash ul {
   text-align: left;
   margin-left: 20px;
   margin-bottom: 20px;
   font-family: 'Silkscreen', sans-serif;
   color: #a0dfff;
}

#splash li {
   margin-bottom: 10px;
   position: relative;
}

#splash li::before {
   content: ">";
   position: absolute;
   left: -15px;
   color: #64c8e6;
   animation: blinkCursor 1.5s infinite;
}

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

/* Enhanced button styling */
#splash p, #replay {
   color: #64c8e6;
   font-family: 'Silkscreen', sans-serif;
   border: 1px solid #64c8e6;
   background-color: rgba(26, 31, 58, 0.7);
   cursor: pointer;
   text-shadow: 0 0 5px #64c8e6;
   box-shadow: 0 0 10px rgba(100, 200, 230, 0.5);
   transition: all 0.3s ease;
   position: relative;
   overflow: hidden;
}

#splash p {
   padding: 10px 25px;
   border-radius: 30px;
   display: inline-block;
   margin-top: 20px;
}

#splash p::after, #replay::after {
   content: "";
   position: absolute;
   top: -50%;
   left: -50%;
   width: 200%;
   height: 200%;
   background: rgba(100, 200, 230, 0.1);
   transform: rotate(30deg);
   animation: sheen 6s infinite;
}

@keyframes sheen {
   0%, 100% { transform: rotate(30deg) translateX(-100%); }
   50% { transform: rotate(30deg) translateX(100%); }
}

#splash p:hover, #replay:hover {
   background-color: rgba(30, 64, 144, 0.7);
   box-shadow: 0 0 20px rgba(100, 200, 230, 0.8);
   transform: scale(1.05);
   border-color: #8ee6ff;
}

/* Enhanced scoreboard elements */
#medal {
   position: absolute;
   opacity: 0;
   top: 62px;
   left: 32px;
   width: 44px;
   height: 44px;
   filter: drop-shadow(0 0 7px rgba(100, 200, 230, 0.7));
   animation: medalPulse 3s infinite alternate;
}

@keyframes medalPulse {
   0% { filter: drop-shadow(0 0 5px rgba(100, 200, 230, 0.5)); }
   100% { filter: drop-shadow(0 0 10px rgba(100, 200, 230, 0.8)); }
}

#currentscore, #highscore {
   position: absolute;
   padding: 20px;
   width: 100%;
   height: 14px;
   text-align: left;
   color: white;
   font-size: 22px;
   font-family: Silkscreen, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
   text-shadow: 0 0 8px #64c8e6;
}

#currentscore {
   top: 10px;
   left: 0%;
}

#highscore {
   top: 60px;
   left: 0%;
}

/* Add subtle label animations */
#currentscore::before, #highscore::before {
   position: absolute;
   left: 20px;
   font-size: 14px;
   opacity: 0.8;
   animation: labelPulse 4s infinite alternate;
}

#currentscore::before {
   content: "SCORE";
   top: 5px;
}

#highscore::before {
   content: "BEST";
   top: 5px;
}

@keyframes labelPulse {
   0% { opacity: 0.6; }
   100% { opacity: 0.9; }
}

#currentscore img, #highscore img {
   padding-left: 2px;
   filter: drop-shadow(0 0 3px rgba(100, 200, 230, 0.7));
   vertical-align: middle;
}

#replay {
   background-position: center;
   background-size: contain;
   position: absolute;
   opacity: 0;
   top: 115px;
   left: 50%;
   transform: translateX(-50%);
   height: 38px;
   width: 110px;
   background-image: url(../assets/replay.png);
   background-repeat: no-repeat;
   border-radius: 5px;
}

#replay:hover {
   transform: translateX(-50%) scale(1.05);
}

.boundingbox
{
   position: absolute;
   display: none;
   top: 0;
   left: 0;
   width: 0;
   height: 0;
   border: 1px solid red;
}

#player
{
   position: absolute;
   left: 60px;
   top: 200px;
   width: 46px;
   height: 46px;
   background-image: url('../assets/BirdSprite.png');
   background-repeat: no-repeat;
   background-size: 400px 150px;
   background-position: -150px -58px;
   z-index: 100;
   display: block;
   animation: simpleBirdFlap 0.4s steps(1) infinite;
   -webkit-animation: simpleBirdFlap 0.4s steps(1) infinite;
}

/* Adjusted background positions for new sizing */
@keyframes simpleBirdFlap {
  0%, 100% { background-position: -150px -58px; }
  33% { background-position: -250px -58px; }
  66% { background-position: -350px -58px; }
}

@-webkit-keyframes simpleBirdFlap {
  0%, 100% { background-position: -150px -58px; }
  33% { background-position: -250px -58px; }
  66% { background-position: -350px -58px; }
}

/* Make sure any bird-related classes are completely hidden */
.bird, .bird-wing-left, .bird-wing-right {
   display: none !important;
   visibility: hidden !important;
   opacity: 0 !important;
   width: 0 !important;
   height: 0 !important;
   overflow: hidden !important;
   position: absolute !important;
   left: -9999px !important;
}

.pipe
{
   position: absolute;
   left: -100px;
   width: 52px;
   height: 100%;
   z-index: 10;
   will-change: transform;
   transform: translateX(0);

   -webkit-animation: animPipe 5500ms linear;
   animation: animPipe 5500ms linear;
}

.pipe_upper
{
   padding-left: 0px;
   padding-right: 0px;
   padding-bottom: 10px;
   padding-top: 10px;
   position: absolute;
   top: 16px;
   width: 52px;
   background: linear-gradient(to bottom, #1a1f3a, #2d325c);
   border: 2px solid #64c8e6;
   border-top: none;
   box-shadow: 0 0 8px #64c8e6, inset 0 0 20px rgba(30, 64, 144, 0.4);
   border-radius: 0 0 3px 3px;
   overflow: hidden;
}

/* Ceiling connector */
.pipe_upper:before {
   content: "";
   position: absolute;
   top: -16px; /* Connect to ceiling */
   left: 0;
   right: 0;
   height: 16px;
   background: linear-gradient(to bottom, #1a1f3a, #2d325c);
   border-left: 2px solid #64c8e6;
   border-right: 2px solid #64c8e6;
   box-shadow: 0 0 8px #64c8e6, inset 0 0 20px rgba(30, 64, 144, 0.4);
   z-index: 1;
}

/* Ethereum logo for upper pipe */
.pipe_upper::after {
   content: "";
   position: absolute;
   width: 32px;
   height: 32px;
   bottom: 15px;
   left: 50%;
   transform: translateX(-50%);
   background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M311.9 260.8L160 353.6 8 260.8 160 0l151.9 260.8zM160 383.4L8 290.6 160 512l152-221.4-152 92.8z" fill="%23ff3333"/></svg>');
   background-repeat: no-repeat;
   background-position: center;
   background-size: contain;
   opacity: 0.8;
   z-index: 2;
}

/* Grid pattern for upper pipe */
.pipe_upper .pipe-texture {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-image: 
     linear-gradient(to bottom, transparent, transparent 4px, rgba(100, 200, 230, 0.3) 4px, transparent 6px),
     linear-gradient(to right, transparent, transparent 8px, rgba(100, 200, 230, 0.2) 8px, transparent 10px);
   background-size: 16px 16px, 24px 24px;
   background-position: center;
   opacity: 0.4;
   z-index: 1;
   pointer-events: none;
}

.pipe_lower
{
   padding: 10px 0px 10px 0px;
   position: absolute;
   bottom: 0;
   width: 52px;
   background: linear-gradient(to top, #1a1f3a, #2d325c);
   border: 2px solid #64c8e6;
   border-bottom: none;
   box-shadow: 0 0 8px #64c8e6, inset 0 0 20px rgba(30, 64, 144, 0.4);
   border-radius: 3px 3px 0 0;
   overflow: hidden;
}

/* Grid pattern for lower pipe */
.pipe_lower::before {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-image: 
     linear-gradient(to top, transparent, transparent 4px, rgba(100, 200, 230, 0.3) 4px, transparent 6px),
     linear-gradient(to right, transparent, transparent 8px, rgba(100, 200, 230, 0.2) 8px, transparent 10px);
   background-size: 16px 16px, 24px 24px;
   background-position: center;
   opacity: 0.4;
   z-index: 1;
}

/* Ethereum logo for lower pipe */
.pipe_lower::after {
   content: "";
   position: absolute;
   width: 32px;
   height: 32px;
   top: 15px;
   left: 50%;
   transform: translateX(-50%);
   background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M311.9 260.8L160 353.6 8 260.8 160 0l151.9 260.8zM160 383.4L8 290.6 160 512l152-221.4-152 92.8z" fill="%23ff3333"/></svg>');
   background-repeat: no-repeat;
   background-position: center;
   background-size: contain;
   opacity: 0.8;
   z-index: 2;
}

/* Style for passed pipes with green ETH logo */
.pipe-passed .pipe_upper::after,
.pipe-passed .pipe_lower::after {
   background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M311.9 260.8L160 353.6 8 260.8 160 0l151.9 260.8zM160 383.4L8 290.6 160 512l152-221.4-152 92.8z" fill="%2333ff33"/></svg>');
}

@keyframes glow {
   to {
    text-shadow: 0 0 4px #fff, 0 0 12px #d25ed4, 0 0 20px #d25ed4, 0 0 28px #d25ed4;
   }
 }

.fud_text {
   display: none;
}

#footer
{
   position: absolute;
   bottom: 3px;
   left: 3px;
}

#footer a,
#footer a:link,
#footer a:visited,
#footer a:hover,
#footer a:active
{
   display: block;
   padding: 2px;
   text-decoration: none;
   color: #fff;
}

@keyframes ledBlink {
   0%, 100% { opacity: 0.4; }
   50% { opacity: 1; }
}

/* Enhanced FUD headline appearance animation */
.sudden-fud-text {
  position: absolute;
  z-index: 1000;
  font-family: 'Silkscreen', sans-serif;
  font-weight: bold;
  color: #ff3333;
  text-shadow: 0 0 10px rgba(255,50,50,0.9);
  transform: translateZ(0) scale(0.5);
  opacity: 0;
  padding: 10px 15px;
  border-radius: 2px;
  background-color: rgba(20, 20, 30, 0.95);
  border: 2px solid #ff3333;
  border-left: 8px solid #ff3333;
  box-shadow: 0 0 20px rgba(255, 50, 50, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
  white-space: normal;
  word-wrap: break-word;
  pointer-events: none;
  letter-spacing: 0.5px;
  line-height: 1.3;
  text-transform: uppercase;
  min-width: 150px;
  max-width: 250px;
  text-align: left;
  /* Hardware acceleration */
  will-change: transform, opacity;
  backface-visibility: hidden;
  perspective: 1000px;
  overflow: hidden;
}

/* Add warning icon before text */
.sudden-fud-text::before {
  content: "ALERT:";
  display: block;
  color: #ffdd33;
  margin-bottom: 3px;
  font-size: 0.9em;
}

/* Add breaking news top bar */
.sudden-fud-text::after {
  content: "BREAKING NEWS";
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  background-color: #ff3333;
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  text-align: center;
}

.fud-animation {
  animation: fudAppear 3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  -webkit-animation: fudAppear 3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* More dramatic animation with shake effect */
@keyframes fudAppear {
  0% { opacity: 0; transform: translateZ(0) scale(0.5) translateY(-50px); }
  5% { opacity: 0.9; transform: translateZ(0) scale(1.1) translateY(0); }
  10% { transform: translateZ(0) scale(1.1) translateX(-5px); }
  15% { transform: translateZ(0) scale(1.1) translateX(5px); }
  20% { transform: translateZ(0) scale(1.1) translateX(-3px); }
  25% { transform: translateZ(0) scale(1.1) translateX(3px); }
  30% { transform: translateZ(0) scale(1.1) translateX(0); }
  
  /* Flash effect for urgency */
  40% { opacity: 0.9; background-color: rgba(30, 30, 40, 0.9); border-color: #ff5555; }
  45% { opacity: 1; background-color: rgba(50, 30, 30, 0.9); border-color: #ff3333; }
  50% { opacity: 0.9; background-color: rgba(30, 30, 40, 0.9); border-color: #ff5555; }
  55% { opacity: 1; background-color: rgba(50, 30, 30, 0.9); border-color: #ff3333; }
  
  85% { opacity: 1; transform: translateZ(0) scale(1.1); }
  100% { opacity: 0; transform: translateZ(0) scale(1.5); }
}

@-webkit-keyframes fudAppear {
  0% { opacity: 0; transform: translateZ(0) scale(0.5) translateY(-50px); }
  5% { opacity: 0.9; transform: translateZ(0) scale(1.1) translateY(0); }
  10% { transform: translateZ(0) scale(1.1) translateX(-5px); }
  15% { transform: translateZ(0) scale(1.1) translateX(5px); }
  20% { transform: translateZ(0) scale(1.1) translateX(-3px); }
  25% { transform: translateZ(0) scale(1.1) translateX(3px); }
  30% { transform: translateZ(0) scale(1.1) translateX(0); }
  
  40% { opacity: 0.9; background-color: rgba(30, 30, 40, 0.9); border-color: #ff5555; }
  45% { opacity: 1; background-color: rgba(50, 30, 30, 0.9); border-color: #ff3333; }
  50% { opacity: 0.9; background-color: rgba(30, 30, 40, 0.9); border-color: #ff5555; }
  55% { opacity: 1; background-color: rgba(50, 30, 30, 0.9); border-color: #ff3333; }
  
  85% { opacity: 1; transform: translateZ(0) scale(1.1); }
  100% { opacity: 0; transform: translateZ(0) scale(1.5); }
}