/* =====================
   1. RESET & BASE
   ===================== */
* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Roboto Mono", monospace;
  color: #cfeef5;
  background-color: black;
}

main {
  height: 100vh;
  overflow: hidden;
}

footer {
  color: white;
}

/* =====================
   2. TYPOGRAPHY
   ===================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  color: #b8d4da;
}

h1 {
  margin-top: 0;
}

p {
  margin: 0;
}

li {
  font-size: 1.25rem;
}

.intro-text {
  font-size: 1.5rem;
  max-width: 1000px;
  text-align: center;
}

/* =====================
   3. LAYOUT
   ===================== */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

.container {
  max-width: 1440px;
  margin: 1rem auto;
  padding: 1rem;
  background: #1a1c1e;
  border: 4px solid #477d8548;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.game-dashboard-wrapper {
  margin: 0 auto;
  max-width: 1440px;
  padding-top: 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.game-dashboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1440px;
  padding: 1rem;
  background: #1a1c1e;
  border: 4px solid #477d8548;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dashboard-container {
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  margin: 0.5rem 1rem;
  width: 100%;
  gap: 0.5rem;
}

.dashboard-wrapper {
  display: grid;
  padding: 1rem;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: #1a1c1e;
  border: 4px solid #477d8548;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* =====================
   4. SCREENS
   ===================== */
#start-screen {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.how-to-play-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 1rem;
  background-color: #1a1c1e;
  border: 4px solid #477d8548;
  border-radius: 12px;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)),
    url(/Assets/image/score-texture.jpg);
  background-size: cover;
  background-blend-mode: overlay;
}

.how-to-play-wrapper h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.carousel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.4s ease;
}

.disclaimer {
  font-size: 12px;
  opacity: 0.5;
}

.disclaimer a {
  color: #cfeef5;
  text-decoration: underline;
}

.slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 0 0.5rem;
}

.slide-img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.carousel-btn {
  background: none;
  border: 1px solid #5a9fad;
  color: #b8d4da;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.carousel-btn:hover {
  background: #477d85;
}

.carousel-indicator {
  font-size: 0.85rem;
  color: #8ba8b3;
}

.intro-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

#game-board {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  gap: 1rem;
  margin-top: 1rem;
  background-image: url(/Assets/image/game-board-bg.jpg);
  background-size: fill;
  background-color: #2f3e46;
}

#game-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: center;
}

/* =====================
   5. COMPONENTS
   ===================== */

/* Dashboard */
.game-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #cfeef5;
  background-color: #465b67;
  border: 4px solid #6c8da0;
  border-style: double;
  border-radius: 12px;
  padding: 0.375rem;
  gap: 0.2rem;
  min-width: 90px;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url(/Assets/image/score-texture.jpg);
  background-size: cover;
  background-blend-mode: overlay;
}

.game-info-item h3 {
  font-size: 1rem;
}

.game-info-item p {
  font-size: 3rem;
}

.status-msg {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  min-height: 80px;
  margin: 0.5rem auto;
  padding: 0.75rem 1.5rem;
  font-size: 1.5rem;
  color: #00eb2f;
  background: rgb(0, 0, 0);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.text-red {
  color: #ff6767;
}

.text-green {
  color: #00eb2f;
}

/* Legend */
.legend-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.legend-character {
  display: flex;
  flex-wrap: wrap;
  width: auto;
  height: 80px;
  border-radius: 100px;
  border: 2px solid #5a9fad;
}

.intro-icon {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
}

.hologram-flicker {
  animation: hologramFlicker 15s infinite;
}

/* Game Holes & Characters */
.hole {
  display: flex;
  justify-content: center;
  width: 350px;
  height: 18vh;
  border-radius: 100%;
  position: relative;
  cursor: crosshair;
  overflow: hidden;
  background: #0c0c0c;
  box-shadow:
    inset 0 16px 30px rgba(0, 0, 0, 0.18),
    /* top inner highlight */ inset 0 -28px 40px rgba(0, 0, 0, 0.72),
    /* deep tunnel shadow */ 0 10px 18px rgba(0, 0, 0, 0.35);
}

.character {
  width: auto;
  height: 26vh;
  position: absolute;
  bottom: -55%;
  transform: translate(0, 110%);
  animation: slideUp 0.3s ease-out forwards;
  z-index: 2;
}

.characterExit {
  animation: slideDown 0.3s ease-out forwards;
}

.custom-crosshair {
  cursor:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><line x1='20' y1='0' x2='20' y2='40' stroke='red' stroke-width='2'/><line x1='0' y1='20' x2='40' y2='20' stroke='red' stroke-width='2'/></svg>")
      20 20,
    crosshair;
}

/* Buttons */
button {
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 8px;
  background: #5a9fad;
  font-size: 1rem;
  font-weight: medium;
  color: #0d1014;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #b8d4da;
}

#start-button {
  width: 100%;
  height: 64px;
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(
    135deg,
    #2f3e46 0%,
    #477d85 30%,
    #5a9fad 60%,
    #b8d4da 100%
  );
  background-size: 200% 200%;
  background-position: 0% 50%;
  border: 1px solid #5a9fad;
  color: #d9e5e8;
  letter-spacing: 0.1em;
  transition:
    color 0.5s ease,
    background-position 1s ease,
    box-shadow 0.3s ease;
}

