:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #f4f6f2;
  background: #141714;
  --accent: #d5ff75;
  --muted: #abb4a7;
  --line: #3a4138;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: #1a1e19; }
.bar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 750; }
.mark { display: grid; place-items: center; background: var(--accent); color: #202915; border-radius: 9px; width: 34px; height: 34px; flex-shrink: 0; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 48px 0 24px; }
.intro p { max-width: 32ch; color: var(--muted); line-height: 1.55; margin: 0; }
h1 { font-size: clamp(2.5rem, 8vw, 5rem); letter-spacing: -.065em; line-height: .98; margin: 0; }
h1 span { color: var(--accent); }
h2 { font-size: 1.12rem; margin: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; align-items: start; padding-bottom: 40px; }
aside { display: grid; gap: 18px; }
.card { background: #1d221c; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px; }
#count { color: var(--accent); font-variant-numeric: tabular-nums; }
.search { display: grid; gap: 7px; padding: 0 20px 16px; }
label { font-size: .9rem; color: var(--muted); }
input, select, textarea, button { min-height: 44px; font: inherit; border: 1px solid #4b5548; border-radius: 8px; color: inherit; padding: 9px 11px; }
input, select, textarea { width: 100%; background: #171b16; font-size: 1rem; }
textarea { resize: vertical; }
button { background: #2a3226; cursor: pointer; font-weight: 650; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: #202915; border-color: transparent; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 20px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-size: .875rem; font-weight: 600; }
td:first-child { width: 1%; color: var(--muted); }
th:last-child, td:last-child { text-align: right; }
td:last-child { font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
tr.leader { background: #252e20; }
.fields { display: grid; gap: 12px; padding: 0 20px 20px; }
.fields label { display: grid; gap: 6px; }
details > summary { cursor: pointer; border-top: 1px solid var(--line); padding: 14px 20px; }
#notice { min-height: 1.5em; color: var(--accent); }
#notice[data-error], #login-error, .negative { color: #ffb29f; }
.empty { margin: 0; padding: 0 20px 20px; color: var(--muted); }
#history { margin: 0; padding: 0; list-style: none; }
#history li { padding: 14px 20px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.event-title { display: flex; justify-content: space-between; gap: 12px; }
.positive { color: var(--accent); }
#history p { margin: 6px 0; }
time { font-size: .875rem; color: var(--muted); }
dialog { width: min(390px, calc(100% - 32px)); padding: 20px 0 0; border: 1px solid var(--line); border-radius: 16px; background: #262c25; color: inherit; }
dialog::backdrop { background: #080b08bf; }
nav, .admin-tabs, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
nav a { padding: 11px 8px; color: var(--muted); text-decoration: none; }
nav a[aria-current], a { color: var(--accent); }
.intro { margin-top: 34px; }
.narrow { max-width: 660px; margin-bottom: 36px; }
.filters, .columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.filters { padding: 0 20px 16px; }
.filters label, .moderation-form label, .title-row label { display: grid; gap: 6px; }
.identity, .profile-name { display: flex; align-items: center; gap: 10px; }
.identity { color: inherit; text-decoration: none; }
.identity:hover strong { text-decoration: underline; }
.identity span { overflow-wrap: anywhere; }
.identity small, td:first-child small { display: block; margin-top: 3px; }
.muted { color: var(--muted); }
.avatar { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; overflow: hidden; background: #374833; color: var(--accent); border-radius: 50%; font-size: .8rem; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-name { align-items: center; min-width: 0; }
.profile-name h1 { overflow-wrap: anywhere; }
.profile-name .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.profile-meta { padding: 22px; }
.profile-meta > strong { display: block; font-size: 2.4rem; margin-top: 12px; }
.log-item { padding: 15px 20px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.log-item p, .feedback { margin: 6px 0; }
.log-item > a, .log-item > button { display: inline-block; margin: 8px 10px 0 0; }
.feedback { color: var(--accent); }
[data-error], #reverse-error { color: #ffb29f; }
.admin-tabs { margin-bottom: 16px; }
.admin-tabs button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.proposal-status.pending { color: #f6d98c; }
.proposal-status.approved { color: var(--accent); }
.proposal-status.rejected { color: #ffb29f; }
.moderation-form { display: grid; grid-template-columns: minmax(100px, 130px) minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.moderation-form .actions { grid-column: 1 / -1; }
.title-row { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 10px; }
td:last-child { color: inherit; }
th:nth-last-child(2), td:nth-last-child(2) { text-align: right; }
@media (max-width: 720px) {
  .intro { align-items: start; flex-direction: column; margin-top: 32px; }
  .grid { display: flex; flex-direction: column; }
  .grid > * { width: 100%; }
  body.admin-mode aside { order: -1; }
  th, td { padding-inline: 12px; }
}
@media (max-width: 440px) {
  .shell { width: calc(100% - 24px); }
  .bar { flex-wrap: wrap; gap: 0; padding-block: 8px; }
  .bar nav { width: 100%; }
  .brand { padding-block: 5px; }
  th, td { padding-inline: 6px; }
  .identity { gap: 5px; }
  .identity .avatar { width: 24px; height: 24px; font-size: .6rem; }
  .heading { padding-inline: 12px; }
}

:root {
  background: #151222;
  color: #faf5ff;
  --accent: #d8ff79;
  --muted: #c1b5d2;
  --line: #403652;
}
.top { background: #1e182e; }
.brand { font-size: 1.17rem; letter-spacing: -.03em; }
.mark { color: #271a3e; background: #d7b6ff; box-shadow: 2px 2px 0 #7757a0; transform: rotate(-8deg); }
nav a { border-radius: 9px; }
nav a[aria-current] { background: #382a50; color: #e7d0ff; }
.card { background: #211a31; }
input, select, textarea { background: #191426; border-color: #514461; }
button { background: #332644; border-color: #5c4b70; }
dialog { background: #29203b; }
.primary, .hero-link { background: var(--accent); color: #222611; border-color: transparent; }
.primary:hover, .hero-link:hover { background: #e6ffa8; }
.avatar { background: #453260; color: #ead5ff; }
tr.leader { background: #302340; }
#ranking tr:hover { background: #382a49; }
.meme-hero, .proposal-hero {
  border: 1px solid #644d87;
  border-radius: 22px;
  padding: clamp(22px, 4vw, 48px);
  background: radial-gradient(ellipse at top right, #4c3271, transparent 65%), #261b3b;
}
.meme-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 250px);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
}
.hero-copy p { margin-top: 16px; }
.hero-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 8px 15px;
  border-radius: 10px;
  font-weight: 750;
  text-decoration: none;
}
.meme {
  margin: 5px;
  padding: 12px 12px 15px;
  text-align: center;
  color: #291c3b;
  background: #ffe492;
  border: 2px solid #291c3b;
  border-radius: 18px;
  box-shadow: 5px 5px 0 #160e27;
  transform: rotate(4deg);
}
.meme-face { display: block; font-size: clamp(3.2rem, 8vw, 5rem); line-height: 1.2; }
.meme figcaption { display: grid; gap: 3px; margin-top: 7px; }
.meme strong { font-size: 1.15rem; }
.feed-empty { text-align: center; color: var(--muted); padding: 20px 16px 28px; }
.feed-empty span { display: block; font-size: 2.2rem; }
.feed-empty strong { color: #faf5ff; }
.feed-empty p { margin: 6px 0 0; }
@media (max-width: 520px) {
  .meme-hero { grid-template-columns: 1fr; }
  .meme { justify-self: start; width: min(100%, 205px); }
}
