/* Nono Cats — interface components, menu screens, modals & toasts. */

/* ---------- shared controls ---------- */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 251, 244, 0.78);
  border: 1px solid rgba(93, 73, 56, 0.1);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(103, 79, 58, 0.06);
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  flex: none;
}

.icon-btn:hover {
  background: #fffaf2;
  box-shadow: 0 3px 0 rgba(103, 79, 58, 0.08);
}

.icon-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: none;
}

.icon-btn.soft {
  background: #f3e8db;
  border-color: transparent;
}

.icon-btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.icon-btn .icon {
  width: 21px;
  height: 21px;
}

.icon-btn.tiny {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.wallet-pill {
  height: 44px;
  min-width: 76px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  background: #fffaf2;
  border: 1px solid rgba(93, 73, 56, 0.1);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 2px 0 rgba(103, 79, 58, 0.06);
  transition: transform 0.15s ease, background-color 0.2s ease;
  flex: none;
}

.wallet-pill:hover {
  background: #fff;
}

.wallet-pill:active {
  transform: translateY(1px) scale(0.98);
}

.wallet-pill .icon {
  width: 23px;
  height: 23px;
  color: var(--gold);
}

.wallet-pill b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wallet-pill .wallet-plus {
  font-weight: 800;
  color: var(--ink-faint);
  font-size: 15px;
  margin-left: 1px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 10px 20px;
  border-radius: var(--btn-radius);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.13;
  transition: transform 0.13s ease, box-shadow 0.13s ease, background-color 0.18s ease, opacity 0.18s ease;
  text-align: center;
}

.primary-btn {
  background: linear-gradient(180deg, #4c3b30 0%, #3c2f27 100%);
  color: #fff7e9;
  box-shadow: var(--shadow-button), 0 10px 22px rgba(67, 46, 33, 0.16);
}

.primary-btn:hover {
  background: linear-gradient(180deg, #584439 0%, #44352c 100%);
}

.primary-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(74, 52, 39, 0.22), 0 6px 12px rgba(67, 46, 33, 0.1);
}

.secondary-btn {
  background: #fff9f0;
  color: var(--ink);
  border: 1px solid rgba(85, 65, 49, 0.12);
  box-shadow: 0 3px 0 rgba(103, 79, 58, 0.08);
}

.secondary-btn:hover {
  background: #fffdf9;
}

.secondary-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.ghost-btn {
  min-height: 44px;
  color: var(--ink-soft);
  background: transparent;
}

.ghost-btn:hover {
  color: var(--ink);
  background: rgba(255, 250, 242, 0.7);
}

.danger-btn {
  background: var(--danger-soft);
  color: #8c4e43;
}

.ghost-btn.danger-text {
  color: var(--danger);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled,
.danger-btn:disabled {
  opacity: 0.45;
  transform: none;
  box-shadow: none;
  cursor: default;
}

.primary-btn .icon,
.secondary-btn .icon {
  width: 20px;
  height: 20px;
}

.btn-full {
  width: 100%;
}

.btn-compact {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 14px;
}

.btn-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-align: left;
}

.btn-label small {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.66;
}

.panel {
  background: rgba(255, 252, 246, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
}

.soft-panel {
  background: rgba(249, 240, 228, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--panel-radius);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.76);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.pill .icon {
  width: 14px;
  height: 14px;
}

.pill.gold {
  background: var(--gold-soft);
  color: #8b6b2e;
}

.pill.sage {
  background: var(--sage-soft);
  color: #5f7458;
}

.pill.peach {
  background: var(--peach-soft);
  color: #8d5748;
}

.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(89, 68, 51, 0.09);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--peach) 0%, var(--peach-deep) 100%);
  transition: width 0.35s cubic-bezier(0.22, 0.8, 0.26, 1);
}

.progress-track.thin {
  height: 6px;
}

.progress-track.sage .progress-fill {
  background: linear-gradient(90deg, #b4c6a5, #8fa982);
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.progress-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.progress-caption b {
  color: var(--ink);
  font-size: 13px;
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.streak-flame {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #f8e3d2;
  color: #c97c57;
  flex: none;
}

.streak-flame .icon {
  width: 15px;
  height: 15px;
}

.shield-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #6f8293;
  background: rgba(230, 239, 244, 0.8);
  padding: 4px 7px;
  border-radius: 8px;
}

.shield-chip .icon {
  width: 14px;
  height: 14px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

.avatar-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--theme-accent, var(--peach));
  flex: none;
}

.hidden-layer {
  display: none !important;
}

/* ---------- home ---------- */
.home-inner {
  gap: 0;
}

.home-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(322px, 0.75fr);
  gap: clamp(12px, 1.8vw, 22px);
}

.home-hero {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: clamp(24px, 3vw, 36px);
  background:
    radial-gradient(120% 120% at 88% 8%, rgba(255, 252, 244, 0.76) 0, rgba(255, 252, 244, 0) 56%),
    linear-gradient(142deg, #f5e4d2 0%, #f3dfd2 45%, #eadac6 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: stretch;
  padding: clamp(20px, 3vw, 36px);
  isolation: isolate;
}

.home-hero::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  right: -140px;
  bottom: -170px;
  border-radius: 50%;
  background: rgba(255, 249, 239, 0.5);
  z-index: -1;
}

