html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100vw;
  font-family: "Segoe UI", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.fullscreen-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 0;
}

.fullscreen-logo {
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  z-index: 1;
}

.fullscreen-container.profile-bg {
  background-size: cover;
  background-position: center;
}

.nav-bar {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  z-index: 2;
}

.nav-bar a {
  text-decoration: none;
  font-size: 1.2em;
  color: #333;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px 20px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.nav-bar a:hover {
  background-color: #4caf50;
  color: white;
}

.sacred-title {
  margin-top: 20px;
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  text-transform: uppercase;
  text-align: center;
  -webkit-text-stroke: 1.5px #fff;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.8));
  font-weight: 900;
  z-index: 10;
}

.sacred-title .white-word {
  color: #99d81b !important;
  -webkit-text-stroke: 0px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

.sacred-title .animated-exclamation {
  display: inline-block;
  animation: jump 2s infinite ease-in-out;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 0;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}

.puzzle-piece {
  background-size: cover;
  background-position: center;
  border-radius: 3px;
}

.piece-1 {
  background-image: url("/static/images/logo-part-1.png");
}
.piece-2 {
  background-image: url("/static/images/logo-part-2.png");
}
.piece-3 {
  background-image: url("/static/images/logo-part-3.png");
}
.piece-4 {
  background-image: url("/static/images/logo-part-4.png");
}
.piece-5 {
  background-image: url("/static/images/logo-part-5.png");
}
.piece-6 {
  background-image: url("/static/images/logo-part-6.png");
}
.piece-7 {
  background-image: url("/static/images/logo-part-7.png");
}
.piece-8 {
  background-image: url("/static/images/logo-part-8.png");
}
.piece-9 {
  background-image: url("/static/images/logo-part-9.png");
}
.piece-10 {
  background-image: url("/static/images/logo-part-10.png");
}
.piece-11 {
  background-image: url("/static/images/logo-part-11.png");
}
.piece-12 {
  background-image: url("/static/images/logo-part-12.png");
}
.piece-13 {
  background-image: url("/static/images/logo-part-13.png");
}
.piece-14 {
  background-image: url("/static/images/logo-part-14.png");
}
.piece-15 {
  background-image: url("/static/images/logo-part-15.png");
}
.piece-16 {
  background-image: url("/static/images/logo-part-16.png");
}

.start-container {
  margin: auto 0;
  z-index: 10;
}

.puzzle-start {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  @keyframes jump {
    0%,
    100% {
      transform: translateY(0);
      filter: brightness(1);
    }
    50% {
      transform: translateY(-20px);
      filter: brightness(1.4);
    }
  }
}

.puzzle-start .piece {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 15px 22px;
  font-size: clamp(1.3rem, 4vw, 2.3rem);
  font-weight: 800;
  border-radius: 12px;
  transition: all 0.3s ease;
  animation: jump 2s infinite ease-in-out;
  will-change: transform;
}

.puzzle-start .piece:nth-child(1) {
  animation-delay: 0.1s;
}
.puzzle-start .piece:nth-child(2) {
  animation-delay: 0.2s;
}
.puzzle-start .piece:nth-child(3) {
  animation-delay: 0.3s;
}
.puzzle-start .piece:nth-child(4) {
  animation-delay: 0.4s;
}
.puzzle-start .piece:nth-child(5) {
  animation-delay: 0.5s;
}
.puzzle-start .piece:nth-child(7) {
  animation-delay: 0.6s;
}
.puzzle-start .piece:nth-child(8) {
  animation-delay: 0.7s;
}
.puzzle-start .piece:nth-child(9) {
  animation-delay: 0.8s;
}
.puzzle-start .piece:nth-child(10) {
  animation-delay: 0.9s;
}
.puzzle-start .piece:nth-child(11) {
  animation-delay: 1s;
}
.puzzle-start .piece:nth-child(12) {
  animation-delay: 1.1s;
}

.puzzle-start:hover .piece {
  animation-play-state: paused;
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.auth-btn {
  min-width: 170px;
  padding: 16px 35px;
  background: linear-gradient(135deg, #ff8c00, #ff4500);
  color: white;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.2rem;
  border: 2px solid #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
  cursor: pointer;
}

.auth-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(255, 69, 0, 0.5);
}

.bottom-auth {
  display: flex;
  gap: 25px;
  margin: 30px;
  z-index: 10;
}

.back-home-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  background-color: #4caf50;
  padding: 10px 15px;
  border-radius: 12px;
}

.back-home-button {
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff8c00, #ff4500);
  color: white;
  font-weight: bold;
  border: 2px solid #fff;
  transition: all 0.3s ease;
}

.back-home-button:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  z-index: 999999;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #3e3030;
  padding: 40px;
  border-radius: 25px;
  border: 2px solid #ff8c00;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 140, 0, 0.4);
  max-width: 400px;
  width: 85%;
  position: relative;
  z-index: 1000000;
}

@media (max-width: 600px), (hover: none) {
  body * {
    backdrop-filter: none !important;
    filter: none !important;
  }
  .puzzle-start-btn .piece {
    animation: none;
  }
  .puzzle-start-btn {
    flex-direction: column;
    align-items: center;
    width: 90%;
  }
  .bottom-auth {
    flex-direction: column;
    gap: 15px;
    width: 85%;
  }
  .auth-btn {
    width: 100%;
    min-width: unset;
  }
  .sacred-title {
    font-size: 1.5rem;
  }
}

/* ============================= */
/* SAFE MOBILE VERSION ONLY */
/* ============================= */

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .profile-buttons,
  .bottom-auth {
    width: 100%;
    padding: 0 15px;
    flex-direction: column;
    align-items: center;
  }

  .auth-btn,
  .profile-button {
    width: 100%;
    max-width: 320px;
  }

  #level-list {
    width: 100%;
    max-height: 50vh;
  }

  .sacred-title {
    font-size: 1.6rem;
    text-align: center;
    padding: 0 10px;
  }

  .puzzle-grid {
    position: absolute;
    inset: 0;
  }
}

@media (max-width: 480px) {
  .auth-btn {
    min-width: unset;
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
  }
  .bottom-auth {
    flex-direction: column;
    gap: 12px;
    width: 90%;
    margin: 20px auto;
  }
  .modal-content {
    width: 92%;
    padding: 20px;
  }
}

input,
select,
textarea {
  font-size: 16px !important;
}
