/* clickclickclick — calm page, loud action. */

:root {
  color-scheme: light dark;
  --bg: #faf9f7;
  --fg: #1a1a18;
  --muted: #6b6963;
  --line: #e4e2dc;
  --card: #ffffff;
  --accent: #e8590c;
  --accent-fg: #ffffff;
  --bump: rgba(232, 89, 12, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --fg: #ececea;
    --muted: #99968f;
    --line: #2c2b28;
    --card: #1d1d1a;
    --accent: #ff7a29;
    --accent-fg: #141310;
    --bump: rgba(255, 122, 41, 0.16);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 880px;
  padding: 0 16px 48px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
}

header { text-align: center; padding: 40px 0 20px; }

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0;
  letter-spacing: -0.02em;
}

h1 a.home { color: inherit; text-decoration: none; }
.tld { color: var(--accent); }

.tagline { color: var(--muted); margin: 8px 0 20px; }

/* --- submit form --- */
form.submit { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

form.submit input {
  font-size: 1rem;
  padding: 12px 14px;
  min-width: min(320px, 70vw);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
}

button {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-fg);
}

form.submit button { padding: 12px 22px; font-size: 1rem; }

/* --- layout: board + activity sidebar --- */
main { width: 100%; }

@media (min-width: 900px) {
  body {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 32px;
    align-items: start;
  }
  header, footer { grid-column: 1 / -1; }
  .activity { position: sticky; top: 24px; }
}

/* --- board rows --- */
ol.board { list-style: none; margin: 0; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 44px 40px 1fr auto 64px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background-color 0.4s ease;
}

.row.bumped { background-color: var(--bump); }

.rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.95rem;
}

.icon { border-radius: 8px; display: block; }

.meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.title {
  font-weight: 650;
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title:hover { text-decoration: underline; }

.host {
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desc {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.age { color: var(--muted); font-size: 0.75rem; }

.count {
  font-size: 1.15rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* The loudest element on the row. */
.clicker button {
  width: 100%;
  min-height: 44px;
  font-size: 1.05rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  transition: transform 60ms ease, box-shadow 60ms ease;
}

.clicker button.pressed,
.clicker button:active {
  transform: translateY(2px);
  box-shadow: none;
}

.empty { padding: 32px; text-align: center; color: var(--muted); }

/* --- the floating +1 --- */
.pop {
  position: absolute;
  inset-inline-end: 18px;
  pointer-events: none;
  font-weight: 800;
  color: var(--accent);
  animation: rise 600ms ease-out forwards;
}

.clicker { position: relative; }

@keyframes rise {
  from { opacity: 1; translate: 0 0; }
  to   { opacity: 0; translate: 0 -34px; }
}

/* --- pager, activity, static pages --- */
.pager { display: flex; gap: 16px; justify-content: center; margin: 24px 0; }
.pager a { color: var(--accent); text-decoration: none; }
.pager span { color: var(--muted); }

.count-line { text-align: center; color: var(--muted); font-size: 0.9rem; }

.activity h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.activity ul { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.activity li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.activity a { color: var(--fg); text-decoration: none; }
.activity a:hover { color: var(--accent); }

.static { max-width: 60ch; margin: 0 auto; line-height: 1.7; }
.static li { margin-bottom: 10px; }

footer {
  text-align: center;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
}
footer a { color: var(--muted); }

/* --- mobile --- */
@media (max-width: 480px) {
  .row { grid-template-columns: 34px 1fr auto 56px; }
  .icon { display: none; }
  .rank { grid-row: span 1; }
}

/* --- reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .pop { animation: none; opacity: 0; }
  .row { transition: none; }
  .clicker button { transition: none; }
}

/* --- feature-flag extras (PostHog flag "confetti") --- */
.party .pop {
  font-size: 1.3rem;
  text-shadow: 0 0 8px var(--accent);
}
