/* ============================================================
   Fallout Wasteland — atompunk / выцветшая краска / пергамент
   Theme id: fallout-wasteland
   Inspired by aged Vault-Tec posters, Abraxo ads, tin signs
   ============================================================ */

html[data-theme="fallout-wasteland"] {
  --fw-cream: #e8d9b8;
  --fw-parchment: #d4c19a;
  --fw-stain: #8b6914;
  --fw-ink: #2a2218;
  --fw-ink-soft: #5c4a32;
  --fw-navy: #2c3d5c;
  --fw-navy-faded: #3d5270;
  --fw-mustard: #c9a227;
  --fw-rust: #b54a2a;
  --fw-rust-bright: #d45a30;
  --fw-metal: #6a5e4e;
  --fw-panel: #cbb890;

  --bg: #c4b089;
  --panel: var(--fw-panel);
  --ink: var(--fw-ink);
  --muted: var(--fw-ink-soft);
  --line: #8a7350;
  --accent: var(--fw-rust-bright);
  --accent-2: var(--fw-mustard);
  --accent-dark: #8a3218;
  --accent-soft: #b8a578;
  --bubble-in: #efe4c8;
  --bubble-out: #c9a227;
  --bubble-out-ink: #1f180c;
  --shadow: 0 3px 0 rgba(60, 40, 15, 0.28);
  --chat-bg-top: #d8c8a0;
  --chat-bg-bot: #c4b089;
  --glow: none;
  --glow-strong: none;
  --input-glow: transparent;
  --danger: var(--fw-rust);
  --radius-bubble: 3px;
  --chip-pressed: #b8a578;
  --select-fill: #b8a578;
  --online: #4a8f3c;
  --font: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  --neon-spread: 0.2;
  --sidebar-texture: none;
}

html[data-theme="fallout-wasteland"] body {
  font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif !important;
  font-size: calc(0.95rem * var(--font-scale, 1));
  background: var(--fw-parchment) !important;
  color: var(--fw-ink);
  text-shadow: none;
  image-rendering: auto;
}

html[data-theme="fallout-wasteland"],
html[data-theme="fallout-wasteland"] body {
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100dvh !important;
}

/* Layered faded paint: parchment + stains + grit + vignette */
html[data-theme="fallout-wasteland"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    url('/themes/assets/grit-noise.svg'),
    url('/themes/assets/parchment-stain.svg') center / cover no-repeat,
    radial-gradient(ellipse at 15% 20%, rgba(139, 105, 20, 0.18), transparent 45%),
    radial-gradient(ellipse at 90% 85%, rgba(92, 58, 26, 0.22), transparent 40%),
    radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(40, 25, 10, 0.28) 100%),
    linear-gradient(165deg, #e6d7b0 0%, #d4c19a 40%, #c4b089 70%, #b8a478 100%);
  background-blend-mode: multiply, multiply, normal, normal, normal, normal;
  opacity: 1;
}
html[data-theme="fallout-wasteland"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background:
    repeating-linear-gradient(
      105deg,
      transparent 0 3px,
      rgba(90, 60, 20, 0.03) 3px 4px
    ),
    url('/themes/assets/grit-noise.svg');
  opacity: 0.35;
  mix-blend-mode: multiply;
}
html[data-theme="fallout-wasteland"] body > *:not(#pixel-stars):not(#pixel-scanlines) {
  position: relative;
  z-index: 1;
}

html[data-theme="fallout-wasteland"] .app-shell {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  max-height: calc(100dvh - 12px) !important;
  gap: 0.5rem;
  padding: 0.5rem;
}

