/* ── Variables ──────────────────────────────────────────── */
:root {
  --cream:     #FBF4E3;
  --amber:     #C8870E;
  --amber-l:   #E6A020;
  --terra:     #C4612A;
  --sage:      #7AAE89;
  --sage-d:    #4D8060;
  --brown:     #3A2A0F;
  --warm-gray: #8A7D6B;
  --card-bg:   #FFFDF5;
  --border:    #EDE3CC;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: #c8b898;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 24px 16px 40px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Phone shell ────────────────────────────────────────── */
.phone-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.phone {
  width: 390px;
  height: 844px;
  background: var(--cream);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
}

/* ── Screen ─────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: absolute;
  inset: 0;
  background: var(--cream);
}
.screen.active { display: flex; }

.screen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 28px 20px;
  display: flex;
  flex-direction: column;
}
.screen-body::-webkit-scrollbar { display: none; }
.screen-body.centered { align-items: center; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 10px;
  flex-shrink: 0;
}
.logo-block  { display: flex; align-items: center; gap: 8px; }
.logo-icon   { width: 34px; height: 34px; background: var(--brown); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.logo-text   { font-family: 'Fredoka One', cursive; font-size: 20px; color: var(--brown); line-height: 1; }
.logo-sub    { font-size: 10px; color: var(--warm-gray); font-weight: 600; }
.topbar-title{ font-family: 'Fredoka One', cursive; font-size: 16px; color: var(--brown); text-align: center; line-height: 1.2; }
.back-btn, .home-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--brown);
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background .15s;
}
.back-btn:active, .home-btn:active { background: rgba(58,42,15,.08); }

/* ── Typography ─────────────────────────────────────────── */
.fredoka  { font-family: 'Fredoka One', cursive; }
.title-lg { font-family: 'Fredoka One', cursive; font-size: 26px; color: var(--brown); line-height: 1.25; }
.title-md { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--brown); line-height: 1.3; }
.subtitle { font-size: 14px; color: var(--warm-gray); font-weight: 600; line-height: 1.5; }
.section-label { font-size: 14px; font-weight: 800; color: var(--brown); margin-bottom: 10px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 16px 32px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  min-height: 52px;
  transition: background .15s, transform .1s, box-shadow .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 4px 14px rgba(200,135,14,.30);
}
.btn-primary:hover  { background: var(--amber-l); }
.btn-primary:active { transform: scale(0.96); box-shadow: 0 2px 6px rgba(200,135,14,.20); }

.btn-secondary {
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-secondary:hover { background: var(--sage-d); }

.btn-ghost {
  background: none;
  border: 2px solid var(--amber);
  color: var(--amber);
  border-radius: 50px;
  padding: 13px 28px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.btn-ghost:hover  { background: #fff3d4; }
.btn-ghost:active { background: #fff3d4; transform: scale(0.97); }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 18px;
  border: 1.5px solid var(--border);
  margin-bottom: 10px;
}
.info-row {
  font-size: 14px;
  color: var(--warm-gray);
  font-weight: 600;
  margin-bottom: 4px;
}
.info-row b { color: var(--brown); }

/* ── Form ───────────────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--warm-gray); margin-bottom: 6px; }
.input-field {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  width: 100%;
  color: var(--brown);
  outline: none;
  transition: border .15s;
}
.input-field:focus { border-color: var(--amber); }
.select-wrap {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.select-field {
  border: none;
  padding: 4px 0;
  background: transparent;
  font-weight: 700;
  color: var(--brown);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.select-field:focus { outline: none; }
.style-dot  { width: 28px; height: 28px; border-radius: 50%; background: #2a5298; flex-shrink: 0; transition: background .2s; }
.select-arrow { color: var(--warm-gray); font-size: 18px; flex-shrink: 0; }

/* ── Style badge / circle ───────────────────────────────── */
.style-badge  { border-radius: 30px; padding: 4px 14px; font-size: 12px; font-weight: 700; color: #fff; }
.style-circle { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }

/* ── Style cards (selector visual en el form) ───────────── */
.style-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.style-card-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 3px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.style-card-name {
  font-size: 10px;
  font-weight: 800;
  color: var(--warm-gray);
  text-align: center;
  transition: color .15s;
  line-height: 1.2;
}
.style-card.selected .style-card-swatch {
  border-color: var(--brown);
  transform: scale(1.10);
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}
.style-card.selected .style-card-name { color: var(--brown); }
.style-card:active .style-card-swatch { transform: scale(0.93); }

/* ── Preview frame (imagen con filtro aplicado) ─────────── */
.preview-frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 10px 36px rgba(0,0,0,.18);
  position: relative;
  flex-shrink: 0;
}
.preview-badge-wrap {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}
.preview-info-card {
  width: 100%;
  margin-bottom: 14px;
  padding: 14px 18px;
}
.preview-info-card .info-row { font-size: 15px; margin-bottom: 6px; }

/* ── Result frame (ocupa más pantalla) ─────────────────── */
.result-frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 14px 48px rgba(0,0,0,.22);
  margin-bottom: 16px;
  flex-shrink: 0;
}
.result-style-pill {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  padding: 6px 14px 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.result-actions { width: 100%; }

/* ── Processing spinner ─────────────────────────────────── */
.proc-spinner {
  font-size: 42px;
  animation: proc-spin 2s linear infinite;
  display: block;
  text-align: center;
  margin-bottom: 10px;
}
@keyframes proc-spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ── Home hero ──────────────────────────────────────────── */
.home-hero {
  background: linear-gradient(160deg, #fff8ec 0%, var(--cream) 100%);
  border-radius: 24px;
  padding: 20px 18px 22px;
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
}
.home-artists {
  font-size: 22px;
  letter-spacing: 6px;
  margin-bottom: 10px;
  text-align: center;
}
.btn-hero {
  font-size: 18px;
  padding: 18px 32px;
  box-shadow: 0 6px 20px rgba(200,135,14,.40);
}

/* ── Home grid ──────────────────────────────────────────── */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-nav  {
  cursor: pointer;
  text-align: center;
  padding: 20px 16px;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.card-nav:active { transform: scale(0.95); }
.card-icon     { font-size: 36px; margin-bottom: 8px; }
.card-nav-title{ font-weight: 800; font-size: 15px; color: var(--brown); }
.card-nav-sub  { font-size: 12px; color: var(--warm-gray); font-weight: 600; }

/* ── Recents row ────────────────────────────────────────── */
.recents-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.recents-row::-webkit-scrollbar { display: none; }
.recent-thumb {
  flex-shrink: 0;
  cursor: pointer;
}
.recent-thumb-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
}
.recent-thumb-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.recent-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brown);
  margin-top: 4px;
  width: 72px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ── Camera box ─────────────────────────────────────────── */
.camera-box {
  width: 100%;
  aspect-ratio: 1;
  background: #e8dfc8;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 3px dashed #c8b090;
  overflow: hidden;
  position: relative;
}
.camera-hint { font-size: 14px; color: var(--warm-gray); font-weight: 700; text-align: center; padding: 0 20px; }

/* ── Shutter button ──────────────────────────────────────── */
.btn-shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 auto 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  transition: transform .1s, box-shadow .1s;
}
.btn-shutter:active { transform: scale(0.90); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.shutter-ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--amber);
  display: block;
  transition: transform .1s;
}
.btn-shutter:active .shutter-ring { transform: scale(0.88); }

/* ── Live camera indicator ───────────────────────────────── */
.camera-live-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,.25);
  animation: live-blink 1.2s ease-in-out infinite;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ── Processing ─────────────────────────────────────────── */
