:root {
  --accent: #ff4d6d;
  --ink: #14141f;
  --muted: #676776;
  --line: #e5e7ef;
  --paper: #fffdf8;
  --green: #00b894;
  --shadow: 0 16px 40px rgba(20, 20, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(255, 77, 109, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(47, 128, 237, 0.1), transparent 34%),
    var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 42px);
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 1px solid rgba(20, 20, 31, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: #fff;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  background:
    linear-gradient(135deg, #ff4d6d 0 35%, #ffd166 35% 62%, #2f80ed 62%);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 1.12rem;
}

.brand small {
  max-width: min(52vw, 420px);
  color: var(--muted);
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alias-pill,
.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 900;
  border-radius: 999px;
}

.alias-pill {
  max-width: 170px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.alias-pill.locked {
  color: #3b1800;
  background: linear-gradient(90deg, #ffe3a3, #fff3c4);
  border-color: rgba(255, 159, 28, 0.55);
}

.alias-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-pill {
  color: #11351f;
  background: #d9fbe6;
  border: 1px solid rgba(0, 184, 148, 0.24);
}

.pulse {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.65);
  animation: pulse 1.7s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(0, 184, 148, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 184, 148, 0);
  }
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: start;
  gap: clamp(18px, 3vw, 30px);
  width: min(1220px, calc(100% - 28px));
  margin: 24px auto 54px;
}

.main-flow,
.side-flow {
  display: grid;
  gap: 18px;
}

.composer-zone,
.my-zone,
.featured-zone,
.feed-zone,
.side-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(20, 20, 31, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.composer-zone {
  overflow: hidden;
}

.announcement {
  padding: 12px 18px;
  color: #221500;
  font-size: 0.92rem;
  font-weight: 900;
  background:
    linear-gradient(90deg, rgba(255, 209, 102, 0.92), rgba(255, 77, 109, 0.22)),
    #fff7d6;
  border-bottom: 1px solid rgba(20, 20, 31, 0.08);
}

.composer {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 24px);
}

.composer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 14px;
  align-items: start;
}

.composer h1,
.section-head h2,
.admin-top h2 {
  margin: 0;
  letter-spacing: 0;
}

.composer h1 {
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
}

.composer h1::after {
  content: "  ▲";
  color: var(--accent);
}

.composer p,
.admin-top p {
  margin: 4px 0 0;
  color: var(--muted);
}

.composer input,
.composer select,
.composer textarea,
.category-form input,
.feed-head input,
.admin-panel input {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.composer input,
.composer select,
.category-form input,
.feed-head input,
.admin-panel input {
  min-height: 42px;
  padding: 0 12px;
}

.composer input[readonly] {
  cursor: pointer;
  background: #f8f9fc;
}

.composer textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.composer-controls {
  display: grid;
  grid-template-columns: minmax(160px, 260px) auto minmax(120px, auto);
  gap: 10px;
  align-items: center;
}

.counter {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

.primary-button,
.category-form button,
.reply-form button,
.chat-form button,
.admin-panel button:not(.icon-button),
.empty-state button {
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  font-weight: 950;
  background: var(--ink);
  border-radius: 8px;
}

.primary-button {
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--ink);
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 42px;
  max-width: 230px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--chip-color, var(--line));
  border-radius: 999px;
}

.category-chip.active {
  color: #fff;
  background: var(--chip-color, var(--ink));
}

.category-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-chip span:last-child {
  opacity: 0.78;
  font-size: 0.82rem;
}

.category-status {
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.category-form {
  display: grid;
  grid-template-columns: 58px minmax(130px, 1fr) minmax(160px, 1.4fr) 52px auto;
  gap: 10px;
}

.category-form input[type="color"] {
  width: 52px;
  min-width: 52px;
  padding: 5px;
}

.category-form input[name="emoji"] {
  max-width: 58px;
}

.category-limit {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.my-zone {
  padding-bottom: 16px;
}

.my-feed {
  display: grid;
  gap: 10px;
  padding: 14px 18px 0;
}

.my-post-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--card-color) 14%, #fff), #fff 72%);
  border: 1px solid color-mix(in srgb, var(--card-color) 42%, #fff);
  border-left: 6px solid var(--card-color, var(--accent));
  border-radius: 8px;
}

.my-post-top,
.my-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.my-post-top {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.my-post-card p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.my-post-actions {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}

.section-head h2 {
  font-size: 1.15rem;
}

.section-head span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  text-align: right;
}

.section-head.compact {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px 18px;
}

.featured-card {
  display: grid;
  gap: 12px;
  min-height: 168px;
  padding: 14px;
  color: #161621;
  background: linear-gradient(160deg, color-mix(in srgb, var(--card-color) 18%, #fff), #fff 68%);
  border: 2px solid color-mix(in srgb, var(--card-color) 52%, #fff);
  border-radius: 8px;
}

.featured-card strong,
.post-body {
  overflow-wrap: anywhere;
}

.featured-meta,
.post-meta,
.reply-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.featured-score {
  align-self: end;
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  color: #fff;
  font-weight: 950;
  background: var(--ink);
  border-radius: 999px;
}

.feed-zone {
  padding-bottom: 16px;
}

.feed-head {
  padding-bottom: 12px;
}

.feed-head input {
  max-width: 240px;
}

.feed-filter-row {
  display: grid;
  gap: 10px;
  padding: 0 18px 14px;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 14px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(64px, auto);
  min-height: 38px;
  overflow: hidden;
  background: #f3f4f8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented button {
  min-width: 0;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 950;
  background: transparent;
  border-right: 1px solid var(--line);
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active,
.mini-segmented button.active {
  color: #fff;
  background: var(--ink);
}

.feed-list {
  display: grid;
  gap: 12px;
  padding: 0 18px;
}

.post-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--card-color, var(--accent));
  border-radius: 8px;
}

.vote-stack {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  min-width: 52px;
}

.vote-button,
.reply-vote-button {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 950;
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vote-button {
  width: 40px;
  height: 34px;
  font-size: 1.08rem;
}

.vote-button.active,
.vote-button:hover,
.reply-vote-button.active,
.reply-vote-button:hover {
  color: #fff;
  background: var(--card-color, var(--accent));
}

.score {
  font-size: 1.28rem;
  font-weight: 950;
}

.post-content {
  min-width: 0;
}

.post-body {
  margin: 9px 0 12px;
  font-size: 1.04rem;
  line-height: 1.52;
  white-space: pre-wrap;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.soft-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 950;
  background: color-mix(in srgb, var(--card-color) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--card-color) 36%, #fff);
  border-radius: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 950;
  background: #f4f5f9;
  border-radius: 999px;
}

.badge.pin {
  color: #4b2500;
  background: #ffe3a3;
}

.badge.mine {
  color: #11351f;
  background: #d9fbe6;
}

.badge.hot {
  color: #4b1400;
  background: #ffd6c2;
}

.badge.unlocked {
  color: #11351f;
  background: #d9fbe6;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.reaction-row button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 950;
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.reaction-row button.active,
.reaction-row button:hover {
  background: color-mix(in srgb, var(--card-color) 20%, #fff);
  border-color: color-mix(in srgb, var(--card-color) 58%, #fff);
}

.reaction-row strong {
  font-size: 0.82rem;
}

.post-card.spotlight {
  animation: spotlight 1.8s ease;
}

@keyframes spotlight {
  0%,
  100% {
    box-shadow: none;
  }
  30% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--card-color) 28%, transparent);
  }
}

.replies {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.reply-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.reply-tools strong {
  font-size: 0.9rem;
}

.mini-segmented {
  display: inline-grid;
  grid-auto-flow: column;
  overflow: hidden;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-segmented button {
  padding: 0 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  background: #f6f7fb;
  border-right: 1px solid var(--line);
}

.mini-segmented button:last-child {
  border-right: 0;
}

.reply {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding-left: 12px;
  border-left: 3px solid color-mix(in srgb, var(--card-color) 34%, #fff);
}

.reply-vote-stack {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
}

.reply-vote-button {
  width: 30px;
  height: 26px;
  font-size: 0.8rem;
}

.reply-score {
  font-size: 0.88rem;
  font-weight: 950;
}

.reply-copy {
  min-width: 0;
}

.reply p {
  margin: 4px 0 0;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.reply-empty {
  color: var(--muted);
  padding: 4px 0;
}

.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.reply-form input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chat-panel {
  background:
    linear-gradient(145deg, rgba(255, 77, 109, 0.1), rgba(47, 128, 237, 0.1)),
    #fff;
  scroll-margin-top: 92px;
}

.chat-panel.spotlight {
  animation: chatSpotlight 1.6s ease;
}

@keyframes chatSpotlight {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  34% {
    box-shadow:
      0 0 0 5px rgba(255, 77, 109, 0.2),
      0 18px 44px rgba(20, 20, 31, 0.14);
  }
}

.chat-list {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 260px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
}

.chat-message {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #2f80ed;
  border-radius: 8px;
}

.chat-message.mine {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, #fff);
}

.chat-message div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.chat-message strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message p {
  margin: 0;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.chat-empty {
  align-self: center;
  padding: 14px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 2px;
}

.chat-form input {
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side-panel {
  padding: 0 14px 14px;
}

.mission-panel {
  background:
    linear-gradient(150deg, rgba(255, 209, 102, 0.32), rgba(255, 77, 109, 0.1)),
    #fff;
}

.level-panel {
  background:
    linear-gradient(150deg, rgba(0, 184, 148, 0.14), rgba(47, 128, 237, 0.1)),
    #fff;
}

.wheel-panel {
  background:
    linear-gradient(150deg, rgba(255, 190, 11, 0.3), rgba(239, 71, 111, 0.12), rgba(0, 187, 249, 0.14)),
    #fff;
}

.momentum-panel {
  background:
    linear-gradient(150deg, rgba(251, 86, 7, 0.14), rgba(255, 190, 11, 0.16)),
    #fff;
}

.mission-card,
.level-card {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.mission-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.mission-card p,
.level-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.level-top,
.level-stats,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.level-top {
  justify-content: space-between;
}

.level-top span,
.level-stats span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.level-meter {
  height: 10px;
  overflow: hidden;
  background: #eceef4;
  border-radius: 999px;
}

.level-meter span {
  display: block;
  width: var(--meter, 0%);
  height: 100%;
  background: linear-gradient(90deg, #00b894, #2f80ed);
}

.wheel-card {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.wheel-copy {
  display: grid;
  gap: 6px;
}

.wheel-copy h3,
.wheel-copy p {
  margin: 0;
}

.wheel-copy h3 {
  font-size: 1.08rem;
}

.wheel-copy p,
.wheel-copy small,
.wheel-progress small,
.wheel-result small,
.wheel-rule {
  color: var(--muted);
  line-height: 1.42;
}

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 196px;
}

.wheel-pointer {
  position: absolute;
  top: 5px;
  z-index: 2;
  width: 0;
  height: 0;
  border-right: 14px solid transparent;
  border-left: 14px solid transparent;
  border-top: 28px solid var(--ink);
  filter: drop-shadow(0 2px 0 #fff);
}

.prize-wheel {
  position: relative;
  display: grid;
  place-items: center;
  width: min(178px, 72vw);
  aspect-ratio: 1;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background:
    conic-gradient(
      #ff4d6d 0deg 60deg,
      #ffd166 60deg 120deg,
      #2f80ed 120deg 180deg,
      #00b894 180deg 240deg,
      #f15bb5 240deg 300deg,
      #ff9f1c 300deg 360deg
    );
  box-shadow: 6px 6px 0 var(--ink);
}

.prize-wheel::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 48px;
  height: 48px;
  translate: -50% -50%;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.prize-wheel span {
  position: absolute;
  inset: 13px;
  display: block;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 950;
  text-align: center;
  text-shadow: 0 1px 2px rgba(20, 20, 31, 0.5);
  transform: rotate(calc(var(--segment) * 60deg + 30deg));
  transform-origin: center;
}

.prize-wheel strong {
  position: relative;
  z-index: 1;
  max-width: 46px;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1;
  text-align: center;
}

.wheel-card.is-spinning .prize-wheel {
  animation: wheelSpin 0.82s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes wheelSpin {
  to {
    transform: rotate(900deg);
  }
}

.wheel-progress,
.wheel-result {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wheel-result span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.wheel-result.is-prize {
  border-color: rgba(255, 159, 28, 0.62);
  background: #fff3c4;
}

.wheel-button {
  min-height: 44px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, #ff4d6d, #ff9f1c 58%, #2f80ed);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
}

.wheel-button:disabled {
  cursor: not-allowed;
  color: #5e6070;
  background: #eceef4;
  box-shadow: none;
}

.wheel-rule {
  font-size: 0.78rem;
  font-weight: 850;
}

.leader-row,
.category-row,
.ad-slot,
.momentum-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.leader-row:last-child,
.category-row:last-child,
.ad-slot:last-child,
.momentum-row:last-child {
  border-bottom: 0;
}

.leader-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
}

.rank-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  font-weight: 950;
  background: var(--ink);
  border-radius: 8px;
}

.momentum-row {
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  color: inherit;
  text-align: left;
  background: transparent;
}

.momentum-row > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  background: var(--card-color, var(--accent));
  border-radius: 8px;
}

.momentum-row strong,
.momentum-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.momentum-row strong {
  white-space: nowrap;
}

.momentum-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.leader-row strong,
.category-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-row small,
.category-row small,
.ad-slot small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.stat-tile {
  min-height: 76px;
  padding: 12px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-tile strong {
  display: block;
  font-size: 1.36rem;
}

.stat-tile span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.category-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.category-meter {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  background: #eceef4;
  border-radius: 999px;
}

.category-meter span {
  display: block;
  width: var(--meter, 0%);
  height: 100%;
  background: var(--meter-color, var(--accent));
}

.ads-panel {
  background:
    linear-gradient(135deg, rgba(0, 187, 249, 0.18), rgba(255, 209, 102, 0.18)),
    #fff;
}

.ad-slot a {
  width: fit-content;
  color: var(--ink);
  font-weight: 950;
}

.empty-state {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 18px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.legal-zone {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto 28px;
  padding: clamp(18px, 3vw, 26px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 20, 31, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.legal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.legal-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  padding: 5px 9px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 950;
  background: var(--ink);
  border-radius: 999px;
}

.legal-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  letter-spacing: 0;
}

.legal-head p,
.legal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.legal-note {
  margin-top: 16px;
  padding: 12px 14px;
  color: #3b1800;
  font-weight: 850;
  line-height: 1.45;
  background: #fff3c4;
  border: 1px solid rgba(255, 159, 28, 0.4);
  border-radius: 8px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.legal-grid details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legal-grid summary {
  padding: 13px 14px;
  font-weight: 950;
  cursor: pointer;
}

.legal-copy {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.site-footer a {
  color: var(--ink);
}

.chat-jump-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 55;
  display: inline-grid;
  grid-template-columns: 42px minmax(0, auto);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  max-width: min(260px, calc(100vw - 36px));
  padding: 8px 14px 8px 8px;
  color: #fff;
  text-decoration: none;
  background:
    linear-gradient(135deg, #ff4d6d, #f59f00 56%, #2f80ed),
    var(--accent);
  border: 2px solid rgba(20, 20, 31, 0.92);
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--ink), 0 18px 42px rgba(20, 20, 31, 0.18);
}

.chat-jump-button:hover {
  transform: translateY(-2px);
}

.chat-jump-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  font-size: 1.22rem;
  background: #fff;
  border-radius: 50%;
}

.chat-jump-button strong,
.chat-jump-button small {
  display: block;
  line-height: 1.05;
  white-space: nowrap;
}

.chat-jump-button strong {
  font-size: 0.96rem;
  font-weight: 950;
}

.chat-jump-button small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.75rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 80;
  max-width: min(340px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #fff;
  font-weight: 950;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.alias-overlay,
.admin-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 20, 31, 0.52);
}

.alias-overlay {
  z-index: 70;
  background:
    linear-gradient(135deg, rgba(255, 77, 109, 0.26), rgba(47, 128, 237, 0.26)),
    rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px);
}

.alias-panel {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  padding: clamp(20px, 5vw, 30px);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 8px 8px 0 var(--ink);
}

.alias-kicker {
  width: fit-content;
  padding: 5px 9px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 950;
  background: var(--accent);
  border-radius: 999px;
}

.alias-panel h2 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2.2rem);
}

.alias-panel p {
  margin: -6px 0 0;
  color: var(--muted);
}

.alias-panel input {
  min-height: 48px;
  width: 100%;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-overlay {
  z-index: 60;
}

.admin-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1060px, 100%);
  max-height: min(86vh, 900px);
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.admin-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

#adminContent {
  overflow: auto;
  padding: 18px;
}

.admin-login,
.admin-dashboard,
.admin-list,
.admin-form {
  display: grid;
  gap: 12px;
}

.admin-login {
  max-width: 420px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-card,
.admin-block {
  padding: 14px;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-card strong {
  display: block;
  font-size: 1.5rem;
}

.admin-card span,
.admin-block p {
  color: var(--muted);
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-wide {
  grid-column: 1 / -1;
}

.ad-editor {
  display: grid;
  gap: 10px;
}

.ad-slot-editor {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.4fr) minmax(96px, 0.8fr) minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-line {
  align-items: center;
  grid-template-columns: auto auto;
  min-height: 42px;
}

.check-line input {
  width: 18px;
  min-height: 18px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-row.is-muted {
  opacity: 0.62;
}

.admin-row.is-prize-row {
  border-color: rgba(255, 159, 28, 0.62);
  background: #fff7d6;
}

.admin-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-row strong,
.admin-row p {
  overflow-wrap: anywhere;
}

.admin-row button[data-tone="light"] {
  color: var(--ink);
  background: #eef0f6;
}

.admin-row button[data-tone="danger"] {
  background: #d92d20;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .side-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ads-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
    padding-inline: 12px;
  }

  .brand small {
    display: none;
  }

  .page-shell {
    width: min(100% - 20px, 720px);
    margin-top: 14px;
  }

  .composer-head,
  .composer-controls,
  .category-form,
  .reply-form,
  .chat-form,
  .admin-row,
  .admin-stats,
  .admin-grid,
  .ad-slot-editor,
  .legal-grid {
    grid-template-columns: 1fr;
  }

  .legal-head {
    display: grid;
  }

  .counter {
    text-align: left;
  }

  .featured-grid,
  .side-flow {
    grid-template-columns: 1fr;
  }

  .feed-head,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .feed-head input {
    max-width: none;
  }

  .segmented {
    width: 100%;
    grid-auto-columns: minmax(0, 1fr);
  }

  .segmented button {
    padding-inline: 6px;
    font-size: 0.82rem;
    line-height: 1.1;
    white-space: normal;
  }

  .post-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .vote-button {
    width: 36px;
  }

  .chat-jump-button {
    right: 12px;
    bottom: 12px;
    grid-template-columns: 38px minmax(0, auto);
    min-height: 52px;
    padding: 7px 12px 7px 7px;
  }

  .chat-jump-icon {
    width: 38px;
    height: 38px;
  }

  .toast {
    right: 12px;
    bottom: 78px;
  }
}

@media (max-width: 420px) {
  .alias-pill {
    justify-content: center;
    width: 40px;
    padding: 0;
  }

  .alias-pill span:last-child {
    display: none;
  }

  .online-pill {
    max-width: 112px;
    overflow: hidden;
    white-space: nowrap;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .vote-stack {
    grid-template-columns: 40px auto 40px;
    justify-content: start;
  }

  .chat-jump-button {
    left: 12px;
    right: 12px;
    justify-content: center;
    max-width: none;
  }
}
