html.static-mirror .static-mirror-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  padding: 0.45rem 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  background: #2a1810;
  color: #ffd4a8;
  border-bottom: 1px solid #5c3d1e;
}

html.static-mirror .static-mirror-banner a {
  color: #ffb347;
  font-weight: 600;
}

html.static-mirror .nav-btn[data-tab="chat"],
html.static-mirror #chat,
html.static-mirror .nav-btn[data-tab="jetstream"],
html.static-mirror #jetstream {
  display: none !important;
}

html.is-cloaked,
html.is-cloaked body {
  overflow: hidden;
}

html.is-cloaked body > :not(#site-cloak) {
  visibility: hidden;
}

#site-cloak {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: #0b0b0b;
}

#site-cloak iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

:root {
  --bg: #120606;
  --bg2: #1a0707;
  --panel: #241010;
  --panel2: #2a0c0c;
  --text: #ffe8e8;
  --muted: #ffb3b3;
  --accent: #c62828;
  --accent2: #ff7a7a;
  --border: rgba(255, 122, 122, 0.16);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #120606 0%, #0d0303 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input, textarea {
  font: inherit;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar-legal a {
  color: var(--muted);
  text-decoration: none;
}

.sidebar-legal a:hover {
  color: var(--accent2);
  text-decoration: underline;
}

.sidebar-legal-sep {
  opacity: 0.55;
}

.logo {
  margin: 0 0 20px;
  font-size: 22px;
  color: var(--text);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--accent);
}

.content {
  flex: 1;
  padding: 20px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

html.chromebook .nav-btn[data-tab="playables"].active {
  background: rgba(255, 82, 82, 0.15);
  color: #ff8a80;
}

.browser-frame {
  width: 100%;
  height: calc(100vh - 40px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #120606;
}

.jetstream-embed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 40px);
}

.jetstream-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(36, 16, 16, 0.95), rgba(18, 6, 6, 0.95));
}

.jetstream-banner strong {
  color: var(--accent2);
  font-size: 1.1rem;
  margin-right: 10px;
}

.jetstream-tag {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.ads-banner-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ads-banner-head strong {
  color: var(--accent2);
  font-size: 1.1rem;
}

.ads-tag {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.jetstream-open {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(198, 40, 40, 0.2);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font: inherit;
}

.jetstream-open:hover {
  background: var(--accent);
  text-decoration: none;
}

.jetstream-embed .browser-frame {
  flex: 1;
  height: auto;
  min-height: 0;
}

.jetstream-chromebook-note {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 14px;
  background: rgba(255, 193, 7, 0.08);
  text-align: center;
}

.jetstream-chromebook-note p {
  max-width: 520px;
  margin: 0 0 16px;
  color: #ffdca8;
  line-height: 1.5;
}

.jetstream-chromebook-open {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5252, #b71c1c);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

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

.card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}

.card h3 {
  margin: 0 0 10px;
  word-break: break-word;
}

.card-link {
  display: block;
  margin-bottom: 14px;
  word-break: break-word;
  color: var(--muted);
}

.open-link {
  display: inline-block;
  padding: 10px 12px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  text-decoration: none;
}

.open-link:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.playables-wrap {
  min-height: calc(100vh - 40px);
}

.playables-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px;
  border: 1px solid rgba(255, 122, 122, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(198, 40, 40, 0.18), rgba(36, 10, 10, 0.95) 55%),
    linear-gradient(180deg, rgba(255, 122, 122, 0.08), transparent);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 140, 140, 0.06) inset,
    0 1px 0 rgba(255, 180, 180, 0.12) inset;
  backdrop-filter: blur(10px);
}

.playables-toolbar.hidden {
  display: none;
}

.playables-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.playables-search-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 140, 140, 0.45);
  background-color: #2a0c0c;
  background-image:
    linear-gradient(180deg, rgba(255, 122, 122, 0.28), rgba(198, 40, 40, 0.18));
  box-shadow:
    0 0 0 1px rgba(255, 180, 180, 0.08) inset,
    0 8px 24px rgba(198, 40, 40, 0.16);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: text;
  color-scheme: dark;
}

