:root {
  --bg: #000000;
  --yellow: #ffec00;
  --pill: #1a1a1a;
  --pill-hover: #262626;
  --pill-edge: #2e2e2e;
  --grey: #8a8a8a;
  --grey-pill: #141414;
  --line: #333333;

  --sunk: #0c0c0c;
  --placeholder: #5a5a5a;
  --msg-name: #8ad6ff;
  --msg-body: #ded9c4;
  --msg-time: #4f4f4f;
  --danger: #ff5555;
  --scroll: #2a2a2a;
}

:root[data-theme="light"] {
  --bg: #f2eee2;
  --yellow: #7a5c00;
  --pill: #e4ddc9;
  --pill-hover: #d8cfb6;
  --pill-edge: #c4b995;
  --grey: #6f6858;
  --grey-pill: #e9e3d2;
  --line: #cdc3a6;

  --sunk: #ece5d3;
  --placeholder: #9a917c;
  --msg-name: #1f6f9c;
  --msg-body: #33302a;
  --msg-time: #918872;
  --danger: #b3261e;
  --scroll: #c4b995;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--yellow);
}

body {
  transition: background-color 0.15s ease, color 0.15s ease;
  font-family: "Courier New", ui-monospace, "DejaVu Sans Mono", monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  min-height: 100vh;
  padding-bottom: 60px;
}

.header {
  position: relative;
  line-height: 0;
}

.logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  width: min(19%, 300px);
  height: auto;
  pointer-events: none;

  filter: drop-shadow(0 2px 7px rgba(0, 0, 0, 0.95));
}

.banner {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 150;
  background: url("assets/header.gif") no-repeat center / 100% 100%;
  image-rendering: pixelated;
  user-select: none;
}

:root[data-theme="light"] .banner {
  background-image: url("assets/header-day.gif");
}

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

.welcome {
  margin: 34px auto 0;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section {
  margin-top: 46px;
}

.label {
  display: inline-block;
  background: var(--grey-pill);
  color: var(--grey);
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 8px;
  letter-spacing: 3px;
  font-size: 13px;
}

.row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.btn {
  display: inline-block;
  background: var(--pill);
  color: var(--yellow);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 11px 20px;
  border: 1px solid var(--pill-edge);
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  transition: background 0.12s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--pill-hover);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn.small {
  font-size: 13px;
  padding: 8px 14px;
  letter-spacing: 1px;
}

.badge {
  display: block;
  width: min(150px, 42vw);
  height: auto;
  margin: 34px auto 0;
}

.note {
  margin-top: 26px;
  line-height: 1.75;
  font-size: 14px;
}

.dim { color: var(--grey); }

.sign {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.sign .note { margin-top: 0; }

.bar {
  width: min(320px, 90%);
  height: 10px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow) 0 10px,
    #000 10px 20px
  );
  opacity: 0.85;
}

.dots::after {
  content: "";
  animation: dots 1.6s steps(1, end) infinite;
}

@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}

.caret {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 5px;
  vertical-align: -2px;
  background: var(--yellow);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.trail {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 40;
}

.trail svg {
  position: absolute;
  will-change: transform, opacity;
  animation: heart-drift var(--life) linear forwards;
}

@keyframes heart-drift {
  0% {
    transform: translate(-50%, -50%) scale(0.85) rotate(var(--rot));
    opacity: 0;
  }
  10% { opacity: 1; }
  70% { opacity: 1; }
  100% {

    transform:
      translate(calc(-50% + var(--drift)), calc(-50% - var(--rise)))
      scale(0.8)
      rotate(calc(var(--rot) * 1.6));
    opacity: 0;
  }
}

.field {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.input {
  flex: 1 1 320px;
  min-width: 0;
  background: var(--pill);
  border: 1px solid var(--pill-edge);
  border-radius: 9px;
  color: var(--yellow);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  padding: 11px 14px;
  outline: none;
  text-align: center;
}

.input::placeholder { color: var(--placeholder); letter-spacing: 1px; }
.input:focus { border-color: var(--yellow); }

:root[data-ads="off"] .ad { display: none !important; }

.btn.on {
  background: var(--yellow);
  color: var(--bg);
  border-color: var(--yellow);
}

.sub { margin-top: 30px; }
.small-label { font-size: 11px; letter-spacing: 2px; }
.stack.tight { gap: 8px; margin-top: 0; align-items: flex-start; }
.link { color: var(--yellow); }

.avatar-row {
  margin-top: 22px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--sunk);
  border: 1px solid var(--pill-edge);
}

.avatar.big { width: 72px; height: 72px; }

.avatar.blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--grey);
  font-size: 26px;
}

