* {
  box-sizing: border-box;
}

.tutorial-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background-image: url("../assets/images/backgrounds/tutorial-bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: none !important;
}

.tutorial-background {
  position: absolute;

  inset: 0;

  pointer-events: none;

  z-index: 0;
}

.tutorial-ground {
  position: absolute;

  left: 0;
  right: 0;
  bottom: 0;

  height: 220px;
}

.bg-decoration {
  position: absolute;

  width: 70px;
  height: 70px;

  border-radius: 15px;

  background: rgba(255, 255, 255, 0.13);
}

.bg-piece-1 {
  left: 5%;
  top: 20%;
}

.bg-piece-2 {
  right: 10%;
  top: 15%;
}

.bg-piece-3 {
  right: 4%;
  top: 40%;
}

.tutorial-topbar {
  position: relative;
  z-index: 5;
  max-width: 700px !important;
  margin: 35px auto 45px !important;
  transform: translateY(0) !important;
}

.tutorial-status-bar {
  position: relative;

  width: 100%;

  min-height: 70px;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 14px 28px 14px 150px;

  background: #36aef4;

  border: 4px solid #ffffff;

  border-radius: 32px;

  box-shadow:
    0 0 0 4px #67ddff,
    0 0 18px rgba(103, 221, 255, 0.85),
    0 10px 22px rgba(0, 80, 150, 0.2);
}

.tutorial-character {
  position: absolute;

  left: 10px;
  bottom: -18px;

  z-index: 4;
}

.tutorial-character-image {
  width: 172px;
  height: 172px;

  object-fit: contain;
  display: block;
}

.social-button {
  width: 70px;
  height: 70px;

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

  flex: 0 0 70px;

  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.social-icon {
  width: 90px;
  height: 90px;

  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px rgba(22, 140, 255, 0.95))
    drop-shadow(0 0 16px rgba(22, 140, 255, 0.75))
    drop-shadow(0 0 28px rgba(22, 140, 255, 0.55));

  transform: scale(1.01);

  transition:
    transform 0.1s ease,
    filter 0.1s ease;
}
.social-buttons {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;

  gap: 25px;

  width: auto;
  height: auto;
  margin-right: -100px;

  flex-wrap: nowrap !important;

  transition:
    transform 0.2s ease,
    filter 0.1s ease;
}

.social-button:hover {
  transform: translateY(-3px) scale(1.08);
}

.social-button:active {
  transform: translateY(1px);
}

.tutorial-area {
  z-index: 4;
  margin: 0 auto !important;
  display: grid !important;
  align-items: center !important;
  max-width: 1320px !important;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr) !important;
  gap: 35px !important;
  transform: translateY(12px) !important;
  position: relative !important;
  top: -12px !important;
}

.tutorial-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border: 4px solid #ffffff;
  border-radius: 32px;
  box-shadow:
    0 0 0 3px #8edfff,
    0 8px 22px rgba(0, 92, 170, 0.18);
  padding: 38px 20px 20px !important;
  transform-origin: center top;
}

.panel-title {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 310px;
  height: 66px;
  padding: 0 25px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 4px solid white;
  box-shadow: 0 6px 15px rgba(0, 70, 140, 0.15);
  gap: 12px;
  padding-left: 18px;
  padding-right: 18px;
}

.panel-title h2 {
  margin: 0;
  font-size: 26px;
  white-space: nowrap;
  line-height: 1;
}

.panel-title span {
  font-size: 24px;
}

