/* Reset + base */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sct-font-main);
  background: #111;
  color: #f5f5f5;
}

/* Inner game wrapper
   IMPORTANT: this is inside SCT already, so do NOT act like a full-page app */
.page {
  min-height: auto;          /* was 100vh, that was pushing content down */
  max-width: 820px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
  display: block;            /* stop nested flex page layout */
  
}

.description {
  max-width: 320px;
  opacity: 0.8;
  font-size: 14px;
  margin-bottom: 12px;
}

/* Main stack */
.main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* was center */
  align-items: center;
  text-align: center;
  gap: 12px;                    /* slightly more deliberate spacing */
  padding-top: 0;               /* remove clamp top padding */
}

/* --- Cat circle + cat image --- */
.cat-stage {
  width: 360px;
  height: 360px;
  position: relative;
  margin: 14px auto;
}

.zoomie-spoke {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  transform-origin: center center;
  pointer-events: none;
  z-index: 4;
}

.zoomie-spoke.is-active {
  animation: zoomieSpokeSpin 5000ms linear infinite;
}

.cat-wrapper {
  width: 300px;
  height: 300px;
  background: linear-gradient(to bottom, #ffffff 0%, #f3f3f3 60%, #e9e9e9 100%);
  border-radius: 50%;
  border: 2px solid #ff4fa8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 30px auto 0;
  cursor: pointer;
  overflow: hidden;

  box-shadow:
    6px 2px 0 #c43b86,
    8px 6px 14px rgba(0, 0, 0, 0.30),
    0 0 8px rgba(255, 79, 168, 0.35),
    inset 0 3px 6px rgba(255, 255, 255, 0.65),
    inset 0 -8px 12px rgba(0, 0, 0, 0.18);

  transition:
    transform 0.08s ease-out,
    box-shadow 0.12s ease-out;

  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.cat-wrapper img {
  width: 80%;
  height: auto;
  max-width: 80%;
  max-height: 80%;
  user-select: none;
  -webkit-user-drag: none;
}

.zoomie-cat {
  position: absolute;
  top: -24px;
  left: -24px;
  width: 48px;
  height: 48px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(180px);
}

.zoomie-cat.is-active {
  opacity: 1;
  animation: zoomieRunBounce 170ms steps(2, end) infinite;
}

@keyframes zoomieSpokeSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes zoomieRunBounce {
  0% {
    transform: translateX(180px) translateY(0) rotate(-6deg) scaleY(0.96);
  }
  100% {
    transform: translateX(180px) translateY(-2px) rotate(6deg) scaleY(1);
  }
}


.cat-wrapper.zoomies-mode {
  animation: zoomiesGlowFlash 0.26s ease-in-out infinite;
}

@keyframes zoomiesGlowFlash {
  0%,
  100% {
    box-shadow:
      6px 2px 0 #c43b86,
      8px 6px 14px rgba(0, 0, 0, 0.30),
      0 0 22px rgba(255, 255, 255, 0.95),
      0 0 46px rgba(255, 255, 255, 0.9),
      0 0 86px rgba(255, 79, 168, 0.85),
      0 0 140px rgba(255, 255, 255, 0.75),
      inset 0 3px 6px rgba(255, 255, 255, 0.65),
      inset 0 -8px 12px rgba(0, 0, 0, 0.18);
  }
  50% {
    box-shadow:
      6px 2px 0 #c43b86,
      8px 6px 14px rgba(0, 0, 0, 0.30),
      0 0 30px #ffffff,
      0 0 64px rgba(255, 255, 255, 0.98),
      0 0 120px rgba(255, 79, 168, 0.95),
      0 0 180px rgba(255, 255, 255, 0.9),
      inset 0 3px 6px rgba(255, 255, 255, 0.7),
      inset 0 -8px 12px rgba(0, 0, 0, 0.18);
  }
}


.cat-wrapper.final-level-flash {
  animation: finalLevelFlash 0.28s ease-in-out 7;
}

@keyframes finalLevelFlash {
  0%,
  100% {
    box-shadow:
      6px 2px 0 #c43b86,
      8px 6px 14px rgba(0, 0, 0, 0.30),
      0 0 20px rgba(255, 255, 255, 0.9),
      0 0 42px rgba(255, 255, 255, 0.8),
      0 0 90px rgba(255, 255, 255, 0.75),
      inset 0 3px 6px rgba(255, 255, 255, 0.65),
      inset 0 -8px 12px rgba(0, 0, 0, 0.18);
  }
  50% {
    box-shadow:
      6px 2px 0 #c43b86,
      8px 6px 14px rgba(0, 0, 0, 0.30),
      0 0 30px #ffffff,
      0 0 70px rgba(255, 255, 255, 0.98),
      0 0 140px rgba(255, 255, 255, 0.95),
      0 0 210px rgba(255, 255, 255, 0.9),
      inset 0 3px 6px rgba(255, 255, 255, 0.75),
      inset 0 -8px 12px rgba(0, 0, 0, 0.18);
  }
}


.cat-wrapper.finale-overload {
  z-index: 10001;
  animation: finaleOverloadGrow 1.5s ease-in forwards;
}

@keyframes finaleOverloadGrow {
  0% {
    transform: scale(1);
    box-shadow:
      6px 2px 0 #c43b86,
      8px 6px 14px rgba(0, 0, 0, 0.30),
      0 0 18px rgba(255, 255, 255, 0.7),
      0 0 40px rgba(255, 255, 255, 0.55);
  }
  60% {
    transform: scale(1.8);
    box-shadow:
      0 0 30px rgba(255, 255, 255, 0.9),
      0 0 80px rgba(255, 255, 255, 0.85),
      0 0 170px rgba(255, 255, 255, 0.8);
  }
  100% {
    transform: scale(4.2);
    box-shadow:
      0 0 42px rgba(255, 255, 255, 1),
      0 0 120px rgba(255, 255, 255, 0.95),
      0 0 260px rgba(255, 255, 255, 0.9);
  }
}

.finale-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(255, 255, 255, 0);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.finale-overlay.is-active {
  opacity: 1;
}

.finale-overlay.is-overload {
  animation: finaleWhiteFlash 2.6s ease-out forwards;
}

.finale-overlay.is-blackout {
  background: #000000;
  transition: background 600ms ease;
}

.finale-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 16px;
  padding: 24px;
}

.finale-line {
  margin: 0;
  color: #fef7ff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 800ms ease, transform 800ms ease;
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  letter-spacing: 0.02em;
}

.finale-restart-button {
  margin: 18px auto 0;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 500ms ease, transform 500ms ease;
}

.finale-overlay.show-restart .finale-restart-button {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.finale-overlay.show-line-1 .finale-line-1,
.finale-overlay.show-line-2 .finale-line-2 {
  opacity: 1;
  transform: translateY(0);
}

@keyframes finaleWhiteFlash {
  0% { background: rgba(255, 255, 255, 0); }
  15% { background: rgba(255, 255, 255, 0.65); }
  45% { background: rgba(255, 255, 255, 1); }
  100% { background: rgba(255, 255, 255, 0); }
}

.cat-wrapper:active {
  transform: translateY(2px) scale(0.98);
  box-shadow:
    3px 1px 0 #c43b86,
    5px 4px 10px rgba(0, 0, 0, 0.26),
    0 0 6px rgba(255, 79, 168, 0.45),
    inset 0 2px 5px rgba(255, 255, 255, 0.35),
    inset 0 -5px 9px rgba(0, 0, 0, 0.20);
}

/* Floating +1 */
.floating-xp {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;

  background: #ff4fa8;
  color: #ffffff;
  padding: 7px;
  border-radius: 50%;
  border: 3px solid #ff177f;
  box-shadow:
    0 0 8px rgba(255, 0, 140, 0.9),
    0 4px 6px rgba(0, 0, 0, 0.45);

  font-size: 0.9rem;
  font-weight: bold;
  white-space: nowrap;

  animation: float-up 1.4s ease-out forwards;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -140%) scale(1.1);
  }
}