.home-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(140, 100, 73, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
  mask-image: linear-gradient(100deg, transparent 0%, #000 60%);
  -webkit-mask-image: linear-gradient(100deg, transparent 0%, #000 60%);
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: 68%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(10px, 1.5vh, 16px);
  min-width: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8f6655;
  background: rgba(255, 250, 241, 0.66);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-eyebrow .icon {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(38px, 5.7vw, 70px);
  line-height: 0.94;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 700;
  text-wrap: balance;
}

.hero-title span {
  color: #ad6e58;
}

.hero-sub {
  color: #7e6253;
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 700;
  max-width: 30ch;
  line-height: 1.45;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.play-btn {
  min-height: 64px;
  min-width: 186px;
  padding: 9px 17px 9px 10px;
  justify-content: flex-start;
  gap: 11px;
  border-radius: 20px;
  background: linear-gradient(150deg, #526957 0%, #3f5345 100%);
  box-shadow: 0 5px 0 #304034, 0 14px 26px rgba(54, 71, 58, 0.19);
}

.play-btn:hover {
  background: linear-gradient(150deg, #5b7461 0%, #485e4e 100%);
}

.play-btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 247, 232, 0.16);
  color: #fff7e9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.play-btn-icon .icon {
  width: 22px;
  height: 22px;
}

.play-btn-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.play-btn-copy b {
  font-family: var(--font-pixel);
  font-size: 24px;
  line-height: 0.95;
  font-weight: 700;
}

.play-btn-copy small {
  color: rgba(255, 249, 237, 0.63);
  font-size: 10.5px;
  font-weight: 800;
  max-width: 130px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-ghost-btn {
  height: 52px;
  min-width: 52px;
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.65);
  color: #705747;
  border: 1px solid rgba(124, 90, 65, 0.08);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-meta .pill {
  background: rgba(255, 250, 241, 0.5);
  color: #806a5c;
}

.hero-stage {
  position: absolute;
  z-index: 1;
  right: -1%;
  bottom: 1%;
  width: min(48%, 430px);
  height: 96%;
  pointer-events: none;
}

.hero-stage canvas {
  width: 100%;
  height: 100%;
}

.hero-sticker {
  position: absolute;
  left: 3%;
  bottom: 7%;
  z-index: 4;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fffaf2;
  box-shadow: 0 4px 0 rgba(113, 84, 60, 0.1);
  color: var(--peach-deep);
  transform: rotate(-6deg);
}

.hero-sticker .icon {
  width: 23px;
  height: 23px;
}

.home-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}

.daily-card {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  border-radius: var(--card-radius);
  padding: clamp(15px, 2vw, 21px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    radial-gradient(80% 100% at 100% 0, rgba(255, 252, 246, 0.78) 0, rgba(255, 252, 246, 0) 65%),
    linear-gradient(150deg, var(--theme-soft, #f1dfd1) 0%, #f7eee2 100%);
  box-shadow: var(--shadow-card);
}

.daily-card::after {
  content: '';
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--theme-accent, var(--peach));
  opacity: 0.08;
  right: -50px;
  bottom: -65px;
  pointer-events: none;
}

.daily-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.daily-head .eyebrow {
  color: var(--theme-deep, #8b6652);
  margin-bottom: 2px;
}

.daily-date {
  font-size: 12px;
  font-weight: 800;
  color: rgba(65, 53, 46, 0.52);
}

.daily-main {
  display: grid;
  grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.daily-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 180px;
  border-radius: 20px;
  background: rgba(255, 251, 244, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.daily-art canvas {
  width: 100%;
  height: 100%;
}

.daily-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  background: var(--theme-accent, var(--peach));
  color: #fffaf3;
  border-radius: 5px;
  padding: 3px 5px;
  line-height: 1;
}

.daily-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.daily-title {
  font-family: var(--font-pixel);
  font-size: clamp(23px, 2.3vw, 29px);
  font-weight: 700;
  line-height: 0.95;
  color: var(--theme-deep, var(--ink));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-desc {
  font-size: 11.5px;
  line-height: 1.35;
  color: rgba(72, 57, 46, 0.68);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.daily-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: rgba(72, 57, 46, 0.57);
  font-weight: 800;
  flex-wrap: wrap;
}

.daily-countdown .icon {
  width: 13px;
  height: 13px;
  opacity: 0.7;
}

.daily-countdown b {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--theme-deep, var(--ink));
  letter-spacing: 0.03em;
}

.daily-streak {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 252, 246, 0.52);
  border-radius: 12px;
  padding: 7px 9px;
  font-size: 11.5px;
  font-weight: 800;
  color: #746153;
  position: relative;
  z-index: 2;
}

.daily-week {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  padding: 0 2px;
  position: relative;
  z-index: 2;
}

.dw-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(72, 57, 46, 0.46);
}

.dw-days {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.dw-day {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 7.5px;
  font-weight: 800;
  color: rgba(72, 57, 46, 0.36);
  background: rgba(255, 252, 246, 0.45);
}

.dw-day.done {
  color: #fffaf0;
  background: var(--theme-accent, var(--sage));
}

.dw-day.today {
  box-shadow: inset 0 0 0 1.5px var(--theme-deep, var(--ink));
  color: var(--theme-deep, var(--ink));
}

.dw-day.done.today {
  color: #fffaf0;
  box-shadow: inset 0 0 0 1.5px rgba(255, 250, 240, 0.75);
}

.daily-streak b {
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.daily-streak .shield-chip {
  margin-left: auto;
}

.daily-start {
  width: 100%;
  min-height: 46px;
  position: relative;
  z-index: 2;
  background: var(--theme-deep, var(--ink));
  box-shadow: 0 4px 0 rgba(74, 52, 39, 0.2);
}

.daily-start.is-done {
  background: rgba(255, 252, 246, 0.55);
  color: var(--theme-deep, var(--ink));
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.daily-card .daily-start .icon {
  width: 18px;
  height: 18px;
}

.home-progress {
  flex: none;
  width: 100%;
  border-radius: 20px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 251, 244, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.6);
  text-align: left;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.home-progress:hover {
  background: rgba(255, 251, 244, 0.92);
}

.home-progress:active {
  transform: scale(0.994);
}

.home-progress .hp-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.home-progress .hp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 800;
}

.home-progress .hp-row b {
  color: var(--ink);
}

.home-progress .hp-arrow {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  flex: none;
}

.home-progress .hp-arrow .icon {
  width: 16px;
  height: 16px;
}

.trophy-btn {
  position: relative;
}

.trophy-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--gold);
  color: #fff9ec;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(90, 68, 43, 0.15);
}

.home-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-faint);
  padding-left: 3px;
}

.home-tip .icon {
  width: 14px;
  height: 14px;
}

/* ---------- puzzles ---------- */
.puzzles-inner {
  gap: 0;
}

.pack-tabs {
  display: flex;
  gap: 7px;
  flex: none;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.pack-tabs::-webkit-scrollbar { display: none; }

.pack-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 45px;
  padding: 6px 10px 6px 7px;
  border-radius: 14px;
  border: 1px solid rgba(91, 70, 53, 0.08);
  background: rgba(255, 251, 244, 0.64);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.pack-tab:hover {
  background: rgba(255, 251, 244, 0.94);
  color: var(--ink);
}

.pack-tab:active { transform: scale(0.98); }

.pack-tab-icon {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--accent);
}

.pack-tab-icon .icon { width: 18px; height: 18px; }

.pack-tab-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.05;
}

.pack-tab-copy small {
  font-size: 8.5px;
  font-weight: 800;
  opacity: 0.62;
  letter-spacing: 0.04em;
}

.pack-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff8ec;
  box-shadow: 0 3px 0 rgba(54, 40, 30, 0.2);
}

.pack-tab.active .pack-tab-icon {
  background: rgba(255, 248, 236, 0.15);
  color: #ffe4c8;
}

.puzzles-scroll {
  padding-bottom: 4px;
}

.pack-banner {
  position: relative;
  overflow: hidden;
  padding: clamp(15px, 2.4vw, 23px);
  border-radius: var(--card-radius);
  background:
    radial-gradient(90% 120% at 90% 10%, rgba(255, 252, 246, 0.7) 0, rgba(255, 252, 246, 0) 68%),
    linear-gradient(135deg, var(--soft) 0%, rgba(255, 250, 241, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.pack-banner::after {
  content: '';
  position: absolute;
  right: -15px;
  top: -25px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 18px solid var(--accent);
  opacity: 0.1;
  pointer-events: none;
}

.pack-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
  min-width: 0;
}

.pack-banner .eyebrow {
  color: var(--deep);
  opacity: 0.75;
}

.pack-banner h2 {
  font-family: var(--font-pixel);
  font-size: clamp(25px, 3.6vw, 36px);
  line-height: 1;
  color: var(--ink);
}

.pack-banner p {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
}

.pack-banner-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(210px, 40%);
  z-index: 1;
}

.pack-banner-progress .progress-caption {
  color: var(--deep);
  opacity: 0.78;
}

.pack-banner-progress .progress-caption b {
  color: var(--deep);
}

.pack-banner-progress .progress-track {
  background: rgba(255, 252, 246, 0.55);
}

.pack-banner-progress .progress-fill {
  background: var(--accent);
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 12px);
  padding-bottom: 10px;
}

.level-card {
  position: relative;
  min-width: 0;
  border-radius: 20px;
  padding: 8px;
  background: rgba(255, 251, 244, 0.82);
  border: 1px solid rgba(89, 69, 52, 0.08);
  box-shadow: 0 3px 0 rgba(103, 79, 58, 0.04);
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.level-card:hover {
  transform: translateY(-2px);
  background: #fffdf8;
  box-shadow: 0 6px 16px rgba(99, 74, 52, 0.08);
}

.level-card:active { transform: translateY(0) scale(0.988); }

.level-art {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1.3 / 1;
  background: var(--soft);
}

.level-art canvas {
  width: 100%;
  height: 100%;
}

.level-size {
  position: absolute;
  left: 6px;
  top: 6px;
  font-size: 8px;
  font-weight: 800;
  border-radius: 6px;
  padding: 3px 5px;
  background: rgba(255, 251, 244, 0.7);
  color: var(--deep);
  letter-spacing: 0.02em;
}

.level-mark {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 251, 244, 0.78);
  color: var(--ink-soft);
}

.level-mark .icon { width: 14px; height: 14px; }
.level-mark.done { background: var(--accent); color: #fff9ed; }
.level-mark.current { background: var(--ink); color: #fff2dc; }

.level-card-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 0 3px 2px;
}

.level-index {
  font-size: 8.5px;
  font-weight: 800;
  color: var(--deep);
  opacity: 0.68;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-status {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink-faint);
}

.level-card.locked {
  opacity: 0.7;
}

.level-card.locked .level-art canvas {
  filter: grayscale(1) brightness(0.9);
}

.level-card.is-completed .level-status {
  color: var(--sage);
}

.level-card.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft, rgba(0, 0, 0, 0));
}

.level-card.is-current::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--accent);
  opacity: 0.55;
  pointer-events: none;
}