.blue-title {
  background: linear-gradient(to bottom, #318ef0, #1768c8);
}

.orange-title {
  background: linear-gradient(to bottom, #ffc022, #f29100);
}

.original-image-placeholder {
  width: 100%;

  aspect-ratio: 1 / 1;

  border-radius: 20px;

  border: 3px dashed rgba(30, 115, 190, 0.45);

  background: linear-gradient(135deg, #e7f5fe, #caeafb);

  position: relative;

  overflow: hidden;
}

.original-image {
  width: 100%;

  height: 100%;

  object-fit: contain;

  display: block;
}

.tutorial-puzzle-board {
  width: 100%;

  aspect-ratio: 1 / 1;

  display: grid;

  gap: 5px;

  padding: 4px;

  border-radius: 20px;

  overflow: hidden;

  background: #d5e6ef;

  direction: ltr;
}

.puzzle-6 {
  grid-template-columns: repeat(3, 1fr);

  grid-template-rows: repeat(2, 1fr);
}

.tutorial-tile {
  position: relative;

  border-radius: 7px;
  border: 2px dashed rgba(0, 100, 180, 0.35);

  background-color: #d6effd;
  background-repeat: no-repeat;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.tutorial-empty-tile {
  background-image: none !important;

  background: #d5e6ef;

  border: 2px dashed rgba(0, 100, 180, 0.35);

  cursor: default;
}

.tutorial-footer {
  z-index: 5;
  max-width: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute !important;
  left: 0px !important;
  right: auto !important;
  top: 50% !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: translateY(-50%) !important;
}

.tutorial-footer-button {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: none;
  padding: 0;
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease;
  width: 130px !important;
  height: 70px !important;
  flex-shrink: 0 !important;
  transform: none !important;
  overflow: hidden !important;
}

.footer-button-icon {
  width: 84px;
  height: 84px;
  object-fit: contain;
  display: block;
  transform: scale(1.2) !important;
}

.tutorial-tile-number {
  position: absolute;
  top: 8px;
  left: 8px;

  width: 30px;
  height: 30px;

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

  border-radius: 50%;

  background: rgb(10, 80, 231);
  border: 2px solid rgb(0, 0, 0);

  color: white;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;

  box-shadow: 0 3px 8px rgba(0, 70, 140, 0.18);
}

.tutorial-message {
  position: absolute !important;
  right: 35px !important;
  left: auto !important;
  bottom: 20px !important;
  top: auto !important;
  width: 600px !important;
  height: 400px !important;
  z-index: 20 !important;
  transform: none !important;
}

.tutorial-message-image {
  width: 100%;
  height: 100%;

  object-fit: contain;
  display: block;
}

.tutorial-message-content {
  position: absolute;
  text-align: center;
  top: 45% !important;
  left: 40% !important;
  right: auto !important;
  width: 60% !important;
  transform: translate(-50%, -50%) !important;
}

.tutorial-message-title {
  margin-bottom: 12px;

  color: #d71912;

  font-size: 30px;
  font-weight: 900;

  text-align: center;

  font-family: "Tahoma", "Arial", sans-serif;

  text-shadow:
    1px 1px 0 #000,
    2px 2px 2px rgba(0, 0, 0, 0.15);
}

.tutorial-message-text {
  color: #111;

  font-size: 22px;
  font-weight: 900;

  line-height: 1.5;
}
.tutorial-message-content.win-message {
  top: 52% !important;
}
.tutorial-message.hidden {
  display: none;
}

.tutorial-tile-locked {
  cursor: default;
}

.tutorial-puzzle-board .tutorial-tile.tutorial-tile-active {
  position: relative;
  z-index: 10;

  cursor: pointer;

  box-shadow:
    0 0 10px rgba(22, 140, 255, 0.85),
    0 0 22px rgba(22, 140, 255, 0.65),
    0 0 38px rgba(22, 140, 255, 0.4),
    inset 0 0 14px rgba(22, 140, 255, 0.35);

  filter: brightness(1.08) saturate(1.12);

  animation: tutorialBluePulse 1.3s ease-in-out infinite;
}

.tutorial-puzzle-board .tutorial-tile.tutorial-tile-active:hover {
  transform: translateY(-2px) scale(1.025);

  box-shadow:
    0 0 14px rgba(22, 140, 255, 1),
    0 0 30px rgba(22, 140, 255, 0.8),
    0 0 48px rgba(22, 140, 255, 0.55),
    inset 0 0 18px rgba(22, 140, 255, 0.45);
}

.tutorial-puzzle-board .tutorial-tile.tutorial-tile-correct {
  position: relative;
  z-index: 11;

  animation: tutorialCorrectGlow 0.6s ease-out;

  box-shadow:
    0 0 14px rgba(34, 197, 94, 1),
    0 0 30px rgba(34, 197, 94, 0.85),
    0 0 50px rgba(34, 197, 94, 0.55),
    inset 0 0 20px rgba(34, 197, 94, 0.45);

  filter: brightness(1.12) saturate(1.18);

  transform: scale(1.025);
}

@keyframes tutorialBluePulse {
  0%,
  100% {
    box-shadow:
      0 0 8px rgba(22, 140, 255, 0.65),
      0 0 18px rgba(22, 140, 255, 0.45),
      0 0 30px rgba(22, 140, 255, 0.25),
      inset 0 0 10px rgba(22, 140, 255, 0.25);
  }

  50% {
    box-shadow:
      0 0 14px rgba(22, 140, 255, 1),
      0 0 30px rgba(22, 140, 255, 0.8),
      0 0 46px rgba(22, 140, 255, 0.5),
      inset 0 0 18px rgba(22, 140, 255, 0.4);
  }
}

@keyframes tutorialCorrectGlow {
  0% {
    transform: scale(1);

    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
  }

  45% {
    transform: scale(1.04);

    box-shadow:
      0 0 18px rgba(34, 197, 94, 1),
      0 0 40px rgba(34, 197, 94, 0.9),
      0 0 65px rgba(34, 197, 94, 0.6),
      inset 0 0 24px rgba(34, 197, 94, 0.5);
  }

  100% {
    transform: scale(1.015);

    box-shadow:
      0 0 10px rgba(34, 197, 94, 0.7),
      0 0 22px rgba(34, 197, 94, 0.45);
  }
}

@media (max-width: 750px) {
  .tutorial-page {
    padding: 14px;
  }

  .tutorial-panel {
    width: 100%;
  }

  .panel-title {
    min-width: 240px;
  }

  .tutorial-footer {
    flex-direction: column;
  }
}
.original-image-placeholder,
.tutorial-puzzle-board {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
}

.tutorial-footer-button:active {
  transform: translateY(3px) scale(0.9) !important;
}

.game-frame-wrap {
  visibility: hidden;
}

html.frame-ready .game-frame-wrap {
  visibility: visible;
}

html[lang="en"] .panel-title h2 {
  font-size: 22px;
}

html[lang="de"] .panel-title h2 {
  font-size: 21px;
}

html[lang="tr"] .panel-title h2 {
  font-size: 22px;
}
