:root {
  --bg: #edf4fb;
  --panel: #ffffff;
  --line: #c5d9ec;
  --text: #1a3352;
  --muted: #6b8aad;
  --sky: #7ec4e8;
  --sky-dim: #4a90c4;
  --gold: #f2d56e;
  --gold-dim: #e8c040;
  --win: #5cb88a;
  --lose: #e07a7a;
  --shadow: rgba(74, 143, 201, 0.14);
  --overlay: rgba(237, 244, 251, 0.9);
  --header-h: 64px;
  --dock-h: 88px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 50% -10%, rgba(126, 196, 232, 0.45), transparent 70%),
    radial-gradient(700px 400px at 90% 100%, rgba(242, 213, 110, 0.28), transparent 70%),
    radial-gradient(600px 400px at 5% 80%, rgba(74, 144, 196, 0.18), transparent 65%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky-dim); }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 20px calc(40px + var(--safe-bottom));
}

/* Silo: riel vertical de farming en desktop */
.silo {
  display: none;
}

.silo-logo {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff8e4;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 8px 24px rgba(242, 213, 110, 0.4);
}

.silo-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.silo-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.silo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--muted);
  transition: 0.15s;
}

.silo-link:hover { color: var(--text); background: rgba(126, 196, 232, 0.14); }
.silo-link.active {
  color: var(--sky-dim);
  background: linear-gradient(180deg, rgba(126, 196, 232, 0.28), rgba(242, 213, 110, 0.18));
}

.silo-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.silo-hint {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}

.silo-link .nav-icon { width: 22px; height: 22px; }

.share-slot { display: none; }

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, #f8e08a 48%, var(--sky) 100%);
  color: #1f3550;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(242, 213, 110, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.share-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.share-btn:active { transform: scale(0.97); }

.share-btn.done {
  background: linear-gradient(135deg, #dff5ea, #b8e8cc);
  color: #1f5f42;
}

.share-btn-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.share-btn-icon svg { width: 100%; height: 100%; display: block; }

.silo-share {
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px 8px;
  border-radius: 18px;
}

.silo-share .share-btn-label {
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Dock móvil: logo al centro como acción principal */
.farm-dock {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  padding: 8px 10px 10px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(74, 143, 201, 0.24);
}

.dock-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dock-link .nav-icon { width: 22px; height: 22px; }
.dock-link.active {
  color: var(--sky-dim);
  background: rgba(126, 196, 232, 0.18);
}

.dock-farm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: -28px;
  text-decoration: none;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.dock-farm img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff8e4;
  box-shadow:
    0 0 0 4px #fff,
    0 8px 20px rgba(242, 213, 110, 0.45);
  animation: bob 2.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.dock-farm.active img {
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 7px var(--gold),
    0 10px 24px rgba(242, 213, 110, 0.5);
}

.page-hero {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky-dim);
}

.made-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
  transition: 0.15s;
}

.made-by img { border-radius: 50%; display: block; }
.made-by b { color: var(--text); font-weight: 600; }
.made-by:hover { border-color: var(--sky); color: var(--text); background: #fff; }

h1 {
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.sub {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
}

/* Racha y progreso */
.scorebar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 540px;
  margin: -18px auto 28px;
}

.scorebar[hidden] { display: none; }

.pill {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  white-space: nowrap;
}

.pill.racha {
  color: var(--text);
  background: #fff;
  border-color: var(--sky);
  box-shadow: 0 4px 16px var(--shadow);
}

.pill.racha.hot { background: var(--gold); border-color: var(--gold-dim); color: #3d3200; }
.pill.racha.fire { background: #f5b88a; border-color: #e8a070; color: #4a2010; }

.cooldown {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: rgba(74, 144, 196, 0.25);
  animation: cooldown 15s linear forwards;
}

@keyframes cooldown { to { width: 0; } }

.track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  overflow: hidden;
}

.track-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky-dim), var(--sky), var(--gold));
  transition: width 0.4s ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + var(--safe-bottom));
  z-index: 40;
  transform: translate(-50%, 18px);
  padding: 12px 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 44px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 0.28s cubic-bezier(0.2, 1.2, 0.4, 1);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #fde8e8; color: #7a2020; border-color: var(--lose); box-shadow: 0 12px 44px rgba(224, 122, 122, 0.22); }