.pack-note {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 800;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 4px 0 10px;
}

/* ---------- cat collection ---------- */
.cats-inner {
  gap: 0;
}

.collection-hero {
  flex: none;
  border-radius: var(--card-radius);
  padding: clamp(13px, 2vw, 18px) clamp(15px, 2.4vw, 22px);
  display: flex;
  align-items: center;
  gap: 14px;
  background:
    radial-gradient(90% 150% at 100% 0, rgba(255, 252, 246, 0.74) 0, rgba(255, 252, 246, 0) 70%),
    linear-gradient(135deg, #f2e3d5 0%, #f8f1e6 100%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
}

.collection-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: none;
}

.collection-count b {
  font-family: var(--font-pixel);
  font-size: clamp(32px, 4vw, 42px);
  line-height: 0.85;
  color: var(--ink);
}

.collection-count span {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 800;
}

.collection-progress {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rarity-legend {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.rarity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  color: var(--ink-soft);
}

.rarity-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--r-color);
}

.collection-hero .trophy-btn {
  flex: none;
}

.filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex: none;
  margin-bottom: 9px;
}

.filter-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  background: rgba(255, 251, 244, 0.58);
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.filter-chip:hover { background: rgba(255, 251, 244, 0.94); }

.filter-chip.active {
  background: var(--ink);
  color: #fff8ec;
}

