@font-face {
  font-family: "determination";
  src: url("fonts/determination.ttf") format("truetype");
}

@font-face {
  font-family: "04B_30_";
  src: url("fonts/04B_30__.TTF") format("truetype");
}

@font-face {
  font-family: "Daydream";
  src: url("fonts/Daydream DEMO.otf") format("opentype");
}

/*========= GLOBAL =========*/
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameShell {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  touch-action: none;
}

#gameWrap {
  position: relative;
  width: 960px;
  height: 540px;
  transform-origin: center center;
  overflow: hidden;
  touch-action: none;
}

canvas {
  width: 960px;
  height: 540px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

/*============ OVERLAYS ============*/
#gameWrap.dj-active {
  animation: djBorderGlow 0.7s linear infinite;
}

@keyframes djBorderGlow {
  0% {
    box-shadow:
      0 0 0 4px #ff4fa3,
      0 0 18px #ff4fa3;
  }

  25% {
    box-shadow:
      0 0 0 4px #4fcdf7,
      0 0 18px #4fcdf7;
  }

  50% {
    box-shadow:
      0 0 0 4px #ffe45c,
      0 0 18px #ffe45c;
  }

  75% {
    box-shadow:
      0 0 0 4px #9b5cff,
      0 0 18px #9b5cff;
  }

  100% {
    box-shadow:
      0 0 0 4px #ff4fa3,
      0 0 18px #ff4fa3;
  }
}

#gameWrap.dj-active .game-hud {
  animation: hudDjGlow 0.5s ease-in-out infinite alternate;
}

@keyframes hudDjGlow {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.25);
  }
}

#gameWrap.dj-active canvas {
  animation: beatPulse 0.45s ease-in-out infinite;
}

@keyframes beatPulse {
  0%, 100% {
    filter: brightness(1) saturate(1);
  }

  50% {
    filter: brightness(1.12) saturate(1.35);
  }
}

/*============ LAYOUT =============*/
.screen {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: "determination", sans-serif;
  z-index: 40;
}

.screen h1 {
  color: #ff4fa3;
  font-size: 48px;
  margin-bottom: 10px;
}

.title-screen{
    background:
        linear-gradient(rgba(18,10,32,.45),
                        rgba(18,10,32,.45)),
        url("assets/menu-bg.png");
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    image-rendering:pixelated;
}

