/* ======= GLOBAL STYLES ======= */
@font-face {
  font-family: 'Minecraftia-Regular';
  src: url('fonts/Minecraftia-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Minecraft-ten';
  src: url('fonts/MinecraftTen-VGORe.ttf') format('truetype');
}


* {
  box-sizing: border-box;
}

 html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    position: relative;
    overflow: visible;
    background: rgba(255, 255, 255, 0); /* fallback */
    font-family: 'Minecraftia-Regular', sans-serif;
    -webkit-overflow-scrolling: touch;

  }
  


.event-section,
.map-section,
.countdown,
.calendar-section {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.page-loaded .event-section,
.page-loaded .map-section,
.page-loaded .countdown,
.page-loaded .calendar-section {
  opacity: 1;
}



.page-container {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

  canvas#portal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -999; /* ensures it's behind everything */
    width: 100vw;
    height: 100vh;
    display: block;
    pointer-events: none; /* ensures clicks go through */
  }




/* ======= HEADER ======= */
header {
  background-image: url("images/glass_256.png");
  background-position-y: -12.5vh;
  background-repeat: repeat;
  background-size: 12.5vh;
  image-rendering: pixelated;
  height: 25vh;
  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;      /* vertical centering */
  justify-content: center;  /* horizontal centering */
  text-align: center;
  font-family: 'Minecraft-ten';
  width: 100%;              /* ensure full width */
}



.outside {
  background-image: url("images/minecraftlandscape02.PNG");
  background-size:100vw;
  background-position-y: -5vh ;

  background-attachment: fixed;
  image-rendering:optimizeSpeed;
  margin: 0;
}

.title {
  font-size: 12vh;
  margin: 0;
  color: white;
  text-shadow: 2px 2px 8px black;
  padding-top: 2vh;
}





.button-background {
  background-image: url(images/spruce_256.png);
  background-size: auto;
  image-rendering: pixelated;
  background-repeat: repeat;

  position: sticky;
  top: 0;
  background-color: #1a1a1a;
  background-size: 7vh;
  height: 7vh;

  z-index: 999; /* ← Add this */
}


.nav-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3vw;
  flex-wrap: nowrap;
  padding-top: 1.2vh;
}

.nav-btn {
  font-family: 'Minecraftia-Regular';
  padding: 0.5em 1em;
  padding-bottom: 0.07em;
  color: #fff;
  text-shadow: 2px 2px rgb(48, 48, 48);
  text-decoration: none;
  text-align: center;

  background-color: #707070;
  background-image: url("images/bgbtn.png");
  image-rendering: pixelated;
  background-size: cover;
  background-repeat: no-repeat;
  
  border-top: 2px solid rgba(255, 255, 255, 0.493);
  border-left: 2px solid rgba(255, 255, 255, 0.493);
  border-right: 2px solid rgba(0, 0, 0, 0.493);
  border-bottom: 2px solid rgba(0, 0, 0, 0.493);
  box-shadow: none;
  transition: none;

  display: inline-block;
  justify-content: center;
  align-items: center;

  cursor: pointer;
  font-size: 1.5vh;

  width: 15vh;
  height: 4.5vh;
}

.nav-btn:hover {
  box-shadow: inset 0 0 0 1000px rgba(77, 110, 255, 0.432);
  border-top: 2px solid rgba(211, 222, 255, 0.493);
  border-left: 2px solid rgba(211, 222, 255, 0.493);
  border-right: 2px solid rgba(0, 0, 0, 0.493);
  border-bottom: 2px solid rgba(0, 0, 0, 0.493);
  color: rgb(253, 255, 161);
  background-color: transparent;
}

.nav-btn:active {
  box-shadow: inset 0 0 0 1000px rgba(47, 85, 252, 0.432);
  border-bottom: 2px solid rgba(211, 222, 255, 0.493);
  border-right: 2px solid rgba(211, 222, 255, 0.493);
  border-left: 2px solid rgba(0, 0, 0, 0.493);
  border-top: 2px solid rgba(0, 0, 0, 0.493);
  color: rgb(241, 235, 144);
  position: relative;
  top: 2px;
  left: 2px;
  background-color: transparent;
}





/* ======= EVENTS SECTION ======= */

.event-section {

width: 100%;
height: auto;
margin: 0 auto;
display: flex;
justify-content: center;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;

position: relative;
z-index: 0;

}


.event-content {
  display: flex;
  flex-wrap: nowrap;
  
  max-width: 1400px;

  width: 100%;
  height: auto;
  justify-content: center;
  align-items: stretch; /* Ensures both image and text line up */
  gap: 2rem;

  margin: 1vh 2vh;
  padding: 1vh 2vh;
}


