html {
  /* A rich, deep navy-to-midnight blue */
  background-color: #0a192f;
  background-image: radial-gradient(circle, #112240 0%, #020c1b 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
}

.title-site h1 a {
  color: #fcfaf2;
  font-size: 2rem;
}

/* Add this to the body to layer the pattern over the blue gradient */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1; /* Keep it behind the forum */
  pointer-events: none;
  opacity: 0.15; /* Adjust this to make the pattern more or less subtle */

  /* Elegant Diamond Pattern */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 0l30 30-30 30L0 30z' fill='%23ffffff' fill-opacity='0.1'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

#pun-title {
  margin: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 122px;
  line-height: 80px;

  /* Lighter, rich sapphire blue with a subtle metallic sheen */
  background: linear-gradient(180deg, #1b3a6d 0%, #12284c 100%);

  /* Royal Bottom Border:
     A combination of a solid gold line and a decorative 'glow'
  */
  border-bottom: 4px solid #c2a67a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 2px 0 #9c7d58;

  /* Center the text within the 122px height */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#pun-navlinks {
  position: relative;
  top: 82px;
}

/* Styling the Title Text (usually an H1 inside #pun-title) */
#pun-title h1 {
  color: #fcfaf2;
  font-family: 'Georgia', serif;
  font-variant: small-caps;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin: 0;
}

/* Optional: Add a subtle 'silk' stripe to the header for extra texture */
#pun-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.05);
}

#pun {
  /* Center the forum and add a shadow */
  max-width: 1100px; /* Or your preferred width */
  margin: 40px auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Target the main forum wrap */
#pun {
  border: 1px solid #c2a67a;
  background-color: #fcfaf2; /* Base parchment color */
  padding: 10px;
  /* Subtle inner shadow to mimic paper depth */
  box-shadow: inset 0 0 100px rgba(181, 153, 110, 0.15);
}

#pun-main {
  position: relative;
}

/* The Category Wrapper */
.category {
  margin-bottom: 25px;
  background: #fffdf7;
  /* This creates a gold/bronze outer frame effect */
  border: 1px solid #9c7d58;
  box-shadow:
    0 0 0 3px #fcfaf2,      /* Spacer (matches paper color) */
    0 0 0 4px #c2a67a,      /* Thin secondary frame */
    0 4px 15px rgba(0,0,0,0.1); /* Soft shadow for lift */
  position: relative;
}

/* The Category Header (Title Bar) */
.category h2 {
  /*background: linear-gradient(to right, #0a192f, #112240);*/
  border-bottom: 2px solid #9c7d58;
  color: #fcfaf2 !important;
  text-shadow: 1px 1px 2px #000;
  padding: 8px 15px;
  font-family: 'Georgia', serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  /* Double line divider at the bottom of the title */
  border-bottom: 3px double #9c7d58;

  border-top: 1px solid #c2a67a; /* Gold top "cap" */
  background: #12284c; /* Using the deep blue for consistency */
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Decorative brackets on corners */
.category::before,
.category::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #9c7d58;
  z-index: 10;
}

/* Top Left Bracket */
.category::before {
  top: -6px;
  left: -6px;
  border-right: none;
  border-bottom: none;
}

/* Bottom Right Bracket */
.category::after {
  bottom: -6px;
  right: -6px;
  border-left: none;
  border-top: none;
}

/* Standard PunBB Table Cells */
.pun table td,
.pun table th {
  border-color: rgba(156, 125, 88, 0.2) !important;
}

/* Row Hover effect - subtle paper highlight */
.pun tr:hover td {
  background-color: rgba(244, 236, 216, 0.4) !important;
}

/* Link styling to match the aesthetic */
.pun a {
  color: #7a5d3b;
  text-decoration: none;
  transition: 0.3s;
}

.pun a:hover {
  color: #3d2f21;
  text-decoration: underline;
}

.punbb .container {
  border: none!important;
}

.punbb td {
  border: none!important;
}

.punbb .post h3 {
  border: none!important;
}

#pun-statistics .main-content {
  display: flex;
  justify-content: space-between;
}

.linkst {
  margin-top: 1rem;
}

