/* Mobile-first styles for the Meters POC. Large tap targets, plain colors. */

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --amber: #f59e0b;
  --error: #f87171;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1 {
  font-size: 1.4rem;
  text-align: center;
  margin: 8px 0 0;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hint {
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
}

/* The visible camera control is a big styled label. The real
   file input sits underneath it, invisible, so iOS Safari opens
   the camera with no extra permission prompt. */
.take-photo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  background: var(--accent);
  color: #041018;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}

.take-photo-button:active {
  filter: brightness(0.9);
}

#photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

#preview-image {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.spinner-ring {
  width: 42px;
  height: 42px;
  border: 4px solid var(--panel);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.digit-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.digit-box {
  width: 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border-radius: 10px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 2rem;
  font-weight: 700;
}

.digit-box.mid-roll {
  background: var(--amber);
  color: #241a02;
}

.mid-roll-note,
.confidence-line {
  font-size: 1rem;
  text-align: center;
  margin: 0;
}

.notes-line {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.secondary-button {
  min-height: 56px;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.secondary-button:active {
  filter: brightness(1.15);
}

.error-message {
  text-align: center;
  color: var(--error);
  font-size: 1.05rem;
}
