/* Reset + viewport control */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Layout for instructions and game area */
.main-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 0 5vw;
}

.instructions {
  background: rgba(0,0,0,0.18);
  color: #fff;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  font-size: 1.1em;
  border-radius: 18px;
  box-shadow: 0 0 24px 4px rgba(0,0,0,0.12);
  padding: 2em 1.5em 2em 2em;
  margin: 2vw 2vw 2vw 0;
  min-width: 220px;
  max-width: 300px;
  z-index: 2;
  text-align: left;
}

.instructions h3 {
  margin-top: 0;
  font-size: 1.3em;
  color: #f99b45;
}

.instructions ul {
  padding-left: 1.2em;
  margin: 0.5em 0 0 0;
}

.instructions li {
  margin-bottom: 0.7em;
  line-height: 1.5;
}

h1 {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  font-size: 2.8em;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  margin-top: 2vw;
  margin-bottom: 0.5em;
  border-radius: 16px;
  padding: 0.3em 1em;
  background: rgba(0,0,0,0.12);
  display: inline-block;
}

h2 {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2vw;
  border-radius: 12px;
  padding: 0.2em 0.8em;
  background: rgba(0,0,0,0.10);
  display: inline-block;
}

.btn {
  height: 18vw;
  width: 18vw;
  min-width: 100px;
  min-height: 100px;
  max-width: 200px;
  max-height: 200px;
  border-radius: 30%;
  border: 8px solid #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  outline: none;
  position: relative;
  margin: 2vw;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.95);
}

body {
  text-align: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f99b45, #63aac0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow-x: hidden;
}

/* Buttons container and header positioning */
.btn-container, h1, h2 {
  position: relative;
  z-index: 1;
}

.btn-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin-top: 1vw;
  flex-wrap: wrap;
  gap: 2vw;
}

h1, h2 {
  text-align: center;
  color: #222;
  margin: 0.5em 0;
}

/* Button colors */
.red-btn { background-color: #d95980; }
.green-btn { background-color: #63aac0; }
.yellow-btn { background-color: #f99b45; }
.purple-btn { background-color: #819ff9; }
.flash { background-color: white; }
.user-flash { background-color: black; }

/* Start button styling */
.start-btn {
  display: none;
  padding: 0.8em 1.5em;
  margin: 1em 0;
  font-size: 1.2em;
  font-weight: bold;
  color: white;
  background: #f99b45;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.start-btn:active {
  transform: scale(0.95);
  background: #d95980;
}

/* Responsive for tablets */
@media (max-width: 1024px) {
  .main-layout {
    flex-direction: column;
    align-items: center;
    padding: 2vw;
    width: 100%;
    max-width: 100vw;
  }
  .instructions {
    margin: 0 0 2vh 0;
    max-width: 90%;
  }
}

/* Responsive for mobile */
@media (max-width: 600px) {
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .start-btn {
    display: inline-block; /* Show on mobile */
  }

  .btn-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4vw;
    width: 100%;
    max-width: 100vw;
    justify-items: center;
  }

  .btn {
    width: 40vw;
    height: 40vw;
    min-width: 70px;
    min-height: 70px;
    max-width: 120px;
    max-height: 120px;
  }

  .instructions {
    font-size: 1em;
    padding: 1.2em;
    margin: 0 auto;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  h1 { font-size: 1.8em; }
  h2 { font-size: 1em; margin-top: 1em; }
}

/* Extra small screen tweaks */
@media (max-width: 400px) {
  h1 { font-size: 1.5em; }
  h2 { font-size: 0.9em; }
  .btn {
    width: 40vw;
    height: 40vw;
  }
}
