*,
*::before,
*::after { box-sizing: border-box; }

body, html {
  margin: 0;
  padding: 0;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  z-index: 1000;
  border-bottom: 1px solid #222;
}

.logo {
  font-size: 1.7em;
  font-weight: 600;
  font-family: "Courier New", Courier, monospace;
  color: green;
}

.hamburger {
  display: none;
  font-size: 28px;
  cursor: pointer;
}

.menu {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.menu a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 500;
  transition: opacity 0.2s;
}

.menu a:hover { opacity: 0.7; }

/* Main Content */
#main-content {
  padding-top: 100px;
  min-height: 100vh;
}

/* Grid */
.grid {
  columns: 4 300px;
  column-gap: 12px;
  padding: 0 20px 60px;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 1200px) { .grid { columns: 3 300px; } }
@media (max-width: 900px) { .grid { columns: 2 300px; } }
@media (max-width: 600px) { .grid { columns: 1; padding: 0 10px 40px; } }

.grid-item {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.grid-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.35s ease;
}

.grid-item img:hover { transform: scale(1.08); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
  z-index: 2000;
  text-align: center;
}

.lightbox-image {
  max-width: 92%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.lightbox-caption {
  margin: 25px 0 15px;
  font-size: 1.4em;
  max-width: 80%;
}

.comments {
  background: #111;
  width: 90%;
  max-width: 620px;
  padding: 25px;
  border-radius: 14px;
  margin-top: 20px;
}

.comments h3 { margin: 0 0 15px; font-size: 1.3em; }

.comments ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  max-height: 220px;
  overflow-y: auto;
  text-align: left;
}

.comments li {
  padding: 8px 0;
  border-bottom: 1px solid #333;
}

.comments form { display: flex; gap: 12px; }

.comments input {
  flex: 1;
  padding: 14px;
  background: #222;
  border: none;
  border-radius: 8px;
  color: #fff;
}

.comments button {
  padding: 0 28px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.close {
  position: absolute;
  top: 25px;
  right: 35px;
  font-size: 44px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.8;
}

.close:hover { opacity: 1; }

/* Lightbox comments section - fixed height with internal scrolling */
.lightbox .comments {
    max-height: 220px;                  /* Adjust this value as desired (200px–250px works well) */
    overflow-y: auto;                   /* Enables scrolling when comments exceed height */
    margin-top: 20px;
    padding-right: 10px;                /* Space for scrollbar */
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);     /* Slight background for readability */
}

/* Nice custom scrollbar (WebKit browsers) */
.lightbox .comments::-webkit-scrollbar {
    width: 8px;
}
.lightbox .comments::-webkit-scrollbar-track {
    background: transparent;
}
.lightbox .comments::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}
.lightbox .comments::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Comment list styling */
.lightbox .comments ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}
.lightbox .comments li {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.95em;
    word-wrap: break-word;
}
.lightbox .comments li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Lightbox Navigation Arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 2.5em;
  cursor: pointer;
  padding: 15px 20px;
  border-radius: 8px;
  transition: background 0.3s ease;
  z-index: 2001;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-nav.prev {
  left: 25px;
}

.lightbox-nav.next {
  right: 25px;
}

/* Mobile */
@media (max-width: 768px) {
  .lightbox-nav {
    font-size: 1.8em;
    padding: 10px 15px;
  }
  
  .lightbox-nav.prev {
    left: 10px;
  }
  
  .lightbox-nav.next {
    right: 10px;
  }

  .lightbox {
    padding: 10px;
    overflow-y: auto;
  }

  .lightbox-image {
    max-width: 95%;
    max-height: 50vh;
  }

  .lightbox-caption {
    margin: 15px 0 10px;
    font-size: 1.1em;
    max-width: 90%;
  }

  .comments {
    width: 95%;
    max-width: 100%;
    padding: 15px;
    margin-top: 15px;
  }

  .comments h3 {
    margin: 0 0 10px;
    font-size: 1.1em;
  }

  .comments ul {
    max-height: 150px;
    margin: 0 0 15px;
  }

  .comments form {
    flex-direction: column;
    gap: 8px;
  }

  .comments input {
    padding: 10px;
    font-size: 16px;
  }

  .comments button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .close {
    top: 15px;
    right: 15px;
    font-size: 32px;
  }
}

/* Mobile Menu */
@media (max-width: 768px) {
  .hamburger { display: block; }

  .menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: #000;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 100px;
    gap: 40px;
    transition: left 0.35s ease;
    z-index: 1000;
  }

  .menu.active { left: 0; }

  .menu a { font-size: 1.6em; }
}

body.menu-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 998;
  pointer-events: auto;
}

.lightbox-image {
  object-fit: contain; /* Ensures full image visible without cropping */
}
.iframe-container {
    width: 100%;                  /* Full width */
    height: calc(100vh - 80px);   /* Full viewport height minus your nav height */
    max-width: 100%;              /* Ensures it doesn't overflow */
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}   border: none;
}

/* Perfect responsive container - no borders, no cut-offs */
.iframe-container {
    width: 100%;
    height: 85vh;                  /* Adjust 80-90vh to fit your nav perfectly */
    overflow: hidden;
    background: #000;              /* Matches dark theme, no gray edges */
}

/* Full fit iframe */
#irc-frame {
    width: 100%;
    height: 100%;
    border: none !important;
    display: block;
}

/* FIX iOS ZOOM: Make input 16px (stops zoom) but scale it visually smaller */
#irc-frame #input,
#irc-frame input[type="text"] {
    font-size: 16px !important;    /* Required to prevent zoom */
    transform: scale(0.875);       /* 14px visual size (16 * 0.875) - matches original */
    transform-origin: left bottom;
    height: 40px !important;       /* Adjust if needed for visual fit */
    line-height: 40px !important;
}

/* Optional: Slightly larger chat messages for readability */
#irc-frame .messages,
#irc-frame .msg,
#irc-frame #chat {
    font-size: 15px !important;
}
