/* ==========================================================================
   Alcoholímetro — sistema de diseño
   Tema "barra de noche": negro cálido, ámbar cerveza, acentos neón suaves.
   ========================================================================== */

:root {
  --bg: #0e0c0a;
  --bg-2: #14110e;
  --surface: #1b1814;
  --surface-2: #24201b;
  --surface-3: #2e2922;
  --line: #352f27;
  --line-soft: #2a251f;
  --text: #f6efe4;
  --text-2: #c9bba6;
  --text-3: #8d7f6c;

  --amber: #f5b83d;
  --amber-2: #ffd27a;
  --amber-ink: #2a1c00;
  --coral: #ff6b4a;
  --pink: #ff4f8b;
  --violet: #9a8cff;
  --teal: #3fd0c0;
  --green: #6bd66b;
  --red: #ff5a5a;

  --grad-amber: linear-gradient(135deg, #ffd27a 0%, #f5b83d 45%, #e8743b 100%);
  --grad-night: radial-gradient(1200px 600px at 10% -10%, rgba(245, 184, 61, .10), transparent 60%),
                radial-gradient(900px 500px at 110% 10%, rgba(255, 79, 139, .07), transparent 60%);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;

  --nav-h: 68px;
  --top-h: 60px;
  --side-w: 248px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  background-image: var(--grad-night);
  background-attachment: fixed;
  color: var(--text);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-2); }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 5vw, 34px); font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
::selection { background: var(--amber); color: var(--amber-ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* ==========================================================================
   Shell: sidebar (desktop) + topbar & bottom nav (móvil)
   ========================================================================== */
.app { min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex; align-items: center; gap: 12px;
  background: rgba(14, 12, 10, .78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .brand { flex: 1; min-width: 0; }
.topbar-title { font: 800 19px/1 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 20px;
  background: var(--grad-amber);
  box-shadow: 0 6px 18px -6px rgba(245, 184, 61, .6), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-name { font: 800 19px/1 var(--font-display); letter-spacing: -.02em; }
.brand-name b { color: var(--amber); font-weight: 800; }

.main {
  padding: 18px var(--gutter) calc(var(--nav-h) + 36px + env(safe-area-inset-bottom));
  max-width: 1120px; margin: 0 auto;
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0 6px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(20, 17, 14, .9);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-top: 1px solid var(--line-soft);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 100%; color: var(--text-3); font-size: 11px; font-weight: 700;
  border: 0; background: none; position: relative;
  transition: color .2s var(--ease);
}
.nav-item svg { width: 23px; height: 23px; transition: transform .25s var(--ease-spring); }
.nav-item.active { color: var(--amber); }
.nav-item.active svg { transform: translateY(-1px) scale(1.06); }
.nav-item:hover { color: var(--text); }
.nav-item.active:hover { color: var(--amber); }
.nav-item .dot {
  position: absolute; top: 10px; left: calc(50% + 8px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--pink); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}

.fab {
  justify-self: center;
  width: 60px; height: 60px; margin-top: -28px; border-radius: 22px; border: 0;
  display: grid; place-items: center;
  background: var(--grad-amber); color: var(--amber-ink);
  box-shadow: 0 12px 28px -8px rgba(245, 184, 61, .7), 0 0 0 5px var(--bg), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.6; }
.fab:hover { transform: translateY(-2px) rotate(-4deg); }
.fab:active { transform: scale(.94); }

.sidebar { display: none; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: var(--side-w) 1fr; }
  .topbar, .bottom-nav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px;
    position: sticky; top: 0; height: 100dvh;
    padding: 22px 14px;
    border-right: 1px solid var(--line-soft);
    background: rgba(20, 17, 14, .55);
  }
  .sidebar .brand { padding: 4px 10px 18px; }
  .side-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 12px;
    color: var(--text-2); font-weight: 700; font-size: 14.5px;
    transition: background .2s, color .2s;
  }
  .side-link svg { width: 21px; height: 21px; flex: none; }
  .side-link:hover { background: var(--surface); color: var(--text); }
  .side-link.active { background: rgba(245, 184, 61, .12); color: var(--amber); }
  .side-link .dot { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; line-height: 20px; text-align: center; }
  .side-sep { height: 1px; background: var(--line-soft); margin: 10px 8px; }
  .side-add { margin: 6px 0 14px; }
  .side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; color: var(--text); }
  .side-user:hover { background: var(--surface); color: var(--text); }
  .side-user .meta { min-width: 0; }
  .side-user .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user .meta span { font-size: 12px; color: var(--text-3); }
  .main { padding: 32px 36px 60px; width: 100%; }
}

/* ==========================================================================
   Componentes base
   ========================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--text-3); margin-top: 6px; font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; }
.section-head a, .link-btn { font-size: 13.5px; font-weight: 700; color: var(--amber); background: none; border: 0; padding: 0; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 8px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.two-col { display: grid; gap: 18px; }
@media (min-width: 1000px) { .two-col { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card.pad-sm { padding: 14px; }
.card-title { font: 700 15px/1.2 var(--font-display); color: var(--text-2); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card.hover { transition: transform .2s var(--ease), border-color .2s, background .2s; }
.card.hover:hover { transform: translateY(-2px); border-color: var(--line); background: var(--surface-2); }
a.card { color: var(--text); display: block; }

/* Tarjeta destacada con gradiente */
.hero-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 210, 122, .22), transparent 60%),
    linear-gradient(160deg, #2a2016 0%, #1b1712 60%);
  border: 1px solid rgba(245, 184, 61, .22);
  box-shadow: var(--shadow);
}
.hero-card::after {
  content: ''; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 184, 61, .18), transparent 70%);
  pointer-events: none;
}