#start-button:hover {
  background-position: 100% 50%;
  box-shadow:
    0 0 16px #477d8566,
    0 0 32px #477d8522;
  color: #0d1014;
}

.button-secondary {
  background: none;
  border: 1px solid #5a9fad;
  color: #fafaf9bc;
  transition:
    color 0.3s ease,
    background 0.3s ease;
}

.button-secondary:hover {
  background: #5a9fad;
  color: #0d1014;
}

/* =====================
   6. UTILITIES
   ===================== */
.text-align-center {
  text-align: center;
}

.margin-bottom-small {
  margin-bottom: 1rem;
}

.flash-red {
  animation: flashRed 0.5s ease-in-out;
}

.flash-green {
  animation: flashGreen 0.5s ease-in-out;
}

/* =====================
   7. ANIMATIONS
   ===================== */
@keyframes slideUp {
  from {
    transform: translate(0, 120%);
  }
  to {
    transform: translate(0, 0);
  }
}

@keyframes slideDown {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(0, 110%);
  }
}

@keyframes flashRed {
  0% {
    color: #fafaf9b2;
    transform: scale(1);
  }
  50% {
    color: #ff4444;
    transform: scale(1.2);
    text-shadow: 0 0 10px #ff0000;
  }
  100% {
    color: #fafaf9b2;
    transform: scale(1);
  }
}

@keyframes hologramFlicker {
  0% {
    opacity: 1;
    transform: translateX(0);
    filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
  }
  2% {
    opacity: 0.6;
    transform: translateX(-2px);
    filter: drop-shadow(0 0 12px #5a9fad) brightness(1.4);
  }
  3% {
    opacity: 1;
    transform: translateX(0);
    filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
  }
  20% {
    opacity: 1;
    transform: translateX(0);
  }
  21% {
    opacity: 0.2;
    transform: translateX(1px);
    filter: drop-shadow(0 0 4px #477d85) brightness(0.9);
  }
  22% {
    opacity: 1;
    transform: translateX(0);
    filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
  }
  50% {
    opacity: 1;
    transform: translateX(0);
  }
  51% {
    opacity: 0.7;
    transform: translateX(-0.5px);
    filter: drop-shadow(0 0 8px #5a9fad) brightness(1.2);
  }
  52% {
    opacity: 1;
    transform: translateX(0);
    filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
  }
  75% {
    opacity: 1;
    transform: translateX(0);
  }
  76% {
    opacity: 0.1;
    transform: translateX(1px);
    filter: drop-shadow(0 0 16px #a2bbc1) brightness(1.3);
  }
  77% {
    opacity: 0.8;
    transform: translateX(-0.5px);
    filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
  }
  78% {
    opacity: 1;
    transform: translateX(0);
    filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: drop-shadow(0 0 6px #5a9fad) brightness(1);
  }
}

@keyframes flashGreen {
  0% {
    color: #fafaf9b2;
    transform: scale(1);
  }
  50% {
    color: #00cd00;
    transform: scale(1.2);
    text-shadow: 0 0 10px #00cd00;
  }
  100% {
    color: #fafaf9b2;
    transform: scale(1);
  }
}