.playables-search-box:focus-within {
  border-color: #ff8a8a;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 3px rgba(198, 40, 40, 0.22),
    0 0 24px rgba(255, 100, 100, 0.18),
    0 0 0 1px rgba(255, 210, 210, 0.14) inset;
}

.playables-search-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, #ef5350, #c62828);
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.35);
  flex-shrink: 0;
}

.playables-search {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  background-color: #2a0c0c !important;
  background-image: none !important;
  color: #fff5f5 !important;
  caret-color: #ff9a9a;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.playables-search::placeholder {
  color: rgba(255, 220, 220, 0.78);
  opacity: 1;
}

.playables-search:-webkit-autofill,
.playables-search:-webkit-autofill:hover,
.playables-search:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff5f5 !important;
  box-shadow: 0 0 0 1000px #2a0c0c inset !important;
  transition: background-color 99999s ease-in-out 0s;
}

.playables-category-select-wrap {
  position: relative;
  flex-shrink: 0;
}

.playables-category-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #ffb3b3;
  border-bottom: 2px solid #ffb3b3;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.playables-category-select {
  min-width: 180px;
  max-width: 220px;
  min-height: 52px;
  padding: 0 38px 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 140, 140, 0.45);
  background-color: #2a0c0c;
  background-image: linear-gradient(180deg, rgba(255, 122, 122, 0.28), rgba(198, 40, 40, 0.18));
  color: #fff5f5;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  box-shadow:
    0 0 0 1px rgba(255, 180, 180, 0.08) inset,
    0 8px 24px rgba(198, 40, 40, 0.16);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.playables-category-select:hover,
.playables-category-select:focus {
  border-color: #ff8a8a;
  box-shadow:
    0 0 0 3px rgba(198, 40, 40, 0.22),
    0 0 24px rgba(255, 100, 100, 0.18),
    0 0 0 1px rgba(255, 210, 210, 0.14) inset;
}

.playables-category-select option {
  background: #2a0c0c;
  color: #fff5f5;
}

.playables-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
  padding-right: 4px;
}

.playables-category-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 122, 122, 0.32);
  background: rgba(42, 12, 12, 0.92);
  color: #ffb3b3;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.playables-category-chip:hover {
  border-color: rgba(255, 140, 140, 0.55);
  color: #ffe8e8;
  transform: translateY(-1px);
}

.playables-category-chip.active {
  background: linear-gradient(180deg, #ef5350, #c62828);
  border-color: #ff9a9a;
  color: #fff;
  box-shadow: 0 4px 14px rgba(198, 40, 40, 0.35);
}

.playables-count {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 122, 122, 0.28);
  background: rgba(26, 8, 8, 0.85);
  color: #ffc9c9;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 180, 180, 0.06) inset;
}

.playables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.playables-grid.hidden {
  display: none;
}

.playable-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel2);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.playable-card:hover {
  border-color: rgba(255, 122, 122, 0.45);
  transform: translateY(-2px);
}

.playable-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #1a0707;
}

.playable-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: bold;
  background: linear-gradient(180deg, #3a1010, #1a0707);
  color: var(--accent2);
}

.playable-info {
  padding: 10px 12px 12px;
}

.playable-info strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
  line-height: 1.3;
}

.playable-info span {
  display: inline-block;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffc9c9;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(198, 40, 40, 0.22);
  border: 1px solid rgba(255, 122, 122, 0.22);
}

.playables-player {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 40px);
}

.playables-player.hidden {
  display: none;
}

.playables-player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(36, 16, 16, 0.95), rgba(18, 6, 6, 0.95));
}

.playables-back {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(198, 40, 40, 0.2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.playables-title {
  flex: 1;
  font-weight: bold;
  color: var(--accent2);
}

.playables-frame {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #000;
}

.empty {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
}

#announcement {
  display: none;
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel2);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(198, 40, 40, 0.3);
  backdrop-filter: blur(8px);
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: floatIn 0.4s ease;
}

#announcement.visible {
  display: block;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.fluxer-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 14px rgba(88, 101, 242, 0.7),
    0 0 32px rgba(75, 74, 226, 0.45),
    0 4px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 999;
}

