/* RocketTales — Activity pages
 * Shared shell + per-activity styling. Keeps the dark RocketTales palette
 * but puts the line-art / illustrations on a white canvas so colors read
 * correctly. Designed to work touch-first.
 */

:root {
  --rt-act-accent:    #00E5FF;
  --rt-act-accent-2:  #FF3DFF;
  --rt-act-warn:      #FFD700;
}

body.rt-activity-body {
  background: var(--navy, #0a0322);
  color: #fff;
  min-height: 100vh;
  padding-top: 0;
  margin: 0;
}

/* ── STICKY DOWNLOAD BANNER ────────────────────────────────── */
.rt-act-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #13003A 0%, #1B0654 100%);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.rt-act-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
}
.rt-act-sticky-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.rt-act-sticky-icon { font-size: 1.2rem; line-height: 1; }
.rt-act-sticky-text {
  font-size: .92rem;
  color: #fff;
  line-height: 1.35;
}
.rt-act-sticky-cta {
  flex-shrink: 0;
  background: linear-gradient(135deg, #FF3DFF 0%, #7B2FFF 100%);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(255,61,255,.35);
  white-space: nowrap;
}
.rt-act-sticky-cta:hover { color: #fff; transform: translateY(-1px); }

@media (max-width: 600px) {
  .rt-act-sticky-text { font-size: .82rem; }
  .rt-act-sticky-cta  { font-size: .82rem; padding: 8px 12px; }
}

/* ── ACTIVITY SHELL ────────────────────────────────────────── */
.rt-activity-main { padding: 12px 0 30px; }
.rt-act-breadcrumbs { margin-bottom: .5rem; font-size: .82rem; }
.rt-activity-header { margin-bottom: .75rem; }
.rt-activity-h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 .15rem 0;
  color: #fff;
  line-height: 1.2;
}
.rt-activity-subtitle {
  font-size: .85rem;
  color: var(--text-dim, #B2A8D6);
  margin: 0;
}
.rt-activity-subtitle a { color: var(--rt-act-accent); }

.rt-activity-empty {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
}
.rt-activity-empty p { color: var(--text-dim, #B2A8D6); margin-bottom: 1.25rem; }

/* Generic stage + spinner. */
.rt-act-stage {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.rt-act-canvas-wrap,
.rt-act-spot-wrap {
  position: relative;
  width: 100%;
  background: #fff;
}
.rt-act-lineart,
.rt-act-spotimg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity .2s;
}
.rt-act-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.rt-act-spotsvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rt-act-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.7);
  z-index: 2;
}
.rt-spin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,.12);
  border-top-color: var(--rt-act-accent);
  animation: rt-spin 0.9s linear infinite;
}
@keyframes rt-spin { to { transform: rotate(360deg); } }

/* ── TOOLBAR ───────────────────────────────────────────────── */
.rt-act-toolbar {
  background: rgba(13,3,52,.6);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 14px 16px;
}
.rt-act-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}
.rt-act-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  cursor: pointer;
  padding: 0;
  transition: transform .15s, border-color .15s;
}
.rt-act-swatch:hover { transform: scale(1.08); }
.rt-act-swatch.is-active {
  border-color: var(--rt-act-accent);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(0,229,255,.25);
}

.rt-act-brushrow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}
.rt-act-brushlabel { color: #fff; font-size: 1.2rem; line-height: 1; }
.rt-act-brush { flex: 0 1 220px; max-width: 60%; accent-color: var(--rt-act-accent); }

.rt-act-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.rt-act-counter {
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  padding: 6px 10px;
  min-width: 48px;
  text-align: center;
}
.rt-act-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(0,229,255,.35);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.rt-act-btn:hover {
  background: rgba(0,229,255,.12);
  border-color: var(--rt-act-accent);
}
.rt-act-btn-print {
  border-color: var(--rt-act-accent-2);
  color: var(--rt-act-accent-2);
}
.rt-act-btn-print:hover {
  background: rgba(255,61,255,.12);
  border-color: var(--rt-act-accent-2);
}

/* ── SPOT THE DIFFERENCES ──────────────────────────────────── */
.rt-act-stage-spot .rt-act-spotimg { cursor: pointer; }
.rt-act-spot-status {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}
.rt-act-spot-counter { color: var(--rt-act-accent-2); }
.rt-act-spot-found {
  color: var(--text-dim, #B2A8D6);
  font-size: .85rem;
  font-weight: 500;
  margin-left: 4px;
}
.rt-act-spot-hint {
  color: var(--text-dim, #B2A8D6);
  font-size: .82rem;
  text-align: center;
  margin: 0 0 10px 0;
}

/* ── PUZZLE ───────────────────────────────────────────────── */
.rt-act-puzzle { display: flex; flex-direction: column; gap: 1rem; }
.rt-act-puzzle-controls-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: rgba(13,3,52,.6);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.rt-act-level-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt-act-level-label { color: var(--text-dim, #B2A8D6); font-size: .85rem; margin: 0; }
.rt-act-level-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.rt-act-level-tab {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text-dim, #B2A8D6);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.rt-act-level-tab.is-active {
  border-color: var(--rt-act-accent);
  color: var(--rt-act-accent);
  background: rgba(0,229,255,.08);
}
.rt-act-puzzle-progress {
  color: var(--rt-act-accent-2);
  font-weight: 800;
  font-size: 1.05rem;
}

.rt-act-puzzle-stage {
  background: #0a0322;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
}
.rt-act-puzzle-board {
  position: relative;
  width: 100%;
  background: #050111;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 10px;
  touch-action: none;       /* let drags through; the page won't scroll. */
}
.rt-act-puzzle-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.18;
  pointer-events: none;
}
.rt-act-puzzle-slot {
  position: absolute;
  box-sizing: border-box;
  border: 1px dashed rgba(255,255,255,.15);
}
.rt-act-puzzle-piece {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-color: #1a1240;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.rt-act-puzzle-piece.is-dragging {
  cursor: grabbing;
  box-shadow: 0 16px 36px rgba(0,0,0,.6);
  z-index: 9999;
}
.rt-act-puzzle-piece.is-placed {
  border-color: rgba(0,229,255,.4);
  box-shadow: none;
  cursor: default;
}

.rt-act-puzzle-tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  padding: 8px;
  background: rgba(0,0,0,.35);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  min-height: 72px;
  max-height: 160px;
  overflow-y: auto;
}
.rt-act-puzzle-tray .rt-act-puzzle-piece {
  aspect-ratio: 1;
  height: auto;
}

.rt-act-puzzle-done {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--rt-act-warn);
  padding: 12px;
  background: rgba(255,215,0,.08);
  border: 1px solid rgba(255,215,0,.35);
  border-radius: 12px;
}

/* ── BOTTOM CTA ────────────────────────────────────────────── */
.rt-act-bottom-cta {
  background: linear-gradient(180deg, #13003A 0%, #0a0322 100%);
  padding: 70px 0 90px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.rt-act-bottom-cta h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
}
.rt-act-bottom-cta p {
  color: var(--text-dim, #B2A8D6);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}
.rt-act-bottom-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin-bottom: 2rem;
}
.rt-act-bottom-links a {
  color: var(--rt-act-accent);
  text-decoration: none;
  font-weight: 600;
}
.rt-act-bottom-btn { font-size: 1.05rem; padding: 14px 32px; }

@media (max-width: 600px) {
  .rt-activity-h1 { font-size: 1.3rem; }
  .rt-act-puzzle-tray { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
}
