.st-wrap {
  width: 100%;
  padding: 4px 0 24px;
  box-sizing: border-box;
}

.st-welcome {
  padding: 8px 0 20px;
}

.st-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
}

.st-start-btn {
  display: block;
  width: 200px;
  max-width: 100%;
  margin: 24px auto;
  padding: 0;
  height: 44px;
  border: none;
  border-radius: 4px;
  background: #10b981;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.35);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.st-start-btn:hover {
  background: #059669;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.55);
}

.st-meta {
  margin: 18px 0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
}

.st-meta p {
  margin: 0 0 6px;
}

.st-meta-label {
  color: #111827;
  font-weight: 600;
}

.st-note,
.st-disclaimer {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #6b7280;
}

.st-disclaimer {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.st-intro {
  margin-top: 24px;
  padding: 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.st-intro h2 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: #111827;
}

.st-intro h2:not(:first-child) {
  margin-top: 20px;
}

.st-intro h3 {
  margin: 12px 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.st-intro p,
.st-intro li {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

.st-intro ul {
  margin: 0;
  padding-left: 1.3em;
}

/* ===== overlay ===== */
.st-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.st-stage {
  position: absolute;
  inset: 0;
  outline: none;
}

.st-slide {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.st-slide.is-active {
  display: block;
}

/* solids */
.st-slide[data-id="solid-red"] { background: #f00; }
.st-slide[data-id="solid-green"] { background: #0f0; }
.st-slide[data-id="solid-blue"] { background: #00f; }
.st-slide[data-id="solid-yellow"] { background: #ff0; }
.st-slide[data-id="solid-cyan"] { background: #0ff; }
.st-slide[data-id="solid-magenta"] { background: #f0f; }
.st-slide[data-id="solid-white"] { background: #fff; }
.st-slide[data-id="solid-black"] { background: #000; }

/* interference patterns */
.st-slide[data-id="hline-1"] {
  background: repeating-linear-gradient(to bottom, #fff 0 1px, #000 1px 2px);
}
.st-slide[data-id="hline-2"] {
  background: repeating-linear-gradient(to bottom, #fff 0 2px, #000 2px 4px);
}
.st-slide[data-id="vline-1"] {
  background: repeating-linear-gradient(to right, #fff 0 1px, #000 1px 2px);
}
.st-slide[data-id="vline-2"] {
  background: repeating-linear-gradient(to right, #fff 0 2px, #000 2px 4px);
}
.st-slide[data-id="cross-1"] {
  background:
    repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, #fff 0 1px, transparent 1px 4px),
    #000;
}
.st-slide[data-id="cross-2"] {
  background:
    repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, #fff 0 2px, transparent 2px 6px),
    #000;
}
.st-slide[data-id="dots"] {
  background-color: #000;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 4px 4px;
  background-position: 0 0;
}

.st-slide[data-id="pattern"] {
  background-color: #000;
  background-image:
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff);
  background-size:
    5px 5px, 5px 5px, 5px 5px, 5px 5px, 5px 5px,
    20px 2px, 2px 20px, 12px 2px, 2px 12px, 30px 30px;
  background-position:
    8px 8px, calc(100% - 8px) 8px, 8px calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), 50% 50%,
    50% calc(50% - 14px), calc(50% - 14px) 50%, 50% calc(50% + 14px), calc(50% + 14px) 50%, 50% 50%;
  background-repeat: no-repeat;
}

.st-slide[data-id="white-grid"] {
  background-color: #000;
  background-image:
    linear-gradient(to right, #fff 1px, transparent 1px),
    linear-gradient(to bottom, #fff 1px, transparent 1px);
  background-size: 45px 45px;
}

.st-slide[data-id="convergence"] {
  background-color: #000;
  background-image:
    linear-gradient(to right, #f00 1px, transparent 1px),
    linear-gradient(to bottom, #0f0 1px, transparent 1px),
    linear-gradient(to right, transparent 22px, #00f 22px, #00f 23px, transparent 23px),
    linear-gradient(to bottom, transparent 22px, #ff0 22px, #ff0 23px, transparent 23px);
  background-size: 45px 45px, 45px 45px, 45px 45px, 45px 45px;
}

/* stability / breathing */
.st-stability {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 2px solid #fff;
  padding: 6px;
  background: #000;
}

.st-stability-inner {
  width: 100%;
  height: 100%;
  border: 6px solid #000;
  box-sizing: border-box;
  background: #fff;
  animation: st-breathe 1s steps(1, end) infinite;
}

@keyframes st-breathe {
  0%, 49% { background: #fff; }
  50%, 100% { background: #000; }
}

/* contrast */
.st-slide[data-id="contrast-white"] { background: #fff; color: #000; }
.st-slide[data-id="contrast-black"] { background: #000; color: #fff; }

.st-contrast {
  border-collapse: collapse;
  position: relative;
  left: 2%;
  top: 10%;
  height: 80%;
  width: 96%;
  text-align: center;
  border-spacing: 0;
  font-size: 12px;
}

.st-contrast td {
  width: 10%;
  padding: 0;
}

.st-contrast-color td {
  height: 22%;
}

.st-contrast-ruler td {
  height: 2.2%;
  border: 1px #808080;
  border-style: none solid;
}

/* gradients */
.st-slide[data-id="grad-white"] {
  background: linear-gradient(to right, #000, #fff);
}
.st-slide[data-id="grad-red"] {
  background: linear-gradient(to right, #000, #f00);
}
.st-slide[data-id="grad-green"] {
  background: linear-gradient(to right, #000, #0f0);
}
.st-slide[data-id="grad-blue"] {
  background: linear-gradient(to right, #000, #00f);
}

/* saturation */
.st-saturation {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(
      to bottom,
      #fff 0%,
      rgba(255, 255, 255, 0) 42%,
      rgba(0, 0, 0, 0) 58%,
      #000 100%
    ),
    linear-gradient(
      to right,
      #f00,
      #ff0,
      #0f0,
      #0ff,
      #00f,
      #f0f,
      #f00
    );
}

.st-end {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  font-size: 28px;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
}

/* controls */
.st-control {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.st-control-top,
.st-control-bottom {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(64, 64, 64, 0.55);
  pointer-events: auto;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.st-control-top {
  top: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 16px;
  box-sizing: border-box;
}

.st-control-info {
  min-width: 0;
  flex: 1;
}

.st-control-title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-control-desc {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-control-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.st-ctrl-btn {
  border: 1px solid #ccc;
  background: transparent;
  color: #fff;
  font-size: 12px;
  line-height: 24px;
  height: 26px;
  padding: 0 8px;
  border-radius: 3px;
  cursor: pointer;
}

.st-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.st-control-bottom {
  bottom: 0;
  height: 84px;
  overflow: hidden;
  position: absolute;
}

.st-control-triangle {
  position: absolute;
  top: -10px;
  left: 50%;
  margin-left: -50px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 50px 10px;
  border-color: transparent transparent #fff;
}

.st-control-buttons {
  display: flex;
  gap: 6px;
  padding: 14px 10px 10px;
  width: max-content;
  max-width: none;
  position: relative;
  left: 0;
  will-change: left;
  transition: left 0.35s ease;
}

.st-nav-btn {
  flex: 0 0 auto;
  width: 132px;
  height: 56px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.st-nav-btn.is-current {
  background: rgba(16, 185, 129, 0.75);
  border-color: #a7f3d0;
}

.st-control.control-hide .st-control-top {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.st-control.control-hide .st-control-bottom {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.st-res-tip {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 8;
  width: 280px;
  height: 100px;
  margin: -50px 0 0 -140px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 36px;
  line-height: 100px;
  text-align: center;
  pointer-events: none;
}

@media (max-width: 640px) {
  .st-control-title {
    font-size: 16px;
  }
  .st-control-desc {
    display: none;
  }
  .st-nav-btn {
    width: 108px;
    height: 48px;
    font-size: 13px;
  }
  .st-end {
    font-size: 20px;
  }
  .st-contrast {
    font-size: 10px;
  }
}