/* Image box */
.event-box {
  width: 50%;
  height: 100%;

  display: flex;
  justify-content: center;
  flex-direction: column;
  
  align-self: flex-start;

  box-sizing: border-box;
  overflow: hidden;

}

.event-box img {
  width: 80%; /* adjust this to scale event image */

  height: auto;
  object-fit: contain;
  display: block;
  align-self: center;
  border: 2px solid rgb(255, 255, 255);
  border-radius: 5px;

}



.event-info {
  container-type: inline-size;
  container-name: eventinfo;

  flex: 1 1 40%;
  width: 50%;
  height: 100%;

  
  font-size: 10px;
  line-height: 2;

  color: black;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  

  text-align: left;

  opacity: 0;
  transition: opacity 0.2s ease-in;

  position: relative;   /* create stacking context */
  z-index: 1;           /* below the nav */
}

.event-info.scaled {
  opacity: 1;
}

.section-title {
  align-items: flex-end;  /* aligns content to the bottom */
  font-size: 7cqw;
  text-decoration: underline;
  margin: 0;
  font-family: 'Minecraft-ten';
  text-align: left;
  padding: 0;
  color: white;
}

#event-description {
  margin-top: 0;    /* reduce top margin */
  /* other styles you have */
}




/* WHO'S ONLINE SECTION */

/* Collapsed state of the online section */
/* --- TOP BAR STYLE --- */
.online-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 12vh; /* full screen width */
  height: 7vh; /* collapsed height */
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* ✅ Safari-specific */
  border: 2px solid black;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: row; /* horizontal bar */
  align-items: center;
  padding: 0 1vh;
  overflow: hidden;
  transition: height 0.4s ease, width 0.4s ease;
  z-index: 1000;
}

/* Expanded on hover */
.online-section:hover,
.online-section.active {
  width: 100vw;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* ✅ Safari-specific */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  overflow: visible;
}

/* --- TITLE --- */
.online-title {
  font-size: 2.5vh;
  margin: auto;
  font-family: 'Minecraft-ten';
  text-align: center;

  color: white;
  text-shadow:2px 2px 2px black;

  opacity: 1;
  transition: opacity 0.4s ease 0.2s;
}

.online-section:hover .online-title,
.online-section.active .online-title  {
  opacity: 1;
}

/* --- PLAYER CONTAINER ROW --- */
.online-box {
  display: flex;
  flex-direction: row; /* row of players */
  align-items: center;
  justify-content: flex-start;
  gap: 1vh;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease 0.2s;
  pointer-events: none;
}

.online-section:hover .online-box,
.online-section.active .online-box  {
  opacity: 1;
  pointer-events: auto;
}

/* --- PLAYER AVATAR CONTAINERS --- */
.player-container {
  position: relative;
  display: inline-block;
  image-rendering: pixelated;
  height: 5vh;
  width: 5vh;
  margin: 0 0.5vh;
}

/* Player head image border on hover */
.player-container img {
  border: 2px solid transparent;
  transition: border 0.1s ease;
}

.player-container:hover img {
  border: 0.5vh solid #00ff44;
}

/* --- TOOLTIP NAME BOX --- */
.player-name-box {
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 3px 6px;
  padding-top: 10px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
  white-space: nowrap;
}

/* Tooltip arrow (top of tooltip) */
.tooltip-tag {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #333;
}

/* Show tooltip on hover */
.player-container:hover .player-name-box {
  opacity: 1;
  visibility: visible;
}

/* --- NO PLAYERS MESSAGE --- */
.no-players-msg {
  font-size: 2vh;
  font-family: 'Minecraftia-Regular';
  color: #ff0000;
  text-shadow: 0px 0px 15px rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.online-box:has(.no-players-msg) {
  justify-content: center;
}
/*------------------------------------------------------*/









.scroll-guard {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: auto;      /* captures touch, allowing scroll */
  background: transparent;
  touch-action: pan-y;       /* allow vertical scroll */
}

/* Hide scroll-guard when map is active */
.map-container.active .scroll-guard {
  display: none;
}



/* LIVE MAP SECTION */
.map-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-repeat: repeat;
  background-size: 100px; /* adjust as needed */
  image-rendering: pixelated;
  text-align: center;
  padding: 2rem 0;
}




/* MAP TITLE */
.map-header {
  display: flex;
  align-items: center;
  justify-content: center; /* center the title */
  position: relative;
  width: 100%;
  padding: 0 2rem;
}

.live-map-title {
  font-size: 6vh;
  color: red;

  text-shadow:
    -1px -1px 0 white,
     1px -1px 0 white,
    -1px  1px 0 white,
     1px  1px 0 white;

  margin: 0; /* remove default margins for better centering */
  font-family: 'Minecraft-ten';
  text-align: center;
  flex: 1; /* allow the title to take full available space */
}







