:root {
  --ink: #1a1030;
  --pink: #ff4fa3;
  --pink-deep: #e91e8c;
  --pink-soft: #ffb6d9;
  --gold: #ffd54a;
  --gold-deep: #f5a623;
  --sky-top: #6ec8ff;
  --sky-mid: #ff9ed2;
  --sky-bot: #ff6eb4;
  --cream: #fff7fb;
  --panel: #fff0f7;
  --green: #7cfc00;
  --blue: #4da3ff;
  --shadow: #1a1030;
  --font-display: "Lilita One", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bot) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  min-height: 100vh;
}

button, input {
  font: inherit;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  filter: blur(1px);
  animation: drift 28s linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.c1 { width: 140px; height: 42px; top: 12%; left: -10%; animation-duration: 32s; }
.c1::before { width: 58px; height: 58px; top: -28px; left: 22px; }
.c1::after { width: 44px; height: 44px; top: -18px; left: 68px; }

.c2 { width: 180px; height: 48px; top: 28%; left: -20%; animation-duration: 40s; animation-delay: -10s; }
.c2::before { width: 70px; height: 70px; top: -34px; left: 30px; }
.c2::after { width: 52px; height: 52px; top: -22px; left: 90px; }

.c3 { width: 120px; height: 36px; top: 55%; left: -15%; animation-duration: 36s; animation-delay: -20s; }
.c3::before { width: 48px; height: 48px; top: -22px; left: 18px; }
.c3::after { width: 38px; height: 38px; top: -16px; left: 58px; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(130vw); }
}

.stars-layer span {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0.55;
  animation: twinkle 2.4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { transform: scale(0.7) rotate(0deg); opacity: 0.35; }
  50% { transform: scale(1.15) rotate(18deg); opacity: 0.9; }
}

.view {
  position: relative;
  z-index: 1;
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0.75rem 0.85rem 2rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.view.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: viewIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* HOME HERO */
.hero {
  text-align: center;
  margin-top: 0.25rem;
  width: min(640px, 100%);
}

.brand-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: brandPop 0.7s cubic-bezier(0.2, 1.4, 0.3, 1);
}

@keyframes brandPop {
  from { transform: scale(0.6) rotate(-6deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.star-icon {
  width: 48px;
  height: 48px;
  fill: var(--gold);
  stroke: var(--ink);
  stroke-width: 3;
  filter: drop-shadow(0 4px 0 var(--ink));
  animation: spinStar 4s ease-in-out infinite;
}

@keyframes spinStar {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.08); }
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 14vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: #fff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    0 6px 0 var(--pink-deep),
    0 10px 0 var(--ink);
  cursor: pointer;
  user-select: none;
}

.brand-sub {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4.5vw, 2rem);
  letter-spacing: 0.35em;
  color: var(--gold);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  margin-top: 0.15rem;
}

.tagline {
  margin-top: 0.55rem;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}

.egg-hint {
  margin: 0.85rem 0 0.35rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.75;
  text-align: center;
}

.star-hit {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.star-hit.spin .star-icon {
  animation: spinOnce 0.5s ease;
}

@keyframes spinOnce {
  from { transform: rotate(0) scale(1); }
  to { transform: rotate(360deg) scale(1.15); }
}

.character-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 1.5vw, 0.9rem);
  margin: 0.75rem 0 0.75rem;
  width: min(820px, 100%);
  min-height: 120px;
}

.brawler-portrait {
  border: none;
  background: transparent;
  cursor: pointer;
  width: clamp(88px, 18vw, 130px);
  padding: 0;
  filter: drop-shadow(0 8px 0 rgba(26, 16, 48, 0.22));
  transition: transform 0.15s ease;
}

.brawler-portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  border: 4px solid var(--ink);
  background: linear-gradient(180deg, #fff, #ffe0f0);
  box-shadow: 0 5px 0 var(--ink);
}

.brawler-portrait:hover {
  transform: translateY(-6px) scale(1.04);
}

.brawler-portrait:active {
  transform: translateY(2px) scale(0.98);
}

