@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=Press+Start+2P&display=swap');

html {
  background: url("background1.png") repeat;
  background-size: 64px;
  background-attachment: fixed;
  image-rendering: pixelated;
  cursor: url("cursor1.png"), auto;
  color: white;
  scrollbar-width: thin;
  scrollbar-color: #FBC531 #110A03;
}

/* Overall page container (light blue interior used by template) */
#page {
  background-color: transparent;
  max-width: 1100px;
  margin: 32px auto;
  padding: 24px;
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

/* Title box (centered, taller, with properly aligned border) */
#titlebox {
  font-family: "Press Start 2P", cursive;
  background-color: #96c6e4;
  border: 48px solid transparent;          /* makes space for the frame */
  border-image-source: url("border1.png");
  border-image-slice: 25%;
  border-image-width: 45px;                /* ensures border fully overlaps edges */
  border-image-outset: 12px;                /* small outward push to hug the box */
  border-image-repeat: stretch;
  width: 60%;
  margin: 0 auto 24px auto;
  text-align: center;
  padding: 2px 0;                         /* taller look */
  box-sizing: border-box;
}

#titlebox h1 {
  color: white;
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  margin: 0;
  letter-spacing: 1px;
}


/* Layout container */
#layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

/* Sidebar: width adjusted so buttons keep their intended size */
#sidebar {
  width: 400px; /* restore a comfortable width for 240px buttons and frame */
  background-color: #96c6e4;
  border: 48px solid transparent;
  border-image-source: url("border1.png"); /* makes space for the frame */
  border-image-slice: 25%;
  border-image-width: 32px;                /* ensures border fully overlaps edges */
  border-image-outset: 8px;                /* small outward push to hug the box */
  border-image-repeat: stretch;
  margin: 0 auto 24px auto;
  text-align: left;
  padding: 8px 0; /* slightly reduced vertical padding */
  box-sizing: border-box;
}

/* Sidebar buttons (restored to original template sizing/placement) */
button {
  background: #96c6e4;
  color: white;
  font-family: "Press Start 2P", cursive;
  border-image-source: url("border2.png");
  border-image-slice: 25%;
  border-image-width: 32px;
  border-image-outset: 8px;
  border-image-repeat: stretch;
  border-style: solid;
  padding: 7px;
  width: 240px;
  margin: 8px;
}
button:hover {
  filter: brightness(80%);
}

/* Main content box */
#mainbox {
  flex: 1;
  font-family: "Press Start 2P", cursive;
  background-color: #96c6e4;
  margin: 0 auto 10px auto;
  text-align: center;
  box-sizing: border-box;
}

/* Bottom credits box */
#bottombox {
  font-family: "Press Start 2P", cursive;
  background-color: #96c6e4;
  border-style: solid;
  border: 48px solid transparent; 
  border-image-slice: 25%;
  border-image-width: 45px;
  border-image-outset: 12px;
  border-image-repeat: stretch;
  border-image-source: url("border1.png");
  border-style: solid;
  padding: 18px;              /* taller look */
  box-sizing: border-box;
}

/* Lists */
ul {
  list-style: none;
  padding-left: 0;
}
ul li {
  background: url("bullet1.png") no-repeat left center;
  background-size: 16px;
  padding-left: 20px;
  margin-bottom: 4px;
}

/* Links */
a {
  color: #ffffff;
  text-decoration: none;
  transition: filter 0.3s ease;
}
a:hover {
  filter: brightness(130%);
}

/* ===== BORDER STYLES ===== */

/* Full-frame border — wraps entire box */
.border1 {
  /* ensure the frame has thickness so border-image renders outside the content */
  font-family: "Press Start 2P", cursive;
  border: 48px solid transparent;
  border-image-slice: 25%;
  border-image-width: 32px;
  border-image-outset: 8px;
  border-image-repeat: stretch;
  border-image-source: url("border1.png");
  border-style: solid;
  padding: 24px;
}


/* Standard box border (shorter boxes) */
.border2 {
  font-family: "Press Start 2P", cursive;
  border: 50px solid transparent;
  border-image-slice: 25%;
  border-image-width: 45px;
  border-image-outset: 18px;
  border-image-repeat: stretch;
  border-image-source: url("border2.png");
  border-style: solid;
  padding: 20px;
}

.border3 {
  font-family: "Press Start 2P", cursive;
  border: 48px solid transparent;
  border-image-slice: 25%;
  border-image-width: 25px;
  border-image-outset: px;
  border-image-repeat: stretch;
  border-image-source: url("border3.png");
  border-style: solid;
  padding: 9px;
}

/* Optional no-border box */
.noborder {
  border: none !important;
  border-image: none !important;
  background-color: #96c6e4 !important;
}

.post {
  width: 400px;
  float: left;
  margin: 8px;
}

#page {
  margin: auto;
  width: 1100px; /* widened so larger sidebar + main content fit without wrapping */
}

#container {
  /* restored the original template interior color so boxes/flex keep their previous look */
  background: #630d26;
  float: left;
}

/* Sidebar nav: stack buttons and make them fit the sidebar box tightly */
#sidebar .border2 {
  padding: 8px 6px; /* small horizontal inset so button borders don't collide with frame */
}

#sidebar .border2 nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

#sidebar .border2 nav a {
  display: block;
}

#sidebar .border2 nav button {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
}

/* note: the sidebar is defined earlier; removed duplicated/erroneous override */

/* Responsive layout */
@media (max-width: 900px) {
  #layout-wrapper {
    flex-direction: column;
    align-items: center;
  }
  #sidebar,
  #mainbox {
    width: 90%;
  }
}

/* ===== Clean CommentBox Popup Fix ===== */

/* Sidebar stays under overlays */
#sidebar {
  position: relative;
  z-index: 1;
}

/* Comment section stays where you placed it */
.commentbox {
  position: relative;
  z-index: 10;
}

/* The popup overlay (login screen) appears above everything */
.commentbox iframe[src*="commentbox.io/widget/overlay"] {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 999999 !important;
  isolation: isolate !important;
}

/* Ensure sidebar grows to fit its contents (including CommentBox) */
#sidebar {
  display: block;
  height: auto;
  overflow: visible !important;
}

/* Ensure the embedded iframe expands the container */
#sidebar iframe {
  display: block;
  width: 100% !important;
  height: auto !important;
  min-height: 400px; /* Adjust this if it's too short */
}