.avatar.tiny {
  width: 20px;
  height: 20px;
  vertical-align: -5px;
  margin-right: 6px;
  font-size: 11px;
}

.save-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

.save-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  background: var(--pill);
  border: 1px solid var(--pill-edge);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
}

.save-row .dim { font-size: 11px; }

.stack {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.stack .input { width: min(320px, 100%); flex: none; text-align: center; }

.log {
  margin-top: 22px;
  height: min(68vh, 620px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sunk);
  border: 1px solid var(--pill-edge);
  border-radius: 9px;
  padding: 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.msg {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.msg-name { color: var(--msg-name); margin-right: 7px; text-decoration: none; }
a.msg-name:hover { text-decoration: underline; }
.msg-name::after { content: ":"; }
.msg.mine .msg-name { color: var(--yellow); }
.msg-body { color: var(--msg-body); }
.msg-time { color: var(--msg-time); font-size: 11px; margin-left: 8px; }

.msg.notice {
  color: var(--grey);
  font-style: normal;
  text-align: center;
  font-size: 13px;
}

.mod {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #ff6b6b;
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 1px;
  padding: 2px 5px;
  margin-left: 6px;
  border-radius: 4px;
  cursor: pointer;

  opacity: 0.6;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.msg:hover .mod, .mod:focus-visible { opacity: 1; }
.mod:hover { background: #2a1414; border-color: #ff6b6b; }

.who { font-size: 12px; letter-spacing: 1px; align-self: center; }

.log::-webkit-scrollbar { width: 10px; }
.log::-webkit-scrollbar-track { background: var(--sunk); }
.log::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 5px; }

.grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.card {
  background: var(--pill);
  border: 1px solid var(--pill-edge);
  border-radius: 9px;
  padding: 12px;
  text-decoration: none;
  color: var(--yellow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: background 0.12s ease, transform 0.12s ease;
}

.card:hover { background: var(--pill-hover); transform: translateY(-2px); }

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  image-rendering: pixelated;
  background: #000;
}

.card span {
  font-size: 13px;
  letter-spacing: 1px;
  word-break: break-word;
}

.stage {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
  flex-direction: column;
}

.stage.on { display: flex; }

.stage-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--sunk);
  border-bottom: 1px solid var(--line);
}

.stage-search {
  display: flex;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
}

.input.flat {
  flex: 1 1 auto;
  text-align: left;
  font-size: 13px;
  padding: 8px 12px;
  letter-spacing: 1px;
}

@media (max-width: 620px) {
  .stage-bar { flex-wrap: wrap; }
  .stage-search { order: -1; flex-basis: 100%; }
}

.stage iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.status {
  margin-top: 18px;
  min-height: 20px;
  font-size: 13px;
  color: var(--grey);
  letter-spacing: 1px;
}

.status.err { color: var(--danger); }

.thumb {
  position: relative;
  width: 54px;
  height: 54px;
  border: 2px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  flex: 0 0 auto;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  color: #000;
  background: var(--yellow);
}

.msg-body code {
  background: var(--sunk);
  padding: 1px 4px;
  border-radius: 3px;
}
.msg-body pre.code {
  background: var(--sunk);
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre;
}
.msg-body strong { color: var(--yellow); }
.msg-body em { font-style: italic; }

.server { display: flex; gap: 10px; align-items: stretch; text-align: left; }

.channels {
  flex: 0 0 138px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
  background: var(--sunk);
  border-radius: 4px;
  overflow-y: auto;
}

.chan-head {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--dim);
  margin-top: 6px;
}
.chan-head:first-child { margin-top: 0; }

.chan {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.chan:hover { color: var(--fg); background: var(--line); }
.chan.on { color: #000; background: var(--yellow); }
.chan.live { color: var(--yellow); }

.voice-roster, .people {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--dim);
  padding-left: 6px;
}
.people span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.voice-who {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.voice-who .avatar {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  font-size: 10px;
  margin: 0;
  vertical-align: 0;
}
.voice-who .nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-who .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--line);
}
.voice-who.talking .dot { background: #3ad16b; box-shadow: 0 0 5px #3ad16b; }
.voice-who.talking .nick { color: var(--fg); }

.room-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }


.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 0 0; }