.cat-wrapper.level-up {
  animation: levelPulse 700ms ease-out;
  box-shadow:
    6px 2px 0 #c43b86,
    12px 10px 22px rgba(0, 0, 0, 0.35),

    /* BIG WHITE GLOW */
    0 0 18px #ffffff,
    0 0 40px rgba(255, 255, 255, 0.95),
    0 0 70px rgba(255, 255, 255, 0.8),

    /* subtle pink aura behind white */
    0 0 120px rgba(255, 79, 168, 0.6),

    inset 0 4px 7px rgba(255, 255, 255, 0.9),
    inset 0 -8px 12px rgba(0, 0, 0, 0.18);
}

@keyframes levelPulse {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.08); }
  30%  { transform: scale(1); }

  45%  { transform: scale(1.08); }
  60%  { transform: scale(1); }

  75%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
/* XP progress bar container */
.xp-progress {
  width: 100%;
  max-width: 300px;
  height: 18px;
  background: #000000;
  border: 4px solid #f5b3df;
  border-radius: 500px;
  margin: 14px auto 0;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(255, 170, 220, 0.4);
}

.xp-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffffff, #e5e5e5, #fdfdfd);
  border-radius: 999px;
  transition: width 0.25s ease-out;
}

/* --- Game stats panel --- */
.stats-panel {
  width: 92%;
  max-width: 700px;
  margin: 10px auto 0;          /* was 20px, tighten */
  padding: 14px 16px 18px;

  background: linear-gradient(to bottom, #221522 0%, #0e070e 60%, #040104 100%);
  border-radius: 14px;
  border: 2px solid #ff4fa8;

  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.85),
    0 0 12px rgba(255, 79, 168, 0.35),
    inset 0 0 0 4px rgba(255, 79, 168, 0.20),
    inset 0 3px 5px rgba(255, 255, 255, 0.18),
    inset 0 -4px 7px rgba(0, 0, 0, 0.80);

  font-family: var(--sct-font-main);

  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out;

  box-sizing: border-box;
}

