@font-face {
  font-family: "MiSans";
  src: url("../fonts/MiSans-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "MiSansBold";
  src: url("../fonts/MiSans-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "Bubble";
  src: url("../fonts/DynaPuff-VariableFont_wdth,wght.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "MiSans", sans-serif;
  color: #4c4a5f;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 18%, #ffd6eb 0, transparent 27%),
    radial-gradient(circle at 82% 20%, #bfe7ff 0, transparent 30%),
    radial-gradient(circle at 50% 90%, #eadcff 0, transparent 28%),
    linear-gradient(135deg, #fff5fb, #eaf7ff);
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(16px, 5vw, 45px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

.box {
  width: min(90%, 900px);
  max-width: 100%;
  padding: clamp(28px, 6vw, 58px) clamp(20px, 5vw, 60px);
  text-align: center;
  border-radius: clamp(24px, 5vw, 46px);
  background: rgba(255, 255, 255, 0.55);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 90px rgba(150, 165, 210, 0.25);
  backdrop-filter: blur(18px);
  animation: boxFloat 3.5s ease-in-out infinite;
}

.loading {
  margin: 0 0 22px;
  font-size: clamp(14px, 3.5vw, 30px);
  letter-spacing: clamp(1px, 0.8vw, 6px);
  font-family: "MiSans", monospace;
  color: #4c4a5f;
  overflow-wrap: break-word;
}

.progress {
  width: min(360px, 100%);
  max-width: 100%;
  height: 18px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #ffe0ef;
  border: 3px solid #f4b9d7;
  overflow: hidden;
}

.bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ffaad0, #9edcff);
  animation: load 1.8s ease;
}

.percent {
  margin: 0 0 clamp(24px, 5vw, 34px);
  font-size: clamp(16px, 3vw, 24px);
  letter-spacing: clamp(2px, 0.6vw, 5px);
}

h1 {
  margin: 0;
  font-family: "Bubble", "MiSansBold", sans-serif;
  font-size: clamp(32px, 10vw, 76px);
  line-height: 1.15;
  color: #ffb4d2;
  -webkit-text-stroke: 2px #5b5263;
  text-shadow: 5px 5px 0 #bfe7ff;
  overflow-wrap: break-word;
}

.subtitle {
  margin: 14px 0 clamp(28px, 6vw, 48px);
  font-family: "MiSansBold";
  font-size: clamp(16px, 3.5vw, 24px);
  letter-spacing: clamp(2px, 1vw, 8px);
  color: #8d7db8;
}

.menu {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 3vw, 22px);
  flex-wrap: wrap;
}

.btn {
  width: min(240px, 100%);
  padding: clamp(16px, 3vw, 22px) clamp(18px, 4vw, 24px);
  border-radius: 999px;
  text-decoration: none;
  font-family: "MiSansBold";
  font-size: clamp(16px, 3.5vw, 22px);
  color: #5a5870;
  background: rgba(255,255,255,.72);
  box-shadow: 0 14px 35px rgba(150,165,210,.18);
  transition: .28s ease;
}

.blue { border: 3px solid #bfe7ff; }
.pink { border: 3px solid #ffc2dd; }
.purple { border: 3px solid #d7c8ff; }

.btn:hover {
  transform: translateY(-8px) scale(1.04);
  background: white;
  box-shadow: 0 0 36px rgba(255,190,225,.9);
}

.footer {
  margin-top: 42px;
  color: #9b94b0;
  font-size: 14px;
}

.page--inner {
  align-items: flex-start;
  padding-top: max(clamp(16px, 5vw, 45px), env(safe-area-inset-top));
  padding-bottom: max(clamp(16px, 5vw, 45px), env(safe-area-inset-bottom));
}

.box--inner {
  animation: none;
  margin: 0 auto;
}

.box--content {
  text-align: center;
}

.page-title {
  margin: 0;
  font-family: "Bubble", "MiSansBold", sans-serif;
  font-size: clamp(28px, 7vw, 52px);
  line-height: 1.2;
  color: #ffb4d2;
  -webkit-text-stroke: 2px #5b5263;
  text-shadow: 4px 4px 0 #bfe7ff;
}

.subtitle--compact {
  margin: 10px 0 clamp(24px, 5vw, 36px);
}

.back {
  display: inline-block;
  margin-bottom: 20px;
  font-family: "MiSansBold";
  font-size: 15px;
  color: #8d7db8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back:hover {
  color: #ffb4d2;
}

.tutorial-placeholder {
  margin: 0;
  padding: 32px 20px;
  border-radius: 16px;
  border: 2px dashed #d7c8ff;
  background: rgba(255, 255, 255, 0.45);
  color: #9b94b0;
  font-size: 14px;
  line-height: 1.6;
}

.tutorial-placeholder code {
  font-family: "MiSans", monospace;
  font-size: 13px;
  color: #8d7db8;
}

.float {
  position: absolute;
  font-size: 42px;
  animation: float 4s ease-in-out infinite;
}

.f1 { left: 8%; top: 15%; }
.f2 { right: 10%; top: 12%; animation-delay: .5s; }
.f3 { left: 12%; bottom: 16%; animation-delay: 1s; }
.f4 { right: 12%; bottom: 15%; animation-delay: 1.5s; }
.f5 { left: 48%; top: 9%; animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-18px) rotate(5deg); }
}

@keyframes boxFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes load {
  from { width: 0; }
  to { width: 100%; }
}

@media (max-width: 600px) {
  .page {
    align-items: flex-start;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .menu {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    max-width: none;
    text-align: center;
  }

  h1 {
    -webkit-text-stroke: 1.5px #5b5263;
    text-shadow: 3px 3px 0 #bfe7ff;
  }

  .page-title {
    -webkit-text-stroke: 1.5px #5b5263;
    text-shadow: 3px 3px 0 #bfe7ff;
  }

  .float {
    font-size: clamp(24px, 7vw, 36px);
    opacity: 0.65;
  }

  .f1 { left: 4%; top: 8%; }
  .f2 { right: 4%; top: 6%; }
  .f3 { left: 6%; bottom: 8%; }
  .f4 { right: 6%; bottom: 6%; }
  .f5 { display: none; }
}

@media (max-width: 380px) {
  .loading {
    letter-spacing: 0.5px;
  }

  .subtitle {
    letter-spacing: 1px;
  }
}

.tutorial-images {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.zoomable-img {
  width: 100%;
  display: block;
  border-radius: 18px;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  overflow: auto;
  background: rgba(0, 0, 0, 0.88);
  -webkit-overflow-scrolling: touch;
}

.zoom-overlay.active {
  display: block;
}

.zoom-overlay-img {
  display: block;
  max-width: none;
  height: auto;
  -webkit-touch-callout: default;
  user-select: auto;
}

body.zoom-open {
  overflow: hidden;
}

.zoom-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 30px;
  line-height: 46px;
  text-align: center;
  cursor: pointer;
  z-index: 10000;
  display: none;
}

.zoom-close.show {
  display: block;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-buttons {
  margin: 28px 0;
  gap: 10px; 
}

.tab-buttons .btn {
  font-size: 14px;
  padding: 10px 14px; 
  min-height: 0;
  border-radius: 18px;
}