html:root[data-theme="dark"] body.lotr-mode {
  --lotr-gold: #c9a24d;
  --lotr-gold-bright: #e6c779;
  --lotr-gold-pale: #f3e2b0;
  --lotr-gold-deep: #8a6a24;
  --lotr-gold-line: rgba(201, 162, 77, 0.42);
  --lotr-gold-faint: rgba(201, 162, 77, 0.16);
  --lotr-ink: #0b0d09;
  --lotr-stone: #12140f;
  --lotr-stone-raised: #181b14;
  --lotr-stone-high: #20241a;
  --lotr-parchment: #ece2c6;
  --lotr-parchment-muted: #a99d82;
  --lotr-ember: #d9481f;
  --lotr-ember-deep: #8e2318;
  --lotr-leaf: #5aa36a;
  --lotr-leaf-deep: #23452d;
  --lotr-corner: linear-gradient(var(--lotr-gold), var(--lotr-gold));

  --f2b-page-bg: var(--lotr-ink);
  --f2b-scrollbar-track: #10120d;
  --f2b-scrollbar-thumb: #5c4c26;
  --f2b-scrollbar-thumb-hover: #8a6a24;
  --f2b-select-border: var(--lotr-gold-line);
  --f2b-select-bg: var(--lotr-stone);
  --f2b-modal-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(201, 162, 77, 0.2);
  --f2b-log-highlight-bg: #5e2410;
  --f2b-log-highlight-text: #ffd8a6;
  --f2b-tooltip-bg: #0e100b;
  --f2b-tooltip-text: var(--lotr-parchment);
  --f2b-mark-bg: #6e5216;
  --f2b-mark-text: #fff1cc;
  --f2b-toast-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.85);
  --f2b-toast-hover-shadow: 0 18px 34px -10px rgba(0, 0, 0, 0.9);
  --f2b-toast-ban-bg: #2a110c;
  --f2b-toast-ban-hover-bg: #3a170f;
  --f2b-toast-unban-bg: #12221a;
  --f2b-toast-unban-hover-bg: #183024;
  --f2b-threat-border-strong: rgba(201, 162, 77, 0.5);
  --f2b-threat-border: rgba(201, 162, 77, 0.3);
  --f2b-threat-card-border: rgba(201, 162, 77, 0.3);
  --f2b-threat-danger-border: #8e2318;
  --f2b-threat-safe-border: #2f6b45;
  --f2b-threat-hero-bg: linear-gradient(120deg, #15170f 0%, #22261a 100%);
  --f2b-threat-hero-danger-bg: linear-gradient(120deg, #2a110c 0%, #46180f 100%);
  --f2b-threat-hero-safe-bg: linear-gradient(120deg, #11211a 0%, #1c3a28 100%);
  --f2b-threat-section-bg: var(--lotr-stone-raised);
  --f2b-threat-card-bg: var(--lotr-stone);
  --f2b-threat-danger-bg: #24100b;
  --f2b-threat-safe-bg: #10201a;
  --f2b-threat-text-title: var(--lotr-gold-pale);
  --f2b-threat-text: var(--lotr-parchment);
  --f2b-threat-text-muted: var(--lotr-parchment-muted);
  --f2b-threat-text-soft: #d6cbb0;
  --f2b-threat-kicker: var(--lotr-gold-bright);
  --f2b-threat-raw-bg: #080907;
  --f2b-threat-raw-text: #d6cbb0;

  --f2b-ui-bg-surface: var(--lotr-stone);
  --f2b-ui-bg-surface-soft: var(--lotr-stone-raised);
  --f2b-ui-bg-surface-muted: var(--lotr-stone-high);
  --f2b-ui-bg-gray-200: #33362a;
  --f2b-ui-bg-gray-300: #3d4032;
  --f2b-ui-bg-gray-600: #55584a;
  --f2b-ui-bg-blue-50: rgba(201, 162, 77, 0.08);
  --f2b-ui-bg-blue-100: rgba(201, 162, 77, 0.14);
  --f2b-ui-bg-blue-500: #a8842e;
  --f2b-ui-bg-blue-600: #9a7a2a;
  --f2b-ui-bg-blue-700: #6e561d;
  --f2b-ui-bg-green-600: #2f5d3a;
  --f2b-ui-bg-red-500: #8e2318;
  --f2b-ui-bg-green-soft: #142419;
  --f2b-ui-bg-amber-100: #33270f;
  --f2b-ui-bg-yellow-soft: #2c2410;
  --f2b-ui-bg-red-soft: #2e130e;
  --f2b-ui-bg-hover: rgba(201, 162, 77, 0.09);
  --f2b-ui-bg-blue-50-hover: rgba(201, 162, 77, 0.16);
  --f2b-ui-bg-blue-500-hover: #b8933a;
  --f2b-ui-bg-blue-600-hover: #a8842e;
  --f2b-ui-bg-blue-700-hover: rgba(201, 162, 77, 0.18);
  --f2b-ui-bg-red-50-hover: #3d1810;
  --f2b-ui-border: rgba(201, 162, 77, 0.26);
  --f2b-ui-text: var(--lotr-parchment);
  --f2b-ui-text-muted: var(--lotr-parchment-muted);
  --f2b-ui-link: var(--lotr-gold-bright);
  --f2b-ui-link-hover: var(--lotr-gold-pale);
  --f2b-ui-text-blue-700: var(--lotr-gold-bright);
  --f2b-ui-text-blue-800: var(--lotr-gold-pale);
  --f2b-ui-text-amber-600: #e6a03c;
  --f2b-ui-text-amber-700: #f0c060;
  --f2b-ui-text-yellow: #f0c060;
  --f2b-ui-text-yellow-800: #f6d98e;
  --f2b-ui-text-red: #f2a48c;
  --f2b-ui-text-green: #a7d9b0;
  --f2b-ui-text-red-600: #f2a48c;
  --f2b-ui-text-green-600: #a7d9b0;
  --f2b-ui-input-bg: #0d0f0b;
  --f2b-ui-input-placeholder: #7c7461;
  --f2b-ui-ring-offset: #0d0f0b;
  --f2b-ui-ring-color: rgba(230, 199, 121, 0.45);
  --f2b-ui-jail-toggle-track-bg: #2a2c22;
  --f2b-ui-jail-toggle-track-border: #4a4632;
  --f2b-ui-jail-toggle-track-checked-bg: #9a7a2a;
  --f2b-ui-jail-toggle-track-checked-border: var(--lotr-gold-bright);
  --f2b-ui-jail-toggle-thumb-bg: #f3ead2;
  --f2b-ui-jail-toggle-thumb-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  --f2b-ui-modal-backdrop: rgba(4, 5, 3, 0.84);
  --f2b-ui-bg-yellow-500: #8f6a1c;
  --f2b-ui-bg-yellow-600-hover: #a67b22;
  --f2b-ui-bg-red-600: #8e2318;
  --f2b-ui-bg-red-700-hover: #a82c1e;
  --f2b-ui-footer-bg: rgba(9, 10, 8, 0.94);
  --f2b-ui-code-text: #e3d9bd;
  --f2b-ui-ws-tooltip-bg: #0e100b;
  --f2b-ui-select2-choice-text: #fff6dc;
  --f2b-ui-select2-arrow: var(--lotr-parchment-muted);
  --f2b-ui-select2-option-text: #ddd2b6;
  --f2b-ui-select2-option-selected-bg: rgba(201, 162, 77, 0.15);
  --f2b-ui-select2-option-selected-text: var(--lotr-gold-bright);
  --f2b-ui-select2-option-highlight-bg: #6e561d;
  --f2b-ui-select2-option-highlight-text: #fff6dc;
  --f2b-ui-theme-badge-warning-bg: #3d2e10;
  --f2b-ui-theme-badge-warning-text: #f6d98e;
  --f2b-ui-theme-badge-warning-hover-bg: #4d3a14;
  --f2b-ui-theme-badge-success-bg: #18321f;
  --f2b-ui-theme-badge-success-text: #bfe3c4;
  --f2b-ui-toast-success-bg: #142419;
  --f2b-ui-toast-info-bg: #1d1a10;
  --f2b-ui-toast-warning-bg: #33270f;

  background-color: var(--lotr-ink);
  background-image:
    radial-gradient(ellipse 80% 45% at 70% 100%, rgba(217, 72, 31, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(6, 7, 5, 0.4) 0%, rgba(6, 7, 5, 0.66) 38%, rgba(6, 7, 5, 0.9) 100%),
    url(images/bg-overlay);
  background-size: auto, auto, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.lotr-mode ::selection {
  background: rgba(201, 162, 77, 0.38);
  color: #fff8e4;
}

body.lotr-mode h1,
body.lotr-mode h2,
body.lotr-mode h3,
body.lotr-mode table th,
body.lotr-mode .select2-results__group {
  font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
}

html:root[data-theme="dark"] body.lotr-mode h1,
html:root[data-theme="dark"] body.lotr-mode h2,
html:root[data-theme="dark"] body.lotr-mode h3 {
  color: var(--lotr-gold-bright) !important;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 18px rgba(230, 199, 121, 0.18);
}

body.lotr-mode h1 {
  letter-spacing: 0.08em;
}

html:root[data-theme="dark"] body.lotr-mode table th {
  color: #cdb47c !important;
  letter-spacing: 0.08em;
  font-weight: 600;
}

html:root[data-theme="dark"] body.lotr-mode thead,
html:root[data-theme="dark"] body.lotr-mode thead tr,
html:root[data-theme="dark"] body.lotr-mode thead th {
  background-color: rgba(201, 162, 77, 0.07) !important;
}

html:root[data-theme="dark"] body.lotr-mode thead {
  border-bottom: 1px solid var(--lotr-gold-line);
}

html:root[data-theme="dark"] body.lotr-mode nav {
  background-color: #0b0c08 !important;
  background-image:
    linear-gradient(90deg, transparent 0%, rgba(243, 226, 176, 0.95) 50%, transparent 100%),
    linear-gradient(180deg, #17140c 0%, #0b0c08 100%) !important;
  background-size: 34% 1px, 100% 100% !important;
  background-position: -40% 100%, 0 0;
  background-repeat: no-repeat !important;
  border-bottom: 1px solid var(--lotr-gold-line);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
  animation: lotr-inscription 9s linear infinite;
}

@keyframes lotr-inscription {
  from { background-position: -40% 100%, 0 0; }
  to { background-position: 140% 100%, 0 0; }
}

html:root[data-theme="dark"] body.lotr-mode nav .flex-shrink-0 > a > img {
  display: none;
}

html:root[data-theme="dark"] body.lotr-mode nav .flex-shrink-0 > a::after {
  content: 'Middle-earth Security';
  font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  white-space: nowrap;
  background: linear-gradient(180deg, #f8e7b0 0%, #e6c779 45%, #a07b29 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(230, 199, 121, 0.3));
}

html:root[data-theme="dark"] body.lotr-mode nav a,
html:root[data-theme="dark"] body.lotr-mode nav button {
  color: #e8dcbc !important;
}

html:root[data-theme="dark"] body.lotr-mode nav a:hover,
html:root[data-theme="dark"] body.lotr-mode nav button:hover {
  color: var(--lotr-gold-pale) !important;
}

html:root[data-theme="dark"] body.lotr-mode .bg-white.rounded-lg:is(.shadow, .shadow-lg),
html:root[data-theme="dark"] body.lotr-mode .modal-content {
  background-color: var(--lotr-stone) !important;
  background-image:
    var(--lotr-corner), var(--lotr-corner), var(--lotr-corner), var(--lotr-corner),
    var(--lotr-corner), var(--lotr-corner), var(--lotr-corner), var(--lotr-corner),
    radial-gradient(ellipse 70% 120px at 50% 0%, rgba(230, 199, 121, 0.07), transparent 100%) !important;
  background-size:
    14px 1px, 1px 14px, 14px 1px, 1px 14px,
    14px 1px, 1px 14px, 14px 1px, 1px 14px,
    100% 100% !important;
  background-position:
    7px 7px, 7px 7px, calc(100% - 7px) 7px, calc(100% - 7px) 7px,
    7px calc(100% - 7px), 7px calc(100% - 7px), calc(100% - 7px) calc(100% - 7px), calc(100% - 7px) calc(100% - 7px),
    0 0 !important;
  background-repeat: no-repeat !important;
  border: 1px solid var(--lotr-gold-line) !important;
  box-shadow:
    inset 0 0 0 3px var(--lotr-stone),
    inset 0 0 0 4px var(--lotr-gold-faint),
    0 22px 48px -24px rgba(0, 0, 0, 0.95) !important;
}

html:root[data-theme="dark"] body.lotr-mode .modal-content > .bg-white,
html:root[data-theme="dark"] body.lotr-mode .modal-content > .bg-gray-50 {
  background-color: transparent !important;
}

html:root[data-theme="dark"] body.lotr-mode .modal-content > .bg-gray-50 {
  border-top: 1px solid var(--lotr-gold-faint);
}

html:root[data-theme="dark"] body.lotr-mode .modal-content h3 {
  padding-bottom: 0.35rem;
  background: linear-gradient(90deg, var(--lotr-gold-line), transparent) left bottom / 100% 1px no-repeat;
}

html:root[data-theme="dark"] body.lotr-mode :is(button, a).bg-blue-500,
html:root[data-theme="dark"] body.lotr-mode :is(button, a).bg-blue-600 {
  background-image: linear-gradient(180deg, #ead08a 0%, #c9a24d 52%, #a07b29 100%) !important;
  color: #1f170a !important;
  border: 1px solid #6e561d !important;
  box-shadow: inset 0 1px 0 rgba(255, 246, 220, 0.5), 0 3px 10px -4px rgba(0, 0, 0, 0.8);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.35);
}

html:root[data-theme="dark"] body.lotr-mode :is(button, a).bg-blue-500:hover,
html:root[data-theme="dark"] body.lotr-mode :is(button, a).bg-blue-600:hover {
  background-image: linear-gradient(180deg, #f3dc9c 0%, #d6b05a 52%, #ad8630 100%) !important;
}

html:root[data-theme="dark"] body.lotr-mode :is(button, a):is(.bg-red-500, .bg-red-600) {
  background-image: linear-gradient(180deg, #c84a2c 0%, #9d2a1b 55%, #7a1d12 100%) !important;
  color: #fff1e6 !important;
  border: 1px solid #5c140c !important;
  box-shadow: inset 0 1px 0 rgba(255, 200, 170, 0.35), 0 3px 10px -4px rgba(0, 0, 0, 0.8);
}

html:root[data-theme="dark"] body.lotr-mode :is(button, a):is(.bg-red-500, .bg-red-600):hover {
  background-image: linear-gradient(180deg, #d9573a 0%, #ad3222 55%, #872214 100%) !important;
}

html:root[data-theme="dark"] body.lotr-mode :is(button, a).bg-green-600 {
  background-image: linear-gradient(180deg, #4f8f5d 0%, #346b41 55%, #24502f 100%) !important;
  color: #f1f8ee !important;
  border: 1px solid #1a3a22 !important;
}

html:root[data-theme="dark"] body.lotr-mode :is(button, a).bg-yellow-500 {
  background-image: linear-gradient(180deg, #c09238 0%, #976f22 55%, #74541a 100%) !important;
  color: #fff6e0 !important;
  border: 1px solid #4f3a12 !important;
}

html:root[data-theme="dark"] body.lotr-mode :is(button, a):is(.bg-blue-500, .bg-blue-600, .bg-red-500, .bg-red-600, .bg-green-600, .bg-yellow-500):disabled {
  filter: grayscale(0.85) brightness(0.7);
  cursor: not-allowed;
}

html:root[data-theme="dark"] body.lotr-mode :is(.border-blue-200, .border-blue-300, .border-blue-400, .border-blue-500, .border-blue-600) {
  border-color: var(--lotr-gold-line) !important;
}

html:root[data-theme="dark"] body.lotr-mode :is(.text-blue-500, .text-blue-600) {
  color: var(--lotr-gold-bright) !important;
}

html:root[data-theme="dark"] body.lotr-mode :is(.bg-gray-800, .bg-gray-900) {
  background-color: #080907 !important;
  border-color: var(--lotr-gold-faint) !important;
}

html:root[data-theme="dark"] body.lotr-mode :is(.border-red-200, .border-red-300, .border-red-400, .border-red-500) {
  border-color: rgba(217, 72, 31, 0.55) !important;
}

html:root[data-theme="dark"] body.lotr-mode .toast {
  background-color: rgba(14, 16, 12, 0.97) !important;
  background-image: linear-gradient(90deg, rgba(201, 162, 77, 0.08), transparent 45%) !important;
  color: var(--lotr-parchment) !important;
  border: 1px solid var(--lotr-gold-line);
  border-left: 3px solid var(--lotr-gold);
  backdrop-filter: blur(4px);
}

html:root[data-theme="dark"] body.lotr-mode .toast-success,
html:root[data-theme="dark"] body.lotr-mode .toast-unban-event {
  border-left-color: var(--lotr-leaf);
  background-image: linear-gradient(90deg, rgba(90, 163, 106, 0.14), transparent 50%) !important;
}

html:root[data-theme="dark"] body.lotr-mode .toast-error,
html:root[data-theme="dark"] body.lotr-mode .toast-ban-event {
  border-left-color: var(--lotr-ember);
  background-image: linear-gradient(90deg, rgba(217, 72, 31, 0.16), transparent 50%) !important;
}

html:root[data-theme="dark"] body.lotr-mode .toast-warning {
  border-left-color: #e6a03c;
  background-image: linear-gradient(90deg, rgba(230, 160, 60, 0.14), transparent 50%) !important;
}

html:root[data-theme="dark"] body.lotr-mode .toast button {
  color: var(--lotr-parchment) !important;
}

html:root[data-theme="dark"] body.lotr-mode #loading-overlay {
  background-color: rgba(11, 12, 9, 0.95) !important;
  background-image:
    linear-gradient(rgba(11, 12, 9, 0.5), rgba(11, 12, 9, 0.72)),
    url(images/loading-overlay);
  background-size: cover;
  background-position: center 40%;
  color: var(--lotr-parchment) !important;
  border: 1px solid var(--lotr-gold-line);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

html:root[data-theme="dark"] body.lotr-mode .animate-spin {
  border-color: var(--lotr-gold-bright) !important;
  border-top-color: transparent !important;
  filter: drop-shadow(0 0 4px rgba(230, 199, 121, 0.7));
}

html:root[data-theme="dark"] body.lotr-mode #restartBanner {
  background-color: #1d1709 !important;
  background-image: linear-gradient(90deg, #2a200b, #4a3a14 50%, #2a200b) !important;
  color: var(--lotr-gold-pale) !important;
  border-bottom: 1px solid var(--lotr-gold-line);
}

html:root[data-theme="dark"] body.lotr-mode #restartBanner :is(button, a) {
  color: #1f170a !important;
}

html:root[data-theme="dark"] body.lotr-mode footer {
  border-top: 1px solid var(--lotr-gold-faint);
}

html:root[data-theme="dark"] body.lotr-mode .lotr-divider {
  position: relative;
  height: 16px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--lotr-gold-line) 18%,
    var(--lotr-gold) 44%,
    transparent 44%,
    transparent 56%,
    var(--lotr-gold) 56%,
    var(--lotr-gold-line) 82%,
    transparent 100%) center / 100% 1px no-repeat;
}

html:root[data-theme="dark"] body.lotr-mode .lotr-divider::after {
  content: '\2726';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1;
  color: var(--lotr-gold-bright);
  text-shadow: 0 0 10px rgba(230, 199, 121, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  html:root[data-theme="dark"] body.lotr-mode nav {
    animation: none;
    background-position: 50% 100%, 0 0;
  }
}

@media (max-width: 640px) {
  html:root[data-theme="dark"] body.lotr-mode {
    background-attachment: scroll;
  }

  body.lotr-mode h1,
  body.lotr-mode h2,
  body.lotr-mode h3 {
    letter-spacing: 0.02em;
  }

  html:root[data-theme="dark"] body.lotr-mode nav .flex-shrink-0 > a::after {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
  }
}