.game-over-screen {
  background: rgba(18, 10, 32, 0.88);
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

.game-over-screen.show {
  opacity: 1;
  pointer-events: auto;
  animation: fadeInGameOver 0.45s ease-out forwards;
}

.game-over-logo {
  width: 420px;
  max-width: 80%;
  image-rendering: pixelated;
  animation: gameOverPop 0.45s ease-out;
}

@keyframes fadeInGameOver {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes gameOverPop {
  0% {
    transform: scale(0.65);
    opacity: 0;
  }

  75% {
    transform: scale(1.08);
    opacity: 1;
  }

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

.pause-screen h1 {
  margin-bottom: 28px;
  color: #ff4fa3;
  font-size: 52px;
}

.pause-screen .menu-btn {
  bottom: 0;
  margin: 8px 0;
}

/*========== LOGOS ===========*/
.game-logo {
  width: 700px;
  max-width: 90%;
  image-rendering: pixelated;
  margin-top: 40px;
  margin-bottom: 0px;
  animation: floatTitle 3s ease-in-out infinite;
}

@keyframes floatTitle {
  0% {
    transform: translateY(0);
  }

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

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

.game-over-logo {
  width: 700px;
  max-width:900%;
  image-rendering: pixelated;
  margin-top: 40px;
  margin-bottom: 0px;
  animation: gameOverPop 0.4s ease-out;
  animation: floatTitle 3s ease-in-out infinite;
}

@keyframes gameOverPop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }

  70% {
    transform: scale(1.08);
    opacity: 1;
  }

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

/*============ TEXT ===========*/
.tagline {
  font-family: "determination", sans-serif;
  font-size: 16px;
  color: white;
  margin-bottom: 60px;
}

.final-score,
.best-score {
  font-family: "determination", sans-serif;
  font-size: 28px;
  color: white;
  margin: 4px 0;
}

#playerNameInput {
  width: 260px;
  padding: 12px;
  margin-bottom: 40px ;
  font-family: "determination", sans-serif;
  font-size: 24px;
  text-align: center;
  border: 4px solid #e0d2fc;
  background: #fff7dc;
  color: #2c193c;
  z-index: 100;
}
/*========= BUTTONS ===========*/
.menu-btn {
  position: relative;
  z-index: 1;
  overflow: visible;

  width: 300px;
  height: 72px;
  bottom: 50px;

  font-family: "determination", sans-serif;
  font-size: 28px;
  color: #ffffff;

  cursor: pointer;

  background: linear-gradient(
    to bottom,
    #c1a3f7 0%,
    #7b5db4 100%
  );

  border: 3px solid #e0d2fc;

  box-shadow:
    inset 0 3px rgba(255,255,255,.3),
    inset 0 -4px rgba(80,30,30,.3),
    4px 4px 0 #2c193c,
    8px 8px 0 #2c193c;

  clip-path: polygon(
    6px 0,
    calc(100% - 6px) 0,
    100% 6px,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    6px 100%,
    0 calc(100% - 6px),
    0 6px
  );

  transition: .12s;
}

.menu-btn.disabled {
  background: #7a3cc8;
  opacity: 0.85;
}

.menu-btn::before{

content:"";

position:absolute;

left:4px;
right:4px;
top:4px;

height:12px;

background:rgba(255,255,255,.18);

pointer-events:none;

}

.menu-btn:hover{

    filter:brightness(1.05);

    transform:
        translateY(-2px);

    box-shadow:
        inset 0 3px rgba(255,255,255,.45),
        inset 0 -5px rgba(128,53,53,.30),
        8px 8px 0 #3f294e;

}

.menu-btn:active{

    transform:
        translateY(4px);

    box-shadow:
        inset 0 2px rgba(255,255,255,.15),
        inset 0 -2px rgba(128,53,53,.25),
        2px 2px 0 #3f294e;

}

.bottom-menu {
  position: absolute;
  bottom: 24px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 32px;
  box-sizing: border-box;
}

.secondary-btn{
    width: 210px;
    height: 54px;

    font-size:18px;

    padding:10px 16px;
}

.popup-btn {
  width: 80px;
  height: 40px;

  font-size: 16px;

  margin-top: 20px;
}

.pause-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 30;

  width: 42px;
  height: 42px;

  font-family: "determination", sans-serif;
  font-size: 24px;
  color: #fff7dc;

  background: linear-gradient(to bottom, #c1a3f7, #7b5db4);
  border: 3px solid #e0d2fc;
  box-shadow: 3px 3px 0 #2c193c;

  clip-path: polygon(
    6px 0,
    calc(100% - 6px) 0,
    100% 6px,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    6px 100%,
    0 calc(100% - 6px),
    0 6px
  );
}

.pause-screen {
  background: rgba(18, 10, 32, 0.88);
  z-index: 60;
}

/*============ GAME HUD ===========*/
.game-hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 8px 16px;

  font-family: "determination", sans-serif;
  font-size: 18px;
  color: #fff7dc;

  background: linear-gradient(to bottom, #c1a3f7, #7b5db4);
  border: 3px solid #e0d2fc;
  box-shadow:
    inset 0 3px rgba(255,255,255,.3),
    inset 0 -4px rgba(80,30,30,.3),
    4px 4px 0 #2c193c;

  clip-path: polygon(
    6px 0,
    calc(100% - 6px) 0,
    100% 6px,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    6px 100%,
    0 calc(100% - 6px),
    0 6px
  );
}

.hud-divider {
  width: 2px;
  height: 20px;
  background: rgba(255, 247, 220, 0.7);
}

.hud-lives img,
.hud-power img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
}

.hud-power {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-bar {
  width: 46px;
  height: 8px;
  background: #2c193c;
  border: 2px solid #fff7dc;
}

.hud-bar span {
  display: block;
  height: 100%;
  width: 100%;
}

#hudDjFill {
  background: #4fcdf7;
}

#hudMeatballFill {
  background: #fc0585;
}

