:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #21262d;
  --ink: #c9d1d9;
  --muted: #8b949e;
  --line: #30363d;
  --accent: #f0883e;   /* naranja ip1.cc */
  --accent-d: #d9742c;
  --link: #58a6ff;
  --green: #7ee787;
  --red: #ff7b72;
  --mono: 'JetBrains Mono', 'Fira Code', 'Monaco', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--mono);
}
a { color: var(--link); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px; display: flex; align-items: center;
  padding-top: max(10px, env(safe-area-inset-top));
}
.brand { color: var(--ink); font-weight: 700; text-decoration: none; font-size: 18px; letter-spacing: .5px; }
.brand::after { content: ".cc"; color: var(--accent); }
[x-cloak] { display: none !important; }
.hamburger { margin-left: auto; background: none; border: 0; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.menu-dropdown {
  position: absolute; top: 100%; right: 8px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; min-width: 210px; box-shadow: 0 10px 28px rgba(0,0,0,.45); z-index: 30;
}
.menu-dropdown button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--ink); padding: 11px 12px; font: inherit; font-family: var(--mono);
  cursor: pointer; border-radius: 8px;
}
.menu-dropdown button:hover { background: var(--surface-2); }
.container { max-width: 920px; margin: 0 auto; padding: 16px; }

h1 { font-size: 1.4rem; margin: .2em 0 .4em; }
h2 { font-size: 1.1rem; margin: 1.1em 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { background: rgba(255,123,114,.12); color: var(--red); border: 1px solid rgba(255,123,114,.4); padding: 10px 12px; border-radius: 8px; }

.btn {
  display: inline-block; padding: 11px 16px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; font-weight: 600; cursor: pointer; font-size: .95rem; font-family: var(--mono);
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); color: #0d1117; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.linkbtn { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 14px 0; }
.form-card { max-width: 420px; margin: 24px auto; }
.form-card label { display: block; margin: 12px 0 4px; font-weight: 600; }
.form-card input { width: 100%; padding: 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; color: var(--ink); font-family: var(--mono); }
.form-card input:focus { outline: none; border-color: var(--accent); }
.form-card small { color: var(--muted); }
.form-card code { color: var(--accent); }
.form-card button { width: 100%; margin-top: 16px; }

.hero { text-align: center; padding: 24px 8px; }
.hero h1 { font-size: 1.6rem; }
.hero strong { color: var(--accent); }
.block-cta { text-align: center; }
.join-cta { background: linear-gradient(180deg, rgba(240,136,62,.10), rgba(240,136,62,.02)); border-color: rgba(240,136,62,.4); }
.join-cta strong { color: var(--accent); }
.dash-head { display: flex; justify-content: space-between; align-items: center; }
.dash-head form { margin: 0; }
.share .cta-row { margin-top: 8px; }
.counts-line { color: var(--green); font-weight: 600; }

/* Álbum */
.album-head { position: sticky; top: 47px; background: var(--bg); padding: 6px 0; z-index: 10; border-bottom: 1px solid var(--line); }
.ah-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ah-back { font-size: 1.25rem; text-decoration: none; color: var(--ink); line-height: 1; padding: 2px 4px; }
.album-head .counts-line { flex: 1; font-size: .82rem; white-space: nowrap; }
.filters { display: flex; gap: 8px; margin: 6px 0 0; }
.filters input { flex: 1; min-width: 0; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; color: var(--ink); font-family: var(--mono); }
.filters select, .give select { padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; color: var(--ink); font-family: var(--mono); }
.give { margin: 0; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.team-block h2 { position: sticky; top: 112px; background: var(--bg); padding: 4px 0; color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grid-view { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.cell {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; position: relative; display: flex; flex-direction: column; align-items: center;
}
.cell img { width: 100%; aspect-ratio: 3/4; object-fit: contain; border-radius: 6px; background: #fff; }
.cell.faltante img { filter: grayscale(1) opacity(.4); background: transparent; }
.cell.repe { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.cell .lbl { font-size: .78rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.cell figcaption { font-size: .78rem; text-align: center; margin-top: 4px; color: var(--ink); }
.cell.wanted { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.star {
  position: absolute; top: 6px; right: 6px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 50%; width: 30px; height: 30px; font-size: 15px; cursor: pointer; opacity: .6; color: var(--muted);
}
.star.on { opacity: 1; color: var(--accent); border-color: var(--accent); }
.stepper { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: 20px; cursor: pointer; font-family: var(--mono);
}
.stepper button:disabled { opacity: .35; }
.stepper .cnt { min-width: 18px; text-align: center; font-weight: 800; }
.price { margin-top: 6px; width: 100%; text-align: center; }
.price input { width: 100%; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; text-align: center; color: var(--ink); font-family: var(--mono); }
.price input:focus { outline: none; border-color: var(--accent); }
.price small { display: block; color: var(--muted); font-size: .66rem; margin-top: 2px; min-height: 1em; }

/* Scrubber tipo Google Photos (país actual al scrollear) */
.scroll-indicator {
  position: fixed; right: 4px; top: 50%; transform: translateY(-50%);
  height: 160px; width: 46vw; max-width: 220px; overflow: hidden; z-index: 25; pointer-events: none;
  -webkit-mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent);
          mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent);
}
.si-track { transition: transform .2s ease-out; text-align: right; }
.si-item {
  height: 28px; line-height: 28px; font-size: .8rem; color: var(--muted); opacity: .5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px;
  text-shadow: 0 1px 3px var(--bg), 0 0 3px var(--bg);
  transition: color .15s, opacity .15s, font-size .15s;
}
.si-item.cur { color: var(--accent); opacity: 1; font-weight: 800; font-size: 1.05rem; }

/* v1b: mensajes + ranking */
.btn-mini { padding: 7px 11px; font-size: .82rem; border-radius: 7px; }
.sec-title { margin-top: 18px; }
.msg-block { display: block; text-decoration: none; color: inherit; }
.msg-block.has-unread { border-color: var(--accent); background: linear-gradient(180deg, rgba(240,136,62,.10), rgba(240,136,62,.02)); }
.msg-block.has-unread h2 { color: var(--accent); }

.rank-card { padding: 12px 14px; }
.rank-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rank-user { font-weight: 800; text-decoration: none; }
.rank-figus { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; -webkit-overflow-scrolling: touch; }
.rank-figus img { height: 64px; width: auto; flex: 0 0 auto; border-radius: 4px; background: #fff; }
.rank-figus .more { flex: 0 0 auto; align-self: center; color: var(--muted); font-size: .8rem; padding: 0 6px; }
.rank-need { color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
.rank-need b { color: var(--ink); }

.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.msg { padding: 12px 14px; }
.msg-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.msg-from { font-weight: 800; text-decoration: none; }
.msg-type { color: var(--muted); font-size: .9rem; }
.msg-type b { color: var(--accent); }
.msg-fig { height: 96px; width: auto; border-radius: 6px; background: #fff; margin: 8px 0; display: block; }
.msg-body { margin: 6px 0; }
.msg-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.badge { font-size: .8rem; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.badge-accepted { color: var(--green); border-color: var(--green); }
.badge-declined, .badge-cancelled { color: var(--red); border-color: var(--red); }
