/* ======================= Responsive Asteroids CSS ======================= */

/* --- Global Reset --- */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: VT323;
}

/* --- Buttons --- */
button {
  font-size: xx-large;
  box-shadow: 6px 6px #2e2e5c;
  transition: all 0.1s ease;
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 2px #2e2e5c;
}

button:hover {
  filter: brightness(1.2);
}

/* --- Game Container --- */
.outer-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 1280px;
  background: #eee;
  border: 5px solid gainsboro;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.game-window,
#actual-game,
section {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

section {
  display: none;
}

section.active {
  display: block;
}

/* --- Landing --- */
#landing {
  background: url("../src/frontpage_background.jpg") center/cover no-repeat;
}

#landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 120px;
  background-color: darkslateblue;
  border-bottom: 6px groove;
  padding: 0 16px;
}

#landing-header h1 {
  font-size: clamp(70px, 8vw, 100px);
  color: white;
  margin: 0;
  text-align: center;
}

.header-asteroid {
  height: 100%;
  width: auto;
}

/* --- Buttons on Start Page --- */
#landing-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 64px;
  height: calc(100% - 120px);
}

#landing-buttons button {
  width: clamp(200px, 30vw, 320px);
  height: clamp(80px, 12vh, 120px);
  background-color: darkslateblue;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(24px, 3vw, 36px);
  border-radius: clamp(4px, 0.8vw, 8px);
}

/* --- Settings --- */
#settings {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#settings.open {
  display: flex;
}

#settings-panel {
  width: clamp(280px, 50%, 640px);
  background: #4b448c;
  color: #fff;
  padding: clamp(16px, 4vw, 32px);
  border-radius: 6px;
  border: clamp(4px, 0.6vw, 6px) groove rgba(230, 230, 230, 0.95);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
  text-align: center;
  overflow-y: auto;
}

#settings-panel h2 {
  font-size: clamp(40px, 5vw, 72px);
  margin-bottom: clamp(12px, 3vh, 20px);
}

#settings-panel h3 {
  font-size: clamp(24px, 4vw, 48px);
  margin: clamp(12px, 3vh, 24px) 0 clamp(8px, 2vh, 16px);
}

/* Volume slider */
#volume-slider {
  width: 100%;
  height: clamp(14px, 2vh, 18px);
  background: #b8b5c8;
  outline: none;
}

#volume-slider::-webkit-slider-thumb,
#volume-slider::-moz-range-thumb {
  width: clamp(14px, 2vw, 18px);
  height: clamp(24px, 4vh, 28px);
  background: #2e8b57;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .4);
}

/* Difficulty buttons */
#difficulty-row {
  display: flex;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 36px);
  margin-top: clamp(16px, 3vh, 24px);
}

.diff-btn {
  flex: 1;
  height: clamp(70px, 8vh, 90px);
  background: purple;
  color: white;
  border: clamp(2px, 0.5vw, 4px) solid transparent;
  font-size: clamp(20px, 3vw, 30px);
}

.diff-btn.selected {
  border-color: black;
}

.settings-actions {
  text-align: center;
  margin-top: clamp(16px, 3vh, 24px);
}

#btn-close-settings {
  width: clamp(160px, 18vw, 200px);
  height: clamp(70px, 9vh, 90px);
  background: purple;
  color: white;
  border: none;
  font-size: clamp(22px, 3vw, 30px);
  border-radius: 6px;
}

/* --- Tutorial --- */
#tutorial {
  background-color: gainsboro;
  position: absolute;
  inset: 0;
  display: none; /* stays hidden until JS adds .active */
  align-items: center;
  justify-content: center;
}

#tutorial.active {
  display: flex; /* only visible when toggled on */
}

/* Responsive proportional container */
#tutorial-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 90%;
  width: 90%;
  text-align: center;
  padding: 2%;
  box-sizing: border-box;
}

/* Each segment scales within the 16:9 space */
#tutorial-content h2 {
  flex: 0 0 auto;
  font-size: clamp(50px, 6vw, 75px);
  margin: 0;
}

#tutorial-content p {
  flex: 0 0 auto;
  font-size: clamp(28px, 3vw, 50px);
  margin: 0;
  line-height: 1.2;
}

.tutorial-img {
  width: clamp(80px, 8vw, 100px);
  height: auto;
}

.tutorial-row {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 3vw, 24px);
}

#btn-start {
  flex: 0 0 auto;
  width: clamp(200px, 18vw, 260px);
  height: clamp(80px, 10vh, 100px);
  background: darkslateblue;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: clamp(26px, 3vw, 36px);
  margin-top: clamp(12px, 3vh, 24px);
}

/* --- Utility --- */
img, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

* {
  box-sizing: border-box;
}
