/* CSS for the main master container */
#main-master-container {
  width: 100%;             /* 1. Allows it to shrink on mobile */
  max-width: 950px;        /* 2. Keeps it from getting too wide on desktop */
  box-sizing: border-box;  /* 3. Includes padding and borders in the total width */
  height: auto;
  margin: 20px auto;
  padding: 15px;
  color: #000000;
  background-color: #000000;
  border: 5px double #969696;
  box-shadow: 4px 4px 0px #000000;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

html, body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.pagedoll {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 9999;
  pointer-events: none;
}

/* Desktop size */
.pagedoll img {
  width: 150px;
  height: auto;
}

/* Mobile size (Screens smaller than 600px) */
@media (max-width: 600px) {
  .pagedoll img {
    width: 80px; /* Makes the image smaller on phones */
  }
}

/* Extra small screens (Screens smaller than 400px) */
@media (max-width: 400px) {
  .pagedoll {
    display: none; /* Hides it completely so it doesn't block text */
  }
}
/* Cyber Retro Navigation Bar Styles */
.cyber-nav-container {
  display: flex;
   justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
  background-color: #000000;
  margin-bottom: 20px;
}
.cyber-nav-btn {
  display: inline-block;
  padding: 6px 16px;
  background-color: #000000;
  color: #CCFF00 !important;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none !important;
  border: 2px outset #ff00ff;
}
.cyber-nav-btn:hover {
  color: #00ffff !important;
  background-color: #111111;
  border-style: inset;
}
 .marquee {
            color: white;
            margin-bottom: 12px;
            font-family: Courier;
 }
/* TWO COLUMNS LAYOUT SYSTEM */
.webpage-layout {
  display: grid; /* Changed from flex to grid to match grid-template-columns */
  grid-template-columns: 220px 1fr; /* Left column 220px wide, right fills the rest */
  align-items: start; /* 重なり・突き抜け防止：stretchからstartに変更（中身の高さに合わせる） */
  gap: 15px;
  margin-bottom: 20px; /* Pushes the footer down if one is placed below this layout */
}

/* SIDEBAR STYLING */
.left-sidebar, .right-sidebar {
  color: #000000;
  background-color: #E0E0E0;
  border: 2px solid #000000;
  padding: 15px;
  box-shadow: inset 2px 2px 0px #ffffff, inset -2px -2px 0px #808080;
  display: flex;
  flex-direction: column;

}
.sidebar-widget {
  margin-bottom: 5px;
}
.sidebar-widget h3 {
  background-color: #000000;
  color: #ffffff;
  padding: 4px;
  margin: 0 0 10px 0;
  font-size: 14px;
  text-align: center;
  overflow-y: auto; /* Adds a vertical scrollbar if text overflows down */
  overflow-wrap: break-word; /* Breaks long words so they fit */
}

h2 {
  font-family: "Courier New", monospace;
  font-size: 25px;
  color: #000000;
  font-weight: bold;
}
h3 {
  font-family: "Courier New", monospace;
  font-size: 18px;
  color: #000000;
  font-weight: bold;
}
img {
  max-width: 100%;
  height: auto;
  
}

/* Content block layout for profile boxes */
.box {
  height: auto; /* 修正：100% から auto に変更。フッターを突き抜けないようにします */
  min-height: 150px; /* 必要であれば最小限の不自然じゃない高さを確保 */
  box-sizing: border-box;
  display: flex;
  color: #000000;
  text-align: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  border: 2px outset #FFFFFF;
  background-color: #C4C4C4;
  overflow-y: auto; /* Adds a vertical scrollbar if text overflows down */
  overflow-wrap: break-word; /* Breaks long words so they fit */
}
.box-content {
  flex-grow: 1;
  text-align: center;
  overflow-y: auto; /* Adds a vertical scrollbar if text overflows down */
  overflow-wrap: break-word; /* Breaks long words so they fit */
  width: 100%; /* Locks the width */
}
.left-img, .right-img {
  width: 150px;
  height: auto;
}

/* Content block layout for small profile boxes */
.sbox {
  height: 120px;
  min-height: 80px; 
  box-sizing: border-box;
  display: flex;
  text-align: center;
  color: #000000;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  border: 2px outset #FFFFFF;
  background-color: #C4C4C4;
  overflow-wrap: break-word; /* Breaks long words so they fit */
  font-size: 16px;
    overflow-y: auto;

}
.sbox-content {
  flex: 1;
  overflow-y: auto; /* Adds a vertical scrollbar if text overflows down */
  overflow-wrap: break-word; /* Breaks long words so they fit */
  width: 300px; /* Locks the width */
  text-align: center;
  height: auto; /* 修正：固定80pxから自動に追従 */
}

.sbox2 {
  height: 150px;
  min-height: 80px; 
  box-sizing: border-box;
  display: flex;
  color: #000000;
  align-items: center;
  gap: 20px;
  text-align: center;
  margin-bottom: 20px;
  padding: 15px;
  border: 2px outset #FFFFFF;
  background-color: #C4C4C4;
  overflow-wrap: break-word; /* Breaks long words so they fit */
  font-size: 16px;
    overflow-y: auto;

}
.sbox-content {
  flex: 1;
  overflow-y: auto; /* Adds a vertical scrollbar if text overflows down */
  overflow-wrap: break-word; /* Breaks long words so they fit */
  width: 300px; /* Locks the width */
  text-align: center;
  height: auto; /* 修正：固定80pxから自動に追従 */
}
.sleft-img, .sright-img {
  width: 100px;
  height: auto;
}

/* Pagedoll CSS */
.pagedoll {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 9999;
  pointer-events: none;
}
.pagedoll img {
  width: 150px;
  height: auto;
}

@media (max-width: 600px) {
  .pagedoll img {
    width: 80px; /* Makes the image smaller on phones */
  }
}

@media (max-width: 400px) {
  .pagedoll {
    display: none; /* Hides it completely so it doesn't block text */
  }
}
/* Pagedoll 2 CSS */
.pagedoll2 {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 0;
  pointer-events: none;
}
.pagedoll2 img {
  width: 150px;
  height: auto;
}

/* Responsive adjustment for small screens */
@media only screen and (max-width: 768px) {
  .webpage-layout {
display: grid;
  /* 左に200px、真ん中を広く、右に200pxの3カラムにする例 */
  grid-template-columns: 200px 1fr 200px; 
  gap: 15px;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh; /* vh means viewport height */
}

/* Force images to shrink and stay inside the h2 container */
.sidebar img, #sidebar img, aside img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  border: 5px inset;
}