:root {
  --bg: #111318;
  --panel: #1b1e26;
  --accent: #ff5a8a;
  --accent-2: #7c5cff;
  --text: #f3f4f8;
  --muted: #9aa0ae;
  --ok: #2ecc71;
  --err: #ff5555;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  gap: 18px;
  max-width: 640px;
  margin: 0 auto;
}

.topbar { text-align: center; width: 100%; }
.hero {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  object-position: center 62%;
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
}
.topbar h1 {
  margin: 6px 0 4px;
  font-size: 1.7rem;
  font-family: "Segoe UI", Georgia, "Times New Roman", serif;
  font-weight: 600;
}
.subtitle { margin: 0; color: var(--muted); font-size: 1rem; }

.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  text-align: center;
  transition: transform .08s ease, opacity .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn.big { padding: 20px; font-size: 1.15rem; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn.ghost { background: var(--panel); border: 1px solid #2a2e39; }

/* Botón "Sacar foto" en celeste claro con texto oscuro para buen contraste */
.btn.camera {
  background: linear-gradient(135deg, #b8e6fb, #7ec8e3);
  color: #0f2f3d;
}
.btn.camera:active { background: linear-gradient(135deg, #a9def7, #6cbcd9); }

.status { min-height: 22px; text-align: center; font-weight: 600; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.status.loading { color: var(--muted); }

.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.card img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.badge.loading { background: #555; animation: pulse 1s ease-in-out infinite; }
.badge.ok { background: var(--ok); }
.badge.err { background: var(--err); }

@keyframes pulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

.hidden { display: none !important; }