/* Weathered tin / painted wood panels */
html[data-theme="fallout-wasteland"] .sidebar,
html[data-theme="fallout-wasteland"] .chat-pane,
html[data-theme="fallout-wasteland"] .auth-card,
html[data-theme="fallout-wasteland"] .card,
html[data-theme="fallout-wasteland"] .console-nav,
html[data-theme="fallout-wasteland"] .console-main,
html[data-theme="fallout-wasteland"] .ui-dialog,
html[data-theme="fallout-wasteland"] .info-panel,
html[data-theme="fallout-wasteland"] .me-chip,
html[data-theme="fallout-wasteland"] .composer,
html[data-theme="fallout-wasteland"] .new-menu,
html[data-theme="fallout-wasteland"] .emoji-panel,
html[data-theme="fallout-wasteland"] .msg-ctx,
html[data-theme="fallout-wasteland"] .send-menu,
html[data-theme="fallout-wasteland"] .pinned-bar {
  border-radius: 2px !important;
  background:
    url('/themes/assets/grit-noise.svg'),
    linear-gradient(145deg, rgba(255, 250, 230, 0.35), transparent 42%),
    linear-gradient(180deg, #d8c8a0 0%, #cbb890 55%, #bba878 100%) !important;
  background-blend-mode: soft-light, normal, normal !important;
  border: 2px solid #5c4a32 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.45),
    inset 0 -2px 0 rgba(60, 40, 15, 0.2),
    0 4px 0 rgba(40, 25, 10, 0.25),
    0 0 0 1px rgba(139, 105, 20, 0.25) !important;
  backdrop-filter: none !important;
  color: var(--fw-ink);
}

html[data-theme="fallout-wasteland"] .chat-pane {
  display: grid !important;
  grid-template-rows: auto 1fr auto auto !important;
  min-height: 0;
}
html[data-theme="fallout-wasteland"] .messages-stage {
  min-height: 0;
  overflow: hidden;
  position: relative;
  background:
    url('/themes/assets/parchment-stain.svg') center / cover no-repeat,
    repeating-linear-gradient(
      90deg,
      #d2c094 0,
      #d2c094 16px,
      #c8b588 16px,
      #c8b588 32px
    );
}
html[data-theme="fallout-wasteland"] .messages-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    url('/themes/assets/grit-noise.svg'),
    radial-gradient(ellipse at 50% 0%, transparent 30%, rgba(60, 40, 15, 0.2) 100%);
  opacity: 0.45;
  mix-blend-mode: multiply;
}
html[data-theme="fallout-wasteland"] .messages-stage::after {
  display: none;
}
html[data-theme="fallout-wasteland"] .messages-stage.has-fallout-art::after {
  display: none;
}
html[data-theme="fallout-wasteland"] .messages-stage > .messages {
  position: relative;
  z-index: 1;
}
html[data-theme="fallout-wasteland"] .messages-stage > .fallout-art {
  position: absolute !important;
  z-index: 0;
}
html[data-theme="fallout-wasteland"] .messages-stage > .btn-jump-bottom {
  position: absolute !important;
  z-index: 40;
}
html[data-theme="fallout-wasteland"] .composer-wrap {
  background: transparent;
  flex-shrink: 0;
}

/* Faded propaganda banner headers */
html[data-theme="fallout-wasteland"] .sidebar-header,
html[data-theme="fallout-wasteland"] .chat-header,
html[data-theme="fallout-wasteland"] .info-header,
html[data-theme="fallout-wasteland"] .console-brand {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  background:
    url('/themes/assets/grit-noise.svg'),
    linear-gradient(180deg, #4a6080 0%, var(--fw-navy) 55%, #243248 100%) !important;
  background-blend-mode: soft-light, normal !important;
  color: #f0e6d2 !important;
  border: 0 !important;
  border-bottom: 4px solid var(--fw-mustard) !important;
  border-radius: 0 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35) !important;
  position: relative;
  z-index: 2;
}
html[data-theme="fallout-wasteland"] .sidebar-header .brand-lockup {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 6.5rem);
}
html[data-theme="fallout-wasteland"] .sidebar-header .brand {
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="fallout-wasteland"] .sidebar-header .sidebar-actions {
  flex: 0 0 auto;
  margin-left: auto;
  z-index: 3;
}
html[data-theme="fallout-wasteland"] .brand,
html[data-theme="fallout-wasteland"] #chat-title,
html[data-theme="fallout-wasteland"] .console-brand h2,
html[data-theme="fallout-wasteland"] .boot-splash-brand,
html[data-theme="fallout-wasteland"] .auth-card h1,
html[data-theme="fallout-wasteland"] h3 {
  font-family: "IBM Plex Sans", Tahoma, sans-serif !important;
  color: #f5ecd4 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
html[data-theme="fallout-wasteland"] .sidebar-header .brand::before {
  content: '⚙ ';
  color: var(--fw-mustard);
}
html[data-theme="fallout-wasteland"] .auth-card h1 {
  color: var(--fw-navy) !important;
  text-shadow: 0 1px 0 rgba(255, 245, 220, 0.4) !important;
}
html[data-theme="fallout-wasteland"] .chat-subtitle,
html[data-theme="fallout-wasteland"] .console-brand .console-sub,
html[data-theme="fallout-wasteland"] .console-brand .muted {
  color: rgba(240, 230, 210, 0.88) !important;
  text-transform: none;
}
html[data-theme="fallout-wasteland"] .me-chip-text strong {
  color: var(--fw-ink) !important;
  text-transform: none;
}
html[data-theme="fallout-wasteland"] #me-user,
html[data-theme="fallout-wasteland"] .me-chip-text .muted {
  color: #3d6b32 !important;
  text-transform: none !important;
}

html[data-theme="fallout-wasteland"] input,
html[data-theme="fallout-wasteland"] textarea,
html[data-theme="fallout-wasteland"] select,
html[data-theme="fallout-wasteland"] .search-wrap input,
html[data-theme="fallout-wasteland"] #message-input {
  border-radius: 2px !important;
  background: #efe4c8 !important;
  border: 2px solid #6a5538 !important;
  box-shadow: inset 0 2px 4px rgba(60, 40, 15, 0.25) !important;
  color: var(--fw-ink) !important;
  font-family: inherit !important;
  text-transform: none;
}
html[data-theme="fallout-wasteland"] input::placeholder,
html[data-theme="fallout-wasteland"] #message-input::placeholder {
  color: #8a7350 !important;
  text-transform: none;
}

