/* =========================================================
   Competencias — sistema visual
   Mobile first. Oscuro, calido, con foco en las fotos.
   ========================================================= */

:root {
  color-scheme: dark;

  --bg:        #0d0e12;
  --bg-2:      #13151c;
  --surface:   rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);

  --text:   #f3f5f9;
  --muted:  #98a1b2;
  --faint:  #636c7d;

  --accent:    #ff8a3d;
  --accent-2:  #ffc861;
  --accent-ink:#1a0f04;
  --good:      #4ade80;
  --bad:       #fb7185;
  --info:      #60a5fa;

  --gold:   #ffd166;
  --silver: #cfd6e2;
  --bronze: #d99a6c;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow:    0 10px 30px -12px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.85);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --header-h: 60px;
  --nav-h: 66px;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* Resplandor calido de fondo, fijo, muy sutil. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 138, 61, 0.14), transparent 60%),
    radial-gradient(700px 450px at 95% 5%,  rgba(255, 200, 97, 0.08), transparent 60%);
}

#app { position: relative; z-index: 1; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { margin: 0; }

button, input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* Scrollbar discreta en desktop */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; border: 3px solid var(--bg); }

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */

.shell {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.content {
  flex: 1;
  padding: 18px 14px calc(var(--nav-h) + 28px);
}
.content--flat { padding-bottom: 32px; }

/* ---------------------------------------------------------
   Animaciones de entrada
   --------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pop {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { transform: scale(1.015); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: 200% 0; } }
@keyframes growBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rise-in-place {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.screen { animation: rise 0.34s var(--ease) both; }

/* Cada hijo entra escalonado: --i lo pone el JS */
.stagger > * {
  animation: rise 0.42s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------
   Tarjetas
   --------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.card--tap {
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s;
}
.card--tap:hover { border-color: rgba(255,255,255,.18); background: var(--surface-2); }
.card--tap:active { transform: scale(0.985); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--sm { gap: 8px; }
.stack--lg { gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny  { font-size: 0.78rem; }
.small { font-size: 0.86rem; }
.bold  { font-weight: 700; }
.center { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px 2px;
}
.section-title h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

/* ---------------------------------------------------------
   Botones
   --------------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 650;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s var(--ease), background 0.18s, border-color 0.18s, opacity 0.18s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 8px 24px -10px rgba(255, 138, 61, 0.8);
}
.btn--primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface); color: var(--text); }
.btn--danger { color: var(--bad); border-color: rgba(251,113,133,.3); }
.btn--danger:hover { background: rgba(251,113,133,.1); }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 24px; font-size: 1rem; }
.btn--sm { padding: 7px 13px; font-size: 0.8rem; }

.icon-btn {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.18s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 18px; height: 18px; }

.fab {
  position: fixed;
  right: max(16px, calc(50vw - 380px + 16px));
  bottom: calc(var(--nav-h) + 16px);
  z-index: 45;
  padding: 15px 22px;
  border-radius: 999px;
  animation: pop 0.4s var(--ease) both 0.2s;
}
.fab--flat { bottom: 20px; }

/* ---------------------------------------------------------
   Chips / badges
   --------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge--accent { background: rgba(255,138,61,.14); border-color: rgba(255,138,61,.3); color: var(--accent-2); }
.badge--good   { background: rgba(74,222,128,.13); border-color: rgba(74,222,128,.28); color: var(--good); }
.badge--info   { background: rgba(96,165,250,.13); border-color: rgba(96,165,250,.28); color: var(--info); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------
   Avatares y fotos
   --------------------------------------------------------- */

.avatar {
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(255,138,61,.3), rgba(255,200,97,.15));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent-2);
  letter-spacing: -0.02em;
  border: 1px solid var(--line);
  overflow: hidden;
  width: 46px; height: 46px;
  font-size: 0.95rem;
}
.avatar--sm { width: 32px; height: 32px; font-size: 0.72rem; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar--xl { width: 96px; height: 96px; font-size: 1.9rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--bg-2);
}
.photo--tall { aspect-ratio: 3 / 4; }

.photo-empty {
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03));
  color: var(--faint);
  gap: 6px;
  font-size: 0.8rem;
}