.brawler-name {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-align: center;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.float-a { animation: bob 2.4s ease-in-out infinite; }
.float-b { animation: bobBig 2.8s ease-in-out infinite 0.4s; z-index: 2; }
.float-c { animation: bob 2.2s ease-in-out infinite 0.8s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes bobBig {
  0%, 100% { transform: translateY(0) scale(1.08); }
  50% { transform: translateY(-14px) scale(1.08); }
}

.brawler-rail-wrap {
  width: min(820px, 100%);
  margin-bottom: 1.25rem;
}

.rail-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  margin-bottom: 0.55rem;
  text-align: center;
}

.brawler-rail {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.35rem 0.25rem 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.rail-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.4rem 0.45rem 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  width: 86px;
  text-align: center;
}

.rail-chip img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.2rem;
}

.rail-chip span {
  font-weight: 900;
  font-size: 0.68rem;
  line-height: 1.1;
}

.rail-chip:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.secret-tip {
  margin-top: 1rem;
  font-weight: 800;
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: center;
}

.secret-tip kbd {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.75rem;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: min(420px, 100%);
  margin-top: 0.85rem;
  order: 0;
}

.bs-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 1.05rem 1.15rem;
  min-height: 72px;
  cursor: pointer;
  font-weight: 900;
  color: #fff;
  text-align: left;
  box-shadow: 0 7px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.bs-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, transparent 48%);
  pointer-events: none;
}

.bs-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 0 var(--ink);
}

.bs-btn:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 var(--ink);
}

.bs-btn-panic {
  background: linear-gradient(180deg, #ff7ec8 0%, var(--pink) 55%, var(--pink-deep) 100%);
}

.bs-btn-goals {
  background: linear-gradient(180deg, #ffe27a 0%, var(--gold) 55%, var(--gold-deep) 100%);
  color: var(--ink);
}

.bs-btn-pink {
  background: linear-gradient(180deg, #ff7ec8 0%, var(--pink) 55%, var(--pink-deep) 100%);
  justify-content: center;
  text-align: center;
}

.bs-btn-gold {
  background: linear-gradient(180deg, #ffe27a 0%, var(--gold) 55%, var(--gold-deep) 100%);
  color: var(--ink);
  justify-content: center;
}

.bs-btn-ghost {
  background: linear-gradient(180deg, #fff 0%, #f0e6ef 100%);
  color: var(--ink);
  justify-content: center;
}

.bs-btn.compact {
  width: auto;
  padding: 0.75rem 1.1rem;
  flex-shrink: 0;
}

.btn-icon {
  font-size: 1.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25));
}

.btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.btn-text strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  font-weight: 400;
}

.btn-text small {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.9;
}

/* PANELS */
.panel {
  width: min(560px, 100%);
  background: var(--panel);
  border: 5px solid var(--ink);
  border-radius: 28px;
  padding: 1.25rem 1.15rem 1.5rem;
  box-shadow: 0 10px 0 var(--ink), 0 18px 40px rgba(26, 16, 48, 0.25);
  position: relative;
  margin-top: 0.5rem;
}

.back-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  z-index: 2;
}

.back-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.25rem 0.5rem 0.25rem 3rem;
  margin-bottom: 1rem;
}

.mini-brawler {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  animation: bob 2.5s ease-in-out infinite;
}

.mini-brawler svg {
  width: 100%;
  height: 100%;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  color: var(--pink-deep);
  letter-spacing: 0.02em;
  line-height: 1;
}

.panel-sub {
  font-weight: 700;
  font-size: 0.92rem;
  margin-top: 0.25rem;
  opacity: 0.85;
}

.progress-track {
  height: 16px;
  background: #ffd6ea;
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  width: 16.66%;
  background: linear-gradient(90deg, var(--pink-soft), var(--pink));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15);
}

.step-counter {
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
  color: var(--pink-deep);
}

.step-card {
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 1.25rem 1.1rem;
  min-height: 220px;
  box-shadow: 0 5px 0 var(--ink);
}

.step-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: bounceIn 0.5s cubic-bezier(0.2, 1.4, 0.3, 1);
}

@keyframes bounceIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin-bottom: 0.55rem;
  color: var(--ink);
}

