:root,
[data-theme="wolf"] {
  --bg: #0c0c0c;
  --page: #070707;
  --menu: #121212;
  --panel: #181818;
  --child: #181818;
  --line: #262626;
  --line2: #363636;
  --text: #e6e6e6;
  --muted: #5a5a5a;
  --hover: #b4b4b4;
  --accent: #750851;
  --title: #d98bb8;
}

[data-theme="carbon"] {
  --page: #080808;
  --menu: #111111;
  --panel: #171717;
  --accent: #9a9a9a;
  --title: #d0d0d0;
}

[data-theme="blood"] {
  --page: #0a0606;
  --menu: #140c0c;
  --panel: #1b1010;
  --accent: #a01c24;
  --title: #e08a8a;
}

[data-theme="gold"] {
  --page: #0a0804;
  --menu: #14120c;
  --panel: #1b1810;
  --accent: #c4a35a;
  --title: #ead7a0;
}

[data-theme="ice"] {
  --page: #05080c;
  --menu: #0e141a;
  --panel: #141c24;
  --accent: #4a8fd4;
  --title: #9ec8f0;
}

[data-theme="venom"] {
  --page: #050a06;
  --menu: #0e1410;
  --panel: #141c16;
  --accent: #3d8b4a;
  --title: #9ed4a6;
}

[data-theme="violet"] {
  --page: #09060c;
  --menu: #140e18;
  --panel: #1a1420;
  --accent: #7b3fa0;
  --title: #c9a0e0;
}