/* Duelo */
.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 20px var(--shadow);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

/* Solo con mouse: en touch el :hover queda pegado despues de tocar. */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    border-color: var(--sky);
    box-shadow: 0 16px 44px rgba(126, 196, 232, 0.35);
  }
}

.duel:not(.locked) .card:active {
  transform: scale(0.96);
  border-color: var(--sky-dim);
}

.card.won {
  border-color: var(--gold-dim);
  transform: translateY(-4px) scale(1.015);
  box-shadow:
    0 0 0 2px rgba(242, 213, 110, 0.85),
    0 0 38px rgba(126, 196, 232, 0.45),
    0 0 80px 12px rgba(242, 213, 110, 0.25);
  animation: aura 1.6s ease-out infinite;
}

@keyframes aura {
  0%, 100% { box-shadow: 0 0 0 2px rgba(242,213,110,.85), 0 0 38px rgba(126,196,232,.45), 0 0 80px 12px rgba(242,213,110,.25); }
  50% { box-shadow: 0 0 0 2px rgba(242,213,110,1), 0 0 58px rgba(126,196,232,.6), 0 0 100px 22px rgba(242,213,110,.38); }
}

/* Atenuo las partes de adentro y no la carta entera, asi el Elo del perdedor se lee igual. */
.card.lost .avatar,
.card.lost h2,
.card.lost .role { opacity: 0.38; }

.duel.locked .card { pointer-events: none; }

.ring {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(126, 196, 232, 0.85);
  pointer-events: none;
  animation: ring-out 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes ring-out {
  from { transform: scale(1); opacity: 0.95; }
  to { transform: scale(1.3); opacity: 0; }
}

.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(242, 213, 110, 0.9);
  pointer-events: none;
  animation: spark-out 0.85s ease-out forwards;
}

@keyframes spark-out {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

.pop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.92), rgba(237, 244, 251, 0.82) 65%, rgba(237, 244, 251, 0.55));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

.pop.show { opacity: 1; }

.pop-old {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0;
}

.pop.show .pop-old { animation: pop-old 1s ease-out forwards; }

@keyframes pop-old {
  0% { opacity: 0; transform: translateY(8px); }
  25% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.45; transform: translateY(-6px); }
}