/* Stat */
.stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font: 800 26px/1.05 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.stat-value small { font-size: .55em; font-weight: 700; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.stat-value.xl { font-size: clamp(40px, 9vw, 58px); }
.stat-value.amber { color: var(--amber); }
.stat-hint { font-size: 12.5px; color: var(--text-3); }
.stat-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 16px; }
.stat-card .ico { font-size: 20px; margin-bottom: 6px; }

/* Botones */
.btn {
  --b-bg: var(--surface-2); --b-fg: var(--text); --b-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 14px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd);
  font-weight: 800; font-size: 14.5px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, opacity .2s, box-shadow .2s;
  user-select: none;
}
.btn:hover { background: var(--surface-3); color: var(--b-fg); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { --b-bg: var(--amber); --b-fg: var(--amber-ink); --b-bd: transparent; background: var(--grad-amber); box-shadow: 0 8px 22px -10px rgba(245, 184, 61, .8), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.primary:hover { filter: brightness(1.06); background: var(--grad-amber); }
.btn.ghost { --b-bg: transparent; --b-bd: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { --b-bg: rgba(255, 90, 90, .12); --b-fg: var(--red); --b-bd: rgba(255, 90, 90, .25); }
.btn.danger:hover { background: rgba(255, 90, 90, .2); }
.btn.sm { height: 36px; padding: 0 13px; border-radius: 11px; font-size: 13.5px; }
.btn.xs { height: 30px; padding: 0 10px; border-radius: 9px; font-size: 12.5px; }
.btn.lg { height: 54px; padding: 0 24px; border-radius: 17px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn.icon.sm { width: 36px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 13px;
  color: var(--text); font-weight: 600; font-size: 15.5px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none; -webkit-appearance: none;
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23c9bba6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); font-weight: 500; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(245, 184, 61, .14); background: var(--surface); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 52px; }
.input-group .suffix { position: absolute; right: 14px; color: var(--text-3); font-weight: 700; font-size: 14px; pointer-events: none; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
input[type='datetime-local'].input { padding-right: 10px; }
input[type='number'].input { -moz-appearance: textfield; }
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.switch span { width: 46px; height: 28px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); transition: background .2s; position: relative; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform .25s var(--ease-spring), background .2s; }
.switch input:checked + span { background: var(--amber); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(18px); background: var(--amber-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: 0; }

/* Chips & segmented */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip:active { transform: scale(.96); }
.chip.active, .chip[aria-pressed='true'] { background: var(--amber); color: var(--amber-ink); border-color: transparent; }
.chip small { font-weight: 600; opacity: .7; }

.segmented {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line-soft);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: none; height: 34px; padding: 0 14px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-3); font-weight: 800; font-size: 13px;
  transition: background .2s, color .2s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 8px -2px rgba(0,0,0,.5); }
.segmented.block { display: flex; width: 100%; }
.segmented.block button { flex: 1; }

/* Tabs subrayadas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; height: 44px; padding: 0 14px; border: 0; background: none; color: var(--text-3); font-weight: 800; font-size: 14px; position: relative; }
.tabs button.active { color: var(--text); }
.tabs button.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--amber); }
.tabs button .count { margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; }

/* Badge / pill */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-soft); white-space: nowrap; }
.pill.amber { background: rgba(245, 184, 61, .14); color: var(--amber); border-color: rgba(245, 184, 61, .25); }
.pill.pink { background: rgba(255, 79, 139, .14); color: var(--pink); border-color: rgba(255, 79, 139, .25); }
.pill.green { background: rgba(107, 214, 107, .12); color: var(--green); border-color: rgba(107, 214, 107, .25); }
.pill.red { background: rgba(255, 90, 90, .12); color: var(--red); border-color: rgba(255, 90, 90, .25); }
.pill.violet { background: rgba(154, 140, 255, .14); color: var(--violet); border-color: rgba(154, 140, 255, .25); }