#pun-navlinks + div {
  margin-top: 95px!important;
}

#pun-navlinks {
  padding: 20px 0;
  border-bottom: 1px double #d1bc9b;
  margin-bottom: 20px;
  height: 55px!important;
}

#pun-navlinks ul {
  display: flex;
  justify-content: center;
  gap: 25px;
}

#pun-navlinks a {
  font-family: 'Georgia', serif;
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #4a3b2a !important;
  text-decoration: none;
}

#pun-navlinks a:hover {
  color: #1b3a6d !important; /* Pulls the blue from the header down */
}

#pun-footer .container {
  text-align: center;
}

/* Episode Header Styles */
.episode-header {
  display: flex;
  gap: 20px;
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 20px;
}

.episode-info {
  flex: 1;
}

.episode-info h2 {
  margin-top: 0;
  font-size: 2em;
  color: #333;
}

.episode-summary {
  margin-bottom: 20px;
  font-size: 1.1em;
  color: #555;
}

.episode-characters h3,
.episode-custom-fields h3 {
  font-size: 1.2em;
  color: #444;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
  margin-bottom: 10px;
}

.character-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.character-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #fff;
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 20px;
}

.character-item img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.character-item a {
  text-decoration: none;
  color: #007bff;
  font-weight: bold;
}

.character-item a:hover {
  text-decoration: underline;
}

.episode-custom-fields ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.episode-custom-fields li {
  margin-bottom: 10px;
}

.episode-image {
  flex-shrink: 0;
  width: 200px;
}

.episode-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Custom Field Display Styles */
.custom-field-display {
  margin-bottom: 10px;
}

.custom-field-display label {
  font-weight: bold;
  color: #555;
  display: block;
  margin-bottom: 3px;
}

.custom-field-display span,
.custom-field-display div {
  font-size: 1em;
  color: #333;
}

.long-text-field div {
  white-space: pre-wrap; /* Preserve line breaks */
  background-color: #fdfdfd;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 4px;
}

.pa-avatar img {
  width: 180px;
  height: 180px;
}

/* Viewtopic Styles */
.post {
  margin-bottom: 20px;
  border: 1px solid #d1bc9b;
  background-color: #fffdf7;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.post h3 {
  background: #e9e3d5;
  border-bottom: 1px solid #d1bc9b;
  padding: 8px 15px;
  margin: 0;
  font-size: 0.9em;
  color: #555;
  display: flex;
  justify-content: space-between;
}

.post h3 span {
  display: flex;
  gap: 10px;
  align-items: center;
}

.post h3 a {
  color: #7a5d3b;
  text-decoration: none;
}

.post h3 a:hover {
  text-decoration: underline;
}

.post-main {
  display: flex;
  padding: 15px;
}

.post-author {
  flex: 0 0 200px;
  border-right: 1px solid #eee;
  padding-right: 15px;
}

.post-author ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-author li {
  margin-bottom: 8px;
  text-align: center;
}

.pa-author {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 10px;
}

.pa-author a {
  color: #1b3a6d;
  text-decoration: none;
}

.pa-avatar img {
  border: 3px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-radius: 4px;
}

.post-body {
  flex: 1;
  padding-left: 15px;
}

.punbb .post-body {
  margin-left: 0 !important;
  border-left: none !important;
}

.post-content {
  font-size: 1.05em;
  line-height: 1.6;
  color: #333;
}

.post-footer {
  background: #fcfaf2;
  border-top: none; /* Removed border */
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-contacts a,
.post-links a {
  color: #7a5d3b;
  text-decoration: none;
  font-size: 0.9em;
  margin-right: 10px;
}

.post-contacts a:hover,
.post-links a:hover {
  text-decoration: underline;
}

.sharelink {
  margin-right: 15px;
}

.post-meta {
  display: flex;
  align-items: center;
}

.punbb .post-links {
  border: none !important;
}

.punbb textarea,
.punbb .longinput input {
  width: 96%;
}

.punbb .post .post-author {
  margin-top: -3.5em;
}

.post-author li {
  margin-bottom: 2em;
}

.punbb .post h3 span {
  margin-left: 21em;
  border: none !important;
}
