/* The first-time guide (src/guide.js): centred slides and spotlight bubbles in the blue-and-gold look of the Lobby cards. */
.guide {
  position: fixed;
  inset: 0;
  z-index: 70; /* over the shared modal (60) */
  font-family: "Baloo 2", "Fredoka", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.guide--slide { display: flex; align-items: center; justify-content: center; background: rgba(3, 8, 26, 0.84); }

/* the ring on the button being explained; its huge outer shadow is what dims the rest of Home */
.guide__hole {
  position: fixed;
  box-sizing: border-box;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(3, 8, 26, 0.8), 0 0 0 2px #2fc3ff, 0 0 22px 4px rgba(47, 195, 255, 0.7);
  pointer-events: none;
  transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.guide__hole[hidden] { display: none; }

.guide__bubble {
  box-sizing: border-box;
  padding: 16px 16px 14px;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #0a3a9a, #04195e);
  border: 2px solid #2fc3ff;
  border-radius: 22px;
  box-shadow: 0 0 22px rgba(47, 195, 255, 0.55), inset 0 0 14px rgba(47, 195, 255, 0.2);
}
.guide--slide .guide__bubble { position: relative; width: min(calc(100vw - 32px), 340px); }
.guide--spot .guide__bubble { position: fixed; }
.guide__title { margin: 4px 0 6px; font-size: 22px; font-weight: 800; line-height: 1.1; }
.guide__text { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.38; color: #cfe6ff; }

/* the ✕ that closes the whole guide: a round badge on the card's top-right corner (a 40px touch target, 32px drawn) */
.guide .guide__x {
  position: absolute;
  top: -13px;
  right: -9px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
}
.guide__x i {
  position: relative;
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #0a3a9a, #04195e);
  border: 2px solid #2fc3ff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(47, 195, 255, 0.55);
}
.guide__x i::before, .guide__x i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 3px;
  margin: -1.5px 0 0 -7px;
  background: #cfe6ff;
  border-radius: 2px;
  transform: rotate(45deg);
}
.guide__x i::after { transform: rotate(-45deg); }
.guide .guide__x:active i { transform: scale(0.92); }

/* the little arrow from the bubble to the button it is about */
.guide__tail {
  position: absolute;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  background: #0a3a9a;
  border: 2px solid #2fc3ff;
  transform: rotate(45deg);
}
.guide--slide .guide__tail { display: none; }
.guide__tail--up { top: -11px; border-right: 0; border-bottom: 0; }
.guide__tail--down { bottom: -11px; border-left: 0; border-top: 0; }

/* the dots get their own centred row above the buttons, so nine steps never crowd Skip / Full rules / Let's play */
.guide__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-top: 12px; }
.guide__dots { order: -1; flex: 1 0 100%; display: flex; gap: 6px; align-items: center; justify-content: center; }
.guide__dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(143, 184, 232, 0.35); }
.guide__dot.is-on { width: 20px; border-radius: 6px; background: #ffd869; }
.guide .guide__skip {
  min-width: 0;
  min-height: 0;
  padding: 6px 4px;
  font: 700 14px/1 "Baloo 2", "Fredoka", system-ui, sans-serif;
  color: #8fb8e8;
  background: none;
  border: none;
  box-shadow: none;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}

/* the round gold Next arrow; on the last step it becomes a "Let's play" pill */
.guide .guide__next {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  width: 50px;
  height: 50px;
  padding: 0;
  color: #3a2204;
  background: linear-gradient(180deg, #ffe382, #f6b53a);
  border: 2px solid #fff3b0;
  border-radius: 50%;
  box-shadow: 0 3px 0 #a86a10, 0 0 14px rgba(255, 210, 90, 0.5);
  cursor: pointer;
  animation: guide-nudge 1.4s ease-in-out infinite;
}
.guide .guide__next--go { width: auto; height: auto; padding: 11px 22px; border-radius: 999px; font: 800 17px/1 "Baloo 2", "Fredoka", system-ui, sans-serif; }
.guide .guide__next:active { transform: translateY(2px); box-shadow: 0 1px 0 #a86a10; animation: none; }
.guide__chev { width: 11px; height: 11px; margin-left: -4px; border: solid #3a2204; border-width: 4px 4px 0 0; border-radius: 2px; transform: rotate(45deg); }
@keyframes guide-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

/* the small pictures on the slides: the real board, marbles and set balls */
.gart {
  position: relative;
  height: 132px;
  margin: 0 auto 8px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.42)), #6b3f1b url("assets/arena.jpg") center / cover;
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.gart img { position: absolute; display: block; }
.gart--sets { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.45)), url("assets/arena.jpg"); }
.gart--sets img { position: static; width: 56px; height: auto; }

/* the live board in the first two slides: the real game, drawn by the game's own board code */
.gdemo {
  position: relative;
  width: min(100%, 250px);
  aspect-ratio: 1;
  margin: 0 auto 8px;
  overflow: hidden;
  background: #1a1008;
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.gdemo__canvas { display: block; width: 100%; height: 100%; }
.gdemo__banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;
  padding: 0 6%;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 0 #b36b00, 0 0 18px rgba(255, 207, 63, 0.8);
  pointer-events: none;
}
.gdemo__banner[hidden] { display: none; }
.gdemo__stars { color: #ffd869; }
.gdemo__banner.pop { animation: gdemo-pop 1.6s ease-out; }
@keyframes gdemo-pop { 0% { transform: scale(0.4); opacity: 0; } 18% { transform: scale(1.12); opacity: 1; } 75% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.04) translateY(-10px); opacity: 0.85; } }

/* short phones (a small SE-style screen): a slightly smaller board so the card never runs off the top or bottom */
@media (max-height: 640px) { .gdemo { width: min(100%, 205px); } }

@media (prefers-reduced-motion: reduce) {
  .guide .guide__next { animation: none; }
  .guide__hole { transition: none; }
}