/*============ ACHIEVEMENT BANNER ==========*/
.run-recap-ticker {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;

  width: 78%;
  height: 42px;
  overflow: hidden;

  background: linear-gradient(to bottom, #c1a3f7, #7b5db4);
  border: 3px solid #e0d2fc;
  color: #fff7dc;

  box-shadow:
    inset 0 3px rgba(255,255,255,.35),
    inset 0 -4px rgba(80,30,30,.3),
    4px 4px 0 #2c193c;

  clip-path: polygon(
    8px 0,
    calc(100% - 8px) 0,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0 calc(100% - 8px),
    0 8px
  );

  font-family: "determination", sans-serif;
  font-size: 18px;
  display: flex;
  align-items: center;
}

.run-recap-text {
  white-space: nowrap;
  padding-left: 120%;
  padding-right: 80px;
  animation: tickerScroll 18s linear infinite;
  text-shadow: 2px 2px 0 #2c193c;
}

@keyframes tickerScroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

/*============ POPUP PANELS ===========*/
.popup-panel {
  position: absolute;
  inset: 80px 180px;
  z-index: 200;

  background: rgba(35, 20, 55, 0.95);
  border: 4px solid #e0d2fc;
  color: white;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;

  font-family: "determination", sans-serif;
  text-align: center;
}

.popup-panel h2 {
  font-size: 44px;
  margin: 0;
  margin-bottom: 40px;
  color: #ff4ab7;
}

.popup-panel p {
  font-size: 26px;
}

/*============ HYPE =============*/
#gameWrap.hype-active {
  animation: djBorderGlow .25s linear infinite;
}

#gameWrap.hype-active canvas {
  filter: brightness(1.12) saturate(1.25);
}

/*============ LEADERBOARD ==========*/
#highscorePanel {
  inset: 45px 150px;
  justify-content: flex-start;
  padding: 22px 36px;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 300;
}

#highscorePanel h2 {
  font-size: 34px;
  margin: 0 0 14px;
}

#leaderboardList {
  width: 100%;
  margin: 0 auto 12px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 55px 1fr 110px;
  align-items: center;

  font-size: 20px;
  line-height: 1;
  padding: 5px 0;
  color: white;
}

.place {
  text-align: left;
}

.name {
  text-align: left;
  padding-left: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.score {
  text-align: right;
  color: #ffd35c;
}

.popup-btn {
  width: 120px;
  height: 38px;
  font-size: 14px;
  margin-top: 8px;
}

/*========== ROTATION ============*/
.rotate-notice {
  display: none;
}

@media (orientation: portrait) {
  #gameShell {
    display: none;
  }

  .rotate-notice {
    display: flex;
    position: fixed;
    inset: 0;
    background: #111;
    color: #e7fc26;
    font-family: "determination", sans-serif;
    font-size: 28px;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 9999;
  }
}

/*========== @MEDIA ============*/
@media (max-width: 900px) and (orientation: landscape) {
  .game-logo {
    width: 560px;
    margin-top: 20px;
  }

  .tagline {
    font-size: 14px;
    margin-bottom: 20px;
  }

  #startBtn {
    width: 250px;
    height: 58px;
    font-size: 24px;
  }

  .bottom-menu {
    bottom: 18px;
    padding: 0 46px;
  }

  .bottom-menu .menu-btn {
    width: 185px;
    height: 48px;
    font-size: 17px;
  }
}

/*========== UTILITIES ============*/
.hidden {
  display: none;
}