.fluxer-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.fluxer-btn:hover {
  transform: scale(1.1);
  box-shadow:
    0 0 20px rgba(114, 125, 255, 0.9),
    0 0 44px rgba(88, 101, 242, 0.65),
    0 6px 28px rgba(75, 74, 226, 0.5);
  text-decoration: none;
}

/* =========================
   SETTINGS PANEL
========================= */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}

.settings-card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.settings-card-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--text);
}

.settings-card-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.color-picker {
  width: 56px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: none;
  padding: 2px;
}

.cloak-btn {
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: filter 0.2s;
}

.cloak-btn:hover {
  filter: brightness(1.1);
}

.suggest-area {
  width: 100%;
  padding: 12px;
  background: #160808;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  resize: vertical;
  min-height: 90px;
  font-size: 14px;
  margin-bottom: 10px;
  display: block;
}

.suggest-submit {
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: filter 0.2s;
}

.suggest-submit:hover {
  filter: brightness(1.1);
}

.suggest-status {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  min-height: 18px;
}

.ads-panel {
  max-width: 820px;
}

.ads-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.ads-header p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.ads-header a {
  color: #ff8a80;
}

.ads-empty {
  background: var(--panel2);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.ads-empty.hidden,
.ads-slot.hidden {
  display: none;
}

.ads-slots {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ads-slot {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.ads-slot-label {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.ads-slot-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  overflow: hidden;
}

.ads-slot-body iframe {
  max-width: 100%;
}

.ads-page-body {
  padding: 24px;
}

.ads-page {
  max-width: 820px;
  margin: 0 auto;
}

.ads-page-header {
  margin-bottom: 24px;
}

.ads-page-home {
  display: inline-block;
  margin-bottom: 16px;
  font-weight: bold;
}

.ads-page-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.ads-page-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

/* =========================
   ADMIN
========================= */
.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
}

.admin-card h2,
.admin-card h3 {
  margin-top: 0;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #160808;
  color: var(--text);
}

.admin-btn {
  padding: 12px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.admin-btn.secondary {
  background: #5a0b0b;
}

.admin-btn.danger {
  background: #7a1515;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--text);
}

.admin-ads-slot {
  margin-bottom: 14px;
}

.admin-ads-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
}

.admin-ads-code {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.email-ban-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-ban-row {
  align-items: center;
}

.email-ban-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.email-ban-info span {
  color: #ffb4b4;
}

.email-ban-info small {
  color: var(--muted, #888);
  font-size: 0.82rem;
}

.ads-smartlink {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5252, #b71c1c);
  color: #fff !important;
  font-weight: bold;
  text-decoration: none;
}

.ads-smartlink:hover {
  filter: brightness(1.08);
}

.status {
  margin-top: 12px;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .app {
    flex-direction: column;
  }

  .playables-search-row {
    flex-wrap: wrap;
  }

  .playables-search-box {
    width: 100%;
    flex: 1 1 100%;
  }

  .playables-category-select-wrap {
    width: 100%;
  }

  .playables-category-select {
    width: 100%;
    max-width: none;
  }

  .playables-count {
    width: 100%;
  }

  .playables-categories {
    max-height: 110px;
  }

  .sidebar {
    width: 100%;
    position: static;
    height: auto;
    overflow: visible;
  }

  .browser-frame {
    height: 70vh;
  }

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

/* Chat */
.chat-panel {
  min-height: calc(100vh - 48px);
}

.chat-gate {
  max-width: 420px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.chat-gate h2 {
  margin: 0 0 0.75rem;
  color: var(--accent2);
}

.chat-google-btn,
.chat-rules-btn,
.chat-username-form button,
.chat-compose button,
.chat-buy-btn,
.chat-greet-btn {
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #c62828, #8e0000);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.chat-rules-btn,
.chat-greet-btn,
.chat-buy-btn {
  background: rgba(198, 40, 40, 0.2);
  color: var(--accent2);
  border: 1px solid var(--border);
}

.chat-fluxer-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid rgba(88, 101, 242, 0.45);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.35), rgba(58, 74, 196, 0.25));
  color: #dbeafe;
  cursor: pointer;
  font-weight: 700;
}

.chat-fluxer-link-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.chat-fluxer-link-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.chat-fluxer-link-block {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chat-message-new-user {
  animation: chatGreetIn 0.25s ease;
}

.chat-message-new-user.chat-greet-expiring {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

@keyframes chatGreetIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-username-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chat-username-form input,
.chat-compose input,
.settings-profile-fields input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.65rem 0.85rem;
}

.chat-error {
  color: #ff8a80;
  margin-top: 0.75rem;
}

.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  min-height: calc(100vh - 48px);
}

.chat-sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.chat-sidebar-tab {
  width: 100%;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  background: rgba(198, 40, 40, 0.12);
  color: var(--accent2);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.chat-sidebar-tab:hover {
  background: rgba(198, 40, 40, 0.22);
}

.chat-sidebar-tab.active {
  background: linear-gradient(135deg, #c62828, #8e0000);
  color: #fff;
  border-color: transparent;
}

.chat-sidebar-nav .chat-rules-btn {
  width: 100%;
  margin-top: auto;
}

.chat-area-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.chat-area-tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 10px 10px 0 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chat-area-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.chat-area-tab.active {
  color: var(--text);
  background: var(--panel2);
}

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

.chat-store-panel {
  flex: 1;
  min-height: 55vh;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding: 1rem;
}

.chat-store-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.chat-store-list {
  display: grid;
  gap: 0.75rem;
}

.chat-profile-card {
  background: var(--panel2);
  border-radius: 12px;
  padding: 0.85rem;
}

.chat-profile-top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-profile-pfp,
.chat-avatar,
.settings-profile-pfp {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-profile-pfp-fallback,
.chat-avatar-fallback,
.settings-profile-pfp-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #3a1010;
  color: var(--accent2);
  font-weight: 700;
}

.chat-profile-name {
  font-weight: 700;
}

.chat-profile-role,
.chat-profile-stats span,
.settings-stats-grid span {
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-profile-stats,
.settings-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chat-level-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.chat-level-bar div {
  height: 100%;
  background: linear-gradient(90deg, #c62828, #ff8a80);
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  min-height: 55vh;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.chat-message-system {
  background: rgba(198, 40, 40, 0.08);
  border: 1px solid rgba(255, 138, 128, 0.15);
  border-radius: 12px;
  padding: 0.75rem;
}

.chat-message-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.chat-message-head time {
  color: var(--muted);
  font-size: 0.75rem;
}

.chat-message-name {
  font-weight: 700;
}

.chat-fluxer-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.15);
  color: #93c5fd;
}

.chat-message-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1.02rem;
  line-height: 1.45;
}

.chat-compose-wrap {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--panel2);
}

.chat-emoji-picker {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: calc(100% + 0.35rem);
  max-height: 240px;
  overflow-y: auto;
  padding: 0.65rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.chat-emoji-group + .chat-emoji-group {
  margin-top: 0.5rem;
}

.chat-emoji-group-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2rem, 1fr));
  gap: 0.15rem;
}

.chat-emoji-item {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.35rem;
  border-radius: 8px;
  cursor: pointer;
}

.chat-emoji-item:hover {
  background: rgba(198, 40, 40, 0.18);
}

.chat-emoji-btn {
  flex-shrink: 0;
  width: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(198, 40, 40, 0.12);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.chat-emoji-btn:hover {
  background: rgba(198, 40, 40, 0.22);
}

.chat-compose {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 0;
  background: transparent;
}

.chat-compose-hint {
  margin: 0;
  padding: 0 0.85rem 0.65rem;
  color: #ff8a80;
  font-size: 0.85rem;
}

.chat-store-item {
  background: var(--panel2);
  border-radius: 10px;
  padding: 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.chat-store-item p {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-rules-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.chat-rules-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
}

.chat-rules-modal ol {
  padding-left: 1.2rem;
  line-height: 1.5;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-profile-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-profile-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.settings-profile-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.settings-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.settings-stats-grid strong {
  display: block;
  margin-top: 0.15rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    order: 2;
  }
}