/* ---------------------------------------------------------
   Formularios
   --------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 0.78rem; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; }

.input, .textarea, .select {
  width: 100%;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  font-size: 16px; /* evita el zoom automatico de iOS */
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,138,61,.14);
  background: rgba(0,0,0,.4);
}
.textarea { resize: vertical; min-height: 86px; line-height: 1.5; }
.select { appearance: none; background-image: none; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* Captura de foto */
.photo-field { position: relative; }
.photo-field input[type="file"] { display: none; }
.photo-picker {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--line);
  background: rgba(0,0,0,.2);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  display: block;
  transition: border-color 0.2s, background 0.2s;
}
.photo-picker:hover { border-color: var(--accent); background: rgba(255,138,61,.05); }
.photo-picker__empty {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
}
.photo-picker__empty svg { width: 30px; height: 30px; opacity: .85; }
.photo-picker img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo-picker__actions {
  position: absolute;
  right: 10px; bottom: 10px;
  display: flex; gap: 8px;
}
.photo-picker__actions .btn {
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(10px);
  border-color: rgba(255,255,255,.2);
}

/* ---------------------------------------------------------
   Listas
   --------------------------------------------------------- */

.list { display: flex; flex-direction: column; gap: 10px; }

.tile {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}
.tile--tap { cursor: pointer; }
.tile--tap:hover { background: var(--surface-2); border-color: rgba(255,255,255,.17); }
.tile--tap:active { transform: scale(0.99); }
.tile--me { border-color: rgba(255,138,61,.45); background: rgba(255,138,61,.07); }

.grid-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}
.person-pick {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s;
  text-align: center;
}
.person-pick:hover { border-color: var(--accent); background: rgba(255,138,61,.08); transform: translateY(-2px); }
.person-pick:active { transform: scale(0.96); }
.person-pick__name { font-size: 0.8rem; font-weight: 650; line-height: 1.25; }

.dish-card { padding: 0; }
.dish-card__body { padding: 14px 15px 15px; }
.dish-card__order {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  min-width: 30px; height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.82rem;
  border: 1px solid rgba(255,255,255,.18);
}
.dish-card__flag {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
}

/* ---------------------------------------------------------
   Nav inferior
   --------------------------------------------------------- */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--line-soft);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  position: relative;
  transition: color 0.2s;
  padding-top: 3px;
}
.tab svg { width: 21px; height: 21px; transition: transform 0.25s var(--ease); }
.tab--active { color: var(--accent); }
.tab--active svg { transform: translateY(-1px) scale(1.08); }
.tab--active::after {
  content: "";
  position: absolute;
  top: 0;
  width: 26px; height: 2.5px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: fade 0.3s var(--ease) both;
}
.tab__dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ---------------------------------------------------------
   Progreso
   --------------------------------------------------------- */

.progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s var(--ease);
}

.ring { --p: 0; width: 46px; height: 46px; position: relative; flex: 0 0 46px; }
.ring::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.1) 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%);
  mask: radial-gradient(circle, transparent 58%, #000 59%);
  transition: background 0.5s var(--ease);
}
.ring__label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 800;
}

/* ---------------------------------------------------------
   Puntuacion
   --------------------------------------------------------- */

.score-hero { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); }
.score-hero img, .score-hero .photo-empty { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.score-hero__grad {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,11,14,.96) 6%, rgba(10,11,14,.55) 38%, transparent 70%);
}
.score-hero__text { position: absolute; left: 16px; right: 16px; bottom: 14px; }

.criterion { padding: 13px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.criterion__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.criterion__value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; color: var(--accent-2); min-width: 28px; text-align: right; }
.criterion__value--empty { color: var(--faint); font-size: 1rem; font-weight: 600; }