.stats-panel:hover {
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 4px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 79, 168, 0.35);
}

.stats-panel:active {
  transform: translateY(1px);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 4px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(255, 79, 168, 0.4);
}

.stats-panel #xp,
.stats-panel #level,
.stats-panel #nextLevel {
  text-align: center;
  margin: 4px 0;
  color: #f6e7f2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
  font-size: 0.95rem;
}

.stats-panel #xp,
.stats-panel #level {
  font-weight: 600;
  letter-spacing: 0.03em;
  padding-bottom: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 79, 168, 0.25);
}

.stats-panel #nextLevel {
  font-size: 0.85rem;
  color: #f2e6ef;
}

.stats-panel .xp-progress {
  margin-top: 10px;
}

.stats-panel > * {
  position: relative;
  z-index: 1;
}

/* --- Reusable HUD panel frame for title/other panels --- */
.hud-panel {
  width: 100%;                /* fill the inner game width */
  max-width: 750px;
  margin: 0 auto;
  padding: 14px 16px 18px;

  background: linear-gradient(to bottom, #221522 0%, #0e070e 60%, #040104 100%);
  border-radius: 14px;
  border: 2px solid #ff4fa8;

  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.85),
    0 0 12px rgba(255, 79, 168, 0.35),
    inset 0 0 0 4px rgba(255, 79, 168, 0.20),
    inset 0 3px 5px rgba(255, 255, 255, 0.18),
    inset 0 -4px 7px rgba(0, 0, 0, 0.80);

  font-family: var(--sct-font-main);

  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out;

  box-sizing: border-box;
}

.hud-panel .game-title {
  color: #ffe4f6;
  text-align: center;
  font-size: 1.4rem;
  margin: 0 0 6px 0;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 151, 214, 0.35);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 79, 168, 0.25);
  margin-bottom: 10px;
}

.hud-panel .game-desc {
  text-align: center;
  color: #f4e8f1;
  font-size: 0.9rem;
  margin: 12px 16px 0;     /* was 24px all around, tightened */
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}



.collection-panel {
  width: 92%;
  max-width: 700px;
  margin: 12px auto 0;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid #ff4fa8;
  background: linear-gradient(to bottom, #221522, #040104);
  box-shadow:
    0 12px 24px rgba(0,0,0,.85),
    0 0 12px rgba(255,79,168,.35),
    inset 0 0 0 4px rgba(255,79,168,.2);
  box-sizing: border-box;
}

.collection-title {
  text-align: center;
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 1;
  color: #f5dff0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.cat-collection-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

@media (max-width: 520px) {
  .cat-collection-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.cat-slot {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,79,168,.1);
  overflow: hidden;
}


.cat-slot[data-tooltip] {
  position: relative;
  cursor: pointer;
  overflow: visible;
}

.cat-slot[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  background: rgba(28, 12, 27, 0.96);
  color: #fff4fc;
  border: 1px solid rgba(255, 79, 168, 0.65);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  padding: 4px 8px;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
  z-index: 2;
  transition: opacity 0.12s ease;
}

.cat-slot[data-tooltip]:hover::after,
.cat-slot.show-tooltip::after {
  opacity: 1;
}

.cat-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.level-desc {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.2rem;
  color: #fff7fd;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.72),
    0 0 8px rgba(255,255,255,0.3);
  transition: text-shadow 0.2s ease;
}

.level-desc.zoomies-flash {
  animation: zoomiesFlash 0.45s ease-in-out infinite;
}

@keyframes zoomiesFlash {
  0%,
  100% {
    color: #ffd3f0;
    text-shadow:
      0 0 8px rgba(255,255,255,0.45),
      0 0 16px rgba(248, 209, 229, 0.4);
    font-size: 2rem;

  }

  50% {
    color: #ffffff;
    text-shadow:
      0 0 12px rgba(255,255,255,0.75),
      0 0 24px rgba(249, 220, 235, 0.7);
    font-size: 2rem;

  }
}
