/* Game UI Styles - Sheep Theme */
@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap");
body {
  padding: 0;
  margin: 0;
}

::-webkit-scrollbar {
  width: 10px;
  background: transparent;
  height: 7px;
}

/* Track */
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.327);
  height: 7px;
  border-radius: 100px;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #8ec3de;
  border-radius: 100px;
}

#full-area {
  width: 100%;
  height: 100vh;
  background: #000;
  position: absolute;
  overflow: hidden;
  user-select: none;
}

#game-area {
  position: absolute;
  width: 1280px;
  height: 720px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
}

.overrideResize {
  transform: translate(-50%, -50%) scale(1) !important;
}

#background-container {
  position: absolute;
  width: 1280px;
  height: 720px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 0;
}

#bg {
  width: 100%;
  height: auto;
}

.orbit-container {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#music-notes {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: auto;
  transform-origin: center;
  animation: orbit 6s linear infinite, spin 15s linear infinite;
}

#home-section {
  width: 1280px;
  height: 720px;
  position: absolute;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#home-right {
  position: absolute;
  left: 50%;
  top: 41%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

#logo {
  height: 360px;
  justify-content: center;
  display: flex;
  animation: logoAnim 1.3s infinite;
}

@keyframes orbit {
  0% {
    transform: translate(-50%, -50%) translateX(200px) translateY(0);
  }
  25% {
    transform: translate(-50%, -50%) translateX(0) translateY(80px);
  }
  50% {
    transform: translate(-50%, -50%) translateX(-200px) translateY(0);
  }
  75% {
    transform: translate(-50%, -50%) translateX(0) translateY(-80px);
  }
  100% {
    transform: translate(-50%, -50%) translateX(200px) translateY(0);
  }
}
/* 4) Keyframes for spinning the note around its own center */
@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
#gameContainer {
  width: 1280px;
  height: 720px;
  position: absolute;
  overflow: hidden;
  margin: 0 auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
}

#renderCanvas {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
  z-index: 999;
}

/* UI Containers */
.game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  padding: 20px;
}

.holes-score__outer {
  box-sizing: border-box;
  width: 220px;
  height: 80px;
  border: 3px solid #ff4444;
  border-radius: 18px;
  background: #324753;
  opacity: 0.95;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.holes-score__header {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  border-radius: 17px;
  border: 2px solid #ffdddd;
  background: #cc2525;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.holes-score__label {
  color: #fff;
  font-size: 20px;
  font-family: "Fredoka", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  margin-top: 2px;
}

.holes-score__value {
  color: #fff;
  font-size: 42px;
  font-family: "Fredoka", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  margin-top: 22px;
}

/* Start Game Screen */
.start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 30;
  pointer-events: auto;
}

.start-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 0;
}

.modal-image {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 650px;
  height: 650px;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  background: url("/media/games/do-re-mi/images/popup.png");
  background-repeat: no-repeat;
  background-size: contain;
}

.start-container {
  background: none;
  border: none;
  box-shadow: none;
  width: 80%;
  margin-left: 10px;
  margin-top: 150px;
  max-width: 400px;
  text-align: center;
  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.start-container img {
  cursor: pointer;
  transition: all 0.3s;
  width: 300px;
  height: auto;
}

.start-container img:hover {
  opacity: 0.7;
}

@keyframes modalBounce {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  40% {
    transform: scale(1.05);
    opacity: 1;
  }
  60% {
    transform: scale(0.98);
  }
  80% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
/* Hide distance and pitch containers when intro modal is visible */
#startScreen {
  display: flex;
}

#startScreen:visible ~ .distance-container,
#startScreen:visible ~ .pitch-container {
  display: none !important;
}

/* Fallback: hide if .start-screen is visible */
.start-screen[style*="display: flex"] ~ .distance-container,
.start-screen[style*="display: flex"] ~ .pitch-container,
.start-screen[style*="display: block"] ~ .distance-container,
.start-screen[style*="display: block"] ~ .pitch-container {
  display: none !important;
}

#end-section {
  width: 1280px;
  height: 720px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 999999999 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #00000044;
  backdrop-filter: blur(3px);
}

.content {
  position: absolute;
  width: 1280px;
  height: 720px;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
  transform: scale(0);
}