/* Avatar */
.avatar {
  --c: var(--amber);
  flex: none; width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center; font-size: 20px; line-height: 1;
  background: color-mix(in srgb, var(--c) 22%, var(--surface-2));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent);
}
.avatar.sm { width: 32px; height: 32px; border-radius: 11px; font-size: 16px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 22px; font-size: 32px; }
.avatar.xl { width: 92px; height: 92px; border-radius: 30px; font-size: 46px; }

/* Listas */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  color: var(--text); transition: background .15s;
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); color: var(--text); }
button.list-item { width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; background: none; }
.list-item .title { font-weight: 800; font-size: 14.5px; }
.list-item .meta { font-size: 12.5px; color: var(--text-3); }

/* Emoji de bebida */
.drink-ico {
  --c: var(--amber);
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 23px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface-2));
}

/* Ranking */
.rank-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.rank-row:last-child { border-bottom: 0; }
.rank-row.me { background: rgba(245, 184, 61, .07); }
.rank-pos { font: 800 16px var(--font-display); color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.rank-row:nth-child(1) .rank-pos { color: #ffd27a; }
.rank-row:nth-child(2) .rank-pos { color: #d6dbe3; }
.rank-row:nth-child(3) .rank-pos { color: #e3a172; }
.rank-val { font: 800 16px var(--font-display); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rank-val small { display: block; font: 600 11.5px var(--font); color: var(--text-3); }

/* Podio */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; margin: 8px 0 18px; }
.podium-step { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; color: var(--text); }
.podium-step .name { font-weight: 800; font-size: 13.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-step .val { font: 800 15px var(--font-display); color: var(--amber); }
.podium-block { width: 100%; border-radius: 16px 16px 6px 6px; display: grid; place-items: center; font: 800 26px var(--font-display); color: rgba(0,0,0,.55); }
.podium-step.p1 .podium-block { height: 96px; background: linear-gradient(180deg, #ffd27a, #e9a62c); }
.podium-step.p2 .podium-block { height: 70px; background: linear-gradient(180deg, #e6e9ef, #a9b0bc); }
.podium-step.p3 .podium-block { height: 54px; background: linear-gradient(180deg, #f0b48a, #b8703f); }
.podium-step .crown { font-size: 22px; margin-bottom: -6px; }

/* Barra de progreso */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--grad-amber); transition: width .8s var(--ease); }

/* Barras horizontales simples */
.hbar { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; }
.hbar .track { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--amber)); }

/* Empty state */
.empty { text-align: center; padding: 36px 20px; color: var(--text-3); }
.empty .emoji { font-size: 46px; margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 340px; margin: 0 auto 16px; font-size: 14px; }

/* Skeleton */
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: skel 1.3s infinite linear; }
@keyframes skel { to { background-position: -200% 0; } }

/* Spinner */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--amber); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: grid; place-items: center; min-height: 40vh; }

/* Avisos */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-soft); font-size: 13.5px; color: var(--text-2); }
.notice .ico { font-size: 20px; line-height: 1; }
.notice.warn { background: rgba(255, 107, 74, .08); border-color: rgba(255, 107, 74, .25); }
.notice.amber { background: rgba(245, 184, 61, .08); border-color: rgba(245, 184, 61, .25); }

/* ==========================================================================
   Overlays: sheet / modal / toast
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 4, 3, .6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s var(--ease);
}
.overlay.closing { animation: fade-out .2s var(--ease) forwards; }
.sheet {
  width: 100%; max-height: 92dvh;
  display: flex; flex-direction: column;
  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);
  animation: sheet-up .32s var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}
.overlay.closing .sheet { animation: sheet-down .22s var(--ease) forwards; }
.sheet-grab { width: 42px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px 8px; flex: none; }
.sheet-head h2 { flex: 1; font-size: 20px; }
.sheet-body { padding: 8px 18px 18px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); flex: none; display: flex; gap: 10px; }
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: var(--r-xl); border-bottom: 1px solid var(--line); max-height: 88dvh; animation: pop-in .28s var(--ease); }
  .sheet.wide { max-width: 760px; }
  .overlay.closing .sheet { animation: pop-out .18s var(--ease) forwards; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 18px; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.97); } }

.toasts { position: fixed; z-index: 200; left: 50%; translate: -50% 0; top: calc(env(safe-area-inset-top) + 12px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 16px; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-weight: 700; font-size: 14px;
  animation: toast-in .35s var(--ease-spring);
}
.toast.out { animation: toast-out .25s var(--ease) forwards; }
.toast.error { border-color: rgba(255, 90, 90, .4); }
.toast.success { border-color: rgba(107, 214, 107, .35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* Animación de entrada de vistas */
.view-enter { animation: view-in .35s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.stagger > * { animation: view-in .45s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .04s; }
.stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .12s; }
.stagger > *:nth-child(5) { animation-delay: .16s; }
.stagger > *:nth-child(6) { animation-delay: .2s; }

/* ==========================================================================
   Apuntar bebida (sheet)
   ========================================================================== */
.drink-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.drink-opt {
  --c: var(--amber);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 78px; border-radius: 16px; line-height: 1.15;
  background: var(--surface); border: 1.5px solid var(--line-soft);
  color: var(--text-2); font-weight: 800; font-size: 11.5px; text-align: center; padding: 8px 4px;
  transition: transform .2s var(--ease-spring), border-color .2s, background .2s, color .2s;
}
.drink-opt .e { font-size: 28px; line-height: 1; transition: transform .3s var(--ease-spring); }
.drink-opt:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); color: var(--text); }
.drink-opt:hover .e { transform: scale(1.1) rotate(-6deg); }
.drink-opt.active { background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-color: var(--c); color: var(--text); }
.drink-opt:active { transform: scale(.95); }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.stepper button { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--text); font-size: 22px; font-weight: 700; display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-3); }
.stepper button:active { transform: scale(.92); }
.stepper output { min-width: 46px; text-align: center; font: 800 22px var(--font-display); font-variant-numeric: tabular-nums; }

