.tightrope-app,
.tightrope-app * {
  box-sizing: border-box;
  font-family: 'Nunito', sans-serif;
}
.tightrope-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.tightrope-hidden {
  display: none !important;
}

.tightrope-start-ui {
  width: 100%;
}

.tightrope-start-card {
  width: 100%;
  max-width: 674px;
  margin: 0 auto;
  background: #f3f3f3;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.10);
  padding: 30px 30px 34px;
  text-align: center;
  border: 2px solid #2463EB;
}

.tightrope-start-title {
  margin: 0;
  color: #14294a;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.4px;
  font-family: 'Nunito', sans-serif;
}

.tightrope-start-subtitle {
  margin: 10px 0 0;
  color: #667084;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
}

.tightrope-preview-box {
  width: 100%;
  max-width: 338px;
  height: 80px;
  margin: 16px auto 0;
  border-radius: 6px;
  background: #e7eef8;
  position: relative;
  overflow: visible;
}

.tightrope-preview-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 54px;
  height: 4px;
  background: #d89219;
  border-radius: 2px;
}

.tightrope-preview-runner {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 22px;
  height: 34px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.tightrope-preview-runner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tightrope-start-button {
  appearance: none;
  border: 0;
  outline: 0;
  width: 100%;
  margin: 20px 0 0;
  padding: 18px 18px;
  border-radius: 11px;
  background: linear-gradient(90deg, #2f67ea 0%, #5a3df0 100%);
  color: #ffffff;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(88,72,240,0.28);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.tightrope-start-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.tightrope-start-button:active {
  transform: translateY(0);
}

.tightrope-start-bolt {
  color: #ff9f2c;
  font-size: 19px;
  line-height: 1;
}

.tightrope-start-note {
  margin: 18px 0 0;
  color: #a3a9b3;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 600;
}

.tightrope-game {
  width: 100%;
}

.tightrope-card {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.tightrope-progress-wrap {
  width: 100%;
  background: #dde7f4;
  border-radius: 10px;
  padding: 16px 14px 14px;
  position: relative;
  min-height: 126px;
  overflow: hidden;
}

.tightrope-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tightrope-score-text,
.tightrope-lives-text {
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: rgba(12, 8, 8, 0.92);
  font-family: 'Nunito', sans-serif;
}

.tightrope-score-text strong {
  font-size: 22px;
  color: #2f5fff;
  font-weight: 900;
  margin-left: 5px;
}

.tightrope-lives-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
}

.tightrope-heart {
  font-size: 28px;
  line-height: 1;
}

.tightrope-heart.is-lost {
  opacity: 0.28;
}

/* ROPE TRACK — runner sits ON the rope */
.tightrope-track {
  position: relative;
  height: 60px;
}

.tightrope-line {
  position: absolute;
  left: -14px;
  right: -14px;
  top: 38px;
  height: 5px;
  background: #d89219;
  border-radius: 2px;
  z-index: 1;
}

.tightrope-line.is-shake {
  animation: tgLineShake 0.32s ease-in-out 2;
}

@keyframes tgLineShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.tightrope-steps {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: start;
  z-index: 2;
}

.tightrope-step {
  text-align: center;
  height: 60px;
  position: relative;
}

.tightrope-step-stick {
  width: 8px;
  height: 38px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(120,132,150,0.35);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.tightrope-step.is-wrong .tightrope-step-stick {
  background: #ef2d2d;
  box-shadow: 0 0 12px rgba(239,45,45,0.22);
}

.tightrope-step.is-correct .tightrope-step-stick {
  background: #42b651;
  box-shadow: 0 0 10px rgba(66,182,81,0.16);
}

.tightrope-step-num {
  margin-top: 10px;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
}

/* Runner sits on the rope — bottom of runner aligns with rope top */
.tightrope-runner {
  position: absolute;
  left: 0;
  top: 4px;   /* rope is at top:38px, runner height ~34px, so 38-34=4 */
  z-index: 10;
  width: 24px;
  height: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  transform: translateX(-50%);
  transition: left 0.28s ease, top 0.38s ease, transform 0.38s ease, opacity 0.38s ease;
}

.tightrope-runner.is-falling {
  top: 64px;
  transform: translateX(-50%) rotate(82deg) scale(0.96);
  opacity: 0.92;
}

.tightrope-runner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tightrope-panel {
  margin-top: 40px;
  background: #f5f5f5;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 30px 30px 18px;
}

.tightrope-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tightrope-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #6b7280;
  font-size: 18px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
}

.tightrope-qid {
  color: #315cff;
  font-weight: 800;
}

.tightrope-category,
.tightrope-timer {
  color: #6b7280;
  font-weight: 600;
}

.tightrope-timer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #6b7280;
}

.tightrope-timer-wrap svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.tightrope-meta-right {
  color: #00b34d;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}

.tightrope-question-title {
  margin: 0 0 28px;
  color: #102a4c;
  font-size: 18px !important;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.2px;
  font-family: 'Nunito', sans-serif;

}

.tightrope-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.tightrope-option-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  border: 2px solid #d6dbe2;
  background: #f8f8f8;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  color: #13294b;
  font-size: 19px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tightrope-option-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #fbfbfb;
  color: black;
}

.tightrope-option-btn.is-active {
  border-color: #3c68ff;
  background: #fbfcff;
}

.tightrope-option-btn.is-correct {
  border-color: #34b04a;
  background: #f3fff5;
}

.tightrope-option-btn.is-wrong {
  border-color: #ef4444;
  background: #fff5f5;
}

.tightrope-option-btn:disabled {
  cursor: default;
}

.tightrope-option-letter {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 999px;
  border: 2px solid #c6cbd4;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #26354b;
  font-size: 18px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
}

.tightrope-status {
  margin-top: 16px;
  min-height: 24px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
}

.tightrope-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.tightrope-overlay.is-open {
  display: flex;
}

.tightrope-modal {
  width: 100%;
  max-width: 560px;
  background: #f5f5f5;
  border-radius: 20px;
  padding: 26px 26px 26px;
  text-align: center;
  box-shadow: 0 22px 70px rgba(0,0,0,0.22);
  border: 1px solid rgba(0,0,0,0.08);
}

.tightrope-modal-title {
  margin: 0;
  color: #253044;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.4px;
  font-family: 'Nunito', sans-serif;
}

.tightrope-modal-title .emoji {
  margin-right: 12px;
}

.tightrope-modal-stats {
  margin-top: 18px;
  background: #e6edf8;
  border: 1px solid #d7e1f0;
  border-radius: 12px;
  padding: 18px 16px;
}

.tightrope-modal-scoreline {
  color: #2e394c;
  font-size: 28px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
}

.tightrope-modal-scoreline .score {
  color: #2f5fff;
}

.tightrope-modal-streakline {
  margin-top: 6px;
  color: #707a88;
  font-size: 20px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
}

.tightrope-modal-streakline .value {
  color: #00b34d;
  font-weight: 800;
}

.tightrope-modal-actions {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.tightrope-modal-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 16px 18px;
  width: 100%;
  font-size: 17px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  color: #2f3c50;
  background: #dfe3e8;
}

.tightrope-modal-btn.primary .bolt {
  color: #ff8f2b;
  margin-right: 10px;
}

@media (max-width: 900px) {
  .tightrope-panel {
    padding: 22px 18px 16px;
  }
  .tightrope-question-title {
    font-size: 24px;
  }
  .tightrope-meta-left,
  .tightrope-meta-right {
    font-size: 15px;
  }
  .tightrope-options-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .tightrope-option-btn {
    min-height: 74px;
    font-size: 17px;
    padding: 15px 16px;
  }
  .tightrope-modal-title {
    font-size: 32px;
  }
  .tightrope-modal-scoreline {
    font-size: 24px;
  }
  .tightrope-modal-streakline {
    font-size: 18px;
  }
  .tightrope-start-card {
    padding: 24px 18px 28px;
  }
  .tightrope-start-title {
    font-size: 24px;
  }
  .tightrope-start-button {
    font-size: 17px;
    padding: 17px 16px;
  }
}

@media (max-width: 480px) {
  .tightrope-start-title {
    font-size: 20px;
  }
  .tightrope-start-subtitle {
    font-size: 13px;
  }
  .tightrope-preview-box {
    height: 80px;
  }
  .tightrope-start-note {
    font-size: 10px;
  }
}