/* MAP BUTTON */
.map-toggle-button {
  position: absolute;
  right: 0; /* align left with padding */
  font-size: 2rem;
  font-weight: bold;
  background-color: red;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.4s, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25em 0.5em;
}

.map-toggle-button:hover {
  transform: scale(1.2); /* Expand to 120% size on hover */
}

.map-toggle-button.open {
  background-color: green;
}

/* Animate rotation ONLY on the symbol */
.map-toggle-button .symbol {
  display: inline-block;
  transition: transform 0.4s;
}

.map-toggle-button.open .symbol {
  transform: rotate(180deg);
}






/* THE MAP */

/* Animate container collapsing */
.map-container {
  position: relative; /* needed for absolute positioning of overlay */
  width: 100%;
  height: 50vh;
  border: 4px solid red;
  margin-top: 1rem;
  margin-bottom: 4rem;
  border-radius: 10px;
  overflow: hidden;
  transition:
    height 1s ease,
    opacity 1s ease,
    border-color 0.3s ease,
    margin-bottom 2s ease; /* add margin-bottom transition */
  opacity: 1;
  display: block;
}

.map-container.closed {
  height: 0;
  opacity: 0;
  pointer-events: none;
  margin-bottom: 0; /* collapse margin bottom */
}


.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  pointer-events: auto; /* always on, since scroll is handled by guard */
}


.map-container.active {
  border-color: rgb(0, 255, 0);
}

.map-container.active iframe {
  pointer-events: auto;       /* Enable interaction once activated */
  touch-action: auto;         /* Allow gestures inside iframe */
}




.map-interact-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-family: 'Minecraftia-Regular', monospace, sans-serif;
  font-size: 1.8rem;
  padding: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  border-radius: 0.5rem;
  pointer-events: none; /* allow clicks to pass through */
  user-select: none;
  z-index: 10;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

/* Hide overlay when map is active */
.map-container.active .map-interact-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}



/* Countdown Timer */

.countdown {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-family: 'Minecraft-ten';
  margin-top: 3vh;
  margin-bottom: 3vh;

}

.time-box {
  background: #3f3f3f63;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); /* ✅ Safari-specific */
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  width: 15%;
  color: white;
}

.number {
  /* clamp(min, preferred, max) */
  font-size: clamp(2rem, 10vw, 5rem); /* scales up to 5rem */
  font-weight: bold;
  display: block;
}

.label {
  font-size: clamp(0.5rem, 3vw, 2rem); /* scales up to 3rem */
  font-weight: 200;
}


.label.days {
  color: #ff5555;
}

.label.hours {
  color: #ffaa00;
}

.label.minutes {
  color: #00cc66;
}

.label.seconds {
  color: #3399ff;
}


#calendar-section {
  margin-top: 0;          /* space above it */
  text-align: center;          /* center the button horizontally */
}

#calendar-section a#download-ics {
  background-color: #3f3f3f63;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: white;
  padding: 0.6rem 1.2rem;
  padding-top: clamp(0.5rem, 2vw, 2rem);
  font-family: 'Minecraftia-Regular';
  font-size: clamp(0.5rem, 2vw, 2rem); /* scales up to 3rem */
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  vertical-align: bottom;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}


#calendar-section a#download-ics:hover {
  background-color: #5f5f5f80;         /* slightly brighter on hover */
  transform: scale(1.05);              /* subtle grow on hover */
  cursor: pointer;
}



@media (max-width: 1500px) {

  .map-toggle-button {
  right: 1.5rem;
}
  
}


@media (max-width: 1550px) {
 
  .online-section{
    top:unset;
    bottom: 0;
    
    width: 11vw; /* full screen width */
    height: 6vw; /* collapsed height */
    padding: 0 1vw;
  
  }

  .online-title{
    font-size: 2.25vw;
  }

  .no-players-msg {
  font-size: 1.8vw;
}

.player-name-box {
    top: auto;
    bottom: 120%; /* Move tooltip above the player */
  }
  
  .tooltip-tag {
    top: auto;
    bottom: -6px; /* Position the arrow below the tooltip */
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333; /* Flip the arrow to point down */
    border-bottom: none;
  }
  
}

/* Make events stack vertically on smaller screens */
@media (max-width: 996px) {
  .event-content {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2vh 4vw;
  }

  .event-box {
    width: 100%;
    align-items: center;
  }

  .event-box img{
    width: 100%;
  }

  .event-info {
    width: 100%;

    align-items: center;
    text-align: center;
    padding: 1rem;
    
    font-size: 3.5vw;

    opacity: 1;

  }

  .section-title {
    text-align: center;
    font-size: 7vw;
  }

  #event-description {
    line-height: 1.6;
  }
  