.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-radius: 16px; overflow: hidden; background: var(--line-soft); border: 1px solid var(--line-soft); }
.summary-strip > div { background: var(--surface); padding: 10px 8px; text-align: center; }
.summary-strip b { display: block; font: 800 17px var(--font-display); font-variant-numeric: tabular-nums; }
.summary-strip span { font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.loc-box { border-radius: 18px; background: var(--surface); border: 1px solid var(--line-soft); overflow: hidden; }
.loc-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 13.5px; }
.loc-status .ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); flex: none; font-size: 17px; }
.loc-map { height: 220px; border-top: 1px solid var(--line-soft); position: relative; }
.loc-map .pin-center { position: absolute; left: 50%; top: 50%; z-index: 500; translate: -50% -100%; font-size: 34px; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
.form-section { margin-top: 20px; }
.form-section > .label { display: block; margin-bottom: 10px; }

/* ==========================================================================
   Mapas (Leaflet)
   ========================================================================== */
.map { width: 100%; height: 100%; min-height: 200px; background: #111; border-radius: inherit; }
.map-wrap { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-soft); }
.leaflet-container { background: #0f0f10; font-family: var(--font); }
.leaflet-control-attribution { background: rgba(14, 12, 10, .75) !important; color: var(--text-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 12px 14px; font-weight: 600; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-3); }
.map-pin { font-size: 26px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }

/* ==========================================================================
   Pantallas de acceso
   ========================================================================== */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter);
  background:
    radial-gradient(700px 500px at 50% -10%, rgba(245, 184, 61, .18), transparent 65%),
    radial-gradient(500px 400px at 100% 100%, rgba(255, 79, 139, .1), transparent 60%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 26px; }
.auth-hero .brand-logo { width: 72px; height: 72px; border-radius: 24px; font-size: 40px; margin: 0 auto 18px; }
.auth-hero h1 { font-size: 34px; }
.auth-hero p { color: var(--text-2); margin-top: 8px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--text-3); font-size: 14px; }
.counter-ticker { display: flex; justify-content: center; gap: 22px; margin-top: 26px; color: var(--text-3); font-size: 12.5px; text-align: center; }
.counter-ticker b { display: block; font: 800 22px var(--font-display); color: var(--text); }

