/* ============================================================
   BOUNTIES.CSS — community bounty board (pump.fun-inspired)
   ============================================================ */

:root {
  --bt-green: #16c784;
  --bt-green-2: #1ee08f;
  --bt-green-soft: rgba(22, 199, 132, 0.14);
  --bt-green-border: rgba(22, 199, 132, 0.32);
  --bt-bg: #0a0b10;
  --bt-card: #14161d;
  --bt-card-2: #181b23;
  --bt-line: rgba(255, 255, 255, 0.07);
  --bt-text: #e8ebf2;
  --bt-muted: #8a91a3;
}

.bt-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 20px 64px;
}

/* ── Buttons ── */
.bt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--bt-line);
  background: rgba(255, 255, 255, 0.04); color: var(--bt-text);
  font-size: 0.88rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.bt-btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.07); }
.bt-btn-primary {
  background: linear-gradient(135deg, var(--bt-green-2), #12a86c);
  border-color: transparent; color: #03130c;
  box-shadow: 0 8px 22px rgba(22, 199, 132, 0.28);
}
.bt-btn-primary:hover { box-shadow: 0 12px 28px rgba(22, 199, 132, 0.4); }
.bt-btn-ghost { background: transparent; }
.bt-btn-danger { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.3); }
.bt-btn-danger:hover { background: rgba(255, 107, 107, 0.12); }
.bt-btn-mini { padding: 6px 11px; font-size: 0.78rem; border-radius: 9px; }
.bt-btn-sm { padding: 8px 12px; font-size: 0.82rem; }
.bt-btn-block { width: 100%; }
.bt-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Topbar create button is for mobile only; desktop uses the header button. */
.bt-topbar-actions { margin-left: auto; display: none; gap: 10px; }

/* ── Header (title + stats + create) ── */
.bt-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.bt-head-titles h1 {
  margin: 0; font-size: 1.9rem; font-weight: 900; letter-spacing: -0.01em;
  background: linear-gradient(120deg, #fff, #b8f5dc);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.bt-head-titles p { margin: 4px 0 0; color: var(--bt-muted); font-size: 0.9rem; }
.bt-create { padding: 12px 20px; font-size: 0.92rem; }

/* Stat cells */
.bt-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bt-stat {
  min-width: 116px; padding: 10px 16px; border-radius: 14px;
  background: var(--bt-card); border: 1px solid var(--bt-line);
  display: flex; flex-direction: column; gap: 2px;
}
.bt-stat-num { font-size: 1.15rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bt-stat-num.is-green { color: var(--bt-green); }
.bt-stat-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bt-muted); font-weight: 700; }

/* ── Layout: main + right rail ── */
.bt-layout { display: grid; grid-template-columns: 1fr 312px; gap: 22px; align-items: start; }
.bt-main { min-width: 0; }

/* ── Toolbar ── */
.bt-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bt-sorts { display: flex; gap: 8px; flex-wrap: wrap; }
.bt-toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.bt-sort {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--bt-line);
  background: rgba(255, 255, 255, 0.03); color: var(--bt-muted);
  font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all .15s ease;
}
.bt-sort:hover { color: #fff; border-color: var(--bt-green-border); }
.bt-sort.active { background: var(--bt-green-soft); border-color: var(--bt-green-border); color: var(--bt-green); }

.bt-view-toggle { display: flex; border: 1px solid var(--bt-line); border-radius: 10px; overflow: hidden; }
.bt-view-btn { display: grid; place-items: center; width: 38px; height: 36px; background: transparent; border: none; cursor: pointer; color: var(--bt-muted); }
.bt-view-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bt-view-btn:hover { color: #fff; }
.bt-view-btn.active { background: var(--bt-green-soft); color: var(--bt-green); }

.bt-search { position: relative; min-width: 180px; }
.bt-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: var(--bt-muted); stroke-width: 2; pointer-events: none; }
.bt-search-input { width: 100%; padding: 9px 14px 9px 36px; border-radius: 10px; border: 1px solid var(--bt-line); background: rgba(255, 255, 255, 0.03); color: #fff; font-size: 0.86rem; }
.bt-search-input:focus { outline: none; border-color: var(--bt-green-border); }

/* ── Phase filter chips ── */
.bt-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.bt-chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--bt-line);
  background: rgba(255, 255, 255, 0.03); color: var(--bt-muted);
  font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: all .15s ease;
}
.bt-chip:hover { color: #fff; border-color: var(--bt-green-border); }
.bt-chip.active { background: var(--bt-green-soft); border-color: var(--bt-green-border); color: var(--bt-green); }

.bt-section-title { font-size: 0.95rem; font-weight: 800; color: #fff; margin: 0 0 12px; }

/* ── Grid ── */
.bt-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); }
.bt-empty {
  grid-column: 1 / -1; text-align: center; padding: 56px 20px; color: var(--bt-muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.bt-empty-ic { font-size: 2.2rem; }

/* ── Card (grid view) ── */
.bt-card {
  position: relative; display: flex; flex-direction: column; border-radius: 16px;
  overflow: hidden; cursor: pointer; background: var(--bt-card); border: 1px solid var(--bt-line);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.bt-card:hover { transform: translateY(-3px); border-color: var(--bt-green-border); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4); }

.bt-card-cover { position: relative; height: 124px; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; overflow: hidden; }
.bt-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.bt-card-cover-emoji { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)); }

