* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0d1117;
  color: #e6edf3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  /* Prevent iOS long-press magnifier/selection popups on the button */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom));
}

.app-header {
  text-align: center;
  margin-top: 0.5rem;
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b949e;
}

.brand-logo {
    height: 60px;
    width: auto;
}

.subtitle {
  font-size: 0.85rem;
  color: #6e7681;
  margin-top: 0.15rem;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #8b949e;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-connecting { background: #d29922; }
.dot-connected { background: #3fb950; }
.dot-disconnected { background: #f85149; }

.tech-name {
  font-size: 1.6rem;
  font-weight: 600;
}

.talk-button {
  width: min(80vw, 320px);
  height: min(80vw, 320px);
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, #2ea043, #1a7f37 70%);
  color: white;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 0 0 8px rgba(46, 160, 67, 0.15), 0 12px 30px rgba(0,0,0,0.5);
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
  touch-action: none;
  cursor: pointer;
}

.talk-button:active,
.talk-button.live {
  background: radial-gradient(circle at 35% 30%, #f85149, #b62324 70%);
  box-shadow: 0 0 0 14px rgba(248, 81, 73, 0.2), 0 12px 30px rgba(0,0,0,0.6);
  transform: scale(0.96);
}

.talk-button.disabled {
  background: radial-gradient(circle at 35% 30%, #6e7681, #484f58 70%);
  box-shadow: none;
  cursor: not-allowed;
}

.footer-note {
  font-size: 0.8rem;
  color: #6e7681;
  text-align: center;
}

/* ===========================================================
   Responsive scaling for pages marked scaleForAllDevices in config.js
   (currently: robin, sound, slides, misc - NOT worship leader or
   drum talk, which keep their existing fixed layout untouched).
   The base rules above already scale down nicely on very small
   screens like a smartwatch (confirmed working as-is), so these
   rules only ADD extra scaling for bigger screens like an iPad,
   without changing anything on smaller ones.
   =========================================================== */

@media (min-width: 600px) {
  .app.responsive-scale .brand-logo {
    height: 80px;
  }
  .app.responsive-scale .subtitle {
    font-size: 1.05rem;
  }
  .app.responsive-scale .status-row {
    font-size: 1.1rem;
  }
  .app.responsive-scale .tech-name {
    font-size: 2.1rem;
  }
  .app.responsive-scale .talk-button {
    width: min(45vmin, 420px);
    height: min(45vmin, 420px);
    font-size: 1.7rem;
  }
  .app.responsive-scale .footer-note {
    font-size: 1rem;
  }
}

@media (min-width: 900px) {
  .app.responsive-scale .talk-button {
    width: min(38vmin, 460px);
    height: min(38vmin, 460px);
  }
}

/* Very small screens (smartwatch-sized). Apple Watch's viewport is
   roughly 160-250px wide - well under any real phone - so this only
   ever applies there, never on an actual phone or iPad. The header
   logo, subtitle, and footer note are decorative/non-essential during
   live use, so they're hidden to free up all the room for a big,
   easy-to-hit button. Sizing uses vmin (the SMALLER of width/height)
   specifically so the button is guaranteed to stay a true circle and
   fit on screen, no matter how oddly-shaped the watch's viewport is. */
@media (max-width: 300px) {
  .app.responsive-scale {
    justify-content: center;
    gap: 0.6rem;
  }
  .app.responsive-scale .app-header,
  .app.responsive-scale .footer-note {
    display: none;
  }
  .app.responsive-scale .status-row {
    font-size: 0.65rem;
    gap: 0.3rem;
  }
  .app.responsive-scale .tech-name {
    font-size: 1rem;
  }
  .app.responsive-scale .talk-button {
    width: 82vmin;
    height: 82vmin;
    font-size: 1.05rem;
  }
}

/* ===========================================================
   Selector page (e.g. /drumtalk) - horizontal toggle buttons
   =========================================================== */

.selector-app {
  justify-content: center;
  gap: 2rem;
}

.status-text {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  color: #e6edf3;
  min-height: 1.6em;
  padding: 0 1rem;
}

.selector-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 480px;
}

.selector-button {
  flex: 1 1 auto;
  min-width: 70px;
  padding: 0.9rem 0.5rem;
  border: none;
  border-radius: 14px;
  background: #21262d;
  color: #c9d1d9;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.04);
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
  touch-action: manipulation;
  cursor: pointer;
}

.selector-button:active {
  transform: scale(0.96);
}

.selector-button.active {
  background: radial-gradient(circle at 35% 30%, #2ea043, #1a7f37 70%);
  color: white;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15), 0 6px 16px rgba(0, 0, 0, 0.4);
}

.selector-button.active.active-mute {
  background: radial-gradient(circle at 35% 30%, #f85149, #b62324 70%);
}

/* ===========================================================
   Login page
   =========================================================== */

.login-app {
  justify-content: center;
  gap: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: min(85vw, 320px);
}

.login-form input[type="password"] {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid #30363d;
  background: #161b22;
  color: #e6edf3;
  font-size: 1.05rem;
  outline: none;
}

.login-form input[type="password"]:focus {
  border-color: #2ea043;
}

.login-form button {
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 12px;
  background: radial-gradient(circle at 35% 30%, #2ea043, #1a7f37 70%);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.login-error {
  color: #f85149;
  font-size: 0.95rem;
  text-align: center;
  margin: 0;
}
