* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  background: #000000;
}

.menu-items span {
  font-size: 14px;
  letter-spacing: 0px;
  line-height: 25px;
  color: #e5bd82;
  font-weight: 400;
  text-align: center;
  filter: drop-shadow(0px 1px 5px rgba(16, 13, 1, 0.9));
}

.content span {
  font-size: 14px;
  letter-spacing: 1px;
  color: #cbaa64;
  font-weight: 400;
  line-height: 2;
  text-align: center;
  filter: drop-shadow(0 0 5px rgba(16, 13, 1, 0.9));
}

.timer span {
  font-size: 19px;
  line-height: 25px;
  color: #e5dfbd;
  font-weight: 400;
  text-align: center;
  filter: drop-shadow(5px 5px 10px rgba(16, 13, 1, 0.9));
}

.main-logo {
  height: 160px;
  transition: filter 0.2s ease;
  cursor: pointer;
}

.main-logo:hover {
  filter: brightness(120%);
}

.hamburger-icon {
  color: #626060;
  height: 48px;
  width: 48px;
  cursor: pointer;
}

.top-menu-logo {
  width: auto;
  height: 60px;
  transition: filter 0.2s ease;
  cursor: pointer;
}

.top-menu-logo:hover {
  filter: brightness(120%);
}

/* FLEX LAYOUT */
.layout-flex {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.background-image {
  width: 100%;
}

.separator {
  width: 60%;
}

.gif {
  width: auto;
  max-width: 310px;
  height: auto;
  margin: 0 auto;
  display: block;
}

@media (max-width: 768px) {
  .gif {
    max-width: 90%;
  }
}

/* SIDEBARY */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #eaeaea;
}

.sidebar h2 {
  margin-top: 0;
}

.sidebar.left {
  background-image: url("../assets/left-panel.webp");
  background-size: auto;
  box-shadow: 0px 0px 130px 9px rgb(2, 1, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-size: cover;
  min-width: 420px;
  max-width: 28%;
  height: 100vh;
  padding: 40px 100px;
  position: sticky;
  left: 0;
  top: 0;
  scrollbar-width: none;
  text-align: center;
}

.sidebar.left.is-open {
  display: flex;
}

.sidebar.right {
  min-width: 28%;
  max-width: 28%;
  height: 100vh;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 999;
  overflow: hidden;
}

.content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  flex: 1 1 0%;
  min-width: 0;

  position: relative;
  min-height: 100vh;
  padding: 40px;
  overflow: hidden;
}

