/* =========================================================================
   Evelyn's Room — styles
   Soft, cute, bouncy. Pink + purple. Modern, not Myspace.
   ========================================================================= */

:root {
  /* Core palette */
  --pink: #ff7eb6;
  --pink-deep: #ff4fa3;
  --purple: #a974ff;
  --purple-deep: #8b5cf6;
  --plum: #5b2a6b; /* friendly dark text */
  --plum-soft: #7b4b8a;
  --cream: #fff6fb;

  /* Background blobs */
  --bg-1: #ffe3f3;
  --bg-2: #f3e4ff;
  --bg-3: #ffeef8;

  /* Soft shadows */
  --shadow-sm: 0 6px 16px rgba(167, 76, 160, 0.16);
  --shadow-md: 0 14px 30px rgba(167, 76, 160, 0.22);
  --shadow-lg: 0 26px 50px rgba(139, 92, 246, 0.28);

  --radius: 28px;
  --radius-lg: 40px;

  --font-head: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--plum);
  background:
    radial-gradient(900px 700px at 12% -8%, var(--bg-2), transparent 60%),
    radial-gradient(900px 700px at 95% 0%, #ffe1ee, transparent 55%),
    radial-gradient(1100px 900px at 50% 120%, #e9defc, transparent 60%),
    linear-gradient(160deg, var(--bg-3), var(--bg-1));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.app {
  position: relative;
  min-height: 100vh;
  z-index: 0;
}

/* -------------------------------------------------------------------------
   Floating background decorations
   ------------------------------------------------------------------------- */
.floaty {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floaty__bit {
  position: absolute;
  bottom: -10%;
  opacity: 0;
  filter: drop-shadow(0 6px 10px rgba(167, 76, 160, 0.15));
  animation-name: float-up;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

@keyframes float-up {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  50% {
    transform: translateY(-55vh) translateX(calc(var(--drift) * 30px))
      rotate(180deg) scale(1);
  }
  90% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-110vh) translateX(calc(var(--drift) * -20px))
      rotate(360deg) scale(0.8);
    opacity: 0;
  }
}

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */
.home {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(18px, 4vw, 40px) 60px;
}

/* -------------------------------------------------------------------------
   Hero / header
   ------------------------------------------------------------------------- */
.hero {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 52px);
}

.hero__hi {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--plum-soft);
  background: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hero__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.8rem, 11vw, 6rem);
  line-height: 0.95;
  letter-spacing: -1px;
}

.hero__title-word {
  display: inline-block;
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 5px 0 rgba(255, 255, 255, 0.65);
  animation: wiggle 4s ease-in-out infinite;
}

.hero__title-word--2 {
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation-delay: 0.4s;
}

.hero__sub {
  margin-top: 16px;
  font-size: clamp(1rem, 3.2vw, 1.35rem);
  font-weight: 700;
  color: var(--plum-soft);
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-2deg) translateY(0);
  }
  50% {
    transform: rotate(2deg) translateY(-4px);
  }
}

/* -------------------------------------------------------------------------
   Game grid
   ------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(16px, 2.5vw, 26px);
}

/* -------------------------------------------------------------------------
   Game cards
   ------------------------------------------------------------------------- */
.card {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-body);
  color: var(--plum);
  background: #fff;
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease;
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Colored top section: holds the subject pill + icon */
.card__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px 18px;
  background: var(--card-grad);
}

/* White body: title, blurb, and the play button always sit on white */
.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 16px 16px 20px;
  background: #fff;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-10px) scale(1.03) rotate(-0.6deg);
  box-shadow: var(--shadow-lg);
  outline: none;
}

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

.card__subject {
  align-self: center;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  padding: 4px 12px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.card__icon {
  font-size: clamp(3.2rem, 9vw, 4.2rem);
  line-height: 1;
  margin: 10px 0 6px;
  filter: drop-shadow(0 8px 10px rgba(91, 42, 107, 0.22));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover .card__icon,
.card:focus-visible .card__icon {
  transform: scale(1.18) rotate(8deg);
}

.card__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--plum);
}