.cats-scroll {
  padding-bottom: 4px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: clamp(8px, 1.3vw, 12px);
  padding-bottom: 12px;
}

.cat-card {
  min-width: 0;
  border-radius: 19px;
  padding: 7px;
  background: rgba(255, 251, 244, 0.83);
  border: 1px solid rgba(89, 69, 52, 0.08);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.cat-card:hover {
  transform: translateY(-2px);
  background: #fffdf8;
  box-shadow: 0 6px 16px rgba(99, 74, 52, 0.08);
}

.cat-card:active { transform: scale(0.988); }

.cat-art-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1.12 / 1;
  background: #f0e7dc;
}

.cat-art-wrap canvas {
  width: 100%;
  height: 100%;
}

.rarity-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
  color: #fffaf2;
  border-radius: 6px;
  padding: 3px 5px;
  line-height: 1;
  background: var(--r-color, var(--sage));
}

.cat-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fffaf2;
  background: rgba(80, 67, 56, 0.1);
}

.cat-lock .icon {
  width: 27px;
  height: 27px;
  color: rgba(255, 250, 242, 0.9);
  filter: drop-shadow(0 1px 3px rgba(60, 45, 33, 0.3));
}

.cat-card-copy {
  min-width: 0;
  padding: 1px 3px 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cat-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card-sub {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card-source {
  font-size: 9px;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
}

.cat-card-source .icon {
  width: 11px;
  height: 11px;
  color: var(--gold);
}

.cat-card.locked .cat-name {
  color: var(--ink-soft);
}

.cat-card.locked {
  background: rgba(241, 234, 225, 0.64);
}

.collection-empty {
  grid-column: 1 / -1;
  padding: 34px 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ---------- modals ---------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
}

.modal-layer.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(55, 42, 32, 0.42);
  backdrop-filter: blur(7px) saturate(0.9);
  -webkit-backdrop-filter: blur(7px) saturate(0.9);
  animation: fade-in 0.22s ease both;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 27px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 28px 80px rgba(53, 37, 25, 0.24);
  overflow: hidden;
  animation: pop-in 0.26s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.modal-card.wide {
  width: min(680px, 100%);
}

.modal-card.small {
  width: min(380px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 10px;
  flex: none;
}

.modal-head-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal-title {
  font-family: var(--font-pixel);
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  font-weight: 700;
}

.modal-sub {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.4;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(241, 232, 220, 0.7);
  color: var(--ink-soft);
  flex: none;
}

.modal-close:hover { background: #f2e6d8; color: var(--ink); }
.modal-close .icon { width: 17px; height: 17px; }

.modal-body {
  padding: 4px 20px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 69, 51, 0.22) transparent;
  min-height: 0;
}

.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(90, 69, 51, 0.2); border-radius: 99px; }

.modal-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px calc(18px + var(--safe-bottom) * 0.2);
  flex: none;
  flex-wrap: wrap;
}

.modal-actions .primary-btn,
.modal-actions .secondary-btn,
.modal-actions .danger-btn {
  flex: 1;
  min-width: 120px;
}

.modal-actions .btn-full {
  flex-basis: 100%;
}

.modal-note {
  padding: 8px 20px 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ink-faint);
  font-weight: 700;
}

/* settings */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child { border-bottom: 0; }

.setting-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f2e7d9;
  color: #866753;
  flex: none;
}

.setting-icon .icon { width: 18px; height: 18px; }

