/* ============================================================
   cacau · ranking claude
   paleta cacau: #2C2C28 carvão · #E5E2D5 creme · #FBF8F3 off-white
   estilo: apple minimalista, editorial, preto e branco
   ============================================================ */

:root {
  --ink: #2C2C28;
  --ink-soft: #54483A;
  --paper: #FBF8F3;
  --cream: #E5E2D5;
  --gray: #858580;
  --line: rgba(44,44,40,0.10);
  --line-strong: rgba(44,44,40,0.20);
  --shadow-sm: 0 1px 2px rgba(44,44,40,0.04), 0 4px 16px rgba(44,44,40,0.04);
  --shadow-md: 0 4px 24px rgba(44,44,40,0.08);
  --shadow-lg: 0 16px 48px rgba(44,44,40,0.12);
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea { font-family: inherit; }
img, svg { display: block; max-width: 100%; }

/* ============================================================
   topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(251,248,243,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 22px;
  height: 22px;
  color: var(--ink);
}

.brand-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.brand-title {
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.countdown {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 500;
}

/* ============================================================
   hero
   ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}

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

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 20px;
  font-weight: 500;
}

.hero-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(28px, 4.5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-sub strong {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================================
   ranking columns (vertical bars)
   ============================================================ */
.ranking {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 56px;
  align-items: stretch;
}

.col {
  --col-color: var(--ink);
  --col-tint: rgba(44,44,40,0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 18px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}

.col:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--col-color);
}

.col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--col-color);
  opacity: 0;
  transition: opacity .25s ease;
}

.col.is-leader::before { opacity: 1; }
.col.is-leader { border-color: var(--col-color); }

.col-rank {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gray);
  text-transform: uppercase;
}

.col.is-leader .col-rank {
  color: var(--col-color);
}

.col-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-top: 6px;
  margin-bottom: 4px;
  text-align: center;
}

.col-meta {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 18px;
}

.col-tube {
  position: relative;
  width: 86px;
  flex: 1;
  min-height: 320px;
  background: var(--col-tint);
  border-radius: 999px;
  overflow: visible;
}

.col-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: var(--col-color);
  border-radius: 999px;
  transition: height 1.4s cubic-bezier(.2,.85,.2,1);
}

.col-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 60%);
  pointer-events: none;
}

.col-photo {
  position: absolute;
  left: 50%;
  bottom: 0%;
  transform: translate(-50%, 50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--cream);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.08);
  transition: bottom 1.4s cubic-bezier(.2,.85,.2,1), transform .25s ease;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 0.04em;
}

.col-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.col:hover .col-photo {
  transform: translate(-50%, 50%) scale(1.06);
}

.col-bubble {
  position: absolute;
  left: 50%;
  bottom: 0%;
  transform: translate(-50%, calc(50% - 92px));
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
  max-width: 200px;
  text-align: center;
  white-space: normal;
  width: max-content;
  max-width: 180px;
  line-height: 1.3;
  opacity: 0;
  z-index: 4;
  pointer-events: none;
  transition: bottom 1.4s cubic-bezier(.2,.85,.2,1), opacity .35s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.col-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--ink);
  border-radius: 1px;
}

.col-bubble.show { opacity: 1; }

.col-points {
  margin-top: 22px;
  text-align: center;
}

.col-points-num {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: transform .4s cubic-bezier(.2,.85,.2,1);
}

.col-points-num.bump {
  animation: bump .6s cubic-bezier(.2,.85,.2,1);
}

@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.col-points-label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
  margin-top: 8px;
}

.col-badge {
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--col-color);
  color: #fff;
  text-align: center;
  display: inline-block;
}

.col-badge.is-last {
  background: transparent;
  color: var(--gray);
  border: 1px solid var(--line-strong);
}

/* pulse for leader */
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(0,0,0,0.18), 0 6px 20px rgba(0,0,0,0.18); }
  70%  { box-shadow: 0 0 0 14px rgba(0,0,0,0), 0 6px 20px rgba(0,0,0,0.18); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0), 0 6px 20px rgba(0,0,0,0.18); }
}
.col.is-leader .col-photo {
  animation: pulseRing 2.4s ease-out infinite;
}

