/* ============================================
   HOW TO PLAY GUIDE
   ============================================ */

/* Self-contained fullscreen — overrides .modal base completely */
#guide-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 5100 !important;
 
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 1.5vh, 2rem) clamp(8px, 3vw, 120px);
  background: var(--bg-color, #ffffff);
  color: var(--text-color, #111111);
  text-align: center;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
 
}

#guide-modal.hidden {
  display: none !important;
}

body.dark-mode #guide-modal,
[data-theme="dark"] #guide-modal {
  background: var(--bg-color, #1a1a1a) !important;
  color: var(--text-color, #fff);
}

[data-theme="dark"] .guide-content {
  color: var(--text-color, #f3f3f3);
}

[data-theme="dark"] .guide-dot-item {
  background: rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .guide-block-label,
[data-theme="dark"] .guide-desc {
  color: var(--text-color, #e9e9e9);
}

/* Content fills the modal */
.guide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 28px 24px;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
  color: var(--text-color, #111);
}

/* Progress dots */
.guide-dots {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

.guide-dot-item {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfcfcf;
  transition: background 0.25s, transform 0.25s;
}

.guide-dot-item.active {
  background: #fb6354;
  transform: scale(1.4);
}

/* Slides container — fills remaining space */
.guide-slides {
  flex: 1;
  width: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Each slide — absolutely fills the container */
.guide-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3.5vh, 28px);
  text-align: center;
  padding: 0 8px;
  box-sizing: border-box;
}

.guide-slide.active {
  display: flex;
  animation: guide-slide-in 0.25s ease;
}

.guide-slide.from-left.active {
  animation: guide-slide-in-left 0.25s ease;
}

@keyframes guide-slide-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes guide-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Graphic zone */
.guide-graphic {
  display: flex;
  align-items: center;

  justify-content: center;
  min-height: clamp(100px, 24vh, 180px);
}

/* Label */
.guide-label {
  font-size: clamp(0.9rem, 2.4vw, 1.3rem);
  letter-spacing: 0.22em;
  font-weight: 700;
}

/* Description */
.guide-desc {
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  line-height: 1.6;
  opacity: 0.82;
  max-width: min(60ch, 88vw);
  margin: 0;
}

/* --- SLIDE 1 & 2: Demo dice --- */
.guide-dice-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: clamp(8px, 2vw, 14px);
  align-items: center;
  justify-content: center;
}

.guide-demo-die {
  --dice-size: clamp(54px, 13vw, 70px);
  width: clamp(54px, 13vw, 70px) !important;
  height: clamp(54px, 13vw, 70px) !important;
  border-radius: 14%;
  cursor: default;
  animation: guide-die-float 3s ease-in-out infinite;
  flex-shrink: 0;
}

.guide-demo-die:nth-child(2) {
  animation-delay: 0.35s;
}
.guide-demo-die:nth-child(3) {
  animation-delay: 0.7s;
}
.guide-demo-die:nth-child(4) {
  animation-delay: 1.05s;
}

@keyframes guide-die-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.guide-block-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.guide-block-label {
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  font-weight: 700;
  opacity: 0.7;
  letter-spacing: 0.04em;
}

/* --- SLIDE 3: Tap --- */
.guide-tap-visual {
  position: relative;
  width: clamp(110px, 28vw, 155px);
  height: clamp(110px, 28vw, 155px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-tap-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid #fb6354;
  width: 100%;
  height: 100%;
  animation: guide-pulse 2s ease-out infinite;
}

.guide-tap-ring-2 {
  animation-delay: 1s;
}

@keyframes guide-pulse {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.guide-tap-icon {
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  color: #fb6354;
  position: relative;
  z-index: 2;
  animation: guide-tap-bounce 1.6s ease-in-out infinite;
}

@keyframes guide-tap-bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.88);
  }
}

/* --- SLIDE 4: Hit block --- */
.guide-hit-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.guide-hit-die {
  --dice-size: clamp(68px, 17vw, 92px);
  width: clamp(68px, 17vw, 92px) !important;
  height: clamp(68px, 17vw, 92px) !important;
  border-radius: 14%;
  cursor: default;
  animation: guide-hit-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes guide-hit-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  38% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(251, 99, 84, 0.18);
  }
  55% {
    transform: scale(0.97);
  }
}

.guide-hit-dot {
  animation: guide-dot-light 1.8s ease-in-out infinite !important;
}

.guide-hit-dot:nth-child(1) {
  animation-delay: 0s !important;
}
.guide-hit-dot:nth-child(2) {
  animation-delay: 0.06s !important;
}

@keyframes guide-dot-light {
  0%,
  30%,
  100% {
    background-color: var(--dot-color, #000);
  }
  42%,
  58% {
    background-color: rgba(255, 255, 255, 0.95);
  }
}

.guide-hit-label-row {
  display: flex;
  justify-content: center;
  min-height: 2em;
  align-items: center;
}

.guide-hit-label {
  font-size: clamp(0.95rem, 2.6vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #fb6354;
  animation: guide-hit-label-cycle 1.8s ease-in-out infinite;
}

@keyframes guide-hit-label-cycle {
  0%,
  25% {
    opacity: 0;
    transform: translateY(6px);
  }
  42%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* --- SLIDE 5: Hold --- */
.guide-hold-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 28px);
}

.guide-hold-die-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.guide-hold-die {
  animation: guide-die-float 3s ease-in-out infinite !important;
}

.guide-hold-icon {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  color: #fb6354;
  animation: guide-hold-hand 2.4s ease-in-out infinite;
}

@keyframes guide-hold-hand {
  0%,
  60%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  25% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

.guide-hold-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: guide-panel-in 2.4s ease-in-out infinite;
}

@keyframes guide-panel-in {
  0%,
  38% {
    opacity: 0;
    transform: translateX(-10px);
  }
  55%,
  88% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
  }
}

.guide-hold-row {
  background: #f0f0f0;
  border-radius: 10px;
  padding: 0.38rem 0.9rem;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  font-weight: 700;
  color: #222;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: clamp(125px, 30vw, 175px);
  text-align: left;
}

.guide-hold-row i {
  color: #fb6354;
  width: 1.1em;
  text-align: center;
  flex-shrink: 0;
}

body.dark-mode .guide-hold-row,
[data-theme="dark"] .guide-hold-row {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color, #eee);
}

/* --- SLIDE 6: Edit --- */
.guide-edit-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 28px);
}

