/* =========================
   Base / Global Styles
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Courier New", Courier, monospace;
  background-color: #f2f2f2;
  color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

h1, header, .main-container h1 {
  font-size: 28px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: "Courier New", Courier, monospace;
}
header {
  width: 100%;
  text-align: center;
  margin: 32px 0 0 0;
}
header h1 {
  font-size: 32px;
  margin-bottom: 24px;
  display: inline-block;
}

/* =========================
   Containers & Layouts
========================= */

/* Home Wrapper */
.home-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

/* About Box */
.about-box {
  max-width: 800px;
  margin-bottom: 60px;
  text-align: left;
}

/* App Grid/Cards */
.app-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
@media (max-width: 640px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}
.app-card {
  background: #fff;
  border: 5px solid #000;
  box-shadow: 10px 10px 0 #000;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.app-card h2 {
  margin-bottom: 12px;
}
.app-card p {
  flex-grow: 1;
  margin-bottom: 16px;
  font-size: 16px;
}
.app-card button {
  margin-top: auto;
}

/* General Card Containers */
.container,
.main-container {
  text-align: center;
  background: #fff;
  padding: 30px;
  border: 5px solid #000;
  box-shadow: 10px 10px 0 #000;
  width: 100%;
}
.container {
  max-width: 400px;
}
.main-container {
  max-width: 440px;
  margin: 48px auto;
  border-radius: 0;
  display: block;
}
@media (max-width: 600px) {
  .main-container {
    max-width: 98vw;
    min-width: 0;
    padding: 12px 1.5vw;
  }
  #detector,
  #output {
    width: 96vw !important;
    max-width: 340px;
    min-width: 200px;
  }
}

/* =========================
   Typography
========================= */
h1 {
  font-size: 28px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
p {
  margin-top: 15px;
  font-size: 18px;
  font-weight: bold;
}

/* =========================
   Buttons
========================= */
button,
#next-btn,
#back-btn,
#proceed-btn,
#settings-btn,
#demo-audio-btn,
#live-input-btn,
#oscillator-btn {
  background-color: #fff;
  color: #000;
  border: 3px solid #000;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 20px;
}

button:hover,
#next-btn:hover,
#back-btn:hover,
#proceed-btn:hover,
#settings-btn:hover,
#demo-audio-btn:hover,
#live-input-btn:hover,
#oscillator-btn:hover,
#fret-slider::-webkit-slider-thumb:hover,
#fret-slider::-moz-range-thumb:hover,
#fret-limit::-webkit-slider-thumb:hover,
#fret-limit::-moz-range-thumb:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #000;
}

/* Navigation Buttons Row */
#next-btn,
#back-btn,
#proceed-btn,
#settings-btn {
  margin: 15px 10px;
  display: inline-block;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 12px;
}
.button-row button {
  margin: 0 7px;
}

/* "Mode" Toggle Buttons for Detector */
#demo-audio-btn,
#live-input-btn,
#oscillator-btn {
  margin: 13px 7px;
}

/* =========================
   Sliders / Range Inputs
========================= */

/* FRET SLIDER (old) */
#fret-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 300px;
  height: 10px;
  margin: 20px auto;
  background: #000;
  border: 3px solid #000;
  cursor: pointer;
  display: block;
}
#fret-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#fret-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#fret-slider::-moz-range-track {
  height: 10px;
  background: #000;
  border: 3px solid #000;
}

/* FRET LIMIT (new) */
.fret-limit-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 1.1em;
}
.fret-limit-block label {
  font-size: 15px;
  margin-right: 4px;
  font-family: inherit;
}
#fret-limit {
  -webkit-appearance: none;
  appearance: none;
  width: 65%;
  max-width: 260px;
  height: 10px;
  background: #000;
  border: 3px solid #000;
  cursor: pointer;
  display: inline-block;
}
#fret-limit::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#fret-limit::-moz-range-thumb {
  width: 20px; height: 20px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#fret-limit::-moz-range-track {
  height: 10px;
  background: #000;
  border: 3px solid #000;
}
#fret-limit-value {
  background: #f2f2f2;
  border: 2px solid #000;
  padding: 1px 9px;
  font-size: 14px;
  margin-left: 8px;
  font-family: inherit;
  border-radius: 0;
}

/* =========================
   Tutorial Page Styles
========================= */

#tutorial-container {
  max-width: 600px;
}

.tutorial-content {
  text-align: left;
  padding: 0 20px;
}
.tutorial-content ol {
  margin: 20px 0;
  padding-left: 30px;
}
.tutorial-content li {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: normal;
}

/* =========================
   Game & Detector/App Specific
========================= */
.settings-section,
.check-section,
.detector-section,
.controls-section {
  margin-bottom: 28px;
}

#check-result,
#accept-status {
  font-size: 1.12em;
  margin: 12px 0;
  font-weight: bold;
  letter-spacing: 1px;
}

#detector {
  margin: 1.5em auto 1.8em auto;
  display: block;
}

/* =========================
   Accessibility Helpers
========================= */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