.processing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 0 40px;
}
.processing-img-wrap {
  width: 170px;
  height: 170px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.proc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: opacity .6s ease;
}
.proc-img.hidden { opacity: 0; }

.progress-bar-wrap {
  width: 240px;
  background: #e8dfc8;
  border-radius: 30px;
  height: 12px;
  overflow: hidden;
  margin-top: 14px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--amber-l));
  border-radius: 30px;
  width: 0%;
  transition: width .1s linear;
}

/* ── Tabs ───────────────────────────────────────────────── */
.tabs-row {
  display: flex;
  gap: 6px;
  padding: 14px 0 10px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 14px;
}
.tab {
  padding: 10px 18px;
  border-radius: 30px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--warm-gray);
  transition: all .15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tab.active { background: var(--terra); color: #fff; }
.tab:active { transform: scale(0.95); }

/* ── Gallery ────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.artwork-card {
  background: var(--card-bg);
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.artwork-card:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.artwork-thumb-wrap {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  overflow: hidden;
}
.artwork-thumb-wrap img { width:100%; height:100%; object-fit:cover; }
.artwork-info { padding: 10px 12px; }
.artwork-info .a-name   { font-weight: 800; font-size: 14px; color: var(--brown); margin-bottom: 2px; }
.artwork-info .a-author { font-size: 12px; color: var(--warm-gray); font-weight: 600; }
.artwork-info .a-age    { font-size: 11px; color: var(--warm-gray); }
.artwork-info .a-style  { font-size: 11px; color: var(--amber); font-weight: 700; }

/* ── Conócenos ──────────────────────────────────────────── */
.conocenos-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}
.conocenos-icon  { font-size: 28px; flex-shrink: 0; }
.conocenos-body  { flex: 1; }
.conocenos-title { font-weight: 800; font-size: 15px; color: var(--brown); margin-bottom: 4px; }
.conocenos-text  { font-size: 13px; color: var(--warm-gray); font-weight: 600; line-height: 1.5; }
.conocenos-arrow { color: var(--amber); font-size: 18px; flex-shrink: 0; }
.conocenos-footer{
  background: var(--brown);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.conocenos-footer span { font-size: 13px; color: #d4b878; font-weight: 600; line-height: 1.5; }

/* ── Waves ──────────────────────────────────────────────── */
.wave { display: block; width: 100%; flex-shrink: 0; margin-top: auto; }

/* ── Animations ─────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes slideUp  { from{transform:translateY(30px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes pop      { 0%{transform:scale(0)} 70%{transform:scale(1.15)} 100%{transform:scale(1)} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }

.slide-up { animation: slideUp .4s ease forwards; }
.pop      { animation: pop .5s cubic-bezier(.34,1.56,.64,1) forwards; }

/* ── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── AI Detection Banner ────────────────────────────────────────────────────── */
.ai-banner {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 2px solid transparent;
  animation: slideUp .35s ease;
  text-align: center;
}
.ai-banner.ai-drawing {
  background: #eaf7ee;
  border-color: #7AAE89;
}
.ai-banner.ai-photo {
  background: #fff3e0;
  border-color: #C8870E;
}
.ai-banner-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
#ai-icon { font-size: 28px; }
#ai-label {
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  color: var(--brown);
}
#ai-confidence {
  font-size: 12px;
  font-weight: 700;
  color: var(--warm-gray);
}
#ai-warning {
  display: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--terra);
  background: #fff3e0;
  border-radius: 10px;
  padding: 6px 10px;
  width: 100%;
}