.end-modal-image {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 650px;
  height: 650px;
  z-index: 1;
  background: url("/media/games/do-re-mi/images/end-popup.png");
  background-repeat: no-repeat;
  background-size: contain;
}

#end-score {
  color: white;
  font-family: Fredoka;
  font-weight: bold;
  margin-top: -55px;
  font-size: 52px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
}

#end-score span {
  font-size: 72px;
  display: block;
  margin-top: -15px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
}

.end-btns {
  background: none;
  border: none;
  box-shadow: none;
  width: 80%;
  margin-left: 10px;
  margin-top: 10px;
  max-width: 400px;
  text-align: center;
  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.end-btns img {
  cursor: pointer;
  transition: all 0.3s;
  width: 300px;
  height: auto;
}

.end-btns span {
  position: absolute;
  color: white;
  font-family: Fredoka;
  font-weight: bold;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
  font-size: 38px;
  margin-top: 5px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #0f7a00, 0 4px 0 #0b5f00, 0 6px 6px rgba(0, 0, 0, 0.35);
}

#endGameBtn {
  text-align: center;
  display: flex;
  justify-content: center;
  cursor: pointer;
}

#downloadRecordingBtn {
  text-align: center;
  display: flex;
  justify-content: center;
  cursor: pointer;
}

#timer {
  position: absolute;
  display: flex;
  justify-content: space-between;
  align-items: center;
  right: 5%;
  top: 1%;
  padding: 10px 20px;
  color: #fff;
  font-family: Fredoka;
  font-size: 40px;
  font-weight: bold;
  text-shadow: 2px 2px rgba(0, 0, 0, 0.555);
  z-index: 999;
  font-variant-numeric: tabular-nums;
  transform: scale(0);
}

#camera-bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: #000;
}

#camera-bg-wrap.active {
  opacity: 1;
}

#camera-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#camera-bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}

#renderCanvas {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
  z-index: 20;
  background: transparent !important;
}

@media (max-width: 600px) {
  #gameContainer {
    width: 800px;
    height: 1180px;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .modal-image {
    width: 720px;
    height: 600px;
    margin-top: -620px;
  }

  .start-container {
    margin-top: 250px;
    padding: 0;
    max-width: 100vw;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .start-instructions {
    font-size: 12px;
    margin-bottom: 0;
    margin-top: 235px;
    text-align: center;
    width: 80%;
  }

  .start-game-btn {
    width: 120%;
    margin-top: 15px;
  }

  #background-container {
    position: absolute;
    width: 1480px;
    height: 720px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1) rotate(90deg);
    z-index: 9;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #bg {
    width: 100%;
    height: auto;
  }

  .orbit-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  #music-notes {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1100px;
    height: auto;
    transform-origin: center;
    animation: orbit 6s linear infinite, spin 15s linear infinite;
  }

  #home-section {
    width: 800px;
    height: 1180px;
    position: absolute;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #logo {
    height: 360px;
    margin-top: 210px;
    justify-content: center;
    display: flex;
    animation: logoAnim 1.3s infinite;
  }

  #end-section {
    width: 800px;
    height: 1180px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 999999999999;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #00000044;
    backdrop-filter: blur(3px);
  }

  .content {
    position: absolute;
    width: 800px;
    height: 1180px;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    transform: scale(0);
  }

  #end-score {
    margin-top: -165px;
  }

  #end-score span {
    font-size: 72px;
    display: block;
    margin-top: 5px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
  }

  .end-btns {
    background: none;
    border: none;
    box-shadow: none;
    width: 80%;
    margin-left: 10px;
    margin-top: 10px;
    max-width: 400px;
    text-align: center;
    display: flex;
    gap: 15px;
    flex-direction: column;
    align-items: center;
    z-index: 2;
  }

  .end-btns img {
    cursor: pointer;
    transition: all 0.3s;
    width: 300px;
    height: auto;
  }

  .end-btns span {
    position: absolute;
    color: white;
    font-family: Fredoka;
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    font-size: 38px;
    margin-top: 5px;
    text-transform: uppercase;
    text-shadow: 0 2px 0 #0f7a00, 0 4px 0 #0b5f00, 0 6px 6px rgba(0, 0, 0, 0.35);
  }
}