/* Rusted / painted metal buttons */
html[data-theme="fallout-wasteland"] .btn-primary,
html[data-theme="fallout-wasteland"] .btn-ghost,
html[data-theme="fallout-wasteland"] .icon-btn,
html[data-theme="fallout-wasteland"] .send-btn,
html[data-theme="fallout-wasteland"] .chip,
html[data-theme="fallout-wasteland"] .tab,
html[data-theme="fallout-wasteland"] .theme-opt,
html[data-theme="fallout-wasteland"] .info-action {
  border-radius: 2px !important;
  background:
    url('/themes/assets/grit-noise.svg'),
    linear-gradient(180deg, #8a7a62 0%, #6a5e4e 55%, #564a3c 100%) !important;
  background-blend-mode: soft-light, normal !important;
  color: #f0e6d2 !important;
  border: 2px solid #3d3224 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 210, 0.25),
    0 2px 0 rgba(40, 25, 10, 0.35) !important;
  font-family: inherit !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35) !important;
  filter: none !important;
}
html[data-theme="fallout-wasteland"] .btn-primary,
html[data-theme="fallout-wasteland"] .send-btn.has-text,
html[data-theme="fallout-wasteland"] .chip.active,
html[data-theme="fallout-wasteland"] .tab.active,
html[data-theme="fallout-wasteland"] .theme-opt.active {
  background:
    url('/themes/assets/grit-noise.svg'),
    linear-gradient(180deg, #e07848 0%, var(--fw-rust-bright) 50%, #9a3a1a 100%) !important;
  background-blend-mode: soft-light, normal !important;
  color: #fff8e8 !important;
  border-color: #5a2210 !important;
}
html[data-theme="fallout-wasteland"] .send-btn {
  width: auto !important;
  height: auto !important;
  padding: 0.5rem 0.9rem !important;
  white-space: nowrap;
  background:
    url('/themes/assets/grit-noise.svg'),
    linear-gradient(180deg, #dfc04a 0%, var(--fw-mustard) 55%, #8a7018 100%) !important;
  background-blend-mode: soft-light, normal !important;
  color: #1f180c !important;
  border-color: #5a4a14 !important;
  text-shadow: none !important;
}
html[data-theme="fallout-wasteland"] .send-btn .send-ico-default { display: none !important; }
html[data-theme="fallout-wasteland"] .send-btn .send-label-pixel {
  display: inline !important;
  font-family: inherit !important;
  text-transform: uppercase;
  font-weight: 700;
}

html[data-theme="fallout-wasteland"] .chat-list li button {
  border-radius: 2px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--fw-ink) !important;
}
html[data-theme="fallout-wasteland"] .chat-list li button:hover {
  background: rgba(44, 61, 92, 0.12) !important;
}
html[data-theme="fallout-wasteland"] .chat-list li button.active {
  background: rgba(44, 61, 92, 0.2) !important;
  border-color: var(--fw-mustard) !important;
  box-shadow: inset 3px 0 0 var(--fw-rust) !important;
}
html[data-theme="fallout-wasteland"] .chat-list li button strong {
  color: var(--fw-navy) !important;
  text-shadow: none !important;
  font-size: 0.95rem !important;
  text-transform: none;
  font-weight: 700;
}
html[data-theme="fallout-wasteland"] .chat-list li button .preview,
html[data-theme="fallout-wasteland"] .chat-item-meta {
  color: var(--fw-ink-soft) !important;
}
html[data-theme="fallout-wasteland"] .chat-unread-badge {
  border-radius: 2px !important;
  background: var(--fw-rust) !important;
  color: #fff8e8 !important;
  border: 1px solid #5a2210 !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25) !important;
  font-weight: 800;
}
html[data-theme="fallout-wasteland"] .chat-unread-badge::before {
  content: '☢';
  margin-right: 0.15em;
}

/* Bubbles = worn plastic / tin signs */
html[data-theme="fallout-wasteland"] .messages .row .bubble:not(.deleted) {
  border-radius: 3px !important;
  background:
    url('/themes/assets/grit-noise.svg'),
    linear-gradient(160deg, rgba(255, 250, 235, 0.55), transparent 40%),
    #efe4c8 !important;
  background-blend-mode: multiply, normal, normal !important;
  color: var(--fw-ink) !important;
  border: 2px solid #6a5538 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 230, 0.5),
    0 3px 0 rgba(60, 40, 15, 0.22) !important;
  filter: none !important;
  text-shadow: none !important;
}
html[data-theme="fallout-wasteland"] .messages .row.mine .bubble:not(.deleted) {
  background:
    url('/themes/assets/grit-noise.svg'),
    linear-gradient(160deg, rgba(255, 245, 200, 0.4), transparent 45%),
    var(--fw-mustard) !important;
  background-blend-mode: soft-light, normal, normal !important;
  color: #1f180c !important;
  border-color: #6a5414 !important;
}
html[data-theme="fallout-wasteland"] .messages .row .sender-name,
html[data-theme="fallout-wasteland"] .messages .row.mine .sender-name {
  color: var(--neon, var(--fw-navy)) !important;
  text-shadow: none !important;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  font-size: 0.82rem !important;
}
html[data-theme="fallout-wasteland"] .messages .row.mine .sender-name {
  color: var(--neon, #5a4510) !important;
}
html[data-theme="fallout-wasteland"] .bubble-foot { color: var(--fw-ink-soft) !important; }
html[data-theme="fallout-wasteland"] .messages .row.mine .bubble-foot {
  color: rgba(31, 24, 12, 0.65) !important;
}
html[data-theme="fallout-wasteland"] .day-sep {
  border-radius: 2px !important;
  background: rgba(44, 61, 92, 0.85) !important;
  color: var(--fw-mustard) !important;
  border: 1px solid #1a2536 !important;
  box-shadow: 0 2px 0 rgba(40, 25, 10, 0.25) !important;
  text-shadow: none !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

html[data-theme="fallout-wasteland"] .avatar,
html[data-theme="fallout-wasteland"] .avatar-wrap,
html[data-theme="fallout-wasteland"] .avatar-img { border-radius: 2px !important; }
html[data-theme="fallout-wasteland"] .avatar:not(.has-img) {
  background-image: none !important;
  background-color: var(--av, var(--fw-navy)) !important;
  color: var(--fw-navy);
  text-shadow: none !important;
  border: 2px solid var(--fw-mustard);
}
html[data-theme="fallout-wasteland"] .avatar:not(.has-img)::after { display: none !important; }
html[data-theme="fallout-wasteland"] .avatar-wrap::after,
html[data-theme="fallout-wasteland"] #chat-avatar-wrap::after {
  border-radius: 2px !important;
  box-shadow: 0 0 0 2px var(--fw-mustard) !important;
}
html[data-theme="fallout-wasteland"] .status-dot {
  border-radius: 0 !important;
  border: 1px solid #1a1508 !important;
  width: 12px !important;
  height: 12px !important;
  box-shadow: none !important;
}
html[data-theme="fallout-wasteland"] .status-dot.online {
  background: #4a8f3c !important;
  box-shadow: 0 0 6px rgba(74, 143, 60, 0.7) !important;
}

html[data-theme="fallout-wasteland"] .composer-prompt {
  display: inline-block !important;
  color: var(--fw-navy);
  font-weight: 700;
}
html[data-theme="fallout-wasteland"] .composer-hints,
html[data-theme="fallout-wasteland"] .pixel-rpg-hud { display: none !important; }
html[data-theme="fallout-wasteland"] #message-input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-theme="fallout-wasteland"] .composer::after {
  content: 'ANOTHER QUALITY PRODUCT FROM VAULT-TEC';
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0.15rem;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--fw-navy);
  opacity: 0.7;
  text-transform: uppercase;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="fallout-wasteland"] .console-screen,