.pop-num {
  font-size: clamp(38px, 8vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.pop-delta {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 800;
  padding: 4px 13px;
  border-radius: 999px;
}

.pop.up .pop-num { color: var(--win); text-shadow: 0 0 28px rgba(92, 184, 138, 0.45); }
.pop.down .pop-num { color: var(--lose); text-shadow: 0 0 28px rgba(224, 122, 122, 0.45); }
.pop.up .pop-delta { background: rgba(92, 184, 138, 0.18); color: var(--win); }
.pop.down .pop-delta { background: rgba(224, 122, 122, 0.18); color: var(--lose); }

.pop.show .pop-num { animation: pop-in 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.pop.show .pop-delta { animation: pop-in 0.4s 0.12s cubic-bezier(0.2, 1.5, 0.4, 1) both; }

@keyframes pop-in {
  from { transform: scale(0.55); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.loader {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.card.loading .loader { opacity: 1; }

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(126, 196, 232, 0.3);
  border-top-color: var(--sky-dim);
  animation: spin 0.7s linear infinite;
}

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

.avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  object-position: top center;
  background: #d4e8f5;
  display: block;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 800;
  color: var(--sky-dim);
  background: linear-gradient(150deg, #d4e8f5, #b8daf0);
}

.card h2 {
  margin: 14px 0 4px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.card .role {
  color: var(--sky-dim);
  font-size: 13px;
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card .stats { color: var(--muted); font-size: 13px; margin: 0; }

.vs {
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px var(--shadow);
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 26px;
}

kbd {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  font-family: inherit;
}

/* Ranking */
.podium {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  align-items: end;
  gap: 12px;
  margin-bottom: 28px;
}

.podium[hidden] { display: none; }

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px var(--shadow);
}

.podium-slot.rank-1 {
  padding-top: 18px;
  padding-bottom: 22px;
  border-color: rgba(232, 192, 64, 0.55);
  background: linear-gradient(180deg, #fffef6 0%, #fff 55%);
  transform: translateY(-8px);
}

.podium-slot.rank-2 { order: 1; }
.podium-slot.rank-1 { order: 2; }
.podium-slot.rank-3 { order: 3; }

.podium-medal { font-size: 22px; line-height: 1; margin-bottom: 8px; }
.podium-slot.rank-1 .podium-medal { font-size: 28px; }

.podium-frame {
  width: 100%;
  max-width: 108px;
  margin-bottom: 10px;
}

.podium-slot.rank-1 .podium-frame { max-width: 124px; }

.podium-avatar,
.rank-avatar {
  object-fit: cover;
  object-position: top center;
  background: #d4e8f5;
  display: block;
}

.podium-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
}

.podium-avatar-fallback,
.rank-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--sky-dim);
  background: linear-gradient(150deg, #d4e8f5, #b8daf0);
}

.podium-avatar-fallback {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  font-size: 42px;
}

.rank-avatar,
.rank-avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}

.podium-slot.rank-1 .podium-avatar-fallback { font-size: 50px; }
.rank-avatar-fallback { font-size: 18px; }

.podium-pos {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.podium-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.podium-slot.rank-1 .podium-name { font-size: 17px; }

.podium-role {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sky-dim);
}

.podium-elo {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 900;
  color: var(--sky-dim);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.podium-slot.rank-1 .podium-elo { font-size: 28px; }

.podium-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.rank-section-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.rank-card {
  display: grid;
  grid-template-columns: 34px 52px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 12px var(--shadow);
}

.rank-card-pos {
  font-weight: 800;
  font-size: 16px;
  color: var(--muted);
  text-align: center;
}

.rank-card-body { min-width: 0; }

.rank-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rank-card-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-card-elo {
  font-weight: 800;
  font-size: 18px;
  color: var(--sky-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.rank-card-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-card-bar {
  margin-top: 8px;
  height: 5px;
  border-radius: 999px;
  background: rgba(197, 217, 236, 0.55);
  overflow: hidden;
}

.rank-card-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky-dim), var(--sky), var(--gold));
}

.rank-row {
  display: grid;
  grid-template-columns: 44px 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 12px var(--shadow);
}

.rank-row.top { border-color: rgba(232, 192, 64, 0.55); background: linear-gradient(135deg, #fffef8, #fff); }

.pos { font-weight: 800; font-size: 17px; color: var(--muted); text-align: center; }
.rank-row.top .pos { color: #b8920a; }

.mini {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  object-position: top center;
  background: #d4e8f5;
}

.mini-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--sky-dim);
}

.rank-name { font-weight: 650; letter-spacing: -0.01em; }
.rank-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.elo {
  font-weight: 800;
  font-size: 20px;
  color: var(--sky-dim);
  font-variant-numeric: tabular-nums;
}

/* Duelos */
.duel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 12px var(--shadow);
}

.side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.side.right { flex-direction: row-reverse; opacity: 0.55; }

.side .name {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side.left .name { color: var(--win); }

.beat {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.duel-meta {
  text-align: right;
  min-width: 92px;
  flex-shrink: 0;
}

.duel-meta .pts { font-weight: 800; color: var(--win); font-variant-numeric: tabular-nums; }
.duel-meta .when { color: var(--muted); font-size: 12px; }

.feed { margin-top: 44px; }

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.feed-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.feed-total { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.feed-head a { font-size: 13px; font-weight: 600; text-decoration: none; }

/* Panel */
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 4px 20px var(--shadow);
}

.panel h3 { margin: 0 0 16px; font-size: 16px; letter-spacing: -0.01em; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #f7fbff;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 14px;
}

input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(126, 196, 232, 0.25); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 200px; }

button {
  padding: 12px 20px;
  border-radius: 11px;
  border: none;
  background: var(--sky-dim);
  color: #fff;
  font-weight: 750;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.15s;
}

button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; }

button.ghost {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 13px;
  font-size: 13px;
}

button.ghost:hover { border-color: var(--lose); color: var(--lose); background: #fff; }

.msg { font-size: 14px; margin: 10px 0 0; min-height: 20px; }
.msg.err { color: var(--lose); }
.msg.ok { color: var(--win); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

@media (min-width: 860px) {
  .silo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: fixed;
    left: 16px;
    top: 16px;
    bottom: 16px;
    z-index: 30;
    width: 96px;
    padding: 16px 10px 14px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 16px 40px var(--shadow);
  }

  .silo-nav { flex: 1; justify-content: center; }
  .farm-dock,
  .share-slot { display: none; }

  .wrap {
    padding: 28px 28px 48px 140px;
    max-width: 1120px;
  }

  .toast { bottom: 26px; }
}

@media (max-width: 859px) {
  .wrap {
    padding: 18px 14px calc(var(--dock-h) + 36px + var(--safe-bottom));
  }

  .share-slot {
    display: block;
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 12px;
    z-index: 40;
  }

  .share-fab {
    padding: 11px;
    min-width: 44px;
    min-height: 44px;
  }

  .share-fab .share-btn-label { display: none; }

  .page-hero { margin: 8px 52px 18px 12px; }
  .eyebrow { font-size: 11px; }
  h1 { font-size: 24px; }
  .sub { font-size: 13px; }

  .toast {
    bottom: calc(var(--dock-h) + 18px + var(--safe-bottom));
    max-width: calc(100vw - 32px);
    text-align: center;
  }

  .podium {
    gap: 8px;
    margin-bottom: 20px;
  }

  .podium-slot {
    padding: 10px 6px 12px;
    border-radius: 16px;
  }

  .podium-slot.rank-1 { transform: translateY(-4px); }

  .podium-frame { max-width: 84px; }
  .podium-slot.rank-1 .podium-frame { max-width: 96px; }

  .podium-name { font-size: 12px; }
  .podium-slot.rank-1 .podium-name { font-size: 14px; }

  .podium-role,
  .podium-sub { display: none; }

  .podium-elo { font-size: 18px; }
  .podium-slot.rank-1 .podium-elo { font-size: 22px; }

  .rank-card {
    grid-template-columns: 28px 44px 1fr;
    gap: 10px;
    padding: 10px 12px;
  }

  .rank-card-elo { font-size: 16px; }
}

@media (max-width: 640px) {
  .scorebar { gap: 8px; margin: -8px auto 16px; }
  .pill { font-size: 11px; padding: 5px 10px; }

  /* Las dos opciones quedan lado a lado: se comparan de un vistazo, sin scrollear. */
  /* stretch para que las dos cartas midan igual aunque un rol ocupe dos lineas. */
  .duel {
    position: relative;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .card { padding: 9px; border-radius: 16px; }
  .card h2 { font-size: 15px; margin: 9px 0 3px; }
  .card .role { font-size: 10px; letter-spacing: 0.04em; }
  .avatar { border-radius: 11px; }
  .avatar-fallback { font-size: 40px; }

  .vs {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 11px;
    padding: 8px 9px;
    background: #fff;
    pointer-events: none;
  }

  .pop-old { font-size: 12px; }
  .pop-num { font-size: 34px; }
  .pop-delta { font-size: 13px; margin-top: 5px; padding: 3px 10px; }
  .spark { width: 5px; height: 5px; }

  .hint { display: none; }
  .feed { margin-top: 30px; }

  .rank-row { grid-template-columns: 32px 40px 1fr auto; gap: 10px; padding: 10px 12px; }
  .mini { width: 40px; height: 40px; }
  .beat { display: none; }
  .duel-item { gap: 8px; padding: 10px 12px; }
  .duel-item .mini { width: 30px; height: 30px; border-radius: 8px; }
  .duel-item .side { gap: 7px; }
  .duel-item .name { font-size: 13px; }
  .duel-meta { min-width: 48px; }
  .duel-meta .when { display: none; }
}
