/* Bronze bevels and fine, dark grain sampled from the Members preview. */
:root {
  --forged-grain: url('/images/members-forged-preview-texture.png?v=10');
  --forged-edge: rgb(112 82 63 / 72%);
  --forged-inset: rgb(79 57 46 / 72%);
  --forged-rim: linear-gradient(90deg, transparent,
    rgb(128 80 49 / 72%) 22%, rgb(168 112 71 / 72%) 50%,
    rgb(128 80 49 / 72%) 78%, transparent);
  --forged-panel: linear-gradient(155deg, #29211d, #161413 380px);
  --forged-card: linear-gradient(145deg, #2b2521, #191715 62%);
  --forged-recess: var(--forged-grain), linear-gradient(180deg, #241d19, #141211);
}

/* Page frames and large panels. Keep component spacing and overflow rules. */
html body :is(
  .main-content, .main-shell, .search-main, .home-hero, .forum-hero, .category-hero,
  .thread-hero, .messages-hero, .messages-shell, .admin-hero, .profile-card,
  .landing-card, .gallery-section, .panel, .box, .form-card, .search-panel,
  .term-section, .policy-section, .explorer-wrap, .hbh-login-dialog, .about-page,
  .forged-error
) {
  background:
    var(--forged-rim) center top / 94% 1px no-repeat,
    var(--forged-grain),
    var(--forged-panel);
  border-color: var(--forged-edge);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px #18110d, inset 0 0 0 2px var(--forged-inset),
    0 10px 24px #0006;
}

/* Smaller surfaces retain their status and interaction colors below. */
html body :is(
  .card, .stats-card, .hero-metric, .stat-box, .video-card, .listing-card, .server-box,
  .post, .reply-wrap, .about-card, .stream-card, .activity-card, .sig-box, .n-card,
  .admin-stat-card, .site-setting-card, .storage-card, .mobile-file-card, .choice-card,
  .guide-panel, .guide-box, .info-box, .role-box, .example-card, .map-card, .event-card,
  .intro-box, .prep-box, .goal-box, .mini-panel, .feature-box, .guide-card, .side-box,
  .access-panel, .level-box, .type-box, .nation-box, .track-section, .agent-card
):not(:where(.member-card, .active, .selected, .highlight, .is-number-one, .unread, .is-unread)) {
  background:
    var(--forged-rim) center top / 88% 1px no-repeat,
    var(--forged-grain) 47px 23px,
    var(--forged-card);
  border-color: rgb(98 70 53 / 72%);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px #16110e, inset 0 0 0 2px rgb(64 46 37 / 72%),
    0 6px 16px #0005;
}

html body :is(.video-card, .listing-card, .server-box, .map-card, .choice-card, .admin-stat-card):hover {
  border-color: rgb(171 116 79 / 80%);
}

html body .video-current-meta {
  border-color: rgb(244 162 97 / 20%);
}

/* Recessed navigation and table surfaces. */
html body :is(.hbh-site-nav, .account-pod, .gallery-pagination) {
  background: var(--forged-recess);
  border-color: var(--forged-edge);
  box-shadow: inset 0 1px rgb(112 74 52 / 72%), inset 0 -1px rgb(79 56 44 / 72%), 0 4px 14px #0005;
}

html body :is(.forum-table, .explorer-table) thead th {
  background: var(--forged-grain), linear-gradient(180deg, #362820, #211a16);
  border-bottom-color: #75543d;
}

html body :is(.forum-table, .explorer-table) tbody td {
  border-bottom-color: #513a2d;
}

/* The existing Members design has its own card insets and action bars. */
html body .member-card {
  border-radius: 5px;
}

.forged-error {
  color: #eee;
  margin: clamp(16px, 8vw, 90px) auto;
  max-width: 520px;
  padding: 24px;
  text-align: center;
  font: 1rem/1.6 Arial, sans-serif;
}

.forged-error a {
  color: #ffc184;
}

@media (max-width: 600px) {
  html body :is(.main-content, .main-shell, .search-main) {
    border-radius: 0;
    box-shadow: inset 0 1px var(--forged-inset);
  }
}