.content::before {
  content: "";
  position: fixed;
  inset: 0;

  background-image: url("../assets/main-panel-4k.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  z-index: -1;
}

.content h1 {
  margin-top: 0;
}

.top-menu {
  display: none;
  justify-content: space-between;
  padding: 15px;
  background: #0f0f0f;
  border-bottom: 1px solid #626060;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
}

.overflow-hidden {
  overflow: hidden;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 1500px) {
  .sidebar.right {
    display: none;
  }
}

@media (max-width: 1024px) {
  .layout-flex {
    flex-direction: column;
  }

  .sidebar.left {
    flex: 0 0 200px;
    display: none;
    z-index: 99;
    width: 100% !important;
    max-width: 100%;
    top: 95px;
    position: fixed;
    background-image: url("../assets/main-panel-4k.webp");
    justify-content: flex-start;

    overflow: auto;
  }

  .sidebar.right {
    display: none;
  }

  .top-menu {
    display: flex;
  }

  .main-logo {
    display: none;
  }

  .content {
    margin-top: 95px;
  }
}

@media (max-width: 768px) {
  .layout-flex {
    flex-direction: column;
  }

  .content,
  .sidebar.right {
    flex: 0 0 auto;
    width: 100%;
    min-width: unset;
    height: auto;
  }

  .sidebar.right {
    display: none;
  }

  .content {
    min-height: 100dvh;
  }

  .dungeon-controls {
    display: none !important;
  }

  .dungeon-canvas canvas {
    background-image: url("../assets/bg-test.webp") !important;
  }

  .discord-button {
    display: none;
  }

  .dialog-cloud {
    display: none !important;
  }
}

@media (max-width: 824px) {
  .dungeon-canvas canvas {
    min-width: 0 !important;
    min-height: 0 !important;
  }
}

@media (max-width: 480px) {
  .content h2 span img {
    width: 100%;
  }
}

/* --- REMAINING STYLES UNCHANGED --- */
.sidebar.right video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

video:empty + .fallback {
  display: block;
}

.sidebar.left .menu {
  background-image: url("../assets/menu-bg.webp");
  background-position: center;
  background-repeat: no-repeat;
  min-height: 609px;
  width: 336px;
}

.menu {
  position: relative;
}

.menu-item {
  height: 40px;
  background-image: url("../assets/btn-menu.webp");
  background-position: center;
  background-repeat: no-repeat;
  margin: 6px 20px;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
  transition: filter 0.2s ease;
  cursor: pointer;
}

.menu-item:hover {
  filter: brightness(120%);
}

.menu-item-active {
  filter: brightness(120%);
}

.scroll-wrapper {
  position: relative;
  overflow: hidden;
  width: 280px;
  margin-left: 30px;
  margin-top: 45px;
  height: 532px;
}

.menu-items {
  position: absolute;
  top: 0;
  left: 0;
  right: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scroll-track {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  background: url("../assets/scrollbar_base_312.webp");
  background-size: cover;
}

.scroll-thumb {
  position: absolute;
  top: 0;
  right: 0;
  width: 23px;
  height: 23px;
  background: url("../assets/scrollbar_cursor.webp");
  background-size: cover;
  cursor: pointer;
}

.timer {
  width: 100%;
  position: absolute;
  top: 588px;
  height: 70px;
  background-image: url("../assets/timer.webp");
  background-position: center;
  background-repeat: no-repeat;
}

.timer span {
  display: inline-block;
  margin-top: 35px;
}

.logos {
  margin-top: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logos img {
  cursor: pointer;
  height: auto;
  display: block;
  transition: filter 0.2s ease;
}

.logos img:hover {
  filter: brightness(120%);
}

.title-bar {
  background-image: url("../assets/belka-tytulowa.webp");
  background-position: center;
  background-repeat: no-repeat;
}

.title-bar-text {
  font-size: 19px;
  color: #002f1b;
  font-family: "Cambria";
  text-align: center;
  filter: drop-shadow(0 0 4px #0e1002);
}

.items-description-slot {
  margin-right: 5px;
  margin-left: 5px;
  position: relative;
  width: fit-content;
  display: inline-flex;
  vertical-align: middle;
}

.corner {
  position: absolute;
  width: 10px;
  height: 10px;
  line-height: 7px;
}

.corner.ul {
  top: 0;
  left: 0;
}

.corner.ur {
  top: 0;
  right: 0;
}

.corner.dl {
  bottom: 0;
  left: 0;
}

.corner.dr {
  bottom: 0;
  right: 0;
}

.tooltip {
  font-family: Tahoma, serif;
}

.item-slot:hover {
  filter: brightness(150%);
}

.text-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 5px 0;
  flex-wrap: wrap;
}

.item-slot-item {
  position: absolute;
  top: 1px;
  left: 1px;
  z-index: 2;
}

.items-description-slot img:last-child {
  pointer-events: none;
}

#start a {
  font-size: 14px;
  letter-spacing: 1px;
  color: #cbaa64;
}

#start a:hover {
  color: #9b7f44;
}

.table-container {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-wrap: anywhere;
}

.grid-table {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr;
  border: 1px solid #000;
  max-width: 800px;
  font-size: 14px;
  letter-spacing: 1px;
  color: #cbaa64;
  font-weight: 400;
  line-height: 2;
  text-align: center;
  filter: drop-shadow(0 0 5px rgba(16, 13, 1, 0.9));
  width: 100%;
}

.grid-header {
  font-weight: bold;
}

.grid-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 8px;
  border: 1px solid #9b7f44;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.4s ease;
}

/* Popup */
.popup {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  width: 90%;
  height: 90vh;
  transform: scale(0.9);
  animation: scaleIn 0.4s ease forwards;
}

.popup button {
  margin-top: 20px;
  padding: 10px 20px;
  border: none;
  background: #000;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  to {
    transform: scale(1);
  }
}

/* Hidden state */
.hidden {
  display: none;
}

.dungeon-canvas {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
}

.dungeon-canvas canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 730px;
  min-height: 420px;

  background-position: center;
  /* Wyśrodkowanie */
  background-repeat: no-repeat;
  background-size: contain;
}

.char-canvas {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 330px;
  min-height: 420px;
  aspect-ratio: 16 / 9;
}