.scale { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.scale__dot {
  aspect-ratio: 1;
  min-height: 30px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.16s var(--ease), background 0.18s, color 0.18s, border-color 0.18s;
  padding: 0;
}
.scale__dot:hover { border-color: var(--accent); color: var(--text); }
.scale__dot:active { transform: scale(0.88); }
.scale__dot--on {
  background: linear-gradient(135deg, rgba(255,138,61,.28), rgba(255,200,97,.18));
  border-color: rgba(255,138,61,.55);
  color: var(--accent-2);
}
.scale__dot--sel {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 6px 16px -6px rgba(255,138,61,.9);
}

.score-sticky {
  position: sticky;
  bottom: calc(var(--nav-h) + 6px);
  z-index: 30;
  padding: 18px 0 6px;
  margin-top: -8px;
  /* Tapa lo que queda por detras al hacer scroll, sin cortar de golpe. */
  background: linear-gradient(to top, var(--bg) 0%, var(--bg) 72%, transparent 100%);
}

/* ---------------------------------------------------------
   Resultados
   --------------------------------------------------------- */

.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 10px;
  margin: 8px 0 6px;
}
.podium__slot { display: flex; flex-direction: column; align-items: center; gap: 9px; animation: rise 0.6s var(--ease) both; }
.podium__slot:nth-child(1) { animation-delay: 0.18s; }
.podium__slot:nth-child(2) { animation-delay: 0.05s; }
.podium__slot:nth-child(3) { animation-delay: 0.3s; }
.podium__name { font-size: 0.82rem; font-weight: 700; text-align: center; line-height: 1.2; }
.podium__score { font-size: 0.74rem; color: var(--muted); font-weight: 650; }
.podium__block {
  width: 100%;
  border-radius: 14px 14px 0 0;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: rgba(0,0,0,.55);
  transform-origin: bottom;
  animation: growY 0.7s var(--ease) both 0.3s;
}
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.podium__block--1 { height: 92px; background: linear-gradient(180deg, var(--gold), #e0ac2e); }
.podium__block--2 { height: 68px; background: linear-gradient(180deg, var(--silver), #9aa5b6); }
.podium__block--3 { height: 52px; background: linear-gradient(180deg, var(--bronze), #a9714a); }
.podium__crown { font-size: 1.1rem; line-height: 1; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.rank-row__place {
  flex: 0 0 30px; width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.84rem;
  background: rgba(255,255,255,.07);
  color: var(--muted);
}
.rank-row__place--1 { background: linear-gradient(135deg, var(--gold), #e0ac2e); color: #2a1c00; }
.rank-row__place--2 { background: linear-gradient(135deg, var(--silver), #9aa5b6); color: #1c2027; }
.rank-row__place--3 { background: linear-gradient(135deg, var(--bronze), #a9714a); color: #2a1408; }
.rank-row__score { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }

.meter { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 5px; }
.meter__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  animation: growBar 0.8s var(--ease) both 0.25s;
}

.crit-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.crit-bar__name { font-size: 0.78rem; color: var(--muted); }
.crit-bar__val { font-size: 0.8rem; font-weight: 700; }
.crit-bar__track { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.crit-bar__fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; animation: growBar 0.7s var(--ease) both; }

/* ---------------------------------------------------------
   Hojas y modales
   --------------------------------------------------------- */

.backdrop {
  position: fixed; inset: 0;
  z-index: 90;
  background: rgba(5, 6, 9, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade 0.22s var(--ease) both;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.backdrop--closing { animation: fade 0.22s var(--ease) reverse both; }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.34s var(--ease) both;
  padding-bottom: env(safe-area-inset-bottom);
}
.backdrop--closing .sheet { animation: slideUp 0.26s var(--ease-in-out) reverse both; }
.sheet__grip { width: 38px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.2); margin: 10px auto 2px; flex: 0 0 auto; }
.sheet__head { padding: 8px 18px 10px; display: flex; align-items: center; gap: 10px; }
.sheet__head h2 { flex: 1; }
.sheet__body { padding: 4px 18px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot { padding: 12px 18px 18px; display: flex; gap: 10px; border-top: 1px solid var(--line-soft); }
.sheet__foot .btn { flex: 1; }

@media (min-width: 640px) {
  .backdrop { align-items: center; padding: 20px; }
  .sheet { border-radius: var(--r-xl); border-bottom: 1px solid var(--line); animation: pop 0.3s var(--ease) both; }
  .backdrop--closing .sheet { animation: pop 0.22s var(--ease) reverse both; }
}

/* ---------------------------------------------------------
   Toasts
   --------------------------------------------------------- */

#toasts {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + 14px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 14px;
}
.toast {
  pointer-events: auto;
  background: #22262f;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.87rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: pop 0.3s var(--ease) both;
  display: flex; align-items: center; gap: 8px;
  max-width: 100%;
}
.toast--out { animation: fade 0.25s var(--ease) reverse both; }
.toast--bad  { border-color: rgba(251,113,133,.45); color: #ffd7dd; }
.toast--good { border-color: rgba(74,222,128,.45); color: #d6ffe4; }

/* ---------------------------------------------------------
   Estados
   --------------------------------------------------------- */

.empty {
  text-align: center;
  padding: 46px 22px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: rise 0.4s var(--ease) both;
}
.empty__icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 1.6rem;
  margin-bottom: 2px;
}
.empty h3 { color: var(--text); }

.skeleton {
  border-radius: var(--r);
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.09) 37%, rgba(255,255,255,.04) 63%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}

.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}

.divider { height: 1px; background: var(--line-soft); margin: 4px 0; }

/* Confetti del podio */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* Acordeon del detalle por plato */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .rank-row__score { color: var(--accent-2); }
details > summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(45deg);
  margin-left: 2px;
  transition: transform 0.25s var(--ease);
  flex: 0 0 auto;
}
details[open] > summary::after { transform: rotate(225deg); }
details > div { animation: rise-in-place 0.28s var(--ease) both; }