.setting-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.setting-copy b {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.setting-copy span {
  font-size: 10.5px;
  color: var(--ink-faint);
  font-weight: 700;
  line-height: 1.35;
}

.toggle {
  width: 48px;
  height: 29px;
  border-radius: 999px;
  background: #ded2c5;
  position: relative;
  flex: none;
  transition: background-color 0.2s ease;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fffaf2;
  box-shadow: 0 2px 4px rgba(80, 58, 40, 0.18);
  top: 3px;
  left: 3px;
  transition: transform 0.2s cubic-bezier(0.3, 0.9, 0.4, 1.2);
}

.toggle[aria-checked="true"] {
  background: #879d8c;
}

.toggle[aria-checked="true"]::after {
  transform: translateX(19px);
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  flex-wrap: wrap;
}

.settings-version {
  font-size: 9px;
  color: var(--ink-faint);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.settings-credits {
  font-size: 10px;
  color: var(--ink-faint);
  font-weight: 700;
  line-height: 1.5;
  padding-top: 4px;
}

/* fish modal */
.fish-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: linear-gradient(135deg, #f5e9d7 0%, #fbf3e6 100%);
  border-radius: 18px;
  margin-bottom: 13px;
}

.fish-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: rgba(255, 251, 244, 0.8);
  color: var(--gold);
  display: grid;
  place-items: center;
  flex: none;
}

.fish-hero-icon .icon { width: 34px; height: 34px; }

.fish-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fish-hero-copy b {
  font-family: var(--font-pixel);
  font-size: 36px;
  line-height: 0.9;
  color: var(--ink);
}

.fish-hero-copy span {
  font-size: 10px;
  color: var(--ink-soft);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fish-how {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  font-weight: 700;
}

.fish-ways {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fish-way {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f6ecdf;
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-soft);
}

.fish-way .icon { width: 14px; height: 14px; color: var(--gold); }

.ad-btn {
  width: 100%;
  justify-content: center;
  background: #ece3ef;
  color: #5b4c62;
  border: 1px solid rgba(120, 95, 132, 0.12);
  box-shadow: 0 3px 0 rgba(94, 72, 104, 0.12);
  font-size: 13px;
  min-height: 48px;
}

.ad-btn:hover { background: #f2eaf4; }
.ad-btn .ad-glyph { font-size: 16px; line-height: 1; }
.ad-btn .icon { width: 18px; height: 18px; }

.reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f9f0e2;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
}

.reward-row b { color: var(--ink); }

/* calendar */
.calendar-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.calendar-summary .pill {
  min-height: 31px;
  padding: 6px 10px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-month {
  font-family: var(--font-pixel);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.calendar-nav {
  display: flex;
  gap: 5px;
}

.calendar-nav button {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f5ebde;
  color: var(--ink-soft);
}

.calendar-nav button:disabled {
  opacity: 0.3;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 35px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  background: rgba(244, 236, 225, 0.7);
  overflow: hidden;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cal-day .day-num {
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cal-day .day-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 10px;
}

.cal-day .day-mark .icon {
  width: 11px;
  height: 11px;
}

.cal-day.empty {
  background: transparent;
  pointer-events: none;
}

.cal-day.future {
  opacity: 0.4;
}

.cal-day.today {
  box-shadow: inset 0 0 0 2px var(--peach-deep);
  background: #fbf1e5;
  color: var(--ink);
}

.cal-day.completed {
  background: var(--sage-soft);
  color: #607753;
}

.cal-day.completed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 80% at 50% 10%, rgba(255, 255, 255, 0.55), transparent 70%);
}

.cal-day.makeup {
  background: var(--gold-soft);
  color: #927338;
  box-shadow: inset 0 0 0 1px rgba(192, 152, 83, 0.32);
}

.cal-day.makeup:hover,
.cal-day.completed:hover {
  transform: translateY(-1px);
}

.cal-day.makeup .day-num::after {
  content: '+';
  font-size: 8px;
  margin-left: 1px;
  color: var(--gold);
}

.cal-day.disabled {
  opacity: 0.28;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 0 3px;
  font-size: 9px;
  font-weight: 800;
  color: var(--ink-faint);
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.calendar-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--sage-soft);
}

.calendar-legend i.today { background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.calendar-legend i.makeup { background: var(--gold-soft); }

.calendar-shield-note {
  padding-top: 9px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--ink-faint);
  font-weight: 700;
  display: flex;
  gap: 5px;
  align-items: flex-start;
}

.calendar-shield-note .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: #7a8e9d;
  flex: none;
}

/* cat detail modal */
.cat-detail-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1.3 / 1;
  max-height: 310px;
  border-radius: 19px;
  overflow: hidden;
  background: var(--detail-soft, #f3e7d9);
  margin-bottom: 12px;
}

.cat-detail-art canvas { width: 100%; height: 100%; }

.cat-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.cat-detail-name {
  font-family: var(--font-pixel);
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
}

.cat-detail-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.cat-detail-bio {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 700;
}

.cat-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.cat-detail-source {
  margin-top: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #f6ecdf;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-detail-source .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
  flex: none;
}

.cat-detail-locked {
  text-align: center;
  padding: 5px 3px 2px;
}

.cat-detail-locked h3 {
  font-family: var(--font-pixel);
  font-size: 30px;
  line-height: 1;
}

.cat-detail-locked p {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 5px;
}

/* achievements */
.achievements-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  background: #f6ecdf;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 800;
}

.achievements-summary b { color: var(--ink); }

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(247, 240, 231, 0.65);
  border: 1px solid transparent;
}

.ach-item.unlocked {
  background: #f2ecdc;
  border-color: rgba(197, 161, 94, 0.18);
}

.ach-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #e9ddd0;
  color: #9a8572;
  flex: none;
}

.ach-item.unlocked .ach-icon {
  background: var(--gold-soft);
  color: #9e7b32;
}

.ach-icon .icon { width: 19px; height: 19px; }

.ach-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ach-copy b {
  font-size: 12px;
  color: var(--ink);
  font-weight: 800;
}

.ach-copy span {
  font-size: 10px;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.3;
}

.ach-progress {
  width: 60px;
  flex: none;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
  font-size: 9px;
  font-weight: 800;
  color: var(--ink-faint);
}

.ach-progress .mini-bar {
  width: 52px;
  height: 4px;
  border-radius: 99px;
  background: rgba(90, 68, 51, 0.1);
  overflow: hidden;
}

.ach-progress .mini-bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: inherit;
}

.ach-reward {
  color: #a7823e;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.ach-reward .icon { width: 10px; height: 10px; }

/* decor shop */
.decor-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7edde;
  border-radius: 13px;
  padding: 9px 11px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 800;
}

.decor-wallet b { color: var(--ink); }

