:root {
  color-scheme: dark;
  --bg: #0d0e10;
  --panel: #15171a;
  --panel-soft: #191c20;
  --ink: #e8e3d8;
  --muted: #9d968b;
  --lime: #b7e66b;
  --rose: #d86a8d;
  --blue: #75bfd6;
  --line: #34383d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: 22px 22px;
}

button,
input,
textarea {
  font: inherit;
}

main {
  width: min(1540px, calc(100% - 18px));
  height: 100svh;
  margin: 0 auto;
  padding: 9px 0 32px;
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 318px;
  grid-template-areas: "left wall console";
  gap: 8px;
}

.left-rail {
  grid-area: left;
  min-height: 0;
}

.top,
.console,
.wall {
  border: 1px solid var(--line);
  background: rgba(21, 23, 26, 0.92);
}

.top {
  padding: 10px;
}

.tag,
.sub,
.msg,
#count,
.rail-title {
  color: var(--muted);
}

.tag,
.rail-title {
  margin: 0;
  color: var(--rose);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 2.8vw, 3.05rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: lowercase;
  overflow-wrap: anywhere;
}

#spin-word {
  display: block;
  max-width: 100%;
  font-size: clamp(1.95rem, 2.65vw, 2.95rem);
  overflow-wrap: anywhere;
  color: var(--lime);
  text-shadow: 2px 0 rgba(216, 106, 141, 0.76), -2px 0 rgba(117, 191, 214, 0.68);
  transform-origin: 50% 70%;
}

#spin-word.swap {
  animation: glitchSpin 430ms steps(2, end);
}

@keyframes glitchSpin {
  0% {
    opacity: 0;
    transform: translate(-5px, 7px) rotate(-4deg) skewX(10deg);
  }
  45% {
    opacity: 1;
    transform: translate(6px, -3px) rotate(3deg) skewX(-12deg);
  }
  100% {
    opacity: 1;
    transform: translate(0) rotate(0) skewX(0);
  }
}

.sub {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.36;
}

.console {
  grid-area: console;
  align-self: start;
  padding: 10px;
  position: sticky;
  top: 14px;
}

form {
  display: grid;
  gap: 8px;
}

.post form {
  gap: 6px;
}

.room-form {
  margin-top: 10px;
}

.room-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.room-row input,
.room-row button {
  min-height: 31px;
  font-size: 0.76rem;
}

.row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--lime);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid #4a5056;
  border-radius: 0;
  background: #0a0b0c;
  color: var(--ink);
  outline: none;
}

input {
  min-height: 39px;
  padding: 0 10px;
}

textarea {
  min-height: 78px;
  padding: 10px;
  resize: vertical;
  line-height: 1.35;
}

input:focus,
textarea:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(183, 230, 107, 0.16);
}

button {
  min-height: 39px;
  border: 1px solid var(--lime);
  border-radius: 0;
  padding: 0 12px;
  background: var(--lime);
  color: #0d0e10;
  font-weight: 1000;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover {
  background: var(--rose);
  border-color: var(--rose);
}

.share-site {
  min-height: 25px;
  padding: 0 8px;
  background: rgba(21, 23, 26, 0.95);
  color: var(--lime);
  border-color: var(--line);
  font-size: 0.72rem;
}

.signed {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-weight: 1000;
}

.signed button,
.copy {
  min-height: 30px;
  background: transparent;
  color: var(--lime);
}

.danger,
.reply-delete {
  color: var(--rose);
  border-color: var(--rose);
}

.msg {
  min-height: 1.25em;
  margin: 0;
  font-size: 0.85rem;
}

.hidden {
  display: none;
}

.wall {
  grid-area: wall;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

.wall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.wall-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

#room-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

h2 {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  text-transform: uppercase;
}

#count {
  margin: 0 0 10px;
  font-size: 0.84rem;
}

.clear-filter {
  min-height: 27px;
  padding: 0 8px;
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
  font-size: 0.72rem;
}

.posts {
  height: calc(100svh - 104px);
  overflow: auto;
  padding-right: 4px;
  columns: 2 280px;
  column-gap: 10px;
}

.post {
  display: inline-grid;
  width: 100%;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px;
  break-inside: avoid;
  border: 1px solid #444b52;
  background: #0b0d0f;
}

.post:nth-child(4n + 2) {
  border-color: rgba(117, 191, 214, 0.55);
}

.post:nth-child(4n + 3) {
  border-color: rgba(216, 106, 141, 0.58);
}

.post.cursed {
  border-color: rgba(216, 106, 141, 0.9);
  box-shadow: inset 0 0 0 1px rgba(216, 106, 141, 0.28);
}

.meta,
.bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.meta strong {
  color: var(--blue);
  cursor: pointer;
}

.handle-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.badge {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(183, 230, 107, 0.55);
  width: 1.15rem;
  height: 1.15rem;
  color: var(--lime);
  font-size: 0.76rem;
  line-height: 1.25;
}

.badge-crown {
  border-color: rgba(216, 106, 141, 0.68);
  color: var(--rose);
}

.meta span,
.bottom span {
  color: var(--muted);
  font-size: 0.76rem;
}

h3 {
  margin: 0;
  color: var(--lime);
  font-size: 1.05rem;
  line-height: 1.16;
}

.cursed-tag {
  display: inline-block;
  border: 1px solid rgba(216, 106, 141, 0.68);
  padding: 1px 5px;
  color: var(--rose);
  font-size: 0.66rem;
  vertical-align: middle;
}

.post p {
  margin: 0;
  color: #d8d1c5;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reply {
  display: block;
  overflow: visible;
}

.replies {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(52, 56, 61, 0.76);
}

.reply {
  color: var(--muted);
  font-size: 0.86rem;
}

.reply strong {
  color: var(--blue);
}

.reply-delete {
  min-height: 0;
  padding: 0 5px;
  background: transparent;
  font-size: 0.72rem;
}

.reply-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.reply-form input {
  min-height: 32px;
  font-size: 0.84rem;
}

.reply-form button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.empty {
  color: var(--muted);
}

.corner-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  pointer-events: none;
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 1000;
}

@media (max-width: 980px) {
  main {
    width: min(100% - 14px, 1540px);
    height: auto;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "console"
      "wall";
  }

  h1 {
    font-size: clamp(3.4rem, 14vw, 5.8rem);
  }

  #spin-word {
    display: inline-block;
    font-size: inherit;
  }

  .left-rail {
    display: block;
  }

  .console {
    position: static;
  }

  .row.two {
    grid-template-columns: 1fr;
  }

  .posts {
    height: auto;
    overflow: visible;
    columns: 1;
  }
}