/* ============================================================
   actions
   ============================================================ */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all .15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn.primary {
  background: var(--ink);
  color: var(--paper);
}

.btn.primary:hover { background: #000; transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn.ghost:hover { background: rgba(44,44,40,0.04); border-color: var(--ink); }

/* ============================================================
   feed
   ============================================================ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}

.section-head h2 {
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.section-meta {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.feed-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 22px;
  background: #fff;
  transition: background .15s ease;
}

.feed-item:hover { background: var(--paper); }

.feed-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  overflow: hidden;
}

.feed-avatar img { width: 100%; height: 100%; object-fit: cover; }

.feed-text { min-width: 0; }
.feed-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  flex-wrap: wrap;
}
.feed-line strong { font-weight: 600; }
.feed-kind {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
}
.feed-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-word;
}
.feed-link {
  display: inline-block;
  font-size: 12px;
  color: var(--ink);
  text-decoration: underline;
  margin-top: 4px;
  text-underline-offset: 2px;
}
.feed-time {
  font-size: 11px;
  color: var(--gray);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.feed-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--gray);
  background: #fff;
  font-family: var(--sans);
  font-weight: 500;
}

/* ============================================================
   footer
   ============================================================ */
.footer {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 32px;
  border-top: 1px solid var(--line);
}

.footer .dot { margin: 0 10px; }

/* ============================================================
   toast (motivational)
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
  z-index: 100;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   modal
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(44,44,40,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.modal[aria-hidden="false"] { display: flex; }

.modal-card {
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 520px;
  position: relative;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.detail { max-width: 640px; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--gray);
  transition: background .15s ease;
}
.modal-close:hover { background: var(--line); color: var(--ink); }

.modal-card h3 {
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 18px;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  color: var(--ink);
}

.modal-sub {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 24px;
}

.who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.who {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all .15s ease;
  background: #fff;
}

.who:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.who-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  overflow: hidden;
}
.who-avatar img { width: 100%; height: 100%; object-fit: cover; }
.who-avatar::before {
  content: attr(data-initial);
}
.who-avatar.has-photo::before { content: ''; }

.who span {
  font-size: 14px;
  font-weight: 500;
}

.kind-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.kind {
  text-align: left;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kind:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kind-icon {
  font-size: 22px;
  margin-bottom: 4px;
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
}

.kind-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: lowercase;
}

.kind-meta {
  font-size: 12px;
  color: var(--gray);
  font-weight: 400;
}

#entry-desc {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  min-height: 100px;
  transition: border-color .15s ease;
  margin-bottom: 14px;
}

#entry-desc:focus {
  outline: none;
  border-color: var(--ink);
}

.file-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  background: #fff;
}

.file-name {
  font-size: 12px;
  color: var(--gray);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.modal-status {
  margin-top: 14px;
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  font-family: var(--sans);
  font-weight: 500;
}

.modal-status.error { color: #B33A2F; }
.modal-status.ok { color: var(--ink); }

/* detail list */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.detail-item {
  background: #fff;
  padding: 14px 18px;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 6px;
}

.detail-desc {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 740px) {
  .topbar { padding: 14px 18px; }
  .container { padding: 32px 14px 60px; }
  .ranking { gap: 10px; }
  .col { padding: 18px 8px 16px; }
  .col-tube { width: 56px; min-height: 240px; }
  .col-photo { width: 56px; height: 56px; font-size: 16px; border-width: 3px; }
  .col-bubble { font-size: 9px; padding: 6px 10px; max-width: 110px; transform: translate(-50%, calc(50% - 76px)); }
  .col-name { font-size: 13px; }
  .col-points-num { font-size: 32px; }
  .col-meta { margin-bottom: 12px; font-size: 9px; }
  .col-badge { font-size: 8px; padding: 5px 8px; }
  .who-grid { grid-template-columns: 1fr; }
  .kind-grid { grid-template-columns: 1fr; }
  .feed-item { grid-template-columns: 28px 1fr; padding: 14px 16px; }
  .feed-time { grid-column: 2 / -1; margin-top: 4px; }
}