[data-theme="halloween"] {
  --bg: #140c08;
  --page: #100806;
  --menu: #1c100c;
  --panel: #27160f;
  --child: #27160f;
  --line: #5a2a14;
  --line2: #8a4a22;
  --text: #f6ead8;
  --muted: #b18462;
  --hover: #ffd7b0;
  --accent: #ff7a18;
  --title: #ffc56a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

html, body, .forum-body {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

a { color: inherit; }

.menu {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  margin: 12px auto;
  background: var(--menu);
  border: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-top {
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: linear-gradient(#1a1a1a, #141414);
  border-bottom: 1px solid #262626;
}

.menu-tabs {
  display: flex;
}

.menu-tabs a {
  width: auto;
  min-width: 88px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: #5a5a5a;
  position: relative;
  white-space: nowrap;
}

.menu-tabs a:hover { color: #b4b4b4; background: #191919; }

.menu-tabs a.active {
  color: #fff;
  background: transparent;
}

.menu-tabs a.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  position: relative;
}

.menu-logo {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.dl-top {
  appearance: none;
  height: 24px;
  padding: 0 10px;
  border: 1px solid #2a2a2a;
  background: #161616;
  color: #c8c8c8;
  font: 600 10px/1 "Segoe UI", Tahoma, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.dl-top:hover { border-color: var(--accent); color: #fff; }
.dl-top[hidden] { display: none !important; }
.dl-top:disabled { opacity: 0.5; cursor: wait; }
.dl-top.err { border-color: #8a2a2a; color: #f0a0a0; }
.ea-top { text-decoration: none; display: inline-flex; align-items: center; }
.ea-top[hidden] { display: none !important; }
.ea-top.on { border-color: var(--accent); color: #fff; }

.ea-page {
  max-width: 560px;
  display: grid;
  gap: 12px;
}

.ea-page p,
.ea-page li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.ea-page ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.ea-pay {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #282828;
  background: #161616;
}

.ea-wallet {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ea-wallet code {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-size: 12px;
  color: var(--title);
}

.bell {
  appearance: none;
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bell:hover { color: #fff; }

.bell-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #141414;
}

.bell-panel {
  position: absolute;
  top: 36px;
  right: 8px;
  width: min(320px, calc(100vw - 32px));
  max-height: 320px;
  overflow: auto;
  z-index: 30;
  background: #161616;
  border: 1px solid #2a2a2a;
  padding: 6px;
}

.bell-item {
  display: block;
  text-decoration: none;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.bell-item:hover { background: #1e1e1e; }

.bell-item strong { color: #fff; }

.bell-item span {
  display: block;
  color: #7a7a7a;
  font-size: 11px;
  margin-top: 2px;
}

.block {
  border: 1px solid #2a2a2a;
  background: #181818;
  margin-bottom: 16px;
}

.block-header {
  padding: 9px 12px;
  border-bottom: 1px solid #2a2a2a;
  background: #151515;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.block-body { background: #161616; }

.block-footer {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid #2a2a2a;
  background: #141414;
}

.shout-log {
  max-height: 220px;
  overflow: auto;
}

.shout-block.tall .shout-log { max-height: 420px; }

.shout {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 12px;
  border-bottom: 1px solid #222;
  font-size: 12px;
}

.shout:last-child { border-bottom: 0; }

.shout-name { color: #fff; }

.shout-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}

.shout.roll .shout-body {
  color: #c4a35a;
}

.shout-del {
  appearance: none;
  border: 0;
  background: transparent;
  color: #666;
  cursor: pointer;
  font-size: 11px;
  padding: 0 4px;
}

.shout-del:hover { color: #d36b6b; }

.shout-form {
  display: flex;
  gap: 8px;
  margin: 0;
}

.shout-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #282828;
  background: #0c0c0c;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
}

.shout-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.shout-form .btn {
  min-width: 56px;
}

.menu-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.menu-side {
  width: 140px;
  flex: 0 0 140px;
  background: var(--menu);
  border-right: 1px solid #242424;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}

.menu-side a {
  display: block;
  height: 28px;
  line-height: 28px;
  padding: 0 14px;
  text-decoration: none;
  font-size: 12px;
  color: #5a5a5a;
}

.menu-side a:hover { color: #b4b4b4; }

.menu-side a.active {
  color: #fff;
  box-shadow: inset 2px 0 0 var(--accent);
}

.menu-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 16px 18px 28px;
  background: var(--panel);
}

.menu-user {
  margin-top: auto;
  padding: 14px 10px 12px;
  border-top: 1px solid #242424;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.menu-side .nav-me {
  height: auto;
  line-height: 1.25;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #c8c8c8;
  overflow: hidden;
  max-width: 100%;
}

.menu-side .nav-me span:not(.pfp) {
  display: block;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-side .menu-user .btn {
  width: 100%;
}

.menu.gate-mode .menu-side { display: none; }
.menu.gate-mode .menu-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-content h1 {
  font-size: 15px;
  font-weight: 600;
  color: #c8c8c8;
  margin-bottom: 14px;
}

.muted { color: #8a8a8a; font-size: 12px; }

.err {
  color: #d36b6b;
  font-size: 12px;
  margin-top: 10px;
}

.ok {
  color: #8a8a8a;
  font-size: 12px;
  margin-top: 10px;
}

.gate { width: min(320px, 100%); }

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
}

.tabs button { flex: 1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  color: #8a8a8a;
}

.field input,
.field textarea,
.field select {
  appearance: none;
  width: 100%;
  border: 1px solid #282828;
  background: #101010;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  appearance: none;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: var(--text);
  padding: 8px 14px;
  min-height: 32px;
  min-width: 72px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}

.btn:hover { border-color: var(--accent); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.wide { width: 100%; }

.gate-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #8a8a8a;
  text-decoration: none;
}

.gate-link:hover { color: #fff; }

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

.cat {
  display: block;
  text-decoration: none;
  border: 1px solid #282828;
  background: #181818;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.cat:hover { border-color: var(--accent); }

.cat strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.cat p {
  color: #8a8a8a;
  font-size: 12px;
  margin-top: 4px;
}

.cat .meta {
  margin-top: 8px;
  font-size: 11px;
  color: #6a6a6a;
}

.thread {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  text-decoration: none;
  border-bottom: 1px solid #222;
  padding: 12px 2px;
}

.thread:hover .title { color: #fff; }

.thread .title { font-size: 14px; }

.thread .meta,
.thread .count {
  font-size: 11px;
  color: #7a7a7a;
}

.badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid #333;
  padding: 1px 5px;
  margin-right: 6px;
  color: #8a8a8a;
  vertical-align: middle;
}

.badge.staff { border-color: var(--accent); color: var(--title); }
.badge.mod { border-color: #c47a2a; color: #f0c27a; }
.badge.og {
  border-color: #f0c36a;
  color: #2a1604;
  background: linear-gradient(180deg, #ffe7ad, #e2a23a);
  letter-spacing: 0.14em;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(226, 162, 58, 0.45);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.badge.vip { border-color: #c9a227; color: #e6c86e; }
.badge.beta { border-color: #3a7a9a; color: #7ec8e3; }
.badge.pin { border-color: #8a6a2a; color: #d4b36a; }
.badge.lock { border-color: #555; }
.badge.upd { border-color: var(--accent); color: var(--title); }
.badge.tick-open { border-color: var(--accent); color: var(--title); }
.badge.tick-pending { border-color: #8a6a2a; color: #d4b36a; }
.badge.tick-closed { border-color: #444; color: #7a7a7a; }

.post {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: start;
  width: 100%;
  border: 1px solid #282828;
  background: #181818;
  margin-bottom: 8px;
}

.post-side { padding: 12px 0 12px 12px; }

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #222;
  font-size: 11px;
  color: #7a7a7a;
}

.tick-post {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
}

.tick-post .post-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 0;
  font-size: 11px;
  color: #7a7a7a;
}

.tick-post .post-body {
  padding-top: 8px;
}

.post-body {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
}

.like-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px 12px;
}

.like-who {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--menu);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}

.like-who .wolf,
.like-actions .like .wolf {
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  font-size: 15px;
  line-height: 1;
}

.like-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.like-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

.like-actions .like.on {
  border-color: var(--accent);
  color: var(--title);
}

.thread-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.thread-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  line-height: 1.3;
}

.thread-actions {
  margin: 0 0 16px;
}

.crumb {
  font-size: 11px;
  color: #6a6a6a;
  margin-bottom: 12px;
}

.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--text); }

.nav-me {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 12px;
  color: #8a8a8a;
  margin-bottom: 8px;
}

.nav-me:hover { color: #fff; }

.pfp {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border: 1px solid #2a2a2a;
  background: #101010;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: var(--title);
  overflow: hidden;
}

.pfp.tiny { width: 16px; height: 16px; font-size: 9px; vertical-align: middle; }
.pfp.nav { width: 28px; height: 28px; font-size: 11px; }

.report {
  border: 1px solid #282828;
  background: #181818;
  margin-bottom: 8px;
}
.pfp.lg { width: 44px; height: 44px; font-size: 16px; }
.pfp.xl { width: 88px; height: 88px; font-size: 28px; }
.pfp.letter {
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1;
  padding: 0;
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.person .pfp { display: none; }

.usertitle {
  font-size: 11px;
  color: var(--title);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.uname { color: var(--text); }

.nick,
.profile-user {
  display: inline-block;
}

.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

.who .badge {
  margin: 0;
  letter-spacing: 0.06em;
}

.account { display: grid; gap: 22px; }

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.check-line input {
  appearance: auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.invited-by { margin-top: 4px; }
.invited-by .userlink { color: inherit; }

.badge.cfg { background: #2a1530; color: #d98bb8; }
.badge.nade { background: #152a1c; color: #8bd9a4; }

.cfg-card {
  border: 1px solid #282828;
  background: #161616;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.cfg-card pre {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  background: #101010;
  font: 12px/1.4 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.cfg-account { display: grid; gap: 12px; }
.cfg-account h2 { font-size: 15px; margin: 0; font-weight: 600; }

.cfg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #222;
}

.cfg-block {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #222;
}

.cfg-log {
  display: grid;
  gap: 8px;
}

.cfg-log article {
  font-size: 13px;
  color: #bbb;
  line-height: 1.45;
}

.cfg-log strong {
  color: #d98bb8;
}

.cfg-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfg-mini input {
  appearance: none;
  flex: 1;
  min-width: 0;
  border: 1px solid #282828;
  background: #101010;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.cfg-mini input:focus {
  outline: none;
  border-color: var(--accent);
}

.avatar-edit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.invite-box {
  border: 1px solid #282828;
  background: #181818;
  padding: 14px 16px;
}

.invite-box code {
  font-family: Consolas, "Courier New", monospace;
  color: var(--title);
}

.invite-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px 14px 14px;
  margin-bottom: 10px;
}

.invite-card label {
  display: block;
  font-size: 11px;
  color: #9a9a9a;
  margin: 8px 0 6px;
}

.invite-card label:first-child { margin-top: 0; }

.invite-card input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  padding: 10px 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.invite-card .row-actions { margin-top: 10px; }
.invite-card .btn { margin-top: 0; }

.invite-sec {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid #2a2a2a;
}

.thread .meta .pfp { vertical-align: -3px; }

.userlink { text-decoration: none; }
.userlink:hover { color: #fff; }

.uid { color: #7a7a7a; font-weight: 500; }

.mention {
  color: var(--title);
  text-decoration: none;
}

.mention:hover { text-decoration: underline; }

.profile-head {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mh {
  position: relative;
  margin: -16px -18px 24px;
  background: #0c0c0c;
  border-bottom: 1px solid #242424;
}

.mh-banner {
  height: 210px;
  overflow: hidden;
  line-height: 0;
  background: #101010;
}

.mh-banner img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: var(--bx, 50%) var(--by, 50%);
  transform: scale(var(--bz, 1));
  transform-origin: var(--bx, 50%) var(--by, 50%);
}

.mh-tools {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.mh-tools .btn {
  background: rgba(12, 12, 12, 0.55);
  border-color: rgba(255, 255, 255, 0.16);
}

.mh-content {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  min-height: 210px;
  margin-top: -210px;
  padding: 16px 20px 18px;
  position: relative;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.2) 42%, transparent 68%);
}

.mh-avatar {
  flex: 0 0 auto;
}

.mh .pfp.xl {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.mh-main {
  min-width: 0;
  padding-bottom: 2px;
}

.mh .profile-user {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.mh .usertitle,
.mh .mh-stats,
.mh .mh-stats a {
  color: #e8e8e8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.mh .who {
  margin-top: 6px;
}

.mh-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: #d4d4d4;
}

.banner-edit {
  display: grid;
  gap: 10px;
}

.banner-preview {
  width: 100%;
  height: 210px;
  border: 1px solid #282828;
  background: #101010;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.banner-preview.on {
  cursor: grab;
}

.banner-preview.drag {
  cursor: grabbing;
}

.banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--bx, 50%) var(--by, 50%);
  transform: scale(var(--bz, 1));
  transform-origin: var(--bx, 50%) var(--by, 50%);
  pointer-events: none;
}

.banner-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.banner-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8a8a8a;
  flex: 1;
  min-width: 160px;
}

.banner-zoom input {
  appearance: auto;
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
}

.profile-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  gap: 6px;
}

.profile-user {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  line-height: 1;
}

.profile-name .badge {
  margin: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 7px;
}

.wall { margin-top: 22px; }

.color-edit {
  margin: 14px 0 18px;
}

.color-edit > label {
  font-size: 12px;
  color: #8a8a8a;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 1px solid #333;
  padding: 0;
  cursor: pointer;
  min-width: 28px;
}

.swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }

.solid-row input[type="color"],
.grad-row input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 0;
  border: 1px solid #333;
  background: #111;
  cursor: pointer;
}

.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #282828;
  background: #181818;
  margin-bottom: 8px;
}

.member-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-roles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.member-roles .btn.on {
  border-color: var(--accent);
  background: #2a1020;
  color: #fff;
}

.member { text-decoration: none; cursor: pointer; }
.member:hover { border-color: var(--accent); }

.file-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.file-row {
  border: 1px solid #282828;
  background: #181818;
  padding: 10px 12px;
}

.file-row span {
  display: block;
  font-size: 12px;
  color: #8a8a8a;
  margin-bottom: 4px;
}

.file-row strong { font-weight: 600; }

.mention-box {
  position: absolute;
  z-index: 40;
  min-width: 180px;
  background: #181818;
  border: 1px solid #2a2a2a;
  padding: 4px;
}

.mention-box button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.mention-box button:hover,
.mention-box button.on { background: #222; }

.theme-pop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
}

.theme-btn {
  appearance: none;
  height: 28px;
  padding: 0 12px;
  border: 1px solid #2a2a2a;
  background: #161616;
  color: #c8c8c8;
  font: 600 10px/1 "Segoe UI", Tahoma, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.theme-btn:hover { border-color: var(--accent); color: #fff; }

.theme-list {
  position: absolute;
  right: 0;
  bottom: 34px;
  min-width: 148px;
  padding: 4px;
  background: #161616;
  border: 1px solid #2a2a2a;
}

.theme-list button {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #c8c8c8;
  padding: 7px 8px;
  font: 600 11px/1 "Segoe UI", Tahoma, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}

.theme-list button:hover,
.theme-list button.active { background: #1e1e1e; color: #fff; }

.theme-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  background: var(--accent);
}

.hw-sky { display: none; }

[data-theme="halloween"] .hw-sky {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 186, 92, 0.18), transparent 18%),
    radial-gradient(circle at 8% 110%, rgba(90, 16, 4, 0.35), transparent 36%);
}

[data-theme="halloween"] .menu { position: relative; }
[data-theme="halloween"] .menu-top,
[data-theme="halloween"] .menu-body { position: relative; z-index: 1; }

[data-theme="halloween"] .menu {
  border-color: #6a3014;
  box-shadow: 0 0 0 1px #2a1208, 0 16px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="halloween"] .menu-top {
  background: linear-gradient(#32180e, #1c0e0a);
  border-bottom-color: #6a3014;
}

[data-theme="halloween"] .menu-tabs a { color: #b18462; }
[data-theme="halloween"] .menu-tabs a:hover { color: #ffd7b0; background: #2a140e; }
[data-theme="halloween"] .menu-tabs a.active { color: #fff6ea; }

[data-theme="halloween"] .menu-side { border-right-color: #5a2a14; }
[data-theme="halloween"] .menu-side a { color: #b18462; }
[data-theme="halloween"] .menu-side a:hover { color: #ffd7b0; }
[data-theme="halloween"] .menu-side a.active { color: #fff6ea; }

[data-theme="halloween"] .dl-top,
[data-theme="halloween"] .btn,
[data-theme="halloween"] .theme-btn,
[data-theme="halloween"] .field input,
[data-theme="halloween"] .field textarea,
[data-theme="halloween"] .field select,
[data-theme="halloween"] .cat,
[data-theme="halloween"] .bell-panel,
[data-theme="halloween"] .theme-list {
  background: #1a0e0a;
  border-color: #6a3014;
  color: #f6ead8;
}

[data-theme="halloween"] .theme-list button { color: #f0d2b4; }
[data-theme="halloween"] .theme-list button:hover,
[data-theme="halloween"] .theme-list button.active { background: #32180e; color: #fff6ea; }

[data-theme="halloween"] .cat:hover,
[data-theme="halloween"] .btn:hover,
[data-theme="halloween"] .dl-top:hover { border-color: #ff7a18; }

[data-theme="halloween"] .btn.primary {
  background: #ff7a18;
  border-color: #ff7a18;
  color: #1a0a04;
}

[data-theme="halloween"] .menu-content h1 { color: #ffc56a; }
[data-theme="halloween"] .muted { color: #c4a080; }

.hw-moon {
  position: absolute;
  right: 9%;
  top: 7%;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #fff1c8, #f0a040 58%, #c45a12);
  box-shadow: 0 0 36px rgba(255, 150, 40, 0.35);
}

.hw-moon::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #100806;
  right: -22px;
  top: 6px;
}

.pixel-bat { display: none; }

[data-theme="halloween"] .pixel-bat {
  display: block;
  position: fixed;
  left: -50px;
  top: 20%;
  z-index: 8;
  width: 4px;
  height: 4px;
  zoom: 3;
  pointer-events: none;
  background: #17131f;
  box-shadow:
    -4px 0 #ff5a4f,
    4px 0 #ff5a4f,
    -16px -4px #17131f,
    -12px -4px #17131f,
    -8px -4px #17131f,
    -16px 0 #17131f,
    -12px 0 #17131f,
    -8px 0 #17131f,
    -12px 4px #17131f,
    -8px 4px #17131f,
    -4px 0 #17131f,
    0 0 #17131f,
    4px 0 #17131f,
    -4px 4px #17131f,
    0 4px #17131f,
    4px 4px #17131f,
    0 8px #17131f,
    -4px -4px #17131f,
    4px -4px #17131f,
    8px -4px #17131f,
    12px -4px #17131f,
    16px -4px #17131f,
    8px 0 #17131f,
    12px 0 #17131f,
    16px 0 #17131f,
    8px 4px #17131f,
    12px 4px #17131f;
  image-rendering: pixelated;
  animation:
    bat-fly 11s linear infinite,
    bat-bob 0.7s ease-in-out infinite alternate;
}

[data-theme="halloween"] .pixel-bat.b2 { top: 8%; animation-duration: 15s, 0.8s; animation-delay: -4s, -0.2s; }
[data-theme="halloween"] .pixel-bat.b3 { top: 34%; animation-duration: 13s, 0.62s; animation-delay: -8s, -0.4s; }
[data-theme="halloween"] .pixel-bat.b4 { top: 14%; animation-duration: 17s, 0.9s; animation-delay: -2s, -0.1s; }

@keyframes bat-fly {
  from { left: -60px; }
  to { left: calc(100vw + 60px); }
}

@keyframes bat-bob {
  from { transform: translateY(-7px); }
  to { transform: translateY(7px); }
}

.menu-content.dm-page {
  padding: 0;
  overflow: hidden;
  display: flex;
}

.dm-app {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.dm-nav {
  width: 240px;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #141414;
  border-right: 1px solid #242424;
}

.dm-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #242424;
}

.dm-nav-top h1 { margin: 0; }

.dm-people {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.dm-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
  min-width: 0;
}

.dm-person > div {
  min-width: 0;
}

.dm-person .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-person:hover { background: #1a1a1a; }
.dm-person.active { background: #1e1e1e; }

.dm-chat {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dm-chat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #242424;
}

.dm-chat-top .btn { margin-left: auto; }

.dm-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 16px 8px;
}

.dm-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 8px;
}

.dm-line.grouped {
  padding-left: 48px;
}

.dm-line-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.dm-line-body {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.dm-empty {
  margin: auto;
}

.dm-compose {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #242424;
}

.dm-compose .field {
  flex: 1 1 100%;
  margin: 0;
}

.dm-compose textarea {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 140px;
  resize: none;
  border: 1px solid #282828;
  background: #101010;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.dm-compose textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.dm-compose .err { flex: 1 1 100%; margin: 0; }

@media (max-width: 720px) {
  .menu {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .menu-top {
    height: auto;
    min-height: 48px;
    flex: 0 0 auto;
    padding-top: env(safe-area-inset-top);
  }

  .menu-tabs {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .menu-tabs a {
    width: auto;
    min-width: 72px;
    padding: 0 14px;
    min-height: 48px;
    font-size: 12px;
    flex: 0 0 auto;
  }

  .menu-logo { display: none; }

  .menu-brand {
    padding-right: 8px;
    padding-left: 4px;
  }

  .dl-top, .ea-top, .bell {
    min-height: 36px;
    min-width: 36px;
  }

  .bell-panel {
    right: 4px;
    width: min(100vw - 16px, 320px);
  }

  .menu-body {
    flex-direction: column;
  }

  .menu-side {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid #242424;
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }

  .menu-side a {
    height: 44px;
    line-height: 44px;
    padding: 0 14px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .menu-side a.active {
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  .menu-user {
    margin-top: 0;
    margin-left: auto;
    padding: 6px 10px;
    border-top: 0;
    border-left: 1px solid #242424;
    flex-direction: row;
    flex: 0 0 auto;
    gap: 8px;
  }

  .menu-side .nav-me {
    flex-direction: row;
  }

  .menu-side .nav-me span:not(.pfp) {
    display: none;
  }

  .menu-side .menu-user .btn {
    width: auto;
    min-width: 64px;
    min-height: 36px;
  }

  .menu-content {
    padding: 12px 12px calc(20px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .dm-app { flex-direction: column; }
  .dm-nav {
    width: 100%;
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid #242424;
  }
  .dm-people { max-height: 140px; }

  .menu.gate-mode .menu-content {
    align-items: flex-start;
    padding-top: 28px;
  }

  .theme-pop {
    top: calc(56px + env(safe-area-inset-top));
    right: 8px;
    bottom: auto;
  }

  .theme-list {
    top: 34px;
    bottom: auto;
  }

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

  .mh {
    margin: -12px -12px 18px;
  }

  .mh-banner,
  .mh-banner img {
    height: 168px;
  }

  .mh-content {
    min-height: 168px;
    margin-top: -168px;
    padding: 12px 14px 14px;
  }

  .mh .pfp.xl {
    width: 72px;
    height: 72px;
    font-size: 22px;
  }

  .post-side { padding: 10px 12px 0; }

  .cfg-row,
  .row-actions,
  .thread-actions {
    flex-wrap: wrap;
  }

  .field input,
  .field textarea {
    font-size: 16px;
  }

  #reply .btn,
  #new .btn,
  #wall .btn,
  #profile .btn,
  #cfg-release .btn,
  .gate .btn.primary,
  .cfg-mini .btn {
    min-height: 44px;
    width: 100%;
  }

  .cfg-mini {
    flex-wrap: wrap;
  }

  .cfg-mini input {
    font-size: 16px;
    min-height: 44px;
  }

  .shout-form {
    flex-wrap: wrap;
  }

  .shout-form input { font-size: 16px; min-height: 40px; }
  .shout-form .btn { min-height: 40px; flex: 1; }
}

.menu-content:has(.cas) {
  display: flex;
  flex-direction: column;
}

.cas {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(260px, 0.85fr);
  gap: 16px;
  min-height: 100%;
}

.cas-stage, .cas-side {
  border: 1px solid var(--line);
  background: var(--menu);
  min-width: 0;
}

.cas-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 460px;
}

.cas-side {
  padding: 16px 16px 20px;
  background: var(--panel);
}

.cas-side h1 { margin-top: 0; }

.cas-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--menu);
}

.cas-bar span {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.cas-bar b { color: var(--title); font-size: 18px; }

.cas-bets, .cas-outs, .cas-hands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.cas-bets .btn.on, .cas-outs .btn.on, .cas-num.on {
  border-color: var(--accent);
  color: var(--title);
}

.cas-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.cas-legend span {
  border: 1px solid var(--line);
  background: var(--menu);
  padding: 8px 10px;
  font-size: 12px;
}

.cas-sym {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--panel);
}

.cas-sym.paw, .cas-sym.fang { color: var(--muted); }
.cas-sym.bone, .cas-sym.moon { color: var(--text); }
.cas-sym.wolf { color: var(--title); }
.cas-sym.alpha { color: var(--accent); }

.cas-result { min-height: 22px; margin-top: 8px; color: var(--title); }

.cas-pay { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12px; }
.cas-pay th, .cas-pay td { border-bottom: 1px solid var(--line); padding: 8px 12px 8px 0; text-align: left; }
.cas-pay th { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.cas-felt { justify-content: space-evenly; }
.cas-hands { width: 100%; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.cas-seat { min-width: 180px; border-radius: 6px; padding: 6px; }
.cas-seat.on { box-shadow: inset 0 0 0 1px var(--accent); }
.cas-wait { color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.cas-mission-list {
  align-items: stretch;
  justify-content: center;
  gap: 12px;
}

.cas-mission {
  position: relative;
  width: min(100%, 520px);
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.cas-mission div { display: flex; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.cas-mission b { color: var(--text); }
.cas-mission span, .cas-mission em { color: var(--muted); font-style: normal; position: relative; z-index: 1; }
.cas-mission em { display: block; margin-top: 6px; }
.cas-mission i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
}
.cas-mission.done { border-color: var(--accent); }
.cas-mission.done b { color: var(--title); }

.cas-card {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 72px;
  height: 100px;
  margin: 8px 8px 0 0;
  padding: 8px;
  background: #f4f1ea;
  color: #1a1a1a;
  border-radius: 4px;
  font-family: Georgia, serif;
}
.cas-card b { font-size: 20px; }
.cas-card i { font-style: normal; align-self: flex-end; font-size: 18px; }
.cas-card.red { color: #a32020; }
.cas-card.back {
  background: repeating-linear-gradient(45deg, var(--menu) 0 5px, color-mix(in srgb, var(--accent) 70%, var(--menu)) 5px 10px);
}

.cas-nums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
  width: 100%;
  margin: 10px 0;
}
.cas-num {
  height: 32px;
  border: 1px solid var(--line);
  background: var(--menu);
  color: var(--text);
  cursor: pointer;
}
.cas-num.red { background: #7a1820; color: #fff; }
.cas-num.green { background: #1d6b3a; color: #fff; }
.cas-num.on { outline: 2px solid var(--accent); }

.plinko {
  position: relative;
  background: #101010;
  border-radius: 8px;
  overflow: hidden;
}
.plinko-peg {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #d2d2d2;
}
.plinko-ball {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #f2f2f2;
  border: 2px solid #b5b5b5;
  z-index: 2;
  pointer-events: none;
}
.plinko-slot {
  position: absolute;
  width: 30px;
  height: 22px;
  margin-left: -15px;
  border-radius: 3px;
  text-align: center;
  line-height: 22px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}
.plinko-slot.on {
  outline: 2px solid #fff;
}

.whl-wrap {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin: 0;
  --rim: 158px;
}

.spin-whl { width: min(100%, 460px); --rim: 166px; }
.rou-whl { width: min(100%, 420px); --rim: 150px; }

.whl {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 8px solid var(--line);
  box-shadow: inset 0 0 0 3px var(--accent);
}

.whl-n {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  margin: -9px 0 0 -36px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.whl-n.tiny {
  width: 24px;
  margin-left: -12px;
  font-size: 11px;
}

.whl-pointer {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: -2px;
  margin-left: -9px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 18px solid var(--accent);
}

.whl-hub {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--menu);
  border: 3px solid var(--accent);
}

.cas-machine {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.reel-win {
  flex: 1;
  height: 128px;
  overflow: hidden;
  position: relative;
  background: var(--menu);
  border: 2px solid var(--accent);
}

.reel-win::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.4));
}

.reel-strip .cas-sym {
  width: 100%;
  height: 128px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 16px;
}

.cas-fan { min-height: 112px; perspective: 600px; }

.cas-card.deal {
  animation: cas-deal 0.45s ease both;
}

@keyframes cas-deal {
  from { transform: translateY(-40px) rotateY(-80deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 980px) {
  .cas { grid-template-columns: 1fr; }
  .cas-stage { min-height: 320px; }
  .whl-wrap, .spin-whl, .rou-whl { --rim: 118px; width: min(100%, 320px); }
}

.trick-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080817;
}

.trick-overlay .trick-scene {
  transform-origin: center center;
}

.trick-overlay .player { animation: trick-walk 8s linear 1 forwards; }

.trick-overlay .porch-light,
.trick-overlay .door-window,
.trick-overlay .pumpkin-eye,
.trick-overlay .pumpkin-mouth {
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

.trick-pay {
  position: absolute;
  left: 50%;
  bottom: 11%;
  transform: translateX(-50%);
  color: #ffd24a;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  opacity: 0;
  text-shadow: 0 3px 0 #09070d;
  pointer-events: none;
}

.trick-pay.show { animation: trick-pay 1.8s ease forwards; }

@keyframes trick-pay {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.trick-scene {
  width: 420px;
  height: 180px;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(#080817 0%, #11132b 65%, #19172a 100%);
  border: 4px solid #171421;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 0 0 4px #09070d, 0 8px 0 #09070d;
}

.trick-scene .moon {
  position: absolute;
  width: 32px;
  height: 32px;
  left: 55px;
  top: 24px;
  background: #fff1bb;
  box-shadow: 0 0 0 4px #d8d09c, 0 0 18px rgba(255, 235, 160, .25);
  border-radius: 50%;
}

.trick-scene .moon::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: 6px;
  top: 7px;
  background: #d8d09c;
  box-shadow: 13px 12px #d8d09c, 5px 18px #d8d09c;
}

.trick-scene .stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff7d6;
  animation: trick-twinkle 1.6s infinite alternate;
}

.trick-scene .stars i:nth-child(1) { left: 20px; top: 20px; }
.trick-scene .stars i:nth-child(2) { left: 125px; top: 35px; }
.trick-scene .stars i:nth-child(3) { left: 170px; top: 18px; }
.trick-scene .stars i:nth-child(4) { left: 220px; top: 43px; }
.trick-scene .stars i:nth-child(5) { left: 270px; top: 18px; }
.trick-scene .stars i:nth-child(6) { left: 375px; top: 28px; }

.trick-scene .bat {
  position: absolute;
  left: 150px;
  top: 36px;
  color: #c8b8d8;
  font-size: 16px;
  line-height: 1;
  animation: trick-bat 7s linear infinite;
}

.trick-scene .house {
  position: absolute;
  right: 24px;
  bottom: 25px;
  width: 130px;
  height: 110px;
}

.trick-scene .roof {
  position: absolute;
  width: 118px;
  height: 48px;
  left: 5px;
  top: 5px;
  background: #252031;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(4px 4px 0 #09080e);
}

.trick-scene .chimney {
  position: absolute;
  width: 16px;
  height: 35px;
  right: 20px;
  top: 4px;
  background: #211b26;
  box-shadow: 4px 0 #0d0b11;
}

.trick-scene .house-body {
  position: absolute;
  width: 112px;
  height: 72px;
  left: 9px;
  bottom: 0;
  background: #403044;
  box-shadow: inset 5px 0 #503b50, inset -6px 0 #251e2c, 5px 0 #0b0910;
}

.trick-scene .house-body::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 4px;
  top: 19px;
  background: #2d2435;
  box-shadow: 0 22px #2d2435, 0 44px #2d2435;
}

.trick-scene .window {
  position: absolute;
  width: 20px;
  height: 24px;
  top: 15px;
  background: #ffad35;
  border: 4px solid #18131c;
  box-shadow: 0 0 10px rgba(255, 132, 30, .25);
}

.trick-scene .window-left { left: 13px; }
.trick-scene .window-right { right: 13px; }

.trick-scene .window span::before,
.trick-scene .window span::after {
  content: "";
  position: absolute;
  background: #302235;
}

.trick-scene .window span::before {
  width: 3px;
  height: 100%;
  left: 8px;
}

.trick-scene .window span::after {
  width: 100%;
  height: 3px;
  top: 10px;
}

.trick-scene .door {
  position: absolute;
  width: 30px;
  height: 48px;
  bottom: 0;
  left: 41px;
  background: #211923;
  border: 4px solid #171219;
}

.trick-scene .door-window {
  position: absolute;
  width: 12px;
  height: 10px;
  left: 5px;
  top: 6px;
  background: #553e52;
  animation: trick-door 8s infinite;
}

.trick-scene .door-knob {
  position: absolute;
  width: 4px;
  height: 4px;
  right: 4px;
  top: 27px;
  background: #e4a941;
}

.trick-scene .porch-light {
  position: absolute;
  width: 6px;
  height: 6px;
  left: 61px;
  top: 48px;
  background: #5d4325;
  animation: trick-porch 8s infinite;
}

.trick-scene .pumpkin {
  position: absolute;
  width: 24px;
  height: 19px;
  right: 4px;
  bottom: 0;
  background: #d85b1f;
  border-radius: 45%;
  box-shadow: inset 5px 0 #f17b24, inset -5px 0 #91341b, 3px 3px #0b090d;
}

.trick-scene .pumpkin::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 6px;
  left: 9px;
  top: -5px;
  background: #4c562d;
}

.trick-scene .pumpkin-eye {
  position: absolute;
  width: 4px;
  height: 4px;
  top: 6px;
  background: #321719;
  animation: trick-glow 8s infinite;
}

.trick-scene .eye-left { left: 5px; }
.trick-scene .eye-right { right: 5px; }

.trick-scene .pumpkin-mouth {
  position: absolute;
  width: 10px;
  height: 3px;
  left: 7px;
  bottom: 4px;
  background: #321719;
  animation: trick-glow 8s infinite;
}

.trick-scene .player {
  position: absolute;
  left: -60px;
  bottom: 27px;
  width: 44px;
  height: 64px;
  animation: trick-walk 8s linear infinite;
}

.trick-scene .face {
  position: absolute;
  width: 32px;
  height: 32px;
  left: 6px;
  top: 0;
  background: #d9d5df;
  border: 4px solid #17131d;
  box-sizing: border-box;
  overflow: hidden;
  image-rendering: pixelated;
  animation: trick-bounce .32s ease-in-out infinite alternate;
}

.trick-scene .face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.trick-scene .face span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #17131d;
  font-size: 14px;
  font-weight: 700;
}

.trick-scene .body {
  position: absolute;
  width: 22px;
  height: 22px;
  left: 11px;
  top: 29px;
  background: #33273e;
  border: 3px solid #17131d;
  box-sizing: border-box;
}

.trick-scene .legs span {
  position: absolute;
  width: 7px;
  height: 12px;
  bottom: 2px;
  background: #17131d;
}

.trick-scene .legs span:first-child {
  left: 12px;
  animation: trick-leg-a .32s infinite alternate;
}

.trick-scene .legs span:last-child {
  right: 12px;
  animation: trick-leg-b .32s infinite alternate;
}

.trick-scene .bucket {
  position: absolute;
  width: 13px;
  height: 11px;
  right: -2px;
  top: 38px;
  background: #ef6c22;
  border: 3px solid #17131d;
  box-sizing: border-box;
  animation: trick-bucket .45s ease-in-out infinite alternate;
}

.trick-scene .bucket-handle {
  position: absolute;
  width: 11px;
  height: 8px;
  left: -2px;
  top: -8px;
  border: 2px solid #17131d;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.trick-scene .ground {
  position: absolute;
  width: 100%;
  height: 27px;
  bottom: 0;
  background: #111219;
  border-top: 4px solid #242336;
}

.trick-scene .ground::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 8px;
  top: -8px;
  left: 30px;
  background: #242336;
  box-shadow: 70px 3px #242336, 130px -1px #242336, 190px 4px #242336, 260px 0 #242336, 360px 2px #242336;
}

@keyframes trick-twinkle {
  from { opacity: .25; }
  to { opacity: 1; }
}

@keyframes trick-bat {
  0% { transform: translateX(0); }
  50% { transform: translateX(40px) translateY(6px); }
  100% { transform: translateX(0); }
}

@keyframes trick-walk {
  0% { left: -55px; }
  58%, 65% { left: 225px; }
  70%, 78% { left: 229px; }
  74%, 82%, 100% { left: 225px; }
}

@keyframes trick-bounce {
  from { transform: translateY(0) scaleY(1); }
  to { transform: translateY(-4px) scaleY(.94); }
}

@keyframes trick-leg-a {
  from { transform: translateX(-2px); }
  to { transform: translateX(3px); }
}

@keyframes trick-leg-b {
  from { transform: translateX(3px); }
  to { transform: translateX(-2px); }
}

@keyframes trick-bucket {
  from { transform: rotate(-12deg); }
  to { transform: rotate(12deg); }
}

@keyframes trick-porch {
  0%, 72% { background: #5d4325; box-shadow: none; }
  76%, 100% { background: #ffc348; box-shadow: 0 0 12px #ff9c32; }
}

@keyframes trick-door {
  0%, 72% { background: #553e52; box-shadow: none; }
  76%, 100% { background: #ffad35; box-shadow: 0 0 10px rgba(255, 140, 30, .55); }
}

@keyframes trick-glow {
  0%, 72% { background: #321719; box-shadow: none; }
  76%, 100% { background: #ffd24a; box-shadow: 0 0 5px #ff8a25; }
}

@media (max-width: 460px) {
  .trick-wrap { justify-content: flex-start; }
  .trick-scene { transform: scale(.78); transform-origin: left center; margin-bottom: -20px; }
}

@media (prefers-reduced-motion: reduce) {
  .trick-scene .player,
  .trick-scene .face,
  .trick-scene .legs span,
  .trick-scene .bucket,
  .trick-scene .stars i,
  .trick-scene .bat,
  .trick-scene .porch-light,
  .trick-scene .door-window,
  .trick-scene .pumpkin-eye,
  .trick-scene .pumpkin-mouth {
    animation: none;
  }
  .trick-scene .player { left: 225px; }
}