.char-canvas canvas {
  width: 100% !important;
  height: 100% !important;

  background-image: url("../assets/podest.webp");
  background-position: center;
  /* Wyśrodkowanie */
  background-repeat: no-repeat;
  background-size: initial;
  background-position-y: 245px;
}

.canvas-container {
  display: flex;
  justify-content: center;
}

.dungeon-controls {
  display: flex;
  position: absolute;
  justify-content: center;
  top: 80%;
  max-width: 41%;
}

.dungeon-controls img {
  flex: 1;
  height: auto;
}

.btn-left {
  cursor: pointer;
}

.btn-right {
  cursor: pointer;
}

.dungeon-info {
  width: 100%;
  max-width: 422px;
  height: auto;
  display: block;
  margin: 0 auto;
}

img {
  -webkit-user-drag: none;
  /* iOS / Safari */
  -khtml-user-drag: none;
  /* stare silniki */
  -moz-user-select: none;
  /* Firefox */
  -webkit-user-select: none;
  /* Safari / Chrome */
  -ms-user-select: none;
  /* IE/Edge */
  user-select: none;
  /* standard */
  pointer-events: auto;
  /* aby nadal reagowało na click/touch */
}

.map-info {
  width: 100%;
  max-width: 422px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.spoiler-wrapper {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.spoiler-header {
  padding: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
  color: #e5bd82;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: rgba(255, 255, 255, 0.1);
}

.spoiler-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 10px;
  color: #cbaa64;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.02);
}

.spoiler-content img {
  width: 30px;
}

.spoiler-content .text-center span {
  font-size: 12px;
}

.arrow {
  position: absolute;
  right: 16px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #e5bd82;
  transition: transform 0.3s ease;
}

.spoiler-wrapper.open .arrow {
  transform: rotate(180deg);
}

.spoiler-wrapper.open .spoiler-content {
  padding: 10px;
}

.discord-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  cursor: pointer;
}

.discord-button img {
  width: 120px;
}

.dialog-cloud {
  position: fixed;
  bottom: 150px;
  right: 20px;
  z-index: 1000;
  background: url("../assets/main-panel-4k.webp");
  border: 2px solid #cbaa64;
  border-radius: 20px;
  font-size: 14px;
  letter-spacing: 1px;
  color: #cbaa64;
  font-weight: 400;
  line-height: 2;
  text-align: center;
  filter: drop-shadow(0 0 5px rgba(16, 13, 1, 0.9));
  padding: 20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: none;
}

.dialog-cloud a {
  text-decoration: none;
  color: #4d9539;
}

.dialog-cloud::after {
  content: "";
  position: absolute;

  bottom: -14px;
  /* wysunięcie w dół */
  right: 30px;
  /* przesunięcie od prawej */

  width: 0;
  height: 0;

  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 14px solid #cbaa64;
}

.dialog-close {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 20px;
  font-weight: bold;
  color: #cbaa64;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  display: inline-block;
  width: 18px;
  height: 18px;
  text-align: center;
  transition: color 0.2s;
}

.dialog-close:hover {
  color: #ff0000;
}

#dungeon-osada canvas {
  background-image: url("../assets/backgrounds/bg-osadadzikusow.webp");
}

#dungeon-orc canvas {
  background-image: url("../assets/backgrounds/bg-orkowywawoz.webp");
}

#dungeon-ghost-temple canvas {
  background-image: url("../assets/backgrounds/bg-swiatyniaduchow.webp");
}

#dungeon-baronowna canvas {
  background-image: url("../assets/backgrounds/bg-baronownapajakow.webp");
}

#dungeon-demon canvas {
  background-image: url("../assets/backgrounds/bg-wiezademonow.webp");
}

#dungeon-piekielne canvas {
  background-image: url("../assets/backgrounds/bg-piekielnekatakumby.webp");
}

#dungeon-smok canvas {
  background-image: url("../assets/backgrounds/bg-komnatasmoka.webp");
}

#dungeon-nemere canvas {
  background-image: url("../assets/backgrounds/bg-straznicanemere.webp");
}

#dungeon-trytonskie canvas {
  background-image: url("../assets/backgrounds/bg-trytonskiemokradla.webp");
}

#dungeon-legowisko canvas {
  background-image: url("../assets/backgrounds/bg-mrocznelegowisko.webp");
}

#dungeon-obrona canvas {
  background-image: url("../assets/backgrounds/bg-obronastatku.webp");
}

#dungeon-schronienie canvas {
  background-image: url("../assets/backgrounds/bg-schronienie.webp");
}