.guide-metro-img {
  width: clamp(46px, 12vw, 68px);
  height: auto;
  opacity: 0.85;
  pointer-events: none;
}

.guide-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-edit-btn {
  background: #f0f0f0;
  border-radius: 8px;
  padding: 0.38rem 0.9rem;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  font-weight: 700;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-edit-btn i {
  color: #fb6354;
}

body.dark-mode .guide-edit-btn,
[data-theme="dark"] .guide-edit-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color, #eee);
}

/* --- SLIDE 7: Ready --- */
.guide-ready-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-robot-img {
  width: clamp(80px, 22vw, 125px);
  height: auto;
  pointer-events: none;
  animation: guide-robot-bob 2s ease-in-out infinite;
}

@keyframes guide-robot-bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(0deg);
  }
}

/* Bottom nav */
.guide-nav {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 10% 16px;
  margin-top: 16px;
}

.guide-next-btn {
  font-size: clamp(0.88rem, 2.3vw, 1rem);
  padding: 0.68rem 1.9rem;
  height: auto;
  letter-spacing: 0.12em;
  min-width: 105px;
}

/* ============================================
   OFFSET WIZARD — CLEAN RESTYLE
   ============================================ */

#offset-wizard-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 5000 !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
  border-radius: 0 !important;
}

#offset-wizard-modal.hidden {
  display: none !important;
}

.offset-wizard-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 6vh, 56px) clamp(22px, 2vw, 72px);
  background: var(--bg-color, #ffffff);
  color: var(--text-color, #111111);
  text-align: center;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
  position: relative;
}

.wizard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.5vh, 20px);
}

.wizard-icon {
  width: clamp(80px, 22vw, 120px);
  height: auto;
  max-width: 70%;
  display: block;
  opacity: 0.85;
  animation: guide-robot-bob 2.5s ease-in-out infinite;
}

.wizard-title {
  font-size: clamp(0.9rem, 2.6vw, 1.35rem);
  letter-spacing: 0.22em;
  font-weight: 700;
}

.wizard-main p,
#wizard-instructions {
  margin: 0;
  opacity: 0.82;
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  line-height: 1.55;
  max-width: min(62ch, 86vw);
}

.wizard-status {
  font-size: clamp(0.9rem, 2.4vw, 1.2rem);
  font-weight: 700;
  min-height: 1.6em;
}

.wizard-tap-btn {
  font-size: clamp(1.3rem, 4vw, 2rem);
  padding: 1.1rem 3.2rem;
  height: auto;
  min-width: min(460px, 84vw);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  border-radius: 14px;
}

.wizard-tap-btn.is-hidden {
  display: none;
}

.wizard-bottom {
  width: min(520px, 92vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-link-btn {
  background: none;
  border: none;
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-color, #111);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
}

.wizard-link-btn.secondary {
  color: #fb6354;
}

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

.wizard-finish {
  position: absolute;
  inset: 0;
  background: var(--bg-color, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.wizard-finish-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.wizard-check {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid #fb6354;
  color: #fb6354;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 700;
}

.wizard-finish-title {
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.wizard-finish-text {
  margin: 0;
  opacity: 0.8;
  font-size: clamp(0.9rem, 2.3vw, 1.15rem);
  max-width: min(56ch, 82vw);
  line-height: 1.55;
}

body.dark-mode #offset-wizard-modal,
[data-theme="dark"] #offset-wizard-modal {
  background: var(--bg-color) !important;
}
body.dark-mode .offset-wizard-content,
body.dark-mode .wizard-finish,
[data-theme="dark"] .offset-wizard-content,
[data-theme="dark"] .wizard-finish {
  background: var(--bg-color) !important;
  color: var(--text-color);
}

[data-theme="dark"] .wizard-link-btn {
  color: var(--text-color, #f3f3f3);
}

[data-theme="dark"] .wizard-link-btn.secondary {
  color: #ff8d7f;
}
