/* =========================
   Headings
   ========================= */
main h1, main h2, main h3, main h4, main h5, main h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-color);
  margin-bottom: 1rem;
}

main h1 {
  font-size: 2.5rem;
  border-bottom: 2px solid var(--line-color);
}

main h2 {
  font-size: 2rem;
  border-bottom: 1px solid var(--line-color);
}

main h3 { font-size: 1.6rem; }
main h4 { font-size: 1.3rem; }
main h5 { font-size: 1.1rem; }
main h6 { font-size: 1rem; color: var(--text-color2); }

/* =========================
   Paragraphs and Links
   ========================= */
main p {
  margin: 1rem 0;
}

main a {
  color: var(--link-color);
  text-decoration: none;
}
main a:hover {
  color: var(--hover-color);
  text-decoration: underline;
}

/* =========================
   Lists
   ========================= */
main ul, main ol {
  padding-left: 1rem;
}
main .task-list {
  list-style: none;
  padding-left: 1em;
}
main .task-list-item input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* =========================
   Blockquotes
   ========================= */
main blockquote {
  border-left: 4px solid var(--line-color);
  padding-left: 1rem;
  color: var(--text-color2);
  background: var(--bg-color2);
  margin: 1.5rem 0;
}

/* =========================
   Code Blocks
   ========================= */
main .code-header {
  background-color:var(--line-color);
  color: var(--text-color);
  padding: 0.25em 1em;
  font-family: var(--mono-font);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1em;
  text-align: center;
}
main .code-header button {
  background-color: transparent;
  border: none;
  color: var(--text-color);
  padding: 0.25em 0.25em;
  font-size: 1em;
  cursor: pointer;
}

main pre {
  background-color: var(--bg-color2);
  border: 1px solid var(--line-color);
  margin: 0 0 2em 0;
  padding: 0.5rem 1em;
  overflow-x: auto;
  font-family: var(--mono-font);
}
main code {
  font-family: var(--mono-font);
}

/* =========================
   Horizontal Rule
   ========================= */
main hr {
  border: none;
  border-top: 1px solid var(--line-color);
  margin: 2rem 0;
}

/* =========================
   Tables
   ========================= */
main table {
  border: 1px solid var(--line-color);
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1em;
}
main th {
  border-bottom: 1px solid var(--line-color);
  background-color: var(--text-color);
  color: var(--bg-color);
  font-weight: bold;
  text-align: left;
  padding: 0.5rem;
}
main td {
  padding: 0.5rem;
}
main td + td {
  border-left: 1px solid var(--line-color);
}
main tbody tr:nth-child(odd) {
  background-color: var(--bg-color);
}
main tbody tr:nth-child(even) {
  background-color: var(--bg-color2);
}

/* =========================
   Images
   ========================= */
main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* =========================
   Footnotes
   ========================= */
main sup {
  font-size: 0.8rem;
}
main .footnotes {
  font-size: 0.9rem;
  color: var(--text-color2);
}

/* =========================
   Definition Lists
   ========================= */
main dl dt {
  font-weight: bold;
}
main dl dd {
  margin-bottom: 1rem;
  margin-left: 1rem;
}




/* =========================
    GALLERY
   ========================= */

 main ul.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

main ul.gallery li {
  text-align: center;
  font-size: 0.9em;
  color: var(--text-color2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

main ul.gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

main ul.gallery img:hover {
  transform: scale(1.03);
}

/* Lightbox container */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1em;
  cursor: pointer;
}

/* Hide when not active */
.lightbox.hidden {
  display: none;
}

/* Image display */
.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 0 12px black;
  cursor: default;
  display: block;
  margin: 0 auto;
}


/* Optional content wrapper (if used) */
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
}

/* Close button (top right) */
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

/* Caption bar below the image */
.lightbox-caption {
  background-color: var(--line-color);
  color: var(--text-color);
  font-size: 0.9em;
  padding: 0.75em 1em;
  text-align: center;
  max-width: 100%;
  margin-top: 1rem;
  border-radius: 0.5em;
  font-style: italic;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}


/* =========================
   GAME CONTAINER
   ========================= */


.game-wrapper {
  position: relative;
  width: 640px;
  height: 360px;
  margin: 2rem auto;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  z-index: 10;
  overflow: hidden;
}

.game-poster {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4);
}

.game-play-button {
  position: relative;
  background: var(--accent-color);
  border: none;
  color: white;
  font-size: 3em;
  padding: 0.2em 0.6em;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease;
}

.game-play-button:hover {
  background: var(--hover-color);
}

.game-fullscreen-button {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: var(--line-color);
  border: none;
  color: var(--text-color);
  padding: 0.4em 0.6em;
  font-size: 1.2em;
  border-radius: 0.3rem;
  cursor: pointer;
  z-index: 5;
  opacity: 0.9;
  transition: background 0.2s ease;
}

.game-fullscreen-button:hover {
  background: var(--hover-color);
}

/* Fullscreen support */
.gm4html5_div_class:fullscreen,
.gm4html5_div_class:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gm4html5_div_class:fullscreen canvas,
.gm4html5_div_class:-webkit-full-screen canvas {
  width: 100vw !important;
  height: 100vh !important;
}

/*FULLSCREEN WORKAROUND*/
