:root {
  --asphalt: #16171a;
  --asphalt-2: #1f2125;
  --asphalt-3: #2a2d32;
  --line: #3a3d44;
  --paint: #f4f1e8;
  --muted: #a3a6ad;
  --yellow: #ffd400;
  --yellow-ink: #1a1500;
  --red: #ff4b3e;
  --blue: #2f7cf6;
  --green: #2ecc71;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--asphalt);
  background-image: radial-gradient(rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 6px 6px;
  color: var(--paint);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.demo-ribbon {
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, #111 14px 28px);
  color: #111; text-align: center; font-size: 12px; font-weight: 700; padding: 4px 16px;
}
.demo-ribbon span { background: #111; color: var(--yellow); padding: 2px 10px; border-radius: 99px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(22,23,26,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-p {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px;
  background: var(--blue); color: #fff; font: 28px/1 var(--display); border: 2px solid #fff;
}
.logo-text { font: 16px/0.95 var(--display); letter-spacing: .04em; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-link { white-space: nowrap; text-decoration: none; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav-link:hover, .nav-link.is-active { color: var(--paint); background: var(--asphalt-3); }
.nav-admin::before { content: "🛡 "; }

/* Buttons */
.btn {
  border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-yellow { background: var(--yellow); color: var(--yellow-ink); }
.btn-yellow:hover { background: #ffe14d; }
.btn-ghost { background: transparent; color: var(--paint); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--paint); }
.btn-red { background: var(--red); color: #fff; }
.btn-green { background: var(--green); color: #06260f; }
.btn-sm { padding: 6px 10px; font-size: 14px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 17px; }
.icon-btn { background: var(--asphalt-3); border: 0; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; }
.linklike { background: none; border: 0; padding: 0; color: var(--yellow); text-decoration: underline; cursor: pointer; }

main { padding: 0 clamp(16px, 4vw, 40px); max-width: 1280px; margin: 0 auto; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(28px, 6vw, 64px) 0 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; color: var(--yellow); margin: 0 0 8px; }
h1 { font: clamp(40px, 7vw, 76px)/1.04 var(--display); letter-spacing: .01em; margin: 0 0 16px; text-transform: uppercase; }
.hl { display: inline-block; margin-top: .1em; color: var(--asphalt); background: var(--yellow); padding: 0 .15em; }
.lede { font-size: 18px; color: #d6d4cc; max-width: 34em; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stats strong { display: block; font: 30px/1 var(--display); color: var(--yellow); }
.hero-stats span { font-size: 13px; color: var(--muted); }

.winner {
  background: var(--yellow); color: var(--yellow-ink); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); transform: rotate(1.5deg); position: relative; cursor: pointer;
}
.winner:hover { transform: rotate(0deg); transition: transform .2s; }
.winner-tag { position: absolute; top: -14px; left: 16px; background: var(--red); color: #fff; font: 15px/1 var(--display); letter-spacing: .06em; padding: 8px 12px; border-radius: 6px; transform: rotate(-3deg); }
.winner img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.winner h3 { font: 24px/1.05 var(--display); margin: 12px 0 4px; text-transform: uppercase; }
.winner p { margin: 0; font-weight: 500; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0 8px; border-top: 2px dashed var(--line); }
.tabs { display: flex; gap: 4px; background: var(--asphalt-2); padding: 4px; border-radius: 12px; }
.tab { background: none; border: 0; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); }
.tab.is-active { background: var(--paint); color: var(--asphalt); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input, .field input, .field select, .field textarea {
  background: var(--asphalt-2); border: 2px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0;
}
.filters input { width: 220px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 16px; }
.chip { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip.is-active, .chip:hover { border-color: var(--yellow); color: var(--yellow); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding-bottom: 48px; }
.card {
  background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: #555a63; }
.card-img { position: relative; background: #000; cursor: pointer; border: 0; padding: 0; }
.card-img img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.rank { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.75); font: 15px/1 var(--display); padding: 6px 8px; border-radius: 6px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--asphalt-3); }
.card-img .badge { position: absolute; bottom: 10px; left: 10px; background: var(--yellow); color: var(--yellow-ink); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-weight: 700; font-size: 17px; line-height: 1.25; margin: 0; }
.card-meta { font-size: 13px; color: var(--muted); }
.card-actions { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.vote {
  display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: none; border-radius: 10px;
  padding: 6px 12px; cursor: pointer; font-weight: 700;
}
.vote:hover { border-color: var(--yellow); }
.vote.is-voted { background: var(--yellow); color: var(--yellow-ink); border-color: var(--yellow); }
.vote .arrow { font-size: 14px; }
.flag-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 6px; }
.flag-btn:hover { color: var(--red); }
.flag-btn.is-flagged { color: var(--red); }
.pending-note { font-size: 12px; color: var(--yellow); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* Rules */
.rules { max-width: 720px; padding: 48px 0; }
.rules ol { padding-left: 20px; display: grid; gap: 12px; font-size: 18px; }

/* Admin */
.admin { padding: 36px 0 64px; }
.admin-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: end; }
.admin-head h1 { font-size: clamp(36px, 5vw, 56px); }
.admin-settings { display: grid; gap: 10px; background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 42px; height: 24px; border-radius: 99px; background: var(--asphalt-3); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paint); transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.threshold input { width: 64px; background: var(--asphalt); border: 2px solid var(--line); border-radius: 8px; padding: 4px 8px; margin: 0 4px; }
.admin-stats { list-style: none; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-stats li { background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.admin-stats strong { display: block; font: 34px/1 var(--display); }
.admin-stats .warn strong { color: var(--red); }
.admin-stats span { color: var(--muted); font-size: 13px; }
.admin-tabs { width: fit-content; margin-bottom: 16px; flex-wrap: wrap; }
.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; margin-left: 4px; }
.queue { display: grid; gap: 10px; }
.q-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.q-item img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; }
.q-item h3 { margin: 0 0 4px; font-size: 16px; }
.q-reasons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.q-reasons .badge { background: rgba(255,75,62,.15); color: #ff8a80; }
.q-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.q-empty { color: var(--muted); padding: 32px; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); }

/* Footer */
.site-footer { text-align: center; padding: 0 16px 40px; color: var(--paint); }
.kerb { height: 14px; margin: 0 0 28px; background: repeating-linear-gradient(90deg, var(--red) 0 40px, #fff 40px 80px); }
.site-footer p { margin: 4px 0; }

/* Dialogs */
.dialog { border: 0; padding: 0; border-radius: 18px; background: var(--asphalt-2); color: var(--paint); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dialog-wide { width: min(880px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
.dialog form, #detail { padding: 18px 20px 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog-head h2 { font: 26px/1 var(--display); text-transform: uppercase; margin: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; overflow: hidden; position: relative; }
.drop:hover { border-color: var(--yellow); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-empty { display: grid; place-items: center; gap: 4px; padding: 28px 16px; text-align: center; }
.drop-icon { font-size: 32px; }
.drop img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.field { display: grid; gap: 6px; font-weight: 500; font-size: 14px; margin-top: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--yellow); width: 18px; height: 18px; flex: none; }
.captcha { margin-top: 10px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.err { color: #ff8a80; font-size: 13px; margin: 4px 0 0; min-height: 0; }
.err:empty { display: none; }
.reasons { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.reasons label { display: flex; gap: 10px; background: var(--asphalt); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.reasons input { accent-color: var(--red); }

.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.detail img { border-radius: 12px; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.detail h2 { font: 30px/1.05 var(--display); text-transform: uppercase; margin: 8px 0; }
.detail .card-actions { margin-top: 16px; gap: 8px; flex-wrap: wrap; }
.detail-close { float: right; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--paint); color: var(--asphalt);
  padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); transition: transform .25s ease; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .winner { transform: none; max-width: 520px; }
  .detail { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .main-nav .nav-link:not(.nav-admin) { display: none; }
  .main-nav .btn { padding: 9px 12px; font-size: 14px; }
  .logo-text { font-size: 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters input { width: 100%; flex: 1; }
  .filters select { flex: 1; }
  .row { grid-template-columns: 1fr; }
  .q-item { grid-template-columns: 90px 1fr; }
  .q-actions { grid-column: 1 / -1; justify-content: stretch; }
  .q-actions .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Photo credits for the sample posts */
.photo-credit { font-size: 12px; color: var(--muted); margin-top: 10px; }
.photo-credit a { color: inherit; text-decoration: underline; }