.bt-pill {
  position: absolute; top: 10px; z-index: 2; font-size: 0.64rem; font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(6px);
}
.bt-card-status { left: 10px; }
.bt-card-status.is-open { background: rgba(22, 199, 132, 0.92); color: #03130c; }
.bt-card-status.is-awarded { background: rgba(124, 92, 255, 0.92); color: #fff; }
.bt-card-status.is-expired { background: rgba(120, 130, 150, 0.85); color: #fff; }
.bt-card-status.is-pending { background: rgba(245, 158, 11, 0.92); color: #1a1206; }
.bt-card-status.is-rejected { background: rgba(255, 107, 107, 0.92); color: #fff; }
.bt-card-status.is-refunded { background: rgba(120, 130, 150, 0.85); color: #fff; }
.bt-card-cat { right: 10px; background: rgba(0, 0, 0, 0.5); color: #cfd5e2; font-weight: 700; }

.bt-card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.bt-card-title { font-size: 0.98rem; font-weight: 800; color: #fff; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.bt-card-creator { display: inline-flex; align-items: center; gap: 6px; color: #aab1c2; font-weight: 600; font-size: 0.78rem; }

.bt-reward-row { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.bt-reward-amount { font-size: 1.5rem; font-weight: 900; color: var(--bt-green); font-variant-numeric: tabular-nums; line-height: 1; }
.bt-reward-label { font-size: 0.7rem; font-weight: 700; color: var(--bt-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.bt-card-meta {
  display: flex; align-items: center; gap: 14px; padding-top: 10px;
  border-top: 1px solid var(--bt-line); font-size: 0.75rem; color: var(--bt-muted);
}
.bt-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.bt-card-meta .bt-meta-time { margin-left: auto; }

.bt-mini-avatar { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 0.6rem; font-weight: 800; color: #fff; overflow: hidden; text-decoration: none; }
.bt-mini-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── List view ── */
.bt-grid.is-list { display: block; }
.bt-list-head, .bt-row {
  display: grid;
  grid-template-columns: 96px 1fr 130px 120px 90px;
  align-items: center; gap: 12px;
}
.bt-list-head {
  padding: 6px 16px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--bt-muted); font-weight: 700; border-bottom: 1px solid var(--bt-line);
}
.bt-col-num { text-align: right; }
.bt-grid.is-list .bt-row {
  padding: 12px 16px; border-bottom: 1px solid var(--bt-line); cursor: pointer; transition: background .15s ease;
}
.bt-grid.is-list .bt-row:hover { background: rgba(255, 255, 255, 0.03); }
.bt-row-status .bt-pill { position: static; backdrop-filter: none; }
.bt-row-bounty { display: flex; align-items: center; gap: 11px; min-width: 0; }
.bt-row-thumb { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 1.3rem; overflow: hidden; flex-shrink: 0; }
.bt-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bt-row-info { min-width: 0; }
.bt-row-title { font-weight: 700; color: #fff; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-row-sub { font-size: 0.74rem; color: var(--bt-muted); display: flex; align-items: center; gap: 5px; }
.bt-row-reward { text-align: right; font-weight: 900; color: var(--bt-green); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.bt-row-time, .bt-row-subs { text-align: right; font-size: 0.84rem; color: #c4cad8; font-variant-numeric: tabular-nums; }

/* ── My bounties ── */
.bt-mine { margin-bottom: 18px; }
.bt-mine-list { display: flex; flex-direction: column; gap: 10px; }
.bt-mine-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bt-card); border: 1px solid var(--bt-line); cursor: pointer; }
.bt-mine-row:hover { border-color: var(--bt-green-border); }
.bt-mine-emoji { font-size: 1.4rem; }
.bt-mine-info { flex: 1; min-width: 0; }
.bt-mine-title { font-weight: 700; color: #fff; font-size: 0.9rem; }
.bt-mine-sub { font-size: 0.76rem; color: var(--bt-muted); }
.bt-mine-reward { font-weight: 800; color: var(--bt-green); font-size: 0.95rem; }

/* ── Right rail ── */
.bt-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 14px; }
.bt-rail-card { background: var(--bt-card); border: 1px solid var(--bt-line); border-radius: 16px; padding: 14px 14px 8px; }
.bt-rail-head { display: flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bt-muted); margin-bottom: 10px; }
.bt-rail-head .bt-rail-ic { color: var(--bt-green); }
.bt-rail-item { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 10px; cursor: pointer; transition: background .15s ease; }
.bt-rail-item:hover { background: rgba(255, 255, 255, 0.04); }
.bt-rail-rank { width: 20px; text-align: center; font-weight: 800; color: var(--bt-muted); font-size: 0.85rem; flex-shrink: 0; }
.bt-rail-rank.is-top { color: var(--bt-green); }
.bt-rail-emoji { font-size: 1.05rem; }
.bt-rail-info { flex: 1; min-width: 0; }
.bt-rail-title { font-size: 0.82rem; font-weight: 600; color: #e8ebf2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-rail-meta { font-size: 0.7rem; color: var(--bt-muted); }
.bt-rail-val { font-weight: 800; color: var(--bt-green); font-size: 0.88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bt-rail-empty { color: var(--bt-muted); font-size: 0.8rem; padding: 6px 6px 12px; }

/* ── Modal shell ── */
.bt-overlay { align-items: flex-start; }
.bt-modal {
  position: relative; max-width: 720px; width: 100%; max-height: 92vh; overflow-y: auto; margin: 4vh auto;
  background: linear-gradient(180deg, #15181f, #0f1116); border: 1px solid var(--bt-line); padding: 26px;
}
.bt-modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 16px; cursor: pointer; z-index: 5; }
.bt-modal-close:hover { background: rgba(255, 255, 255, 0.16); }
.bt-modal h3 { margin: 0 0 6px; color: #fff; font-size: 1.25rem; }

/* ── Form ── */
.bt-form-note { font-size: 0.82rem; color: var(--bt-muted); line-height: 1.5; margin: 0 0 18px; }
.bt-form-note strong { color: var(--bt-green); }
.bt-field { margin-bottom: 14px; }
.bt-field .form-label { display: block; margin-bottom: 6px; font-size: 0.82rem; font-weight: 700; color: #cfd5e2; }
.bt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bt-row3 { display: grid; grid-template-columns: 84px 84px 1fr; gap: 12px; align-items: end; }
.bt-grow { min-width: 0; }
.bt-emoji-input { text-align: center; font-size: 1.2rem; }
.bt-color-input { padding: 4px; height: 42px; cursor: pointer; }
.bt-file { padding: 8px; font-size: 0.82rem; }
.bt-balance-hint { margin-top: 6px; font-size: 0.78rem; color: var(--bt-muted); }
.bt-balance-hint strong { color: var(--bt-green); }
.bt-balance-hint.is-bad strong { color: #ff6b6b; }
.bt-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Detail ── */
.bt-detail-cover { height: clamp(280px, 42vh, 420px); border-radius: 16px; margin: 6px 0 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 4.5rem; }
.bt-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.bt-detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.bt-detail-head h2 { margin: 0; font-size: 1.5rem; color: #fff; flex: 1; min-width: 200px; }
.bt-detail-reward-box { text-align: right; padding: 10px 16px; border-radius: 14px; background: var(--bt-green-soft); border: 1px solid var(--bt-green-border); }
.bt-detail-reward-box .amt { font-size: 1.7rem; font-weight: 900; color: var(--bt-green); line-height: 1; }
.bt-detail-reward-box .lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bt-muted); }

.bt-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 16px 0; font-size: 0.84rem; color: var(--bt-muted); }
.bt-detail-creator { display: inline-flex; align-items: center; gap: 8px; color: #c4cad8; }

.bt-detail-section { margin: 18px 0; }
.bt-detail-section h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bt-green); margin: 0 0 8px; }
.bt-detail-text { color: #c8cedb; line-height: 1.6; font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; }

.bt-status-banner { padding: 12px 14px; border-radius: 12px; font-size: 0.86rem; font-weight: 600; margin: 14px 0; border: 1px solid var(--bt-line); }
.bt-status-banner.is-pending { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: #f6c463; }
.bt-status-banner.is-rejected { background: rgba(255, 107, 107, 0.1); border-color: rgba(255, 107, 107, 0.3); color: #ff9b9b; }
.bt-status-banner.is-awarded { background: rgba(124, 92, 255, 0.12); border-color: rgba(124, 92, 255, 0.32); color: #c4b5fd; }
.bt-status-banner.is-expired, .bt-status-banner.is-refunded { background: rgba(120, 130, 150, 0.12); color: #aeb6c6; }

.bt-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--bt-line); margin: 22px 0 16px; }
.bt-tab { padding: 9px 14px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--bt-muted); font-weight: 700; font-size: 0.86rem; cursor: pointer; }
.bt-tab.active { color: var(--bt-green); border-bottom-color: var(--bt-green); }
.bt-tab-count { font-size: 0.74rem; opacity: 0.8; }
.bt-tabpane { display: none; }
.bt-tabpane.active { display: block; }

/* ── Submissions ── */
.bt-sub-form, .bt-comment-form { background: var(--bt-card-2); border: 1px solid var(--bt-line); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.bt-sub-form textarea, .bt-comment-form textarea, .bt-sub-form input, .bt-comment-form input { width: 100%; margin-bottom: 8px; }
.bt-sub-form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bt-sub-form-row .bt-btn { margin-left: auto; }

.bt-sub-list, .bt-comment-list { display: flex; flex-direction: column; gap: 12px; }
.bt-sub { border: 1px solid var(--bt-line); border-radius: 14px; padding: 14px; background: var(--bt-card); position: relative; }
.bt-sub.is-winner { border-color: var(--bt-green); box-shadow: 0 0 0 1px var(--bt-green-border) inset; }
.bt-sub-winner-badge { position: absolute; top: -10px; left: 14px; background: var(--bt-green); color: #03130c; font-size: 0.68rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.bt-sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bt-sub-user { font-weight: 700; color: #fff; font-size: 0.88rem; }
.bt-sub-time { font-size: 0.74rem; color: var(--bt-muted); margin-left: auto; }
.bt-sub-content { color: #c8cedb; line-height: 1.55; font-size: 0.9rem; white-space: pre-wrap; word-break: break-word; }
.bt-sub-img { margin-top: 10px; border-radius: 10px; max-width: 100%; max-height: 360px; display: block; }
.bt-sub-link { display: inline-block; margin-top: 8px; color: var(--bt-green); font-size: 0.84rem; word-break: break-all; }
.bt-sub-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Comments ── */
.bt-comment { display: flex; gap: 10px; }
.bt-comment-body { flex: 1; min-width: 0; }
.bt-comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.bt-comment-user { font-weight: 700; color: #fff; font-size: 0.84rem; }
.bt-comment-time { font-size: 0.72rem; color: var(--bt-muted); }
.bt-comment-del { margin-left: auto; background: none; border: none; color: var(--bt-muted); cursor: pointer; font-size: 0.78rem; }
.bt-comment-del:hover { color: #ff6b6b; }
.bt-comment-text { color: #c4cad8; line-height: 1.5; font-size: 0.88rem; white-space: pre-wrap; word-break: break-word; }

.bt-inline-empty { color: var(--bt-muted); font-size: 0.86rem; padding: 18px 0; text-align: center; }
.bt-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; color: #fff; overflow: hidden; flex-shrink: 0; text-decoration: none; }
.bt-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .bt-layout { grid-template-columns: 1fr; }
  .bt-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .bt-rail-card { flex: 1; min-width: 260px; }
}
@media (max-width: 860px) {
  .bt-head { grid-template-columns: 1fr; gap: 14px; }
  .bt-stats { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .bt-stat { min-width: 110px; }
  .bt-create { display: none; }
  .bt-topbar-actions { display: flex; }
}
@media (max-width: 600px) {
  .bt-content { padding: 14px 14px 56px; }
  .bt-modal { padding: 20px 16px; margin: 0; max-height: 100vh; border-radius: 0; }
  .bt-overlay { padding: 0; }
  .bt-detail-cover { height: clamp(220px, 34vh, 300px); }
  .bt-row, .bt-row3 { grid-template-columns: 1fr; }
  .bt-toolbar-right { width: 100%; }
  .bt-search { flex: 1; }
  /* Compact list columns on phones */
  .bt-list-head { display: none; }
  .bt-grid.is-list .bt-row { grid-template-columns: 1fr auto; grid-template-areas: "bounty reward" "bounty meta"; gap: 4px 12px; }
  .bt-row-status { display: none; }
  .bt-row-bounty { grid-area: bounty; }
  .bt-row-reward { grid-area: reward; align-self: center; }
  .bt-row-time { grid-area: meta; text-align: right; }
  .bt-row-subs { display: none; }
  .bt-detail-head h2 { font-size: 1.25rem; }
}