.card__blurb {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--plum-soft);
  opacity: 0.85;
}

.card__play {
  margin-top: auto;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
  padding: 9px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(255, 79, 163, 0.35);
}

/* Per-card color themes (the colored wash + matching play button) */
.card--berry {
  --card-grad: linear-gradient(160deg, #ffd0e7, #ff9ec7);
}
.card--berry .card__play {
  background: linear-gradient(180deg, #ff8cc0, #f8519c);
  box-shadow: 0 6px 14px rgba(248, 81, 156, 0.4);
}

.card--grape {
  --card-grad: linear-gradient(160deg, #e4d4ff, #b693ff);
}
.card--grape .card__play {
  background: linear-gradient(180deg, #b48cff, #8b5cf6);
  box-shadow: 0 6px 14px rgba(139, 92, 246, 0.4);
}

.card--sky {
  --card-grad: linear-gradient(160deg, #cfeaff, #9ad0ff);
}
.card--sky .card__play {
  background: linear-gradient(180deg, #7cc0ff, #4aa3f5);
  box-shadow: 0 6px 14px rgba(74, 163, 245, 0.4);
}

.card--mint {
  --card-grad: linear-gradient(160deg, #cdf6e6, #97e9c8);
}
.card--mint .card__play {
  background: linear-gradient(180deg, #6fd9b0, #34bf90);
  box-shadow: 0 6px 14px rgba(52, 191, 144, 0.4);
}

.card--bubblegum {
  --card-grad: linear-gradient(160deg, #ffd6ee, #ffaadd);
}
.card--bubblegum .card__play {
  background: linear-gradient(180deg, #ff9dd6, #f562b9);
  box-shadow: 0 6px 14px rgba(245, 98, 185, 0.4);
}

.card--lilac {
  --card-grad: linear-gradient(160deg, #e8dcff, #c4adff);
}
.card--lilac .card__play {
  background: linear-gradient(180deg, #b79bff, #9575f0);
  box-shadow: 0 6px 14px rgba(149, 117, 240, 0.4);
}

.card--sunny {
  --card-grad: linear-gradient(160deg, #fff0c2, #ffd874);
}
.card--sunny .card__play {
  background: linear-gradient(180deg, #ffc94a, #f7a823);
  box-shadow: 0 6px 14px rgba(247, 168, 35, 0.4);
}

.card--peach {
  --card-grad: linear-gradient(160deg, #ffe0cf, #ffb898);
}
.card--peach .card__play {
  background: linear-gradient(180deg, #ff9f76, #f97c47);
  box-shadow: 0 6px 14px rgba(249, 124, 71, 0.4);
}

.card--ocean {
  --card-grad: linear-gradient(160deg, #c9f0f5, #8fdbe8);
}
.card--ocean .card__play {
  background: linear-gradient(180deg, #5fc9da, #2fb0c6);
  box-shadow: 0 6px 14px rgba(47, 176, 198, 0.4);
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.footer {
  text-align: center;
  margin-top: clamp(34px, 6vw, 60px);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  color: var(--plum-soft);
  opacity: 0.8;
}

/* -------------------------------------------------------------------------
   "Coming soon" modal
   ------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(91, 42, 107, 0.32);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
}

.modal__card {
  --card-grad: linear-gradient(160deg, #ffd0e7, #ff9ec7);
  position: relative;
  width: min(420px, 100%);
  text-align: center;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 30px 32px;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  overflow: hidden;
}

.modal__card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 46%;
  background: var(--card-grad);
  opacity: 0.85;
}

.modal__card > * {
  position: relative;
}

.modal__icon {
  display: inline-block;
  font-size: 4.6rem;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(91, 42, 107, 0.25));
  animation: bounce 1.4s ease-in-out infinite;
}

.modal__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2rem;
  margin-top: 8px;
  color: var(--plum);
}

.modal__text {
  margin-top: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--plum-soft);
}

.btn-big {
  margin-top: 24px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  color: #fff;
  cursor: pointer;
  border: none;
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  padding: 14px 38px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(139, 92, 246, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-big:hover,
.btn-big:focus-visible {
  transform: scale(1.07);
  outline: none;
}

.btn-big:active {
  transform: scale(0.96);
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* -------------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------------- */
@media (max-width: 520px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card {
    padding: 20px 12px 18px;
  }
  .card__title {
    font-size: 1.1rem;
  }
  .card__play {
    font-size: 0.82rem;
    padding: 8px 16px;
  }
}

/* =========================================================================
   XP / Levels / Chests / Shop / Room  (added in this pass)
   ========================================================================= */

/* Per-theme accent colors, shared by progress bars and reward badges */
.prof-row--berry, .reward__badge--berry { --accent: #f8519c; --accent2: #ff8cc0; }
.prof-row--grape, .reward__badge--grape { --accent: #8b5cf6; --accent2: #b48cff; }
.prof-row--sky, .reward__badge--sky { --accent: #4aa3f5; --accent2: #7cc0ff; }
.prof-row--mint, .reward__badge--mint { --accent: #34bf90; --accent2: #6fd9b0; }
.prof-row--bubblegum, .reward__badge--bubblegum { --accent: #f562b9; --accent2: #ff9dd6; }
.prof-row--lilac, .reward__badge--lilac { --accent: #9575f0; --accent2: #b79bff; }
.prof-row--sunny, .reward__badge--sunny { --accent: #f7a823; --accent2: #ffc94a; }
.prof-row--peach, .reward__badge--peach { --accent: #f97c47; --accent2: #ff9f76; }
.prof-row--ocean, .reward__badge--ocean { --accent: #2fb0c6; --accent2: #5fc9da; }

/* ----- HUD ----- */
.hud {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(14px, 4vw, 28px);
}
.hud__side {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hud__btn,
.hud__stars {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.92);
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hud__btn.is-on { outline: 3px solid rgba(169, 116, 255, 0.5); }
.hud__stars {
  color: #8a5a00;
  background: linear-gradient(180deg, #ffe49a, #ffd166);
  box-shadow: 0 6px 14px rgba(247, 168, 35, 0.4);
}
.hud__btn:hover,
.hud__stars:hover { transform: scale(1.06); }
.hud__btn:active,
.hud__stars:active { transform: scale(0.96); }

/* ----- Home nav pills ----- */
.home-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 auto clamp(22px, 4vw, 34px);
}
.nav-pill {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  border: none;
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-pill:hover { transform: translateY(-3px) scale(1.04); }
.nav-pill:active { transform: scale(0.97); }
.nav-pill--prog { background: linear-gradient(180deg, #ffc94a, #f7a823); }
.nav-pill--shop { background: linear-gradient(180deg, #ff8cc0, #f8519c); }
.nav-pill--room { background: linear-gradient(180deg, #b48cff, #8b5cf6); }

/* Level badge on ready game cards */
.card__lvl {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.card.is-ready .card__icon { animation: gentle-bob 2.6s ease-in-out infinite; }
@keyframes gentle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ----- Generic screen wrapper ----- */
.screen {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(6px, 2vw, 16px) clamp(16px, 4vw, 36px) 70px;
}
.screen__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 6vw, 3rem);
  text-align: center;
  color: var(--plum);
}
.screen__sub {
  text-align: center;
  font-weight: 700;
  color: var(--plum-soft);
  margin: 6px 0 22px;
  font-size: 1.05rem;
}
.screen__cta {
  text-align: center;
  margin-top: 28px;
}

/* ----- Progress bars ----- */
.bar {
  height: 14px;
  width: 100%;
  background: rgba(91, 42, 107, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent2, #ff8cc0), var(--accent, #ff4fa3));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(255, 126, 182, 0.5);
}
.bar--big { height: 22px; margin: 14px 0 4px; }

/* ----- Profile ----- */
.prof-section { margin-bottom: 26px; }
.prof-section__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--plum);
  margin-bottom: 12px;
  padding-left: 4px;
}
.prof-list { display: grid; gap: 12px; }
.prof-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 22px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.prof-row__icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(91, 42, 107, 0.2));
}
.prof-row__main { flex: 1; min-width: 0; }
.prof-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.prof-row__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--plum);
}
.prof-row__lvl {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  padding: 3px 12px;
  border-radius: 999px;
}
.prof-row__xp {
  margin-top: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--plum-soft);
  opacity: 0.8;
}

/* ----- Shop ----- */
.shop-section { margin-bottom: 26px; }
.shop-section__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--plum);
  margin-bottom: 12px;
  padding-left: 4px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.shop-card {
  background: #fff;
  border-radius: 22px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.shop-card__art {
  width: 100%;
  height: 92px;
  display: grid;
  place-items: center;
}
.shop-card__img {
  max-width: 86px;
  max-height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(91, 42, 107, 0.18));
}
span.shop-card__img.art-emoji { font-size: 3.4rem; }
.shop-card__swatch {
  width: 86px;
  height: 70px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), var(--shadow-sm);
}
.shop-card__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--plum);
}
.shop-card__buy {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  color: #8a5a00;
  background: linear-gradient(180deg, #ffe49a, #ffd166);
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 5px 12px rgba(247, 168, 35, 0.4);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shop-card__buy:hover { transform: scale(1.06); }
.shop-card__buy:active { transform: scale(0.95); }
.shop-card__buy.is-locked {
  filter: grayscale(0.5);
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
.shop-card__owned {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: #34bf90;
  padding: 8px 0;
}

/* ----- Room ----- */
.room {
  position: relative;
  display: flex;
  flex-direction: column;
  height: clamp(280px, 48vw, 380px);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.room__wall {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 26px;
  padding: 18px 18px 0;
}
.room__shelf {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  padding: 0 22px 4px;
}
.room__floor {
  height: 34%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 22px;
  padding: 0 22px 10px;
  box-shadow: inset 0 6px 16px rgba(91, 42, 107, 0.12);
}
.room__item { object-fit: contain; filter: drop-shadow(0 8px 10px rgba(91, 42, 107, 0.25)); }
.room__item--wall { max-height: 70px; max-width: 110px; }
.room__item--shelf { max-height: 64px; max-width: 80px; }
.room__item--floor { max-height: 120px; max-width: 130px; }
span.room__item--wall.art-emoji { font-size: 3rem; }
span.room__item--shelf.art-emoji { font-size: 2.6rem; }
span.room__item--floor.art-emoji { font-size: 4.4rem; }
.room__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--plum-soft);
}

.room-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}
.room-picker { flex: 1; min-width: 200px; }
.room-picker__label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--plum-soft);
  margin-bottom: 8px;
}
.room-picker__opts { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.swatch-btn:hover { transform: scale(1.08); }
.swatch-btn.is-on { outline: 3px solid var(--purple); outline-offset: 2px; }

.room-tray { margin-bottom: 10px; }
.room-tray__items { display: flex; flex-wrap: wrap; gap: 10px; }
.tray-chip {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  opacity: 0.55;
  filter: grayscale(0.4);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tray-chip.is-on { opacity: 1; filter: none; background: #fff; outline: 3px solid var(--pink); }
.tray-chip:hover { transform: scale(1.07); }
.tray-chip__img { max-width: 40px; max-height: 40px; object-fit: contain; }
span.tray-chip__img.art-emoji { font-size: 1.9rem; }

/* ----- Secondary button ----- */
.btn-soft {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  border: none;
  color: var(--plum);
  background: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-soft:hover { transform: scale(1.05); }
.btn-soft:active { transform: scale(0.96); }
.btn-soft--sm { font-size: 0.95rem; padding: 8px 16px; }

/* =========================================================================
   Counting Stars game
   ========================================================================= */
.game {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 16px) clamp(16px, 4vw, 32px) 60px;
  text-align: center;
}
.game__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.game__progress { display: flex; gap: 8px; }
.game__pip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(91, 42, 107, 0.18);
  transition: transform 0.2s ease, background 0.2s ease;
}
.game__pip.is-done { background: linear-gradient(180deg, #6fd9b0, #34bf90); }
.game__pip.is-now { background: linear-gradient(180deg, #ffc94a, #f7a823); transform: scale(1.25); }
.game__count-badge {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--plum-soft);
  background: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.game__prompt {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--plum);
  margin-bottom: 16px;
}
.counting__stage {
  min-height: 180px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.counting__stage.is-correct { transform: scale(1.03); box-shadow: 0 0 0 4px rgba(111, 217, 176, 0.6), var(--shadow-md); }
.counting__cutie {
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 6px 8px rgba(91, 42, 107, 0.2));
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.counting__yay {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.8rem;
  color: #34bf90;
  margin-top: 12px;
  animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.counting__choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}
.counting__choice {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 7vw, 2.8rem);
  width: clamp(80px, 22vw, 110px);
  height: clamp(80px, 22vw, 110px);
  cursor: pointer;
  border: none;
  color: var(--plum);
  background: #fff;
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}
.counting__choice:hover { transform: translateY(-5px) scale(1.04); }
.counting__choice:active { transform: scale(0.95); }
.counting__choice.is-correct {
  color: #fff;
  background: linear-gradient(180deg, #6fd9b0, #34bf90);
  transform: scale(1.12);
}
.counting__choice.is-wrong { animation: shake 0.4s ease; background: #ffe0e0; }
.counting__choice:disabled { cursor: default; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.game__end {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  margin: 30px auto 0;
}
.game__end-emoji { font-size: 4.6rem; animation: bounce 1.4s ease-in-out infinite; }
.game__end-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--plum);
  margin-top: 6px;
}
.game__end-sub { font-weight: 700; font-size: 1.15rem; color: var(--plum-soft); margin-top: 8px; }
.game__end-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* =========================================================================
   Reward sequence (round summary / level up / chest) + confetti
   ========================================================================= */
.reward {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(91, 42, 107, 0.34);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
}
.reward__card {
  position: relative;
  width: min(420px, 100%);
  text-align: center;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 30px 30px;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.reward__card--celebrate { background: linear-gradient(180deg, #fff, #fff4fb); }
.reward__badge {
  display: inline-grid;
  place-items: center;
  width: 90px;
  height: 90px;
  font-size: 3rem;
  border-radius: 50%;
  margin-bottom: 10px;
  background: linear-gradient(160deg, var(--accent2, #ff8cc0), var(--accent, #ff4fa3));
  box-shadow: 0 10px 22px rgba(91, 42, 107, 0.3);
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.4));
}
.reward__badge--big { width: 120px; height: 120px; font-size: 4rem; animation: bounce 1.3s ease-in-out infinite; }
.reward__lvlnum {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--purple-deep);
  letter-spacing: 0.5px;
}
.reward__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2.1rem;
  color: var(--plum);
  margin-top: 4px;
}
.reward__sub { font-weight: 700; font-size: 1.1rem; color: var(--plum-soft); margin-top: 6px; }
.reward__hint { margin-top: 12px; font-weight: 700; color: var(--plum-soft); opacity: 0.8; }
.reward .btn-big { margin-top: 22px; }

.chest {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  margin: 8px auto 0;
  display: block;
  animation: chest-wiggle 0.9s ease-in-out infinite;
}
.chest__img { width: clamp(140px, 40vw, 180px); height: auto; filter: drop-shadow(0 12px 16px rgba(91, 42, 107, 0.3)); }
span.chest__img.art-emoji { font-size: clamp(5rem, 24vw, 8rem); }
.chest:hover { animation-play-state: paused; transform: scale(1.05); }
.chest--open { animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes chest-wiggle {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-6px); }
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.confetti__bit {
  position: absolute;
  top: -16px;
  opacity: 0;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-iteration-count: 1;
}
@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(102vh) rotate(540deg); opacity: 1; }
}

/* ----- Small screens: tighten new screens ----- */
@media (max-width: 520px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .counting__choices { gap: 12px; }
}

/* -------------------------------------------------------------------------
   Respect reduced-motion preferences
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .floaty {
    display: none;
  }
}