.react {
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--fg);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.react:hover { border-color: var(--yellow); }
.react.mine { border-color: var(--yellow); color: var(--yellow); }


@media (max-width: 620px) {
  .server { flex-direction: column; }
  .channels { flex: 1 1 auto; max-height: none; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .chan { width: auto; }
  .people, .voice-roster { flex-direction: row; flex-wrap: wrap; gap: 6px; }
}

.ctx {
  position: fixed;
  z-index: 60;
  min-width: 150px;
  padding: 5px;
  background: var(--sunk);
  border: 2px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ctx-emoji {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding-bottom: 4px;
  margin-bottom: 3px;
  border-bottom: 1px solid var(--line);
}
.ctx-emoji button {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 3px;
  border-radius: 3px;
}
.ctx-emoji button:hover { background: var(--line); }

.ctx-item {
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  text-align: left;
  padding: 5px 7px;
  border-radius: 3px;
  cursor: pointer;
}
.ctx-item:hover { background: var(--line); }
.ctx-item.danger { color: #ff6b6b; }
.ctx-item.danger:hover { background: #ff6b6b; color: #000; }

.profile-head {
  margin-top: 22px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  text-align: left;
  flex-wrap: wrap;
}

.avatar.huge { width: 96px; height: 96px; flex: 0 0 auto; font-size: 34px; }

.profile-side { flex: 1 1 260px; min-width: 0; }

.profile-name {
  font-size: 18px;
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-meta {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.8;
}

.tag {
  font-size: 10px;
  letter-spacing: 2px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--grey-pill);
  color: var(--grey);
  border: 1px solid var(--pill-edge);
}

.tag.friend { color: var(--yellow); border-color: var(--yellow); }

.tight-row { margin-top: 14px; justify-content: flex-start; gap: 10px; }

.about {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--sunk);
  border: 1px solid var(--pill-edge);
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--msg-body);
}

.input.area {
  display: block;
  width: 100%;
  margin-top: 16px;
  text-align: left;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
}

.small-note { font-size: 11px; letter-spacing: 1px; align-self: center; }

.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--bg); }

.chips {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--pill);
  border: 1px solid var(--pill-edge);
  color: var(--yellow);
  text-decoration: none;
}

.chip:hover { background: var(--pill-hover); }

.mates {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.mate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 5px 11px 5px 6px;
  border-radius: 20px;
  background: var(--pill);
  border: 1px solid var(--pill-edge);
  color: var(--yellow);
  text-decoration: none;
  min-width: 0;
}

.mate:hover { background: var(--pill-hover); }
.mate .avatar { margin-right: 0; vertical-align: 0; }
.mate span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mate-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--sunk);
  border: 1px solid var(--pill-edge);
  border-radius: 9px;
  padding: 8px 12px;
  text-align: left;
}

.mate-row .mate { background: none; border: 0; padding: 0; font-size: 13px; }
.mate-row .mate:hover { background: none; text-decoration: underline; }

.mate-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ad16b;
  box-shadow: 0 0 5px #3ad16b;
  flex: 0 0 auto;
}

@media (max-width: 520px) {
  .profile-head { justify-content: center; }
  .profile-name { justify-content: center; }
  .profile-head, .about { text-align: center; }
  .tight-row { justify-content: center; }
}
