/* Make app behave like a native app */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fafafa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* App container */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Header — extends behind notch but keeps text visible */
header {
  position: relative;
  background: linear-gradient(135deg, #00ffbd, #00d478, #009756, #005c34);
  color: white;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  padding: calc(env(safe-area-inset-top) + 24px) 16px 24px;
}

/* Keep header text visible and centered */
header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

header p {
  margin: 6px 0 0;
  font-size: 1rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* Ensure compatibility on browsers supporting modern padding */
@supports (padding: max(0px)) {
  header {
    padding-top: max(env(safe-area-inset-top), 24px);
  }
}

/* Main content centered */
main {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
}

/* Sections */
section {
  margin-bottom: 30px;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

/* Buttons */
button {
  display: block;
  background: linear-gradient(135deg, #00ffbd, #00d478);
  color: #004d2b;
  border: none;
  border-radius: 10px;
  margin: 10px auto;
  padding: 12px 18px;
  width: 90%;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

button:active {
  transform: scale(0.98);
}

/* Debug console */
pre {
  background: #111;
  color: #00ffbd;
  padding: 10px;
  min-height: 100px;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  white-space: pre-wrap;
  margin: 0 auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 0.9rem;
}

/* Offline bar */
#offlineBar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  background: #ff4444;
  color: white;
  text-align: center;
  font-weight: bold;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