/* spinner de análisis */
.ai-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--warm-gray);
}
.ai-spinner-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1s ease-in-out infinite;
}
.ai-spinner-dot:nth-child(2) { animation-delay: .2s; }
.ai-spinner-dot:nth-child(3) { animation-delay: .4s; }

/* botón continuar (debajo del banner) */
#ai-continue-btn { display: none; width: 100%; }

/* confidence bar inside banner */
.conf-bar-wrap {
  width: 100%;
  background: rgba(0,0,0,0.08);
  border-radius: 20px;
  height: 7px;
  overflow: hidden;
}
.conf-bar {
  height: 100%;
  border-radius: 20px;
  background: var(--sage);
  transition: width .5s ease;
}
.ai-banner.ai-photo .conf-bar { background: var(--amber); }

/* ── Foto bloqueada: banner más prominente ───────────────────────────────────── */
.ai-banner.ai-photo {
  background: #fff0f0;
  border-color: #e05050;
}
.ai-banner.ai-photo #ai-label {
  color: #c0392b;
}
.ai-banner.ai-photo .conf-bar { background: #e05050; }
.ai-banner.ai-photo #ai-warning {
  background: #fde8e8;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #c0392b;
  width: 100%;
  text-align: center;
}

/* ── Login infantil ──────────────────────────────────────────────────────── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 8px 0 18px;
}
.avatar-option {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 18px;
  font-size: 30px;
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.avatar-option:hover  { background: #fff8e8; }
.avatar-option:active { transform: scale(0.90); }
.avatar-option.selected {
  border-color: var(--amber);
  background: #fff3d4;
  transform: scale(1.07);
  box-shadow: 0 4px 16px rgba(200, 135, 14, 0.30);
}

.existing-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.existing-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 10px 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--brown);
  transition: background .15s, border-color .15s, transform .1s;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.existing-user-chip:hover  { background: #fff8e8; border-color: var(--amber); }
.existing-user-chip:active { transform: scale(0.95); background: #fff3d4; border-color: var(--amber); }
.existing-user-chip .eu-av { font-size: 20px; }
.existing-user-chip .eu-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Chip de perfil en topbar del Home ───────────────────────────────────── */
.profile-chip {
  display: none;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--brown);
  transition: background .15s;
}
.profile-chip:hover { background: #fff8e8; }
.profile-chip span:first-child { font-size: 18px; }
.profile-chip span:last-child {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Galería: fila con estilo + likes ────────────────────────────────────── */
.artwork-info .a-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.artwork-info .a-likes {
  font-size: 11px;
  font-weight: 700;
  color: var(--warm-gray);
}

/* ── Botón peligro (borrar) ──────────────────────────────────────────────── */
.btn-danger {
  background: #e05050;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
  user-select: none;
}
.btn-danger:hover  { background: #c0392b; }
.btn-danger:active { transform: scale(0.96); }

/* ── Like button activo ──────────────────────────────────────────────────── */
.btn-ghost.liked {
  background: #fde8e8;
  border-color: #e05050;
  color: #c0392b;
}

/* ── Overlay global de carga (async ops) ─────────────────────────────────── */
.mambaq-loader {
  position: absolute;
  inset: 0;
  background: rgba(58, 42, 15, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.mambaq-loader[hidden] { display: none; }
.mambaq-loader-box {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  border: 2px solid var(--border);
}
.mambaq-loader-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #e8dfc8;
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.mambaq-loader-text {
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  color: var(--brown);
}

/* ── Responsive móvil: el marco escala al viewport ───────────────────────── */
@media (max-width: 430px) {
  body {
    padding: 0;
    background: var(--cream);
    align-items: stretch;
  }
  .phone-wrap { gap: 0; }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  /* Safe area para notch / barra de home (iPhone, Android) */
  .topbar {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
  .wave:last-child {
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* Cámara: caja más pequeña en pantallas cortas */
  .camera-box {
    aspect-ratio: unset;
    height: 220px;
  }
  /* Texto principal más ajustado */
  .title-lg { font-size: 23px; }
  .title-md { font-size: 20px; }
}
