:root {
  --bg-deep: #050003;
  --bg-panel: #08040c;
  --bg-panel-2: #0c0612;
  --bg-hover: #120818;
  --bg-input: #060006;
  --border: #1a0f22;
  --border-light: #2a1840;
  --border-red: #6b21a8;
  --text: #f2ecff;
  --text-muted: #b8a8cc;
  --text-dim: #7a6a8f;
  --accent: #c084fc;
  --accent-dark: #9333ea;
  --accent-light: #e9d5ff;
  --accent-glow: rgba(192, 132, 252, 0.24);
  --gold: #f5c542;
  --success: #43a047;
  --radius: 3px;
  --radius-lg: 4px;
  --font-sans: "Segoe UI", "Inter", system-ui, sans-serif;
  --font-mono: "Consolas", "JetBrains Mono", ui-monospace, monospace;
  --topbar-h: 78px;
  --sidebar-w: 0px;
  --main-max: 960px;
  --xf-border: rgba(192, 132, 252, 0.22);
  --xf-border-soft: rgba(192, 132, 252, 0.1);
  --space-xl: clamp(1.25rem, 2.5vw, 2rem);
  --space-lg: clamp(0.85rem, 2vw, 1.5rem);
  --cursor-default: url("../img/cursors/default.png") 0 0, auto;
  --cursor-pointer: url("../img/cursors/pointer.png") 4 0, pointer;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.5;
}

html.site-guard body {
  -webkit-user-select: none;
  user-select: none;
}

html.site-guard input,
html.site-guard textarea,
html.site-guard select,
html.site-guard [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

html.site-guard img,
html.site-guard video {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.forum-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* XenForo-style shell */
.xf-app {
  background: var(--bg-deep);
}

.xf-shell {
  width: 100%;
  max-width: var(--main-max);
  margin: 0 auto;
}

.xf-site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: rgba(5, 0, 3, 0.98);
  border-bottom: 1px solid var(--xf-border-soft);
}

.xf-header-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.xf-header-primary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 46px;
  padding-top: 0.35rem;
}

.xf-header-sub {
  min-height: 30px;
  padding-bottom: 0.4rem;
  border-top: 1px solid var(--xf-border-soft);
}

.xf-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

.xf-logo-img {
  height: 30px;
  width: auto;
  display: block;
  opacity: 0.95;
}

.xf-nav {
  display: flex;
  align-items: center;
  gap: 0.05rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}

.xf-nav::-webkit-scrollbar {
  display: none;
}

.xf-nav > a,
.xf-nav-drop-btn,
.xf-subnav > a,
.xf-header-link,
.xf-header-user span {
  color: var(--accent);
}

.xf-nav > a,
.xf-nav-drop-btn {
  padding: 0.3rem 0.5rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  white-space: nowrap;
}

.xf-nav-drop-btn::after {
  content: "▾";
  margin-left: 0.2rem;
  font-size: 0.72em;
  opacity: 0.7;
}

.xf-nav > a:hover,
.xf-nav-drop-btn:hover,
.xf-subnav > a:hover,
.xf-header-link:hover,
.xf-header-user:hover span {
  color: var(--accent-light);
}

.xf-nav > a.is-active {
  color: var(--accent-light);
}

.xf-nav-drop {
  position: relative;
}

.xf-nav-drop-panel {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  padding: 0.3rem 0;
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: #08040c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 130;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.xf-nav-drop.is-open .xf-nav-drop-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.xf-nav-drop-panel a {
  padding: 0.4rem 0.75rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.xf-nav-drop-panel a:hover {
  background: rgba(192, 132, 252, 0.06);
  color: var(--accent-light);
}

.xf-nav-drop-strong {
  font-weight: 700 !important;
  border-bottom: 1px solid var(--xf-border-soft);
  margin-bottom: 0.15rem;
  padding-bottom: 0.45rem !important;
}

.xf-nav-drop-loading,
.xf-nav-drop-empty {
  margin: 0;
  padding: 0.4rem 0.75rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.xf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  justify-self: end;
  position: relative;
  z-index: 1;
  padding-left: 0.5rem;
  background: rgba(5, 0, 3, 0.98);
}

.xf-header-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-right: 0.5rem;
  border-right: 1px solid var(--xf-border-soft);
}

.xf-header-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 9rem;
}

.xf-header-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xf-header-link {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.xf-header-account-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-left: 0.35rem;
  border-left: 1px solid var(--xf-border-soft);
}

.xf-subnav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.xf-subnav > a {
  font-size: 0.74rem;
  font-weight: 600;
}

