html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background-color: #0c1a0c;
  background-image: var(--themebackground);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
  background-attachment: fixed;
}

* {
  box-sizing: border-box;
}

.header {
  width: 100%;
  height: 90px;
  background-color: rebeccapurple;
  flex-shrink: 0;

  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;       
  padding: 0 25px;

    background-image: 
    linear-gradient(rgba(0, 0, 0, 0.15) 1px, transparent 1px),
    var(--headerbanner); 
  
  background-size: 100% 3px, cover; 
  background-repeat: repeat, no-repeat;
  background-position: center;
}

.headerleftslot {
  width: auto; 
  height: 100%; 
  
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  max-width: 30%; 
}

.chibiavatar {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.headercenterslot {
  flex: 1;
  text-align: center;
}

.headertitle {
  color: #ffffff;
  font-family: 'Arial Black', sans-serif;
  font-size: 2.5rem;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 2px 2px 0px #000000;
}

.headerrightslot {
  width: auto; 
  height: 100%; 
  
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  max-width: 30%; 
}

.badgegif {
  width: 180px;
  height: 90px; 
  
  max-height: 90px; 
  align-self: center; 
  flex-shrink: 0; 
  display: block;
  object-fit: fill;
}

.mastercontainer {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  width: 80%;
  min-height: 0;
  margin: 0 auto;
  align-items: stretch;
  gap: 10px;
}

.pagecontents {
  flex: 1 1 auto;
  min-height: 100%;
  background-image: var(--content-bg-gradient);
  color: var(--content-text-color);
}

.navigationcontainer::before{
  content: "";
  position: absolute;
  z-index: -1;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;

  background-image: 
    var(--nav-layer-pattern), 
    linear-gradient(to bottom, rgba(18, 34, 18, 0.7), rgba(8, 16, 8, 0.9));
    
  background-size: 64px 64px, cover;
  background-repeat: repeat, no-repeat;
  background-blend-mode: multiply; 
}

.navigationcontainer {
  display: flex;
  flex-direction: column;
  width: 25ch;     
  flex-shrink: 0;
  padding: 25px 15px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background-image: var(--navlayertop), var(--navlayerbase);
  background-size: 100% 100%, cover;
  background-repeat: no-repeat, no-repeat;
  background-position: top left, center;
}

.navigationcontainer::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background-image: 
    var(--navlayerpattern),
   var(--navlayerbase);
  background-size: 64px 32px, cover;
  background-repeat: repeat, no-repeat;
  background-blend-mode: overlay; 
}
  
.navlogicmaster {
  width: 100%;
  text-align: center;
}

.emoteimage{
  width: 100%;
  height: auto;
  max-height: 200px; 
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.pagecontents {
  flex: 1;          
  background-image: var(--content-bg-gradient); 
  color: var(--content-text-color);
}

.footer {
  width: 100%;
  height: 60px;
  background-color: #1a1a1a;
  border-top: 2px solid var(--bordercolor);
  flex-shrink: 0;

  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;

  position: relative;
  z-index: 2;
}

.footerleftslot {
  width: 150px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 0;
  margin-left: 0;
}

.thememenuwrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 150px;
  min-width: 150px;
  margin: 0;
}

.themedropdowncontainer {
  position: absolute;
  bottom: 45px;
  left: 0;
  width: min(320px, calc(100vw - 24px));
  max-width: 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.themedropdowncontainer.menu-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.themetogglebtn {
  width: 38px;
  height: 38px;
  margin-left: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bordercolor);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.themetogglelabel {
  color: #888888;
  font-family: monospace;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-left: 0;
}

.themeoption {
  height: 44px;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: overlay;

  border: 2px solid var(--bordercolor);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);

  transition: all 0.15s ease-in-out;
}

.themeoption:hover {
   border: 2px solid var(--activebordercolor);
  transform: translateX(4px);
}

.themeoption-text {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 1px 1px 0px #0b140b;
}

.themeoptionsymbolimg {

  height: 32px; 
  width: auto; 
  
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.themetogglebtn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--activebordercolor);
  transform: scale(1.05); 
}

.themebtnicon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footercenterslot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.copyrighttext {
  color: #888888;
  font-family: monospace;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.socialbadgeribbon {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.socialiconlink img {
  width: 16px;
  height: 16px;
  display: block;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.socialiconlink img:hover {
  opacity: 1;
}

.footerrightslot {
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.footerlogo {
  height: auto;
  width: 58px;
  object-fit: contain;
}

.mobilenavtoggle {
  display: none;
  width: 50px;
  height: 50px;
  user-select: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10001;
}


/* ==========================================================================
   MOBILE COMPATABILITY
   ========================================================================== */

@media (max-width: 768px), (hover: none) {

  .header {
    height: auto; 
    min-height: 90px;
    gap: 10px;
    display: flex;
    align-items: center;
  }

  .headertitle {
    font-size: 1.4rem;
    letter-spacing: 1px;
    word-break: break-word; 
  }

  .headerleftslot, 
  .headerrightslot {
    flex: 0 0 auto;
    width: auto;
    max-width: 25%;
    min-width: 50px;
    display: flex;
    align-items: center;
  }

  .chibiavatar,
  .badgegif {
    width: 100%;
    height: auto;
    max-height: 70px;
    object-fit: contain;
  }

  .mastercontainer {
    display: flex;
    flex-direction: column;
    width: 80%;       
    margin: 0 auto;
    position: relative;
  }


  .pagecontents {
    width: 100%;
    min-height: calc(100vh - 150px);

  }

 .navigationcontainer {
    position: fixed;   
    top: 0;            
    bottom: 0;         
    left: 0;
    
    width: 290px;
    max-width: 80%;    
    background-color: green;
    z-index: 9999;     
    overflow-y: auto;  
    -webkit-overflow-scrolling: touch; 
    display: flex;
    flex-direction: column;
    transform: translateX(-100%); 
    transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
    visibility: hidden;
  }

  .navigationcontainer.nav-open {
    visibility: visible;
    transform: translateX(0);
  }

  .mobilenavtoggle {
    display: block; 
    position: fixed;   
    bottom: 20px;      
    left: 20px;        
    z-index: 10000;
    padding: 13px 17px;
    background-color: #121a12; 
    color: #ffffff;
    border: 2px solid var(--bordercolor);
    border-radius: 50%;
    font-family: monospace;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
    transition: transform 0.3s ease-in-out; 
  }

  .mobilenavtoggle.nav-open {
    transform: translateX(290px); 
    border: 2px solid var(--activebordercolor);
  }

  .footer {
    height: auto;
    min-height: 60px;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 20px 15px;
  }

 .footerleftslot {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .thememenuwrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    bottom: auto;
    left: auto;
  }

  .themedropdowncontainer {
    left: 50%;
    right: auto;
    bottom: 50px;
    width: min(260px, calc(100vw - 28px));
    min-width: 0;
    max-width: calc(100vw - 28px);
    transform: translateX(-50%) translateY(10px);
  }

  .themedropdowncontainer.menu-active {
    transform: translateX(-50%) translateY(0);
  }

.footercenterslot,
  .footerrightslot {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}