.step-card p {
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.step-hint {
  background: #ffe8f4;
  border: 3px dashed var(--pink);
  border-radius: 14px;
  padding: 0.75rem;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--pink-deep);
}

.breathe-circle {
  width: 120px;
  height: 120px;
  margin: 0.75rem auto 1rem;
  border-radius: 50%;
  border: 5px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff, var(--pink-soft) 55%, var(--pink));
  box-shadow: 0 6px 0 var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.72); }
  40% { transform: scale(1.08); }
  60% { transform: scale(1.08); }
}

.step-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.step-actions .bs-btn {
  flex: 1;
}

/* GOALS */
.trophy-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.trophy-stat {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.65rem 0.4rem;
  text-align: center;
  box-shadow: 0 4px 0 var(--ink);
}

.trophy-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.trophy-stat strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--pink-deep);
  line-height: 1.1;
}

.goal-form {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.goal-form input {
  flex: 1;
  min-width: 0;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  font-weight: 700;
  background: #fff;
  box-shadow: 0 4px 0 var(--ink);
  outline: none;
}

.goal-form input:focus {
  border-color: var(--pink);
}

.goal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.goal-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.75rem 0.8rem;
  box-shadow: 0 4px 0 var(--ink);
  animation: viewIn 0.35s ease;
}

.goal-item.done {
  background: #e8ffe0;
  opacity: 0.85;
}

.goal-item.done .goal-title {
  text-decoration: line-through;
  opacity: 0.7;
}

.goal-check {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #ffe27a, var(--gold));
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 var(--ink);
}

.goal-check:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.goal-item.done .goal-check {
  background: linear-gradient(180deg, #b6ff7a, #57c100);
}

.goal-title {
  flex: 1;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.25;
  word-break: break-word;
}

.goal-delete {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.45;
  padding: 0.25rem;
}

.goal-delete:hover {
  opacity: 1;
}

.empty-goals {
  text-align: center;
  font-weight: 800;
  opacity: 0.65;
  padding: 1.5rem 0.5rem;
}

.empty-goals.hidden {
  display: none;
}

/* OVERLAYS */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(26, 16, 48, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: fadeIn 0.25s ease;
}

.overlay[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reward-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 213, 74, 0.45), transparent 25%),
    radial-gradient(circle at 80% 25%, rgba(255, 79, 163, 0.4), transparent 28%),
    radial-gradient(circle at 50% 80%, rgba(124, 252, 0, 0.3), transparent 30%);
  animation: pulseBurst 1.2s ease-in-out infinite;
}