.decor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.decor-item {
  padding: 8px;
  border-radius: 15px;
  background: #fbf5ec;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.decor-item:hover { transform: translateY(-1px); background: #fffaf2; }

.decor-preview {
  border-radius: 11px;
  background: #f1e7da;
  aspect-ratio: 1.5 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.decor-preview canvas { width: 100%; height: 100%; }

.decor-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.decor-name {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.decor-desc {
  font-size: 9px;
  color: var(--ink-faint);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.decor-buy-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  justify-content: space-between;
}

.decor-price {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #a17c39;
}

.decor-price .icon { width: 13px; height: 13px; color: var(--gold); }

.decor-state {
  font-size: 9px;
  font-weight: 800;
  color: var(--ink-faint);
  border-radius: 6px;
  background: #f2e8db;
  padding: 3px 5px;
}

.decor-state.owned { color: #5f7458; background: var(--sage-soft); }
.decor-state.placed { color: #8a6b34; background: var(--gold-soft); }

.decor-remove {
  width: 28px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #f4e4e0;
  color: var(--danger);
}

.decor-remove .icon { width: 12px; height: 12px; }

.decor-item.locked {
  opacity: 0.65;
}

.decor-item.locked .decor-preview {
  filter: grayscale(0.75);
}

/* toasts */
.toast-layer {
  position: fixed;
  z-index: 900;
  left: 50%;
  top: calc(var(--safe-top) + 12px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  width: min(92vw, 440px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 13px;
  background: rgba(55, 43, 34, 0.94);
  color: #fff9ee;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 9px 24px rgba(50, 35, 24, 0.2);
  animation: toast-in 0.24s cubic-bezier(0.22, 0.9, 0.32, 1.1) both;
  max-width: 100%;
}

.toast .icon {
  width: 15px;
  height: 15px;
  color: #f2d28b;
  flex: none;
}

.toast.success { background: rgba(67, 91, 72, 0.95); }
.toast.warn { background: rgba(112, 73, 55, 0.96); }
.toast.leaving { animation: toast-out 0.2s ease both; }

/* input shield (ads) */
.input-shield {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: none;
  background: transparent;
}

body.poki-ad-active .input-shield {
  display: block;
}

/* fx */
.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 800;
  pointer-events: none;
}

/* loading overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(247, 241, 232, 0.75);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.ld {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 248, 235, 0.24);
  border-top-color: currentColor;
  animation: spin 0.75s linear infinite;
  flex: none;
}

.loading-overlay .ld {
  width: 28px;
  height: 28px;
  border-width: 3px;
  border-color: rgba(75, 58, 44, 0.16);
  border-top-color: var(--ink);
}

/* misc temporary feedback */
.shake {
  animation: shake 0.28s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}

/* ---------- responsive menu layouts ---------- */
@media (max-width: 899px) {
  .home-layout {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    gap: 10px;
    padding-bottom: 2px;
  }
  .home-layout::-webkit-scrollbar { display: none; }
  .home-hero {
    flex: 1 1 auto;
    min-height: 218px;
    padding: 18px;
  }
  .hero-copy {
    max-width: 69%;
    gap: 9px;
  }
  .hero-title {
    font-size: clamp(33px, 8.5vw, 48px);
  }
  .hero-sub {
    font-size: 11.5px;
    max-width: 24ch;
  }
  .play-btn {
    min-height: 56px;
    min-width: 168px;
    border-radius: 18px;
  }
  .play-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .play-btn-copy b { font-size: 22px; }
  .hero-stage {
    width: 47%;
    height: 100%;
    right: -4%;
    bottom: 0;
  }
  .home-side {
    flex: none;
  }
  .daily-card {
    flex: none;
    min-height: 0;
    justify-content: flex-start;
    gap: 9px;
  }
  .daily-art {
    max-height: 108px;
  }
  .daily-main {
    grid-template-columns: 86px minmax(0, 1fr);
  }
  .home-progress {
    margin-bottom: 2px;
  }
  .collection-hero {
    gap: 10px;
  }
  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
  .pack-banner {
    align-items: center;
  }
  .pack-banner-progress {
    width: 38%;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
  }
  .topbar-actions {
    gap: 5px;
  }
  .brand-name {
    font-size: 25px;
  }
  .brand-mark {
    width: 39px;
    height: 39px;
  }
  .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }
  .wallet-pill {
    height: 42px;
    min-width: 67px;
    padding: 0 9px;
    font-size: 14px;
    border-radius: 14px;
  }
  .wallet-pill .icon {
    width: 20px;
    height: 20px;
  }
  .home-hero {
    min-height: 205px;
    padding: 16px;
  }
  .hero-copy {
    max-width: 71%;
  }
  .hero-title {
    font-size: clamp(29px, 8.8vw, 40px);
  }
  .hero-eyebrow {
    padding: 5px 8px;
    font-size: 8.5px;
  }
  .hero-sub {
    display: none;
  }
  .play-btn {
    min-height: 52px;
    min-width: 158px;
    padding: 8px 13px 8px 8px;
    gap: 8px;
  }
  .play-btn-icon {
    width: 35px;
    height: 35px;
  }
  .play-btn-icon .icon { width: 18px; height: 18px; }
  .play-btn-copy b { font-size: 20px; }
  .play-btn-copy small { font-size: 9px; max-width: 110px; }
  .hero-meta .pill {
    font-size: 9px;
    min-height: 23px;
    padding: 3px 7px;
  }
  .hero-sticker {
    width: 38px;
    height: 38px;
    left: 1%;
    bottom: 4%;
  }
  .hero-sticker .icon { width: 19px; height: 19px; }
  .home-layout { gap: 9px; }
  .daily-card {
    padding: 13px;
    border-radius: 21px;
  }
  .daily-head .eyebrow {
    font-size: 9px;
  }
  .daily-date {
    font-size: 10px;
  }
  .daily-main {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
  }
  .daily-art {
    border-radius: 16px;
  }
  .daily-main {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 11px;
  }
  .daily-title {
    font-size: 23px;
  }
  .daily-desc {
    font-size: 10px;
    -webkit-line-clamp: 2;
  }
  .daily-countdown {
    font-size: 9px;
    gap: 4px;
  }
  .daily-streak {
    font-size: 10px;
    padding: 6px 8px;
  }
  .daily-streak b { font-size: 13px; }
  .daily-start {
    min-height: 43px;
    font-size: 13px;
  }
  .home-progress {
    padding: 10px 11px;
    border-radius: 16px;
  }
  .collection-hero {
    flex-wrap: wrap;
    padding: 12px;
    gap: 9px;
  }
  .collection-count b { font-size: 33px; }
  .collection-progress { flex-basis: calc(100% - 110px); }
  .rarity-legend { display: none; }
  .collection-hero .trophy-btn {
    width: 40px;
    height: 40px;
  }
  .filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-chip {
    flex: none;
    min-height: 34px;
    padding: 5px 10px;
    font-size: 10px;
  }
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .cat-art-wrap {
    border-radius: 12px;
  }
  .rarity-tag {
    font-size: 7px;
    padding: 2px 4px;
    top: 5px;
    left: 5px;
  }
  .cat-card-copy { padding: 0 2px 2px; }
  .cat-name { font-size: 11.5px; }
  .cat-card-sub { font-size: 8.5px; }
  .cat-card-source { font-size: 8px; }
  .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .level-card {
    border-radius: 16px;
    padding: 6px;
    gap: 5px;
  }
  .level-art {
    border-radius: 11px;
    aspect-ratio: 1.18 / 1;
  }
  .level-size {
    font-size: 7px;
    padding: 2px 4px;
    top: 4px;
    left: 4px;
  }
  .level-mark {
    width: 20px;
    height: 20px;
    top: 4px;
    right: 4px;
    border-radius: 7px;
  }
  .level-mark .icon { width: 12px; height: 12px; }
  .level-title { font-size: 10.5px; }
  .level-status { font-size: 8px; }
  .level-index { font-size: 7.5px; }
  .pack-tab {
    padding: 5px 8px 5px 5px;
    min-height: 42px;
  }
  .pack-tab-icon {
    width: 28px;
    height: 28px;
  }
  .pack-tab-copy { font-size: 10px; }
  .pack-banner {
    padding: 13px;
  }
  .pack-banner h2 { font-size: 24px; }
  .pack-banner p { font-size: 10px; }
  .pack-banner-progress {
    width: 36%;
  }
  .modal-layer {
    padding: calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom)) 10px;
  }
  .modal-card {
    max-height: 91dvh;
    border-radius: 23px;
  }
  .modal-head { padding: 16px 16px 8px; }
  .modal-body { padding: 3px 16px 12px; }
  .modal-actions { padding: 9px 16px 14px; }
  .modal-title { font-size: 25px; }
  .calendar-grid { gap: 3px; }
  .cal-day {
    min-height: 34px;
    font-size: 10px;
    border-radius: 9px;
  }
  .decor-grid { gap: 7px; }
  .ach-item { padding: 8px; gap: 8px; }
  .ach-icon { width: 34px; height: 34px; }
  .ach-progress { width: 48px; }
  .ach-progress .mini-bar { width: 40px; }
}

@media (max-height: 620px) and (min-width: 700px) {
  .home-hero {
    padding: 18px;
  }
  .hero-copy { gap: 8px; max-width: 66%; }
  .hero-title { font-size: clamp(34px, 4.6vw, 52px); }
  .hero-sub { font-size: 11px; }
  .play-btn { min-height: 52px; min-width: 166px; }
  .play-btn-icon { width: 36px; height: 36px; }
  .play-btn-copy b { font-size: 21px; }
  .hero-eyebrow { padding: 4px 8px; font-size: 8px; }
  .hero-meta .pill { font-size: 9px; padding: 3px 7px; min-height: 23px; }
  .daily-card {
    padding: 12px;
    gap: 6px;
  }
  .daily-main { grid-template-columns: 72px minmax(0, 1fr); gap: 9px; }
  .daily-title { font-size: 22px; }
  .daily-desc { font-size: 9.5px; -webkit-line-clamp: 1; }
  .daily-countdown { font-size: 9px; }
  .daily-streak { padding: 5px 7px; font-size: 9.5px; }
  .daily-start { min-height: 38px; font-size: 12px; }
  .home-progress { padding: 8px 10px; }
  .home-head { margin-bottom: 7px; }
  .pack-banner { padding: 12px 15px; margin-bottom: 8px; }
  .pack-banner h2 { font-size: 25px; }
  .level-grid { gap: 7px; }
  .level-card { padding: 6px; gap: 4px; border-radius: 16px; }
  .level-art { border-radius: 11px; }
  .level-title { font-size: 10.5px; }
  .level-status, .level-index { font-size: 8px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
  .collection-hero { padding: 10px 13px; margin-bottom: 7px; }
  .toast-layer { top: calc(var(--safe-top) + 7px); }
  .modal-card { max-height: 91dvh; }
  .modal-head { padding: 13px 16px 6px; }
  .modal-title { font-size: 24px; }
  .modal-body { padding: 2px 16px 9px; }
  .modal-actions { padding: 7px 16px 11px; }
  .modal-actions .primary-btn, .modal-actions .secondary-btn { min-height: 42px; }
}

/* Landscape with little height: keep the daily card beside the hero instead of
   stacking everything below the fold. */
@media (orientation: landscape) and (max-height: 620px) {
  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(285px, 0.8fr);
    overflow: hidden;
    gap: 10px;
  }
  .home-hero {
    min-height: 0;
    padding: 14px;
  }
  .hero-copy {
    max-width: 67%;
    gap: 6px;
  }
  .hero-title { font-size: clamp(28px, 5vw, 43px); }
  .hero-sub { display: none; }
  .hero-eyebrow { font-size: 8px; padding: 4px 7px; }
  .play-btn { min-height: 46px; min-width: 148px; }
  .play-btn-icon { width: 32px; height: 32px; }
  .play-btn-copy b { font-size: 19px; }
  .play-btn-copy small { font-size: 9px; max-width: 100px; }
  .hero-meta { display: none; }
  .hero-ghost-btn { height: 44px; min-width: 44px; width: 44px; }
  .hero-stage { width: 40%; height: 94%; right: -3%; }
  .hero-sticker { width: 34px; height: 34px; }
  .home-side { min-height: 0; }
  .daily-card {
    flex: 1;
    padding: 11px;
    gap: 5px;
    border-radius: 22px;
  }
  .daily-head .eyebrow { font-size: 8px; }
  .daily-date { font-size: 9px; }
  .daily-head .icon-btn.tiny { width: 32px; height: 32px; }
  .daily-main { grid-template-columns: 62px minmax(0, 1fr); gap: 8px; }
  .daily-art { max-height: 76px; border-radius: 14px; }
  .daily-title { font-size: 19px; }
  .daily-desc { font-size: 9px; -webkit-line-clamp: 1; }
  .daily-countdown { font-size: 8.5px; }
  .daily-streak { font-size: 9px; padding: 4px 7px; min-height: 26px; }
  .daily-streak b { font-size: 12px; }
  .daily-start { min-height: 35px; font-size: 11px; border-radius: 12px; }
  .home-progress { display: none; }
  .home-tip { display: none; }
  .collection-hero { padding: 8px 12px; margin-bottom: 7px; }
  .collection-count b { font-size: 28px; }
  .filter-chip { min-height: 30px; font-size: 9px; padding: 4px 8px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 7px; }
  .cat-art-wrap { aspect-ratio: 1.25 / 1; }
  .level-grid { gap: 6px; }
  .level-card { border-radius: 13px; padding: 5px; }
  .pack-banner { padding: 9px 12px; margin-bottom: 6px; }
  .pack-banner h2 { font-size: 20px; }
  .pack-banner p { font-size: 9px; }
  .pack-banner .eyebrow { font-size: 8px; }
  .pack-banner-progress .progress-caption { font-size: 9px; }
}

@media (max-width: 380px) {
  .home-trophy { display: none; }
  .daily-desc { -webkit-line-clamp: 2; }
  .brand-name { font-size: 23px; }
  .topbar-actions { gap: 4px; }
  .wallet-pill { min-width: 62px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .primary-btn,
  .modal-actions .secondary-btn { width: 100%; }
  .calendar-grid { gap: 2px; }
  .cal-day { min-height: 31px; border-radius: 8px; }
  .calendar-weekdays span { font-size: 8px; }
  .decor-grid { grid-template-columns: 1fr 1fr; }
}

.level-arrow { display: none; }

/* Desktop puzzle cards: compact horizontal cards keep the whole pack visible. */
@media (min-width: 900px) {
  .puzzles-scroll {
    display: flex;
    flex-direction: column;
  }
  .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .level-card {
    flex-direction: row;
    align-items: center;
    padding: 8px;
    gap: 10px;
    min-height: 92px;
  }
  .level-art {
    width: 78px;
    height: 78px;
    aspect-ratio: auto;
    flex: none;
  }
  .level-card-copy {
    flex: 1;
    gap: 2px;
    padding: 0 2px;
    min-width: 0;
  }
  .level-size {
    font-size: 7px;
    padding: 2px 4px;
    left: 4px;
    top: 4px;
  }
  .level-mark {
    width: 20px;
    height: 20px;
    top: 4px;
    right: 4px;
    border-radius: 7px;
  }
  .level-mark .icon { width: 11px; height: 11px; }
  .level-title { font-size: 12.5px; white-space: normal; line-height: 1.2; }
  .level-status { font-size: 9px; }
  .level-index { font-size: 8px; }
  .level-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    margin-left: auto;
    margin-right: 3px;
    border-radius: 9px;
    color: var(--ink-faint);
    background: rgba(255, 251, 243, 0.56);
    flex: none;
  }
  .level-arrow .icon { width: 13px; height: 13px; }
  .level-card:hover .level-arrow { color: var(--accent); background: var(--soft); }
  .pack-note { padding-top: 1px; padding-bottom: 4px; }
}

/* Compact portrait phones: keep the daily card above the fold. */
@media (orientation: portrait) and (max-height: 720px) {
  .home-progress,
  .home-tip {
    display: none;
  }
  .home-hero {
    flex: 1 1 auto;
    min-height: 170px;
  }
  .home-side {
    flex: none;
  }
}

@media (orientation: portrait) and (max-height: 580px) and (max-width: 420px) {
  .home-layout {
    gap: 7px;
  }
  .home-hero {
    flex: 1 1 auto;
    min-height: 114px;
    padding: 11px 14px;
    border-radius: 19px;
  }
  .hero-eyebrow,
  .hero-sub,
  .hero-meta,
  .hero-ghost-btn,
  .hero-sticker {
    display: none;
  }
  .hero-copy {
    max-width: 73%;
    gap: 4px;
  }
  .hero-title {
    font-size: 23px;
    line-height: 0.94;
  }
  .play-btn {
    min-height: 36px;
    min-width: 130px;
    padding: 4px 8px;
    border-radius: 12px;
    gap: 6px;
  }
  .play-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }
  .play-btn-icon .icon { width: 14px; height: 14px; }
  .play-btn-copy b { font-size: 17px; }
  .play-btn-copy small { font-size: 8px; max-width: 92px; }
  .hero-stage { width: 45%; height: 92%; }
  .daily-card {
    flex: 0 0 auto;
    padding: 10px;
    gap: 5px;
    border-radius: 17px;
  }
  .daily-head { align-items: center; }
  .daily-head .eyebrow { font-size: 8px; }
  .daily-date { font-size: 9px; }
  .daily-head .icon-btn.tiny { width: 32px; height: 32px; }
  .daily-main {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
  }
  .daily-art {
    max-height: 62px;
    border-radius: 12px;
  }
  .daily-title { font-size: 19px; }
  .daily-desc { display: none; }
  .daily-countdown { font-size: 8px; gap: 3px; }
  .daily-countdown .icon { width: 10px; height: 10px; }
  .daily-streak {
    min-height: 23px;
    padding: 4px 7px;
    font-size: 9px;
  }
  .daily-streak b { font-size: 11px; }
  .daily-streak .shield-chip { padding: 3px 5px; font-size: 8px; }
  .daily-week { display: none; }
  .daily-start {
    min-height: 32px;
    font-size: 10.5px;
    border-radius: 10px;
    gap: 5px;
  }
  .daily-start .icon { width: 14px; height: 14px; }
  .daily-badge { font-size: 7px; }
  .home-side { gap: 0; }
}
