html, body {
  position: relative;
  min-height: 100%;
}

.tut-overlay {
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  display: none;
}

.tut-dim {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 10, 0.62);
  z-index: 399;
  pointer-events: none;
  clip-path: none;
  transition: none !important;
}

body.dark-mode .tut-dim {
  background: rgba(0, 0, 0, 0.72);
}

.tut-block {
  position: absolute;
  pointer-events: auto;
  background: transparent;
  z-index: 405;
}
body.dark-mode .tut-block {
  background: rgba(0, 0, 0, 0.72);
}

.tut-spotlight {
  position: absolute;
  border-radius: 24px;
  pointer-events: none;
  border: 2px solid rgba(94, 207, 154, 0.9);
  box-shadow:
    0 0 0 100vmax rgba(8, 12, 10, 0.62),
    0 0 24px rgba(94, 207, 154, 0.35);
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 406;
}

body.dark-mode .tut-spotlight {
  border-color: rgba(94, 207, 154, 0.8);
  box-shadow: 0 0 18px rgba(94, 207, 154, 0.2), 0 0 30px rgba(94, 207, 154, 0.15) inset;
}

.tut-card {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 28px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(16, 32, 24, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 46px 20px 18px;
  pointer-events: auto;
  z-index: 410;
  color: #102018;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.tut-card.at-top {
  bottom: auto;
  top: 92px;
  animation: cardFlip 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardFlip {
  from {
    opacity: 0.4;
    transform: translateX(-50%) translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

body.dark-mode .tut-card {
  background: rgba(22, 35, 29, 0.96);
  border-color: rgba(43, 70, 58, 0.9);
  color: #e8f4ec;
}

.tut-step-count {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #1f6d4d;
  margin-bottom: 6px;
}

.tut-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.tut-text {
  margin: 0 0 14px;
  color: #607364;
  line-height: 1.55;
  font-size: 0.95rem;
}

body.dark-mode .tut-text {
  color: #abc5b4;
}

.tut-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tut-skip {
  border: 1px solid rgba(16, 32, 24, 0.15);
  background: transparent;
  color: #607364;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.tut-skip.confirm {
  border-color: #b24539;
  color: #b24539;
  font-weight: 800;
}

body.dark-mode .tut-skip {
  border-color: rgba(255, 255, 255, 0.2);
  color: #abc5b4;
}

body.dark-mode .tut-skip.confirm {
  border-color: #d66a5d;
  color: #d66a5d;
}

.tut-next {
  border: 0;
  border-radius: 999px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #1f6d4d, #2d8d63);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(31, 109, 77, 0.3);
}

/* typing caret */
.tut-text {
  min-height: 3.2em;
}

.tut-text.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  vertical-align: -0.15em;
  animation: tutBlink 0.8s step-end infinite;
}

@keyframes tutBlink {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.tut-mascot {
  position: absolute;
  top: -50px;
  left: -14px;
  width: 88px;
  height: 88px;
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
}

.tut-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 100%;
  animation: mojiFloat 3.4s ease-in-out infinite;
}

.tut-mascot.talking img {
  animation: mojiTalk 0.45s ease-in-out infinite;
}

@keyframes mojiTalk {
  0%, 100% {
    transform: scaleY(1) scaleX(1);
  }

  35% {
    transform: scaleY(1.09) scaleX(0.95);
  }

  70% {
    transform: scaleY(0.95) scaleX(1.05);
  }
}

@keyframes mojiFloat {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.tut-card {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.tut-card.dragging, .tut-card.dragging * {
  cursor: grabbing !important;
}

.tut-back {
  border: 1px solid rgba(16, 32, 24, 0.15);
  background: transparent;
  color: #102018;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tut-back:hover {
  background: rgba(16, 32, 24, 0.06);
}

.tut-back[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

body.dark-mode .tut-back {
  border-color: rgba(255, 255, 255, 0.2);
  color: #e8f4ec;
}

body.dark-mode .tut-back:hover {
  background: rgba(255, 255, 255, 0.07);
}

.tut-mascot-name {
  position: absolute;
  left: calc(100% + 10px);
  top: 30px;
  font-family: "Fredoka", sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.03em;
  color: #102018;
  white-space: nowrap;
  background: none;
  border: none;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

body.dark-mode .tut-mascot-name {
  color: #e8f4ec;
}


.tut-clickblock {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  background: transparent;
  z-index: 404;
}

html.tut-lock {
  overscroll-behavior: none;
  scrollbar-width: none;
}
html.tut-lock::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.tut-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tut-actions .tut-skip { margin-right: auto; }

.tut-actions .tut-back,
.tut-actions .tut-next {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.tut-actions .tut-back i,
.tut-actions .tut-next i { margin: 0; }