@keyframes pulseBurst {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.reward-card {
  position: relative;
  width: min(380px, 100%);
  background: linear-gradient(180deg, #fff7fb, #ffe0f0);
  border: 5px solid var(--ink);
  border-radius: 28px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 12px 0 var(--ink);
  animation: rewardPop 0.55s cubic-bezier(0.2, 1.5, 0.3, 1);
}

@keyframes rewardPop {
  from { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.reward-portrait,
.mini-brawler-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.5rem;
  animation: bob 1.8s ease-in-out infinite;
  filter: drop-shadow(0 6px 0 rgba(26, 16, 48, 0.25));
}

.mini-brawler-img {
  width: 64px;
  height: 64px;
  margin: 0;
  flex-shrink: 0;
}

.rarity-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem !important;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: #9cf;
  color: var(--ink);
  margin-bottom: 0.4rem !important;
}

.rarity-tag[data-rarity="EPIC"],
.rarity-tag[data-rarity="Epic"] { background: #d850ff; color: #fff; }
.rarity-tag[data-rarity="MYTHIC"],
.rarity-tag[data-rarity="Mythic"] { background: #fe5e86; color: #fff; }
.rarity-tag[data-rarity="LEGENDARY"],
.rarity-tag[data-rarity="Legendary"] { background: #fff11e; color: var(--ink); }
.rarity-tag[data-rarity="RARE"],
.rarity-tag[data-rarity="Rare"] { background: #68fdff; color: var(--ink); }
.rarity-tag[data-rarity="COMMON"] { background: #b0e3e6; color: var(--ink); }

.reward-card h3 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--pink-deep);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  margin-bottom: 0.35rem;
}

.reward-card p {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.reward-prize {
  font-family: var(--font-display);
  font-size: 1.35rem !important;
  color: var(--gold-deep);
  margin-bottom: 1rem !important;
}

.calm-card {
  background: linear-gradient(180deg, #fff8e7, #ffe9a8);
}

.step-buddy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.step-buddy img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 14px;
  z-index: 60;
  pointer-events: none;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Toast + flash + starr drop */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(20px);
  z-index: 80;
  max-width: min(920px, calc(100% - 2rem));
  background: #fff;
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  font-weight: 900;
  box-shadow: 0 6px 0 var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.brawl-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(255, 79, 163, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.brawl-flash.show {
  opacity: 1;
  animation: flashPulse 1.2s ease;
}

.brawl-flash img {
  width: min(220px, 50vw);
  filter: drop-shadow(0 10px 0 rgba(26, 16, 48, 0.35));
}

.brawl-flash p {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(3rem, 14vw, 6rem);
  color: #fff;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 8px 0 var(--ink);
  letter-spacing: 0.06em;
}

@keyframes flashPulse {
  0% { transform: scale(1.08); }
  30% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.starr-drop {
  text-align: center;
  animation: rewardPop 0.5s cubic-bezier(0.2, 1.5, 0.3, 1);
}

.starr-orb {
  width: 140px;
  height: 140px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 6px solid var(--ink);
  background:
    radial-gradient(circle at 35% 30%, #fff 0%, #ff9ed2 35%, #a855f7 70%, #4c1d95 100%);
  box-shadow: 0 10px 0 var(--ink), 0 0 40px rgba(168, 85, 247, 0.55);
  display: grid;
  place-items: center;
  animation: bob 1.4s ease-in-out infinite, starrGlow 1.6s ease-in-out infinite;
}

.starr-q {
  font-family: var(--font-display);
  font-size: 4rem;
  color: #fff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}

.starr-label {
  font-family: var(--font-display);
  font-size: 2rem;
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  margin-bottom: 1rem;
}

@keyframes starrGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.starr-result .reward-portrait {
  width: 140px;
  height: 140px;
}

body.leon-invisible .brawler-portrait,
body.leon-invisible .rail-chip {
  opacity: 0.08;
  transition: opacity 0.4s ease;
}

body.sandy-sleep::after {
  content: "💤 Sandy Super… zzz";
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(80, 140, 200, 0.45);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.5rem);
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

body.showdown-mode {
  filter: saturate(1.35) contrast(1.08);
}

body.showdown-mode .sky {
  background: radial-gradient(circle at center, transparent 20%, rgba(26, 16, 48, 0.35) 100%);
}

@media (min-width: 700px) {
  .home-actions {
    flex-direction: row;
    width: min(720px, 100%);
  }

  .character-stage {
    min-height: 200px;
  }

  .brand {
    font-size: clamp(4rem, 12vw, 6.5rem);
  }

  .tagline {
    font-size: 1.05rem;
  }
}

@media (max-width: 700px) {
  .star-icon {
    width: 34px;
    height: 34px;
  }

  .hero {
    margin-top: 0.1rem;
  }

  .home-actions {
    width: 100%;
    margin-top: 0.7rem;
  }

  .bs-btn {
    min-height: 76px;
    border-radius: 16px;
    padding: 1rem 1rem;
  }

  .btn-text strong {
    font-size: 1.28rem;
  }

  .character-stage {
    min-height: 0;
  }

  .brawler-portrait {
    width: clamp(64px, 16vw, 96px);
  }

  .brawler-name {
    font-size: 0.78rem;
  }

  .brawler-rail-wrap {
    margin-top: 0.25rem;
  }

  .daily-banner {
    width: 100%;
    padding: 0.7rem 0.75rem;
  }

  .panel {
    margin-top: 0.25rem;
    border-radius: 22px;
    padding: 1rem 0.9rem 1.25rem;
  }

  .music-fab {
    top: max(0.45rem, env(safe-area-inset-top));
    right: max(0.45rem, env(safe-area-inset-right));
    padding: 0.5rem 0.7rem;
  }
}

@media (max-width: 420px) {
  .brand {
    -webkit-text-stroke: 3px var(--ink);
  }

  .panel-head {
    padding-left: 2.75rem;
  }

  .step-actions {
    flex-direction: column;
  }

  .secret-tip {
    font-size: 0.72rem;
  }
}

/* Music FAB */
.music-fab {
  position: fixed;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe27a, var(--gold));
  padding: 0.55rem 0.85rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  color: var(--ink);
}

.music-fab.playing {
  background: linear-gradient(180deg, #ff7ec8, var(--pink));
  color: #fff;
  animation: musicPulse 0.8s ease-in-out infinite;
}

.music-fab:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.music-icon {
  font-size: 1.1rem;
}

.music-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

@keyframes musicPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Daily banner + grid */
.daily-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(520px, 100%);
  margin: 0.85rem 0 0.25rem;
  border: 4px solid var(--ink);
  border-radius: 20px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  text-align: left;
  background: linear-gradient(135deg, #fff7fb 0%, #ffe0f0 45%, #ffe27a 100%);
  box-shadow: 0 6px 0 var(--ink);
  color: var(--ink);
}

.daily-banner.pulse {
  animation: bannerPulse 1.6s ease-in-out infinite;
}

.daily-banner.claimed {
  opacity: 0.88;
  background: linear-gradient(135deg, #e8ffe0, #fff7fb);
  animation: none;
}

@keyframes bannerPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 6px 0 var(--ink); }
  50% { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
}

.daily-banner-orb {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.2));
}

.daily-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.daily-banner-text strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--pink-deep);
}

.daily-banner-text small {
  font-weight: 800;
  font-size: 0.82rem;
  opacity: 0.85;
}

.daily-streak-pill {
  flex-shrink: 0;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  font-weight: 900;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 var(--ink);
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.daily-cell {
  position: relative;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.65rem 0.4rem;
  text-align: center;
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-height: 110px;
}

.daily-cell.today {
  background: linear-gradient(180deg, #ffe27a, #ffb6d9);
  transform: scale(1.04);
  z-index: 1;
}

.daily-cell.done {
  background: #e8ffe0;
  opacity: 0.9;
}

.daily-day {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.7;
}

.daily-emoji {
  font-size: 1.55rem;
  line-height: 1;
}

.daily-cell-title {
  font-weight: 900;
  font-size: 0.72rem;
  line-height: 1.15;
}

.daily-check {
  position: absolute;
  top: 4px;
  right: 6px;
  font-weight: 900;
  color: #57c100;
}

.daily-now {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--pink-deep);
  letter-spacing: 0.04em;
}

.daily-note {
  margin-top: 0.75rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  opacity: 0.75;
}

#dailyClaimBtn:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
  box-shadow: 0 4px 0 var(--ink);
}

.help-now {
  margin-top: 1rem;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 4px 0 var(--ink);
}

.help-now summary {
  cursor: pointer;
  font-weight: 900;
  color: #b81460;
}

.help-now p {
  margin-top: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
}

.help-call {
  display: block;
  margin-top: 0.8rem;
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 0.8rem;
  background: linear-gradient(180deg, #ff7a88, #e6294f);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
  box-shadow: 0 5px 0 var(--ink);
}

.help-note {
  font-size: 0.85rem;
}

.breathe-guide {
  text-align: center;
}

.breathe-guide p {
  font-size: 0.9rem;
}

.goal-suggestions {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  margin: -0.1rem 0 1rem;
  padding: 0.2rem 0.1rem 0.45rem;
}

.goal-suggestions button {
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  padding: 0.45rem 0.7rem;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--pink-deep);
}

@media (max-width: 700px) {
  .music-fab {
    top: max(0.45rem, env(safe-area-inset-top));
    right: max(0.45rem, env(safe-area-inset-right));
    padding: 0.45rem 0.62rem;
  }

  .music-label {
    font-size: 0.78rem;
  }

  .daily-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .help-now {
    margin-bottom: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .breathe-circle {
    animation: none !important;
  }
}

/* ========== GAME PROGRESSION UI ========== */
.top-hud {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  width: min(520px, 100%);
  margin: 0 auto 0.55rem;
  padding-right: 4.5rem;
}

.streak-chip,
.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--ink);
}

.coin-chip {
  cursor: pointer;
  background: linear-gradient(180deg, #ffe27a, var(--gold));
}

.xp-panel {
  width: min(420px, 100%);
  margin: 0.7rem auto 0.2rem;
  background: rgba(255, 255, 255, 0.72);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.55rem 0.7rem 0.65rem;
  box-shadow: 0 4px 0 var(--ink);
}

.xp-meta {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.xp-track,
.goal-progress-track,
.collect-progress .xp-track {
  position: relative;
  height: 14px;
  background: #ffd6ea;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.xp-fill,
.goal-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffb6d9, var(--pink), var(--gold));
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.xp-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: translateX(-100%);
  animation: shine 2.8s ease-in-out infinite;
}

@keyframes shine {
  0%, 40% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}

.game-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: min(520px, 100%);
  margin: 0.85rem 0 0.4rem;
}

.game-nav-btn {
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: rgba(255,255,255,.8);
  padding: 0.55rem 0.35rem;
  font-weight: 900;
  font-size: 0.78rem;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.game-nav-btn span { font-size: 1.15rem; }

.bounce-tap {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bounce-tap:active {
  transform: translateY(4px) scale(0.98);
}

.float-card,
.float-cards .brawler-portrait,
.shop-card,
.ach-card,
.collect-card,
.stat-card,
.timeline-item {
  animation: softFloat 3.4s ease-in-out infinite;
}

@keyframes softFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.float-in {
  animation: rewardPop 0.55s cubic-bezier(0.2, 1.5, 0.3, 1);
}

.sparkle {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  z-index: 5;
  pointer-events: none;
  animation: twinkle 1.1s ease-out forwards;
}

.rail-chip.locked {
  filter: grayscale(1);
  opacity: 0.55;
}

.goal-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.goal-progress-track { height: 10px; }
.goal-progress-label {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.7;
}

.mystery-stage {
  text-align: center;
  margin: 0.5rem 0 1rem;
}

.mystery-box {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 0.75rem;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffe27a, #ff9ed2);
  box-shadow: 0 8px 0 var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.mystery-box .box-body { font-size: 4rem; position: relative; z-index: 1; }
.mystery-box .box-glow {
  position: absolute;
  inset: -8px;
  border-radius: 32px;
  background: radial-gradient(circle, rgba(255,213,74,.55), transparent 70%);
  animation: starrGlow 1.4s ease-in-out infinite;
}
.mystery-box.shake { animation: boxShake 0.5s ease; }
.mystery-box.opened { opacity: 0.55; filter: grayscale(0.3); }

@keyframes boxShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg) scale(1.04); }
  75% { transform: rotate(8deg) scale(1.04); }
}

.loot-stage {
  width: min(360px, 100%);
  text-align: center;
}

.loot-box {
  width: 140px;
  height: 140px;
  margin: 0 auto 1rem;
  position: relative;
  display: grid;
  place-items: center;
  font-size: 4.5rem;
  transition: transform 0.4s ease;
}
.loot-box.opening { animation: boxShake 0.8s ease; }
.loot-box.opened { transform: scale(0.7) translateY(-20px); opacity: 0.35; }
.loot-card {
  background: linear-gradient(180deg, #fff7fb, #ffe0f0);
  border: 5px solid var(--ink);
  border-radius: 24px;
  padding: 1.2rem;
  box-shadow: 0 10px 0 var(--ink);
  animation: rewardPop 0.5s cubic-bezier(0.2, 1.5, 0.3, 1);
}
.loot-icon { font-size: 3rem; margin-bottom: 0.35rem; }

.emoji-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: 0 4px 0 var(--ink);
}

.shop-grid,
.ach-grid,
.collect-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}

.shop-card,
.ach-card,
.collect-card,
.stat-card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.75rem;
  text-align: center;
  box-shadow: 0 4px 0 var(--ink);
}

.shop-icon, .ach-icon { font-size: 1.8rem; }
.shop-card h3, .ach-card h3, .collect-card h3 {
  font-size: 0.85rem;
  margin: 0.35rem 0;
  font-family: var(--font-display);
  font-weight: 400;
}
.shop-card p, .ach-card p, .collect-card p {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.ach-card.locked, .collect-card.locked {
  filter: grayscale(1);
  opacity: 0.55;
}
.ach-card.unlocked {
  background: linear-gradient(180deg, #fff7fb, #ffe8f4);
}
.ach-state {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.collect-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.collect-progress { margin-bottom: 0.85rem; }

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-card span { font-size: 0.72rem; font-weight: 800; opacity: 0.75; }
.stat-card strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--pink-deep); }

.stat-bars { margin-top: 0.85rem; display: flex; flex-direction: column; gap: 0.55rem; }
.stat-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 42px;
  gap: 0.45rem;
  align-items: center;
  font-weight: 800;
  font-size: 0.78rem;
}

.tree-stage { text-align: center; padding: 1rem 0; }
.tree-visual {
  font-size: 5.5rem;
  filter: drop-shadow(0 8px 0 rgba(26,16,48,.2));
  animation: softFloat 2.8s ease-in-out infinite;
}
.tree-caption {
  text-align: center;
  font-weight: 800;
  line-height: 1.4;
}

.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 55vh;
  overflow: auto;
}
.timeline-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0.7rem;
  box-shadow: 0 3px 0 var(--ink);
}
.timeline-item small { display: block; opacity: 0.65; font-weight: 700; margin-top: 0.15rem; }
.tl-icon { font-size: 1.4rem; }

.level-card { background: linear-gradient(180deg, #fff8e7, #ffd6ea); }
.level-burst-icon { font-size: 3rem; animation: spinStar 1.2s ease-in-out infinite; }
.ach-pop-icon { font-size: 3rem; animation: bounceIn 0.55s cubic-bezier(0.2, 1.4, 0.3, 1); }

.sad-streak {
  position: fixed;
  left: 50%;
  top: 20%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 90;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  font-weight: 900;
  box-shadow: 0 6px 0 var(--ink);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.sad-streak.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.panic-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}
.panic-timer {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--pink-deep);
}

/* Calm mode — reduce stimulation */
body.calm-mode {
  filter: saturate(0.72) contrast(0.96);
}
body.calm-mode .sky,
body.calm-mode .character-stage,
body.calm-mode .brawler-rail-wrap,
body.calm-mode .game-nav,
body.calm-mode .daily-banner,
body.calm-mode .egg-hint,
body.calm-mode .music-fab,
body.calm-mode .secret-tip {
  display: none !important;
}
body.calm-mode .view:not(#view-panic) { display: none !important; }
body.calm-mode #view-panic.active {
  display: flex !important;
}
body.calm-mode .float-card,
body.calm-mode .float-a,
body.calm-mode .float-b,
body.calm-mode .float-c,
body.calm-mode .sparkle,
body.calm-mode .xp-shine {
  animation: none !important;
}
body.calm-mode .calm-panel {
  box-shadow: 0 6px 0 var(--ink);
  background: #fff7fb;
}
body.calm-mode .bs-btn {
  min-height: 84px;
  font-size: 1.05rem;
}
body.calm-fadeout {
  transition: filter 0.7s ease;
}

body[data-theme="theme_sunset"] {
  background: linear-gradient(180deg, #ffb347 0%, #ff6eb4 55%, #ff4fa3 100%) fixed;
}
body[data-theme="theme_night"] {
  background: linear-gradient(180deg, #1a1030 0%, #4a2068 45%, #ff4fa3 100%) fixed;
}
body[data-theme="theme_mint"] {
  background: linear-gradient(180deg, #b8f2e0 0%, #ffb6d9 55%, #ff9ed2 100%) fixed;
}
body.fx-glow .brand {
  filter: drop-shadow(0 0 10px rgba(255, 79, 163, 0.55));
}
body.fx-extra-bounce .bounce-tap:active {
  transform: translateY(6px) scale(0.95);
}

@media (max-width: 700px) {
  .top-hud { padding-right: 4.2rem; }
  .game-nav { grid-template-columns: repeat(3, 1fr); }
  .shop-grid, .ach-grid, .collect-grid, .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-bar-row { grid-template-columns: 72px 1fr 36px; }
}