html[data-theme="fallout-wasteland"] #settings-screen,
html[data-theme="fallout-wasteland"] #admin-screen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10060 !important;
  background: var(--fw-parchment) !important;
  overflow: auto !important;
}
html[data-theme="fallout-wasteland"] .console-back,
html[data-theme="fallout-wasteland"] .console-item,
html[data-theme="fallout-wasteland"] .console-signed,
html[data-theme="fallout-wasteland"] .console-main,
html[data-theme="fallout-wasteland"] .console-main .muted,
html[data-theme="fallout-wasteland"] .console-main p {
  color: var(--fw-ink) !important;
}
html[data-theme="fallout-wasteland"] .console-item { border-radius: 2px !important; }
html[data-theme="fallout-wasteland"] .console-item.active {
  background: rgba(44, 61, 92, 0.25) !important;
  color: var(--fw-ink) !important;
  box-shadow: inset 3px 0 0 var(--fw-rust) !important;
}
html[data-theme="fallout-wasteland"] .console-brand h2::before {
  content: 'VAULT-TEC · ';
  color: var(--fw-mustard);
  font-size: 0.75em;
}

html[data-theme="fallout-wasteland"] .auth-screen,
html[data-theme="fallout-wasteland"] .boot-splash {
  background: var(--fw-parchment) !important;
}
html[data-theme="fallout-wasteland"] .boot-splash-brand::after {
  content: 'SURVIVE THE WASTELAND';
  display: block;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--fw-rust);
}
html[data-theme="fallout-wasteland"] .ui-toast {
  border-radius: 2px !important;
  background: #efe4c8 !important;
  color: var(--fw-ink) !important;
  border: 2px solid var(--fw-mustard) !important;
  box-shadow: 0 3px 0 rgba(40, 25, 10, 0.3) !important;
}
html[data-theme="fallout-wasteland"] .btn-jump-bottom {
  position: absolute !important;
  right: 0.85rem !important;
  left: auto !important;
  bottom: 0.85rem !important;
  z-index: 40 !important;
  border-radius: 2px !important;
  background: linear-gradient(180deg, #8a7a62, #6a5e4e) !important;
  color: #f0e6d2 !important;
  border: 2px solid #3d3224 !important;
  box-shadow: 0 2px 0 rgba(40, 25, 10, 0.35) !important;
}
html[data-theme="fallout-wasteland"] .empty-chat {
  color: var(--fw-navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
html[data-theme="fallout-wasteland"] .empty-chat::before {
  display: none;
}
html[data-theme="fallout-wasteland"] .lock-pill {
  background: #efe4c8;
  border-radius: 2px;
  border: 1px solid var(--fw-mustard);
  color: var(--fw-navy);
}

html[data-theme="fallout-wasteland"] .pins-item,
html[data-theme="fallout-wasteland"] .info-media-item,
html[data-theme="fallout-wasteland"] .info-action,
html[data-theme="fallout-wasteland"] .admin-stats,
html[data-theme="fallout-wasteland"] .branding-card,
html[data-theme="fallout-wasteland"] .role-pill,
html[data-theme="fallout-wasteland"] .console-signed,
html[data-theme="fallout-wasteland"] .nav-badge,
html[data-theme="fallout-wasteland"] .card,
html[data-theme="fallout-wasteland"] .ui-dialog,
html[data-theme="fallout-wasteland"] dialog {
  border-radius: 2px !important;
}
html[data-theme="fallout-wasteland"] .pins-item,
html[data-theme="fallout-wasteland"] .info-media-item,
html[data-theme="fallout-wasteland"] .admin-stats,
html[data-theme="fallout-wasteland"] .branding-card,
html[data-theme="fallout-wasteland"] .role-pill {
  background:
    url('/themes/assets/grit-noise.svg'),
    #efe4c8 !important;
  background-blend-mode: multiply !important;
  color: var(--fw-ink) !important;
  border: 2px solid #6a5538 !important;
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.4) !important;
}