.xf-subnav-btn {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.xf-subnav-btn:hover {
  color: var(--accent-light);
}

.xf-page {
  flex: 1;
  padding: 1rem clamp(1rem, 3vw, 2rem) 1.75rem;
}

.xf-page-content {
  min-width: 0;
}

.xf-site-footer {
  border-top: 1px solid var(--xf-border-soft);
  padding: 0.85rem clamp(1rem, 3vw, 2rem) 1.25rem;
  background: rgba(0, 0, 0, 0.35);
}

.xf-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.xf-footer-nav {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

.xf-footer-nav a {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
}

.xf-footer-nav a:hover {
  color: var(--accent-light);
}

.xf-footer-copy {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.65rem;
}

.xf-footer-copy strong {
  color: var(--text-muted);
  font-weight: 600;
}

/* Top bar (legacy hooks) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: rgba(5, 0, 3, 0.97);
  border-bottom: 1px solid rgba(192, 132, 252, 0.12);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.topbar-logo-icon {
  color: var(--accent);
  font-size: 1.1rem;
}

.topbar-search {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
}

.topbar-search input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
}

.topbar-search input::placeholder {
  color: var(--text-dim);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.topbar-lvl {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lvl-bar {
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.lvl-bar span {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--accent);
}

.topbar-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
}

.topbar-icon:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.topbar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  border: 1px solid var(--border-light);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.35rem 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.topbar-logout {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  transition: color 0.15s;
}

.topbar-logout:hover {
  color: var(--text-muted);
}


/* Layout */
.forum-body {
  display: block;
  flex: 1;
  width: 100%;
  min-width: 0;
}

.sidebar {
  display: none;
}

.sidebar-section {
  margin-bottom: 0;
}

.sidebar-title {
  margin: 0 0 1rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.community-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.community-sub {
  list-style: none;
  margin: 0.2rem 0 0.5rem;
  padding: 0 0 0 0.75rem;
  border-left: 1px solid var(--border);
}

.community-item a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: color 0.15s, background 0.15s;
}

.community-item a:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.community-item.is-active a {
  color: var(--text);
  background: rgba(168, 85, 247, 0.07);
}

.community-name {
  font-weight: 500;
  line-height: 1.35;
}

.community-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: lowercase;
}

/* Main */
.main-content {
  min-width: 0;
  padding: var(--space-xl) var(--space-lg) var(--space-xl);
}

.main-inner {
  width: 100%;
  max-width: var(--main-max);
  margin: 0 auto;
}

.page-hero {
  margin-bottom: 1rem;
  padding-bottom: 0;
  border-bottom: none;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.content-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.filter-btn.is-active,
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-select {
  margin-left: auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Post / form cards */
.post-card,
.form-shell {
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: rgba(8, 4, 12, 0.75);
  overflow: hidden;
}

.post-card + .post-card,
.form-shell {
  margin-top: 0.65rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-author {
  color: var(--text);
  font-weight: 600;
}

.post-tag {
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.post-views {
  margin-left: auto;
  color: var(--text-dim);
}

.post-title {
  margin: 0.5rem 1rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.post-badges {
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem 1rem 0;
}

.badge {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge-pinned {
  background: rgba(245, 197, 66, 0.15);
  color: var(--gold);
}

.badge-locked {
  background: var(--bg-hover);
  color: var(--text-dim);
}

.badge-form {
  background: rgba(229, 57, 53, 0.12);
  color: var(--accent);
}

.post-body {
  padding: 0.75rem 1rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.post-body p {
  margin: 0 0 0.65rem;
}

.post-body ul {
  margin: 0;
  padding-left: 1.2rem;
}

.post-body li {
  margin-bottom: 0.35rem;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.post-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.post-link-card {
  display: block;
  transition: border-color 0.15s;
}

.post-link-card:hover {
  border-color: var(--accent);
}

.post-link-card .post-title {
  color: var(--text);
}

/* Form picker grid on home */
.form-grid {
  display: grid;
  gap: 0.85rem;
}

.new-post-bar {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent-dark);
  border: 1px solid var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #7c3aed;
  border-color: var(--accent-light);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.thread-input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 2.5rem;
}

.community-posts {
  margin-top: 1.5rem;
}

.community-posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.community-posts-empty,
.community-posts-note {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.new-post-bar textarea.thread-input {
  min-height: 4rem;
}

.members-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: rgba(8, 4, 12, 0.75);
  overflow: hidden;
}

.members-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--xf-border-soft);
}

.members-row:last-child {
  border-bottom: none;
}

.members-empty {
  padding: 0.75rem;
}

.members-avatar-wrap {
  grid-row: 1 / span 2;
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
}

.members-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(229, 57, 53, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.members-avatar-wrap .presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid var(--bg-panel);
}

.presence-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.presence-dot.is-online {
  background: #4caf50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.55);
}

.presence-dot.is-offline {
  background: #5c5c5c;
}

.presence-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.presence-label.is-online {
  color: #81c784;
}

.presence-label.is-offline {
  color: var(--text-dim);
}

.presence-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-mini-online {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--muted);
}

.members-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.members-name {
  font-weight: 600;
  color: var(--text);
}

.members-level {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.members-joined {
  grid-column: 2 / -1;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.members-empty {
  padding: 1rem 0;
}

.members-row-owner {
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto auto;
}

.members-level-grant {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.level-grant {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.level-grant-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.level-grant-input {
  width: 4.5rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
}

.level-grant-xp {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.members-assign {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
}

.tag-picker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}

.tag-picker-check {
  accent-color: var(--accent);
}

.product-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
}

.product-picker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  cursor: pointer;
}

.product-picker-check {
  accent-color: var(--accent);
}

.members-products {
  width: 100%;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.members-owner-note {
  margin-bottom: 0.75rem;
}

.custom-tag-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.custom-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  border: 1px solid transparent;
}

.custom-tag:not(.custom-tag-rainbow):not([style]) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-color: var(--border);
}

.custom-tag-rainbow {
  --tag-color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: transparent;
  background-image: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #ff6b6b);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: tag-rainbow 4s linear infinite;
}

@keyframes tag-rainbow {
  to {
    background-position: 250% center;
  }
}

.chat-msg .custom-tag-group,
.post-meta .custom-tag-group,
.members-info .custom-tag-group,
.topbar-user .custom-tag-group {
  margin-left: 0.25rem;
}

.tags-admin {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
}

.tag-create-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tag-create-form .field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.tag-rainbow-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-bottom: 0.35rem;
}

.tag-def-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tag-def-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tag-delete-btn {
  font-size: 0.72rem;
  padding: 0.35rem 0.6rem;
}

@media (max-width: 720px) {
  .members-row {
    grid-template-columns: auto 1fr;
  }

  .members-level {
    grid-column: 2;
  }

  .members-joined {
    grid-column: 1 / -1;
    padding-left: calc(2.25rem + 0.85rem);
  }
}

/* Form internals */
.form-progress {
  display: flex;
  gap: 0.4rem;
  padding: 1rem 1rem 0;
}

.progress-step {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-step span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.progress-step.is-active span,
.progress-step.is-complete span {
  width: 100%;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-body {
  padding: 0 1rem 1rem;
}

.form-step {
  display: none;
}

.form-step.is-active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-step h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.form-step > p {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.field {
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.field label .required {
  color: var(--accent);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.field-error {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--accent);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: var(--accent);
}

.field.is-invalid .field-error {
  display: block;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.checkbox-field input {
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

.checkbox-field label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.review-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.review-list li:last-child {
  border-bottom: none;
}

.review-list strong {
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-list span {
  text-align: right;
  word-break: break-word;
}

.success-panel {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
}

.success-panel.is-visible {
  display: block;
}

.success-panel .success-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: rgba(67, 160, 71, 0.15);
  color: var(--success);
  font-size: 1.25rem;
}

.success-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.success-panel p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ticket-id {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.submit-status {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.submit-status.is-error {
  color: var(--accent);
}

.widget {
  margin-bottom: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.widget h3 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.stat-row strong {
  color: var(--text);
}

.online-list,
.leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
}

.online-list li,
.leaderboard li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.leaderboard .rank {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.72rem;
}

html.auth-pending body {
  visibility: hidden;
}

.gate-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: visible;
}

.gate-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}

.gate-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateZ(0);
  will-change: opacity;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gate-video.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .gate-video {
    transition-duration: 0.01ms;
    will-change: auto;
  }
}

.gate-bg-photos {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.gate-bg-photo {
  position: absolute;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0.38;
  filter: saturate(1.1) contrast(1.04);
  background: rgba(0, 0, 0, 0.12);
  transform-origin: center center;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.gate-bg-photo--1 {
  top: 7%;
  left: -10%;
  width: min(210px, 24vw);
  animation: gate-wander-1 24s ease-in-out infinite;
}

.gate-bg-photo--2 {
  top: 2%;
  right: -12%;
  width: min(290px, 32vw);
  animation: gate-wander-2 28s ease-in-out infinite;
  animation-delay: -4s;
}

.gate-bg-photo--3 {
  top: 34%;
  left: -14%;
  width: min(270px, 30vw);
  animation: gate-wander-3 26s ease-in-out infinite;
  animation-delay: -8s;
}

.gate-bg-photo--4 {
  top: 28%;
  right: -11%;
  width: min(250px, 28vw);
  animation: gate-wander-4 30s ease-in-out infinite;
  animation-delay: -6s;
}

.gate-bg-photo--5 {
  bottom: 4%;
  left: -9%;
  width: min(240px, 27vw);
  animation: gate-wander-5 22s ease-in-out infinite;
  animation-delay: -10s;
}

.gate-bg-photo--6 {
  bottom: -2%;
  right: -10%;
  width: min(280px, 31vw);
  animation: gate-wander-6 27s ease-in-out infinite;
  animation-delay: -12s;
}

@keyframes gate-wander-1 {
  0%,
  100% {
    translate: 0 0;
    rotate: -22deg;
    opacity: 0.28;
  }
  25% {
    translate: 16vw 8vh;
    rotate: -6deg;
    opacity: 0.45;
  }
  50% {
    translate: 8vw 18vh;
    rotate: -32deg;
    opacity: 0.32;
  }
  75% {
    translate: 22vw -5vh;
    rotate: -14deg;
    opacity: 0.4;
  }
}

@keyframes gate-wander-2 {
  0%,
  100% {
    translate: 0 0;
    rotate: 19deg;
    opacity: 0.3;
  }
  25% {
    translate: -14vw 10vh;
    rotate: 34deg;
    opacity: 0.48;
  }
  50% {
    translate: -24vw 4vh;
    rotate: 8deg;
    opacity: 0.34;
  }
  75% {
    translate: -10vw 16vh;
    rotate: 26deg;
    opacity: 0.42;
  }
}

@keyframes gate-wander-3 {
  0%,
  100% {
    translate: 0 0;
    rotate: -14deg;
    opacity: 0.26;
  }
  25% {
    translate: 20vw -10vh;
    rotate: 6deg;
    opacity: 0.44;
  }
  50% {
    translate: 12vw 12vh;
    rotate: -28deg;
    opacity: 0.3;
  }
  75% {
    translate: 26vw 6vh;
    rotate: -4deg;
    opacity: 0.38;
  }
}

@keyframes gate-wander-4 {
  0%,
  100% {
    translate: 0 0;
    rotate: 26deg;
    opacity: 0.32;
  }
  25% {
    translate: -18vw -8vh;
    rotate: 10deg;
    opacity: 0.46;
  }
  50% {
    translate: -8vw 14vh;
    rotate: 38deg;
    opacity: 0.28;
  }
  75% {
    translate: -22vw 2vh;
    rotate: 18deg;
    opacity: 0.4;
  }
}

@keyframes gate-wander-5 {
  0%,
  100% {
    translate: 0 0;
    rotate: 16deg;
    opacity: 0.3;
  }
  25% {
    translate: 14vw -12vh;
    rotate: -8deg;
    opacity: 0.42;
  }
  50% {
    translate: 24vw -4vh;
    rotate: 30deg;
    opacity: 0.34;
  }
  75% {
    translate: 10vw -18vh;
    rotate: 4deg;
    opacity: 0.38;
  }
}

@keyframes gate-wander-6 {
  0%,
  100% {
    translate: 0 0;
    rotate: -18deg;
    opacity: 0.28;
  }
  25% {
    translate: -16vw -14vh;
    rotate: 12deg;
    opacity: 0.45;
  }
  50% {
    translate: -6vw -6vh;
    rotate: -30deg;
    opacity: 0.32;
  }
  75% {
    translate: -20vw -2vh;
    rotate: -6deg;
    opacity: 0.4;
  }
}

.xf-gate .gate-overlay {
  background:
    linear-gradient(105deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0.65) 100%),
    rgba(0, 0, 0, 0.25);
}

.gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

@media (max-width: 900px) {
  .gate-bg-photo--1 {
    width: min(130px, 38vw);
  }

  .gate-bg-photo--2 {
    width: min(150px, 42vw);
  }

  .gate-bg-photo--3 {
    width: min(140px, 40vw);
  }

  .gate-bg-photo--4 {
    width: min(135px, 39vw);
  }

  .gate-bg-photo--5 {
    width: min(128px, 37vw);
  }

  .gate-bg-photo--6 {
    width: min(145px, 41vw);
  }
}

.gate-shell {
  position: relative;
  z-index: 3;
  width: min(400px, 100%);
}

.gate-card {
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.gate-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gate-card h1 {
  margin: 0;
  font-size: 1.5rem;
}

.gate-card > p {
  margin: 0.5rem 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.gate-form {
  margin-top: 0.5rem;
}

.gate-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.gate-error {
  min-height: 1.2rem;
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--accent);
}

.auth-tabs {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
  position: relative;
  padding: 0 0 0.65rem;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.18s ease;
}

.auth-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.auth-tab:hover {
  color: var(--text-muted);
}

.auth-tab.is-active {
  color: var(--text);
}

.auth-tab.is-active::after {
  transform: scaleX(1);
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
  animation: gatePanelIn 0.22s ease;
}

@keyframes gatePanelIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.community-feed,
.community-children {
  display: grid;
  gap: 1.25rem;
}

.community-children {
  grid-template-columns: 1fr;
}

.community-card {
  display: block;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: rgba(8, 4, 12, 0.75);
  transition: border-color 0.15s, background 0.15s;
}

.community-card:hover {
  border-color: var(--accent);
  background: rgba(192, 132, 252, 0.04);
}

.community-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.community-card h2,
.community-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.community-view {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}

.community-view-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.community-view h2 {
  margin: 0;
  font-size: 1.2rem;
}

.community-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.product-dl,
.product-dl-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: var(--space-lg);
}

.product-dl-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.product-dl-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.product-file {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-create {
  width: 100%;
  margin-top: 1.25rem;
  font-size: 0.72rem;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 0.45rem 0.6rem;
  justify-content: flex-start;
}

.sidebar-create:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-user {
  display: block;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.community-sub {
  list-style: none;
  margin: 0.25rem 0 0 0.75rem;
  padding: 0;
}

.community-item.is-active > a {
  border-left: 2px solid var(--accent);
  padding-left: calc(0.55rem - 2px);
}

.modal {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 300;
  place-items: center;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  width: min(400px, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: lowercase;
}

.modal-close {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.form-raw {
  border-style: dashed;
}

.form-raw h2 {
  font-size: 0.85rem;
  text-transform: lowercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.form-raw .field label {
  text-transform: lowercase;
  font-size: 0.75rem;
}

.empty-feed {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* XenForo-style */
.topbar-logo-img {
  height: 36px;
  width: auto;
  display: block;
  opacity: 0.95;
}

.xf-header {
  flex-wrap: nowrap;
}

.xf-body {
  background: var(--bg-deep);
}

.xf-main {
  padding: 0;
}

.xf-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.76rem;
  margin-bottom: 0.65rem;
  color: var(--accent);
}

.xf-breadcrumb a {
  color: var(--accent);
  font-weight: 600;
}

.xf-bc-sep {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.xf-bc-current {
  color: var(--text-muted);
}

.xf-page-title {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.xf-lead {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  max-width: 52ch;
  line-height: 1.55;
}

.xf-block {
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: rgba(8, 4, 12, 0.75);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}

.xf-block-msg {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.xf-forum-block {
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: rgba(8, 4, 12, 0.75);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.xf-forum-block-head {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--xf-border-soft);
  background: rgba(147, 51, 234, 0.05);
}

.xf-forum-block-head h2 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.xf-forum-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.xf-forum-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--xf-border-soft);
}

.xf-forum-row:last-child {
  border-bottom: none;
}

.xf-forum-row:hover {
  background: rgba(192, 132, 252, 0.03);
}

.xf-forum-icon {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: rgba(192, 132, 252, 0.06);
}

.xf-forum-title {
  display: block;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.xf-forum-title:hover {
  color: var(--accent-light);
}

.xf-forum-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
}

.xf-forum-meta {
  display: inline-block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.xf-forum-stats {
  text-align: right;
}

.xf-forum-stat {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(192, 132, 252, 0.2);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.xf-form .field label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.xf-form input,
.xf-form select,
.xf-form textarea {
  border: 1px solid #333;
  background: #000;
  color: var(--text);
}

.xf-form input:focus,
.xf-form select:focus,
.xf-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.xf-sidebar {
  background: transparent;
}

.xf-widget {
  border: none;
  background: transparent;
}

.xf-widget h3 {
  color: var(--text-muted);
}

.xf-footer {
  display: block;
}

.xf-gate {
  display: block;
  padding: 0;
  background: #000;
}

.xf-gate-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 1.5rem;
  border-bottom: 1px solid rgba(192, 132, 252, 0.12);
  background: rgba(5, 0, 3, 0.82);
}

.xf-gate-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.xf-gate-nav-active {
  color: var(--accent-light);
}

.xf-gate-nav-sep {
  color: var(--text-dim);
}

.gate-music-btn {
  position: fixed;
  z-index: 4;
  bottom: 1.25rem;
  left: 1.25rem;
  min-width: 4.5rem;
  height: 2rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.gate-music-btn.is-active,
.gate-music-btn:hover {
  border-color: rgba(192, 132, 252, 0.45);
  color: var(--accent);
  background: rgba(0, 0, 0, 0.75);
}

.gate-yt-player {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.xf-gate .gate-shell {
  position: relative;
  z-index: 3;
  max-width: 480px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.xf-gate .xf-page-title {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 1.5rem 0 1rem;
}

.sidebar-role {
  display: block;
  padding: 0 0.55rem;
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
}

.community-card.xf-block:hover {
  border-color: var(--accent);
}

.xf-nav a {
  white-space: nowrap;
}

.community-card {
  color: var(--text);
}

.product-file {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 820px) {
  .xf-nav {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
  }

  .topbar-search {
    display: none;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* ——— Access page ——— */
.gate-layout {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  align-items: center;
  min-height: 100vh;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
  gap: clamp(1.5rem, 5vw, 4rem);
}

.gate-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.65rem;
  padding-right: 1rem;
}

.gate-brand-logo {
  width: min(140px, 32vw);
  height: auto;
  margin-bottom: 0.35rem;
  opacity: 0.95;
}

.gate-brand h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3.5vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.gate-tagline {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gate-warning {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.gate-rules-link {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 0.74rem;
}

.gate-rules-link a {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
}

.gate-rules-link a:hover {
  color: var(--accent-light);
}

html.site-guard .gate-rules-page {
  -webkit-user-select: text;
  user-select: text;
}

.gate-rules-page .gate-overlay {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.94) 100%),
    rgba(0, 0, 0, 0.6);
}

.gate-rules-main {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.gate-rules-card {
  width: min(480px, 100%);
  margin: 0;
}

.gate-rules-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.gate-rules-lead {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.gate-rules-list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  display: grid;
  gap: 0.55rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.gate-rules-list li::marker {
  color: var(--accent);
}

.gate-rules-back {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
}

.gate-rules-back a {
  color: var(--text-dim);
  text-decoration: none;
}

.gate-rules-back a:hover {
  color: var(--accent);
}

.gate-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.xf-gate .gate-card {
  width: 100%;
  padding: 1.5rem 1.6rem 1.35rem;
  background: #080808;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
}

.xf-gate .gate-card .field {
  margin-bottom: 0.95rem;
}

.xf-gate .gate-card .field label {
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.xf-gate .gate-card .field input {
  padding: 0.6rem 0.7rem;
  border: 1px solid #262626;
  border-radius: 3px;
  background: #0e0e0e;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.xf-gate .gate-card .field input::placeholder {
  color: #555;
}

.xf-gate .gate-card .field input:hover {
  border-color: #333;
}

.xf-gate .gate-card .field input:focus {
  border-color: #8a0000;
  background: #0a0a0a;
  box-shadow: none;
}

.xf-gate .gate-submit {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.62rem 1rem;
  border-radius: 3px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.xf-gate .gate-submit:hover {
  background: #a80000;
}

.gate-hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.gate-hint code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.field-hint {
  margin: 0.3rem 0 0;
  font-size: 0.68rem;
  color: #555;
}

.xf-gate .gate-error {
  min-height: 1rem;
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
}

.topbar-user-tag {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 600;
}

.topbar-role-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.4rem;
  border-radius: 3px;
  border: none;
  background: var(--bg-hover);
  color: var(--text-dim);
}

.topbar-role-tag.role-owner,
.topbar-role-tag.role-admin {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent);
}

.sidebar-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.25rem 0.55rem;
}

.home-section {
  margin-bottom: var(--space-lg);
}

.home-section:last-child {
  margin-bottom: 0;
}

.home-section-title {
  margin: 0 0 1.25rem;
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.community-card {
  padding: 1.35rem 1.5rem;
}

.product-file {
  font-size: 0.9rem;
  color: var(--text);
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 168px;
    --main-max: 100%;
  }

  .topbar-logout {
    display: none;
  }
}

@media (max-width: 820px) {
  .xf-header-tools {
    display: none;
  }
}

@media (max-width: 720px) {
  .xf-header-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.45rem;
    padding-bottom: 0.35rem;
  }

  .xf-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .xf-header-actions {
    gap: 0.35rem;
  }

  .xf-header-user span {
    display: none;
  }

  .xf-forum-row {
    grid-template-columns: 2rem 1fr;
  }

  .xf-forum-stats {
    display: none;
  }

  .forum-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .community-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .community-sub {
    display: none;
  }

  .community-item a {
    padding: 0.4rem 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.78rem;
  }

  .sidebar-create {
    width: auto;
    margin-top: 0.5rem;
  }

  .main-content,
  .xf-main {
    padding: var(--space-lg) 1.25rem var(--space-xl);
  }

  .page-hero {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
  }

  .topbar-user-tag,
  .topbar-role-tag {
    display: none;
  }

  .gate-layout {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 1.5rem 1.25rem 2.5rem;
    gap: 1.75rem;
  }

  .gate-brand {
    text-align: center;
    align-items: center;
    padding-right: 0;
  }

  .gate-panel {
    justify-content: center;
  }

  .gate-music-btn {
    bottom: 0.85rem;
    left: 0.85rem;
  }

  .messaging-dock {
    right: 0.75rem;
    bottom: 0.75rem;
    flex-direction: column-reverse;
    align-items: flex-end;
  }

  .dm-mini-panel {
    width: min(360px, calc(100vw - 1.5rem));
    height: 300px;
  }

  .chat-mini-panel {
    width: min(260px, calc(100vw - 1.5rem));
    height: 240px;
  }
}

/* Messaging dock — DMs + live chat */
.messaging-dock {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  font-size: 0.78rem;
}

.chat-mini,
.dm-mini {
  position: relative;
}

.dm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  margin-left: 0.35rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}

.dm-mini-panel {
  width: min(420px, calc(100vw - 1.5rem));
  height: 320px;
}

.dm-layout {
  display: grid;
  grid-template-columns: 38% 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dm-threads {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.02);
}

.dm-thread-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dm-thread-item:hover,
.dm-thread-item.is-active {
  border-color: rgba(192, 132, 252, 0.25);
  background: rgba(124, 58, 237, 0.08);
}

.dm-thread-item.is-unread .dm-thread-name {
  color: var(--accent-light);
}

.dm-thread-new {
  font-weight: 700;
  color: var(--accent-light);
}

.dm-thread-name {
  font-size: 0.72rem;
  font-weight: 600;
}

.dm-thread-preview {
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dm-thread-unread {
  align-self: flex-end;
  min-width: 1rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
}

.dm-threads-empty {
  margin: 0.35rem 0.25rem;
  color: var(--text-dim);
  font-size: 0.68rem;
}

.dm-conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.dm-thread-head {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dm-msg {
  max-width: 92%;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  line-height: 1.4;
}

.dm-msg.is-mine {
  align-self: flex-end;
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.2);
}

.dm-msg-user {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--accent-light);
  font-size: 0.64rem;
  font-weight: 600;
}

.dm-empty {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.72rem;
}

.dm-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--border);
}

.dm-compose #dm-to {
  grid-column: 1 / -1;
}

.dm-compose #dm-input {
  min-width: 0;
}

/* Compact live chat */
.chat-mini {
  font-size: 0.78rem;
}

.chat-mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(12, 12, 14, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: border-color 0.15s, background 0.15s;
}

.chat-mini-toggle:hover,
.chat-mini-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(24, 10, 12, 0.96);
}

.chat-mini-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  display: flex;
  flex-direction: column;
  width: 280px;
  height: 260px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 10, 12, 0.97);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.chat-mini-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-mini-panel[hidden] {
  display: none;
}

.chat-mini-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-mini-title {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.chat-mini-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.chat-mini-close:hover {
  color: var(--text);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.chat-msg {
  line-height: 1.35;
  word-break: break-word;
}

.chat-user {
  font-weight: 600;
  margin-right: 0.35rem;
}

.chat-role-owner {
  color: #ff6b6b;
}

.chat-role-admin {
  color: #ffb347;
}

.chat-role-member {
  color: var(--accent);
}

.chat-text {
  color: var(--text);
}

.chat-typing {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem 0;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-style: italic;
  min-height: 1rem;
}

.chat-typing[hidden] {
  display: none;
}

.chat-form {
  display: flex;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-send {
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
}

.user-avatar,
.topbar-avatar,
.members-avatar,
.profile-avatar,
.profile-friend-avatar {
  object-fit: cover;
}

.user-avatar.has-image,
.topbar-avatar.has-image,
.members-avatar.has-image,
.profile-avatar.has-image,
.profile-friend-avatar.has-image {
  display: block;
}

.topbar-user-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
}

.topbar-user-link:hover .topbar-user-tag {
  color: var(--text);
}

.members-avatar-wrap {
  color: inherit;
}

.members-name {
  color: var(--text);
}

.members-name:hover {
  color: var(--accent);
}

.members-friend-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(67, 160, 71, 0.15);
  color: var(--success);
}

.members-friend-badge.is-pending {
  background: rgba(245, 197, 66, 0.12);
  color: var(--gold);
}

.members-friend-badge.is-incoming {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent);
}

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-banner {
  height: 180px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #141414, #080808);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.profile-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

.profile-avatar-wrap {
  position: relative;
  width: 6rem;
  height: 6rem;
  flex-shrink: 0;
  margin-top: -3rem;
  z-index: 2;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--bg-deep);
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-muted);
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
}

.profile-avatar-wrap .presence-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 14px;
  height: 14px;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  padding-top: 0.85rem;
  padding-bottom: 0.25rem;
}

.profile-name {
  margin: 0;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.profile-stats {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-body {
  margin-top: 0.5rem;
}

.profile-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.profile-bio {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
}

.profile-bio-empty {
  color: var(--text-dim);
  font-style: italic;
}

.profile-comments {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.profile-comment-form textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.profile-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-comment {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-top: 1px solid var(--xf-border-soft);
}

.profile-comment-avatar,
.profile-comment-avatar-link .profile-comment-avatar {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 0.95rem;
}

.profile-comment-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.profile-comment-author {
  font-weight: 700;
  color: var(--accent);
}

.profile-comment-author:hover {
  color: var(--accent-light);
}

.profile-comment-time {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.profile-comment-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.profile-comments-empty {
  margin: 0;
  padding: 0.5rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  list-style: none;
}

.profile-friend-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.profile-friend-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(67, 160, 71, 0.15);
  color: var(--success);
}

.profile-friend-badge.is-pending {
  background: rgba(245, 197, 66, 0.12);
  color: var(--gold);
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-friends-section {
  margin-top: 0.25rem;
}

.profile-friend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.profile-friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-friend-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
}

.profile-friend-link:hover .profile-friend-name {
  color: var(--accent);
}

.profile-friend-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  border: 1px solid var(--border-light);
}

.profile-friend-name {
  font-weight: 600;
}

.profile-friend-level {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.profile-friends-empty {
  margin: 0;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
}

@media (max-width: 640px) {
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-avatar-wrap {
    margin-top: -2.5rem;
  }

  .profile-meta {
    padding-top: 0.35rem;
  }

  .profile-upload-grid {
    grid-template-columns: 1fr;
  }

  .profile-banner {
    height: 140px;
  }
}

.level-progress-slot {
  display: flex;
  align-items: center;
}

.level-bar-compact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 5.5rem;
}

.level-bar-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.level-progress {
  width: 4.5rem;
  height: 6px;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  appearance: none;
}

.level-progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.level-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 999px;
}

.level-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 999px;
}

.level-progress-lg {
  width: 100%;
  height: 10px;
}

.level-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.level-card-xp {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.level-card-meta {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.level-sources {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.level-sources li + li {
  margin-top: 0.2rem;
}

.daily-reward-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.daily-reward-btn.can-claim {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(245, 197, 66, 0.1);
  box-shadow: 0 0 12px rgba(245, 197, 66, 0.15);
}

.daily-reward-btn.can-claim:hover {
  background: rgba(245, 197, 66, 0.18);
}

.daily-reward-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.daily-reward-icon {
  font-size: 0.72rem;
  line-height: 1;
}

.daily-reward-toast {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 120;
  max-width: 16rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: rgba(10, 10, 10, 0.96);
  color: var(--text);
  font-size: 0.78rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.daily-reward-toast.is-level-up {
  border-color: var(--gold);
  color: var(--gold);
}

@media (max-width: 900px) {
  .level-progress-slot {
    display: none;
  }
}

.gamble-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gamble-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 0.65rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--xf-border-soft);
}

.gamble-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gamble-sub {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.gamble-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.gamble-balance-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.gamble-balance-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.gamble-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.55rem;
}

.gamble-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.gamble-tab:hover {
  border-color: var(--border-red);
  color: var(--text);
}

.gamble-tab.is-active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(168, 85, 247, 0.08);
}

.gamble-tab-label {
  font-size: 0.78rem;
  font-weight: 700;
}

.gamble-tab-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
}

.gamble-tab.is-active .gamble-tab-tag {
  color: var(--text-muted);
}

.gamble-form {
  margin: 0;
}

.gamble-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.gamble-stage-wrap {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--border);
  background: #020202;
  overflow: hidden;
}

.gamble-stage-wrap.is-animating {
  pointer-events: none;
}

.gamble-stage-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.012) 2px,
    rgba(255, 255, 255, 0.012) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.gamble-game-panel {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.gamble-game-panel.is-active {
  display: flex;
}

.gamble-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.gamble-side-panel {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
}

.gamble-side-panel.is-active {
  display: flex;
}

.gamble-side-label {
  margin: 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
}

.gamble-bet-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}

.gamble-bet-row input {
  flex: 1;
  font-family: var(--font-mono);
}

.gamble-bet-quick {
  display: flex;
  gap: 0.25rem;
}

.gamble-quick {
  min-width: 2rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
}

.gamble-quick:hover {
  border-color: var(--border-red);
  color: var(--text);
}

.gamble-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gamble-dice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gamble-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  font-size: 0.78rem;
}

.gamble-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gamble-choice:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(168, 85, 247, 0.12);
}

.gamble-roulette-choices .gamble-choice:has(input[value="red"]:checked) {
  border-color: #9a0000;
  background: rgba(154, 0, 0, 0.2);
}

.gamble-roulette-choices .gamble-choice:has(input[value="black"]:checked) {
  border-color: #444;
  background: rgba(40, 40, 40, 0.5);
}

.gamble-roulette-choices .gamble-choice:has(input[value="green"]:checked) {
  border-color: #2ecc71;
  background: rgba(26, 107, 56, 0.25);
}

.gamble-submit {
  width: 100%;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.gamble-result {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.gamble-result.is-win {
  color: var(--success);
}

.gamble-result.is-loss {
  color: var(--accent);
}

.gamble-history-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.gamble-history-empty {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.gamble-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.gamble-history-row {
  display: grid;
  grid-template-columns: 5.5rem 4rem 1fr auto auto;
  gap: 0.35rem 0.6rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.gamble-history-row.is-self {
  background: rgba(168, 85, 247, 0.04);
}

.gamble-history-user {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamble-history-user:hover {
  color: var(--accent);
}

.gamble-history-row.is-win {
  border-left: 2px solid var(--success);
}

.gamble-history-row.is-loss {
  border-left: 2px solid var(--accent);
}

.gamble-history-game {
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
}

.gamble-history-detail {
  color: var(--text-muted);
}

.gamble-history-bet {
  color: var(--text-dim);
}

.gamble-history-result {
  font-weight: 700;
}

.gamble-history-row.is-win .gamble-history-result {
  color: var(--success);
}

.gamble-history-row.is-loss .gamble-history-result {
  color: var(--accent);
}

.gamble-history-time {
  grid-column: 1 / -1;
  color: var(--text-dim);
  font-size: 0.6rem;
}

/* Coin */
.coin-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  perspective: 600px;
}

.coin {
  position: relative;
  width: 7rem;
  height: 7rem;
  transform-style: preserve-3d;
  transition: transform 0.1s;
}

.coin.is-flipping.show-heads {
  animation: coin-toss-heads 1.35s ease-out forwards;
}

.coin.is-flipping.show-tails {
  animation: coin-toss-tails 1.35s ease-out forwards;
}

.coin-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  backface-visibility: hidden;
  border: 3px solid #3a3a3a;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 2rem;
}

.coin-heads {
  background: radial-gradient(circle at 35% 30%, #d4a84b, #8a6b1f 70%);
  color: #1a1408;
  transform: rotateY(0deg);
}

.coin-tails {
  background: radial-gradient(circle at 35% 30%, #555, #1a1a1a 70%);
  color: #ccc;
  transform: rotateY(180deg);
}

.coin-face span {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}

@keyframes coin-toss-heads {
  0% { transform: rotateY(0) scale(1); }
  45% { transform: rotateY(900deg) scale(1.08) translateY(-30px); }
  100% { transform: rotateY(1800deg) scale(1); }
}

@keyframes coin-toss-tails {
  0% { transform: rotateY(0) scale(1); }
  45% { transform: rotateY(900deg) scale(1.08) translateY(-30px); }
  100% { transform: rotateY(1980deg) scale(1); }
}

/* Dice */
.dice-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.dice {
  width: 5.5rem;
  height: 5.5rem;
  padding: 0.65rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: #0e0e0e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.dice.is-rolling {
  animation: dice-shake 0.12s linear infinite;
}

.dice-face {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0.2rem;
  width: 100%;
  height: 100%;
}

.dice-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: transparent;
  justify-self: center;
  align-self: center;
}

.dice-dot.is-on {
  background: #e8e8e8;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.25);
}

.dice-mini {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-template-rows: repeat(3, 4px);
  gap: 2px;
}

.dice-mini .dice-dot {
  width: 4px;
  height: 4px;
}

.dice-mini .dice-dot.is-on {
  background: var(--text-muted);
  box-shadow: none;
}

.gamble-choice-dice:has(input:checked) .dice-dot.is-on {
  background: var(--text);
}

@keyframes dice-shake {
  0%, 100% { transform: rotate(-4deg) translateX(-2px); }
  50% { transform: rotate(4deg) translateX(2px); }
}

/* Roulette */
.roulette-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.roulette-wheel {
  width: min(280px, 80vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid #1c1c1c;
  box-shadow: 0 0 0 2px var(--accent), 0 8px 32px rgba(0, 0, 0, 0.6);
  will-change: transform;
}

.roulette-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.roulette-pointer {
  position: absolute;
  top: calc(50% - min(140px, 40vw) - 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 18px solid var(--gold);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  z-index: 3;
}

.roulette-readout {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  min-width: 3rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.85);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.roulette-readout.is-red {
  border-color: #9a0000;
  color: #ff4444;
}

.roulette-readout.is-black {
  border-color: #444;
  color: #ccc;
}

.roulette-readout.is-green {
  border-color: #2ecc71;
  color: #2ecc71;
}

/* Plinko */
.plinko-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0;
}

#plinko-canvas {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border-bottom: 1px solid var(--border);
}

.plinko-buckets {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  max-width: 360px;
  padding: 0.35rem 0 0.5rem;
  align-items: flex-end;
}

.plinko-bucket {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  height: 80px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s, background 0.15s;
}

.plinko-bucket::before {
  content: "";
  display: block;
  width: 100%;
  height: var(--bucket-h, 40px);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.35), rgba(168, 85, 247, 0.08));
  border-top: 1px solid rgba(168, 85, 247, 0.4);
}

.plinko-bucket.is-peak::before {
  background: linear-gradient(180deg, rgba(245, 197, 66, 0.45), rgba(245, 197, 66, 0.1));
  border-top-color: var(--gold);
}

.plinko-bucket.is-hit {
  border-color: var(--gold);
  background: rgba(245, 197, 66, 0.08);
}

.plinko-bucket-mult {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  padding: 0.2rem 0 0;
  line-height: 1;
}

.plinko-bucket.is-peak .plinko-bucket-mult {
  color: var(--gold);
}

.plinko-bucket.is-hit .plinko-bucket-mult {
  color: var(--gold);
}

/* Mines */
.mines-stage {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.mines-status {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.mines-cell {
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #080808;
  color: var(--success);
  font: inherit;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.1s, background 0.1s;
}

.mines-cell-inner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.85rem;
}

.mines-cell:hover:not(:disabled) {
  border-color: var(--border-red);
  background: rgba(168, 85, 247, 0.06);
}

.mines-cell.is-safe {
  border-color: rgba(67, 160, 71, 0.5);
  background: rgba(67, 160, 71, 0.1);
  cursor: default;
}

.mines-cell:disabled:not(.is-safe) {
  opacity: 0.5;
  cursor: not-allowed;
}

.mines-actions {
  display: flex;
  gap: 0.4rem;
}

@media (max-width: 900px) {
  .gamble-layout {
    grid-template-columns: 1fr;
  }

  .gamble-stage-wrap {
    min-height: 360px;
  }

  .gamble-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gamble-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .gamble-balance {
    align-items: flex-start;
  }

  .gamble-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gamble-dice-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gamble-history-row {
    grid-template-columns: 1fr auto;
  }

  .gamble-history-user {
    grid-column: 1 / -1;
  }

  .gamble-history-detail {
    grid-column: 1 / -1;
  }

  .plinko-buckets {
    max-width: 100%;
  }
}

.product-showcase-page .main-inner {
  max-width: 960px;
}

.product-showcase {
  position: relative;
}

.product-showcase-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.product-showcase-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 0.9s ease;
}

.product-showcase-video.is-playing {
  opacity: 0.35;
}

.product-showcase-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.82) 45%,
    rgba(0, 0, 0, 0.95) 100%
  );
}

.product-showcase-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-showcase-hero {
  padding: 1.25rem 1.35rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.product-showcase-badge {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: lowercase;
}

.product-showcase-note {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.product-gallery {
  background: var(--bg-panel);
}

.product-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.product-gallery-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.product-gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  cursor: zoom-in;
}

.product-gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.product-gallery-thumb:hover img {
  transform: scale(1.03);
}

.product-gallery-item figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-gallery-item figcaption strong {
  color: var(--text);
  font-size: 0.82rem;
}

.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.product-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.product-lightbox[hidden] {
  display: none !important;
}

.product-lightbox-img {
  max-width: min(1100px, 96vw);
  max-height: 86vh;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.product-lightbox.is-open .product-lightbox-img {
  opacity: 1;
  transform: scale(1);
}

.product-lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.9);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 720px) {
  .product-gallery-grid {
    grid-template-columns: 1fr;
  }

  .product-showcase-video {
    opacity: 0.22;
  }
}

/* Classic layout mode — original red/black theme */
.layout-classic {
  --bg-deep: #000000;
  --bg-panel: #050505;
  --bg-panel-2: #0a0a0a;
  --bg-hover: #111111;
  --bg-input: #080808;
  --border: #1c1c1c;
  --border-light: #2a2a2a;
  --border-red: #8b0000;
  --text: #e8e8e8;
  --text-muted: #9a9a9a;
  --text-dim: #5c5c5c;
  --accent: #c40000;
  --accent-dark: #9a0000;
  --accent-light: #ff5555;
  --accent-glow: rgba(196, 0, 0, 0.18);
  --xf-border: rgba(196, 0, 0, 0.35);
  --xf-border-soft: rgba(196, 0, 0, 0.14);
  --sidebar-w: 196px;
  --main-max: 820px;
  --radius: 4px;
  --radius-lg: 6px;
  background: var(--bg-deep);
  color: var(--text);
}

.layout-classic .layout-classic-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: 60px;
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: rgba(0, 0, 0, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.layout-classic .xf-logo-img {
  filter: none;
  opacity: 0.95;
}

.layout-classic .layout-classic-nav > a {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.layout-classic .layout-classic-nav > a:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.layout-classic .layout-classic-nav > a.is-active {
  color: var(--accent);
  background: rgba(196, 0, 0, 0.1);
}

.layout-classic .layout-classic-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}

.layout-classic .sidebar {
  display: block;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  padding: var(--space-lg) 1rem var(--space-lg) 1.5rem;
  overflow-y: auto;
}

.layout-classic .main-content {
  min-width: 0;
  padding: var(--space-xl) var(--space-lg);
}

.layout-classic .main-inner {
  max-width: var(--main-max);
  margin: 0 auto;
}

.layout-classic .topbar-user-tag,
.layout-classic .xf-header-link {
  color: var(--text-muted);
}

.layout-classic .topbar-logout:hover,
.layout-classic .xf-header-link:hover {
  color: var(--text);
}

.layout-classic .topbar-role-tag.role-owner,
.layout-classic .topbar-role-tag.role-admin {
  background: rgba(196, 0, 0, 0.15);
  color: var(--accent);
}

.layout-classic .community-item.is-active a {
  color: var(--text);
  background: rgba(196, 0, 0, 0.07);
}

.layout-classic .community-item a:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.layout-classic .community-card:hover {
  border-color: var(--border-red);
  background: #0c0c0c;
}

.layout-classic .xf-block,
.layout-classic .post-card,
.layout-classic .form-shell,
.layout-classic .members-list,
.layout-classic .community-card {
  border-color: var(--border);
  background: var(--bg-panel-2);
}

.layout-classic .members-row.is-win,
.layout-classic .gamble-history-row.is-win {
  border-left-color: var(--success);
}

.layout-classic .members-row.is-loss,
.layout-classic .gamble-history-row.is-loss {
  border-left-color: var(--accent);
}

.layout-classic .btn-primary {
  background: var(--accent);
  border-color: var(--accent-dark);
}

.layout-classic .btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent);
}

.layout-classic .gamble-tab.is-active {
  border-color: var(--accent);
  background: rgba(196, 0, 0, 0.14);
}

.layout-classic .gamble-choice:has(input:checked) {
  border-color: var(--accent);
  background: rgba(196, 0, 0, 0.1);
}

.layout-classic .gamble-history-row.is-self {
  background: rgba(196, 0, 0, 0.04);
}

.layout-classic .gamble-history-user:hover {
  color: var(--accent);
}

.layout-classic .lvl-bar span {
  background: var(--accent);
}

.layout-classic .settings-layout-option:hover {
  background: rgba(196, 0, 0, 0.04);
}

.layout-classic .settings-layout-option.is-selected {
  border-color: var(--accent);
  background: rgba(196, 0, 0, 0.08);
}

.layout-classic .filter-btn.is-active,
.layout-classic .filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.layout-classic .gamble-tab:hover {
  border-color: var(--border-red);
}

.layout-classic .gamble-quick:hover {
  border-color: var(--border-red);
}

.layout-classic .gamble-stage-wrap {
  border-color: var(--border);
  background: #020202;
}

.layout-classic .roulette-wheel {
  box-shadow: 0 0 0 2px var(--accent), 0 8px 32px rgba(0, 0, 0, 0.6);
}

.layout-classic .plinko-bucket::before {
  background: linear-gradient(180deg, rgba(196, 0, 0, 0.35), rgba(196, 0, 0, 0.08));
  border-top-color: rgba(196, 0, 0, 0.4);
}

.layout-classic .mines-cell:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(196, 0, 0, 0.1);
}

.layout-classic .profile-friend-badge,
.layout-classic .chat-role-owner {
  color: var(--accent);
}

.layout-classic .sidebar-title {
  color: var(--text-dim);
}

.layout-classic .home-section-title {
  color: var(--text-muted);
}

/* Settings */
.settings-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.settings-layout-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.settings-layout-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--xf-border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.settings-layout-option:hover {
  border-color: var(--xf-border);
  background: rgba(192, 132, 252, 0.04);
}

.settings-layout-option.is-selected {
  border-color: var(--accent);
  background: rgba(192, 132, 252, 0.08);
}

.settings-layout-option input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.settings-layout-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-layout-copy strong {
  font-size: 0.88rem;
}

.settings-layout-copy span {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
}

.settings-note {
  margin: 0.75rem 0 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.settings-note.is-success {
  color: #6fcf97;
}

.settings-note.is-error {
  color: #ff8a80;
}

.settings-license-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.settings-license-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.settings-license-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.6;
}

.settings-token-result {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--xf-border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.settings-token-value {
  display: block;
  margin-top: 0.45rem;
  padding: 0.65rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  word-break: break-all;
}

@media (max-width: 720px) {
  .layout-classic .layout-classic-body {
    grid-template-columns: 1fr;
  }

  .layout-classic .sidebar {
    position: static;
    height: auto;
    padding: 1rem var(--space-lg) 0.5rem;
    border-bottom: 1px solid var(--xf-border-soft);
  }

  .layout-classic .community-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .layout-classic .community-sub {
    display: none;
  }
}

/* Form pages — pro layout */
body.form-page .page-root {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

.form-page-root {
  max-width: 34rem;
  margin: 0 auto;
}

.form-pro {
  animation: formProIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes formProIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-pro-head {
  text-align: center;
  margin-bottom: 1.35rem;
}

.form-pro-badge {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-light);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-pro-title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.form-pro-lead {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.form-pro-card {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(192, 132, 252, 0.45) 0%,
    rgba(229, 57, 53, 0.2) 50%,
    rgba(124, 58, 237, 0.35) 100%
  );
  box-shadow:
    0 0 0 1px rgba(192, 132, 252, 0.08),
    0 18px 48px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(124, 58, 237, 0.08);
}

.form-pro-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: rgba(6, 3, 10, 0.92);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.form-pro-form,
.form-pro-success {
  position: relative;
  z-index: 1;
}

.form-pro-form {
  padding: 1.35rem 1.35rem 1.15rem;
}

.form-pro-progress {
  margin-bottom: 1.25rem;
}

.form-pro-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.form-pro-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-light));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.form-pro-progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.form-pro-progress-steps span {
  transition: color 0.25s ease;
}

.form-pro-progress-steps span.is-active {
  color: var(--accent-light);
}

.form-pro-progress-steps span.is-complete {
  color: var(--text-muted);
}

.form-pro-form .form-body {
  padding: 0;
}

.form-step-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.form-step-desc {
  margin: 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.form-pro-form .field {
  margin-bottom: 1rem;
}

.form-pro-form .field label {
  margin-bottom: 0.38rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.form-pro-form .field.is-focused label {
  color: var(--accent-light);
}

.form-pro-form .field input,
.form-pro-form .field select,
.form-pro-form .field textarea {
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) + 2px);
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 0.9rem;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    transform 0.2s ease;
}

.form-pro-form .field input::placeholder,
.form-pro-form .field textarea::placeholder {
  color: rgba(255, 255, 255, 0.22);
}

.form-pro-form .field select {
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 2px),
    calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.form-pro-form .field input:hover,
.form-pro-form .field select:hover,
.form-pro-form .field textarea:hover {
  border-color: rgba(192, 132, 252, 0.25);
  background: rgba(0, 0, 0, 0.55);
}

.form-pro-form .field input:focus,
.form-pro-form .field select:focus,
.form-pro-form .field textarea:focus {
  outline: none;
  border-color: rgba(192, 132, 252, 0.55);
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.form-pro-form .field.is-invalid input,
.form-pro-form .field.is-invalid select,
.form-pro-form .field.is-invalid textarea {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
  animation: fieldShake 0.35s ease;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.form-pro-form .field textarea {
  min-height: 128px;
  line-height: 1.5;
}

.form-pro-actions {
  justify-content: flex-end;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.form-pro-actions .btn-primary {
  min-width: 9rem;
  padding: 0.7rem 1.25rem;
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.22);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.form-pro-actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.32);
}

.form-pro-actions .btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.form-pro-actions .btn-primary.is-loading {
  opacity: 0.85;
  cursor: wait;
}

.form-pro-success {
  padding: 2.5rem 1.5rem 2rem;
}

.form-pro-success.is-visible {
  animation: successPop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes successPop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.form-pro-success .success-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(67, 160, 71, 0.35);
  background: rgba(67, 160, 71, 0.12);
  font-size: 1.35rem;
}

.form-pro-review li {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.form-pro-form .submit-status {
  text-align: center;
  min-height: 1.1rem;
}

@media (max-width: 540px) {
  .form-pro-form {
    padding: 1.1rem 1rem 1rem;
  }

  .form-pro-actions {
    flex-direction: column-reverse;
  }

  .form-pro-actions .btn {
    width: 100%;
  }
}

.inbox-link {
  position: relative;
}

.inbox-link-badge,
.inbox-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}

.inbox-section-badge {
  vertical-align: middle;
}

.inbox-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inbox-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inbox-item:last-child {
  border-bottom: none;
}

.inbox-item.is-unread {
  border-left: 2px solid var(--accent-light);
  padding-left: 0.65rem;
}

.inbox-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.inbox-from {
  color: var(--accent-light);
  font-size: 0.82rem;
}

.inbox-time {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.inbox-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.inbox-empty {
  margin: 0;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Sweezy skeleton cursors */
html,
body,
input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea {
  cursor: var(--cursor-default);
}

a,
area,
button:not(:disabled),
summary,
label[for],
select,
option,
[role="button"]:not([aria-disabled="true"]),
[role="link"],
[role="menuitem"],
[role="tab"],
input[type="submit"]:not(:disabled),
input[type="button"]:not(:disabled),
input[type="reset"]:not(:disabled),
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
input[type="file"]:not(:disabled),
.btn:not(:disabled),
.xf-nav-drop-btn,
.xf-subnav-btn,
.topbar-logout,
#logout-link,
.sidebar-create,
.community-item a,
.xf-forum-row,
.gamble-chip,
.plinko-peg,
.mines-tile,
.roulette-bet,
.daily-reward-btn,
.profile-tab,
.tag-pill-btn,
.modal-close,
.copy-invite-btn {
  cursor: var(--cursor-pointer);
}