/* Utilidades de espaciado */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.segmented button svg { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; margin-right: 4px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '＋ '; color: var(--amber); }
details[open] > summary::before { content: '－ '; }

/* ==========================================================================
   Vista de mapa a pantalla completa
   ========================================================================== */
.map-page { margin: -18px calc(var(--gutter) * -1) calc((var(--nav-h) + 36px) * -1); }
.map-full {
  height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border-radius: 0; border: 0;
}
.map-overlay { position: absolute; left: 0; right: 0; z-index: 500; padding: 12px; pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
.map-overlay > * { pointer-events: auto; }
.map-overlay.top { top: 0; align-items: flex-start; }
.map-overlay.bottom { bottom: 0; }
.map-seg { background: rgba(20, 17, 14, .88); backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.map-select { height: 40px; width: auto; max-width: 70vw; background-color: rgba(20, 17, 14, .92); font-size: 14px; }
.map-panel { background: rgba(20, 17, 14, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow-lg); max-width: 640px; }
.map-panel .segmented { background: var(--bg); }
.map-btn { background: var(--surface-2); border: 1px solid var(--line); width: 38px; height: 38px; }
.map-btn.on { color: var(--amber); border-color: rgba(245, 184, 61, .4); }
.map-full .leaflet-top.leaflet-right { top: 56px; }
@media (min-width: 900px) {
  .map-page { margin: -32px -36px -60px; }
  .map-full { height: 100dvh; }
  .map-overlay { padding: 18px; }
  .map-full .leaflet-top.leaflet-right { top: 8px; }
}
.leaflet-tile.dark-tiles, .dark-tiles .leaflet-tile { filter: invert(1) hue-rotate(185deg) brightness(.95) contrast(.9) saturate(.5); }
.map-panel .chip { height: 32px; padding: 0 12px; font-size: 13px; background: var(--surface-2); }
.map-panel .chip.active { background: var(--amber); }
.map-panel .segmented button { padding: 0 8px; }
/* Los panes de Leaflet miden 0px: sin esto el canvas del mapa de calor colapsa */
.leaflet-container canvas, .leaflet-container img { max-width: none !important; }
.notice > svg { flex: none; align-self: center; color: var(--text-3); }
.pill > svg { width: 12px; height: 12px; flex: none; }