/*--- WHO'S ONLINE SECTION---*/

  .online-box{
    gap: 0.5vw;
  }

  .no-players-msg {
    font-size: 2.5vw;
    margin-bottom: -0.5vw;
  }

  .player-name-box {
    top: auto;
    bottom: 120%; /* Move tooltip above the player */
  }
  
  .tooltip-tag {
    top: auto;
    bottom: -6px; /* Position the arrow below the tooltip */
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333; /* Flip the arrow to point down */
    border-bottom: none;
  }

  .player-container {
  height: 4vh;
  width: 4vh;
  margin-top: 0;
}

.player-container:hover img {
  border: 0.5vw solid #00ff44; /* Change this to whatever color you'd like */
}

/*---------------------------------*/

.outside {

  background-position-y: 0vh ;
}


.button-background{
  background-size: 10vw;
  height: 15vw;
}

.nav-buttons {
  gap: 0.8vw;
  padding-top: 3.5vw;
}

  .nav-btn {
    padding: 0.7em 1em;
    
    font-size: 2.4vw;

    height: 8vw;
    width: 19vw;
    
  }
  

  /*Mobile Map*/


  .live-map-title {
    font-size: 6vw;
  }

  .map-container {
  margin-bottom: 6vw; /* or whatever looks best */
}

.time-box {
  width: 20vw;
}

.number {
  font-size: 8vw;
}

.label {
  font-size: 3vw;
}


#calendar-section a#download-ics {
  font-size: 3vw;
  padding-top:3vw ;
}


.map-toggle-button {
  right: 1.5rem;
}

}








/* Make events stack vertically on EVEN SMALLER screens */
@media (max-width: 712px) {


.title{
  font-size: 20vw;
}

header {
  background-position-y: -25vw ;
  background-size: 25vw;
  height: 50vw;
  z-index: 1;
}

.outside {
  background-position-y: 1vw ;
}




/*--- WHO'S ONLINE SECTION---*/
.online-section {
  padding: 0vw;
  width: 25vw;
  height: 15vw;
}


.online-title{
  font-size: 5vw;
  margin-top: 2vw;
  padding-left: 1.5vw;
}


  .online-box{
    gap: 0.3vw;
  }

  .no-players-msg {
    font-size: 3.5vw;
    margin-bottom: unset;
  }

  .player-container {
    height: 9vw;
    width: 9vw;
    margin-top: 0;
  }

.player-container:hover img {
  border: 0.6vw solid #00ff44; /* Change this to whatever color you'd like */
}

/*--------------------------*/


.nav-btn {
  width: 12vw;
  height: 12vw;
  padding: 0;
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn span {
  display: none;
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-size: 9vw;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  filter: brightness(1); /* default (white) */
  z-index: 2;
}

.nav-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  transition: background-color 0s ease;
  z-index: 1;
}

/* Hover: blue tint */
.nav-btn:hover::before {
  filter: brightness(0) saturate(100%) invert(85%) sepia(100%) saturate(250%) hue-rotate(1deg) brightness(110%) contrast(105%);
}

/* Active: darker blue tint */
.nav-btn:active::before {
  filter: brightness(0) saturate(100%) invert(85%) sepia(100%) saturate(250%) hue-rotate(1deg) brightness(95%) contrast(110%);
}

.nav-btn:hover::after {
  background-color: rgba(77, 110, 255, 0.4);
}

.nav-btn:active::after {
  background-color: rgba(47, 85, 252, 0.6);
}

.nav-btn:active {
  color: rgb(241, 235, 144);
  position: relative;
  top: 2px;
  left: 2px;
}

/* Map the icons to each button */
.home-btn::before {
  background-image: url("vectors/home.png");
}
.events-btn::before {
  background-image: url("vectors/events.png");
}
.map-btn::before {
  background-image: url("vectors/map.png");
}
.highlights-btn::before {
  background-image: url("vectors/highlights.png");
}
.downloads-btn::before {
  background-image: url("vectors/downloads.png");
}

/* Navigation container */
.nav-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7.5vw;
  flex-wrap: wrap;
  padding-top: 3vw;
}

/* Background container */
.button-background {
  background-size: 15vw;
  height: 20vw;
}




   .map-container {
  margin-bottom: 9.8vw; /* or whatever looks best */
}

.live-map-title {
    font-size: 10vw;
  }


.time-box {
  width: 35vw;
}

.number {
  font-size: 12vw;
}

.label {
  font-size: 5vw;
}


#calendar-section a#download-ics {
  font-size: 4vw;
  padding-top:4vw ;
}

}
