/* MOBILE OVERRIDES FOR tests.cairn.com */

/* 1. Global layout: full-height, dark background, scrollable content */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: #111;
  color: #f5f5f5;
}

/* 2. Main container stretches full viewport, centers content */
#container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem 0.75rem;
}

/* 3. Screen behaves like a card with sensible width on phones */
#screen {
  width: 100%;
  max-width: 640px;          /* stops it getting too wide on tablets/desktops */
  background: #191919;
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow-y: auto;          /* allow scrolling if content is long */
}

/* 4. Typography inside the screen */

#screen h1,
#screen h2,
#screen h3 {
  margin: 0 0 0.75rem 0;
  font-weight: 600;
}

#screen h1 {
  font-size: 1.35rem;
}

#screen h2 {
  font-size: 1.1rem;
  margin-top: 1rem;
}

#screen p {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
}

#screen ul,
#screen ol {
  padding-left: 1.25rem;
  margin: 0 0 0.75rem 0;
}

/* Optional: highlight an instruction block if you have one */
#screen .instructions {
  background: #222;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* 5. Form elements (age, device, colour choices, etc.) */

#screen form {
  width: 100%;
}

#screen label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

#screen .form-group {
  margin-bottom: 0.9rem;
}

#screen input[type="text"],
#screen input[type="number"],
#screen input[type="email"],
#screen select,
#screen textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #444;
  background: #181818;
  color: #f5f5f5;
  font-size: 0.95rem;
  box-sizing: border-box;
}

#screen input:focus,
#screen select:focus,
#screen textarea:focus {
  outline: none;
  border-color: #2f8cff;
}

/* 6. Buttons: large and easy to tap */

#screen button,
#screen .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: #2f8cff;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  min-width: 140px;
}

#screen button:disabled,
#screen .button.disabled {
  opacity: 0.5;
  cursor: default;
}

/* When multiple buttons appear in a row */
#screen button + button,
#screen .button + .button {
  margin-left: 0.5rem;
}

/* 7. Canvas on mobile: full width with proper spacing */

#screen #stimulusCanvas {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  margin: 1rem auto;
  border: 1px solid #444;
  touch-action: none;
}

/* Info text below canvas */
#screen p {
  text-align: center;
  margin: 0.5rem 0 1rem 0;
}

/* Screening images on mobile */
#screen .screening-image {
  max-width: 90%;
  margin: 1rem auto;
}

/* 8. Phone-specific tweaks (narrow screens) */

@media (max-width: 480px) {
  #container {
    padding: 0.75rem 0.5rem;
  }

  #screen {
    padding: 1rem 0.8rem;
    border-radius: 0.5rem;
  }

  #screen button,
  #screen .button {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  #screen button + button,
  #screen .button + .button {
    margin-left: 0;
  }
}