:root {
  color-scheme: light;
  --ink: #243042;
  --muted: #657086;
  --paper: #fffdf8;
  --sky: #a7e7ff;
  --grass: #7bd66c;
  --coral: #ff6f7f;
  --gold: #ffc857;
  --violet: #8c6ff7;
  --teal: #29c8b8;
  --line: rgba(36, 48, 66, 0.14);
  --shadow: 0 12px 32px rgba(36, 48, 66, 0.16);
  font-family: ui-rounded, "Avenir Next", "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 200, 87, 0.28), transparent 32rem),
    linear-gradient(180deg, #d9f5ff 0%, #fff7d7 58%, #dff7cf 100%);
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

button {
  color: inherit;
  font: inherit;
}

.hidden {
  display: none !important;
}

.landing-shell {
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2.2rem);
  display: grid;
  place-items: center;
}

.landing-hero {
  width: min(1120px, 100%);
  min-height: min(780px, calc(100vh - 2rem));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(21rem, 0.82fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
  position: relative;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 7% 41% auto auto;
  width: clamp(12rem, 25vw, 21rem);
  aspect-ratio: 1;
  border-radius: 46% 52% 44% 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.8), transparent 28%),
    linear-gradient(145deg, #69df82, #29c8b8);
  box-shadow: inset -1.1rem -1.25rem 0 rgba(0,0,0,0.08), 0 1.4rem 4rem rgba(36,48,66,0.14);
  transform: rotate(-8deg);
  z-index: -1;
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: auto auto 10% 42%;
  width: clamp(7rem, 14vw, 12rem);
  aspect-ratio: 1;
  border-radius: 48% 44% 52% 46%;
  background:
    radial-gradient(circle at 38% 27%, rgba(255,255,255,0.74), transparent 30%),
    linear-gradient(145deg, #ff6f7f, #ffc857);
  box-shadow: inset -0.75rem -0.8rem 0 rgba(0,0,0,0.08), 0 1rem 2.8rem rgba(36,48,66,0.12);
  transform: rotate(12deg);
  z-index: -1;
}

.hero-copy {
  max-width: 39rem;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  font-weight: 950;
}

.hero-copy h1 {
  margin: 1.25rem 0 0;
  max-width: 12ch;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 34rem;
  margin: 1.2rem 0 0;
  color: #44546a;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.45;
  font-weight: 750;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(36, 48, 66, 0.08);
}

.auth-panel,
.account-panel {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255,255,255,0.84);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: clamp(1rem, 3vw, 1.45rem);
  backdrop-filter: blur(14px);
  width: min(100%, 27rem);
  justify-self: end;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 0.7rem;
  background: rgba(36,48,66,0.07);
}

.auth-tab {
  min-height: 2.7rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  font-weight: 950;
}

.auth-tab.active {
  background: #fff;
  box-shadow: 0 0.35rem 0.9rem rgba(36,48,66,0.1);
}

.auth-panel h2 {
  margin: 1rem 0 0.75rem;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1;
}

.auth-form,
.account-actions {
  display: grid;
  gap: 0.8rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  color: #44546a;
  font-size: 0.86rem;
  font-weight: 900;
}

.field input {
  width: 100%;
  min-height: 3.15rem;
  border: 1px solid rgba(36,48,66,0.18);
  border-radius: 0.55rem;
  padding: 0 0.8rem;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 750;
}

.field input:focus {
  outline: 3px solid rgba(41,200,184,0.22);
  border-color: var(--teal);
}

.auth-message,
.account-message {
  min-height: 1.25rem;
  margin: 0;
  color: #b44454;
  font-size: 0.9rem;
  font-weight: 850;
}

.auth-submit,
.secondary-action,
.danger-action,
.account-button {
  min-height: 3rem;
  border: 0;
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 950;
}

.auth-submit {
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  box-shadow: 0 0.45rem 0 rgba(203, 85, 99, 0.42);
}

.auth-submit:disabled {
  opacity: 0.68;
  cursor: wait;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.65rem;
}

.brand-button,
.nav-button,
.mix-button,
.combine-slot,
.close-button,
.account-button {
  border: 0;
  cursor: pointer;
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  width: 2.4rem;
  aspect-ratio: 1;
  border-radius: 44% 48% 42% 50%;
  background: linear-gradient(145deg, #63dd7d, #18b8aa);
  box-shadow: inset -0.25rem -0.35rem 0 rgba(0, 0, 0, 0.1);
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  width: 0.36rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #17324a;
}

.brand-mark::before {
  left: 0.65rem;
}

.brand-mark::after {
  right: 0.65rem;
}

.progress-pill {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  box-shadow: 0 8px 20px rgba(36, 48, 66, 0.08);
  font-weight: 800;
  white-space: nowrap;
}

.progress-pill span:last-child {
  margin-left: 0.4rem;
  color: var(--teal);
}

.account-button {
  padding: 0 0.85rem;
  background: #fff4c8;
  color: #765a13;
  box-shadow: 0 8px 18px rgba(36, 48, 66, 0.08);
}

.screen {
  display: none;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem) 6.5rem;
}

.screen.active {
  display: block;
}

.screen-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.6rem 0 1rem;
}

.screen-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.screen-heading p {
  max-width: 24rem;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.habitat {
  min-height: clamp(30rem, 72vh, 46rem);
  border: 1px solid rgba(36, 48, 66, 0.12);
  border-radius: 1.1rem;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(167, 231, 255, 0.72) 0 50%, rgba(123, 214, 108, 0.56) 50% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 2rem, transparent 2rem 4rem);
  box-shadow: var(--shadow);
}

.habitat::before {
  content: "";
  position: absolute;
  inset: 47% 0 auto;
  height: 5rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), transparent);
}

.habitat-slime {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(4.4rem, 10vw, 7.4rem);
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  animation: drift var(--speed) ease-in-out infinite alternate;
}

.habitat-slime .slime-art {
  animation: bounce 1.55s ease-in-out infinite;
  filter: drop-shadow(0 0.55rem 0 rgba(36, 48, 66, 0.13));
}

.habitat-slime:nth-child(3n) .slime-art {
  animation-delay: -0.35s;
}

.habitat-slime:nth-child(4n) .slime-art {
  animation-delay: -0.7s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1.04, 0.96); }
  48% { transform: translateY(-0.7rem) scale(0.96, 1.04); }
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(var(--dx), var(--dy)); }
}

.combine-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(17rem, 0.9fr);
  gap: 1rem;
  align-items: stretch;
}

.choice-panel,
.result-panel {
  min-height: 18rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.choice-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.6rem, 2vw, 1.2rem);
  padding: clamp(0.8rem, 2vw, 1.4rem);
}

.combine-slot {
  min-height: 13.5rem;
  border-radius: 0.8rem;
  background: #f7fbff;
  border: 2px dashed rgba(36, 48, 66, 0.2);
  display: grid;
  place-items: center;
  padding: 1rem;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.combine-slot.selected {
  border-style: solid;
  border-color: var(--teal);
  background: #effffb;
  transform: translateY(-0.18rem);
  box-shadow: 0 0 0 0.28rem rgba(41, 200, 184, 0.14);
}

.slot-label,
.slot-action {
  display: inline-grid;
  place-items: center;
  min-height: 1.45rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
}

.slot-label {
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  background: rgba(36, 48, 66, 0.08);
  color: #44546a;
}

.slot-action {
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.combine-slot.selected .slot-label,
.combine-slot.selected .slot-action {
  background: var(--teal);
  color: #fff;
}

.combine-controls {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}

.swap-button {
  width: 3rem;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: #e9fbff;
  box-shadow: 0 0.35rem 0 rgba(41, 200, 184, 0.26), 0 8px 18px rgba(36, 48, 66, 0.09);
  cursor: pointer;
  position: relative;
}

.swap-button::before,
.swap-button::after {
  content: "";
  position: absolute;
  left: 0.78rem;
  width: 1.35rem;
  height: 0.42rem;
  border: 0.18rem solid var(--teal);
  border-left: 0;
  border-bottom: 0;
}

.swap-button::before {
  top: 0.82rem;
  transform: rotate(0deg);
}

.swap-button::after {
  bottom: 0.82rem;
  transform: rotate(180deg);
}

.swap-button:active {
  transform: translateY(0.18rem);
}

.mix-button {
  width: 5.3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--coral), var(--gold));
  color: #fff;
  font-size: 1.2rem;
  font-weight: 950;
  box-shadow: 0 0.75rem 0 #cb5563, var(--shadow);
  transform: translateY(-0.25rem);
}

.mix-button:active {
  transform: translateY(0.25rem);
  box-shadow: 0 0.25rem 0 #cb5563, var(--shadow);
}

.result-panel {
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  overflow: hidden;
  position: relative;
  scroll-margin: 6rem 0;
}

.result-panel.new {
  animation: discovery-pop 0.78s ease both;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.96) 0 5.5rem, rgba(255, 231, 117, 0.5) 5.6rem 8rem, transparent 8.1rem),
    linear-gradient(135deg, rgba(255, 244, 200, 0.92), rgba(224, 255, 250, 0.88));
  border-color: rgba(255, 200, 87, 0.75);
}

.result-panel.known {
  animation: pop 0.42s ease both;
}

.result-panel.miss {
  animation: wobble 0.44s ease both;
}

@keyframes pop {
  0% { transform: scale(0.96); }
  55% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes discovery-pop {
  0% { transform: scale(0.9) rotate(-1deg); }
  45% { transform: scale(1.05) rotate(1deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes wobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-0.35rem); }
  50% { transform: translateX(0.35rem); }
  75% { transform: translateX(-0.18rem); }
}

.result-content {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
}

.discovery-content .reveal-art {
  width: min(9rem, 72%);
  animation: reveal-bounce 0.9s cubic-bezier(.18, .92, .28, 1.24) both;
}

.reveal-art .slime-art {
  filter: drop-shadow(0 0.85rem 0 rgba(36, 48, 66, 0.12));
}

.reveal-badge,
.new-badge {
  display: inline-grid;
  place-items: center;
  min-height: 1.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
  box-shadow: 0 0.35rem 0 rgba(203, 85, 99, 0.3);
}

.result-content:not(.discovery-content) .reveal-badge {
  background: #e9fbff;
  color: #277c8a;
  box-shadow: none;
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sparkles span {
  position: absolute;
  width: 0.7rem;
  aspect-ratio: 1;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0 50%, 39% 35%);
  animation: sparkle-pop 0.9s ease both;
}

.sparkles span:nth-child(1) { left: 13%; top: 18%; background: #ff6f7f; animation-delay: 0.04s; }
.sparkles span:nth-child(2) { right: 16%; top: 14%; background: #29c8b8; animation-delay: 0.12s; }
.sparkles span:nth-child(3) { left: 21%; bottom: 30%; background: #8c6ff7; animation-delay: 0.2s; }
.sparkles span:nth-child(4) { right: 20%; bottom: 27%; background: #ffc857; animation-delay: 0.28s; }
.sparkles span:nth-child(5) { left: 44%; top: 4%; background: #7bd66c; animation-delay: 0.16s; }
.sparkles span:nth-child(6) { right: 44%; bottom: 12%; background: #48b5ff; animation-delay: 0.34s; }

@keyframes sparkle-pop {
  0% { transform: scale(0) rotate(0); opacity: 0; }
  45% { transform: scale(1.35) rotate(22deg); opacity: 1; }
  100% { transform: scale(1) rotate(45deg); opacity: 0.88; }
}

@keyframes reveal-bounce {
  0% { transform: translateY(1.2rem) scale(0.35) rotate(-8deg); opacity: 0; }
  58% { transform: translateY(-0.35rem) scale(1.12) rotate(4deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}

.picker,
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.slime-card,
.picker-card {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(36, 48, 66, 0.09);
}

.picker-card {
  min-height: 8.5rem;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 0.65rem;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, outline-color 0.16s ease;
}

.picker-card:hover {
  transform: translateY(-0.16rem);
  background: #ffffff;
}

.picker-card.active {
  outline: 3px solid var(--gold);
  background: #fff8db;
  transform: translateY(-0.16rem);
}

.slime-card {
  min-height: 15.5rem;
  padding: 0.8rem;
  position: relative;
  overflow: hidden;
}

.latest-card {
  border-color: rgba(255, 200, 87, 0.86);
  background:
    radial-gradient(circle at top right, rgba(255, 200, 87, 0.24), transparent 7rem),
    rgba(255, 255, 255, 0.86);
  animation: card-glow 1.1s ease both;
}

.new-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  font-size: 0.68rem;
}

@keyframes card-glow {
  0% { transform: scale(0.96); box-shadow: 0 0 0 rgba(255, 200, 87, 0); }
  55% { transform: scale(1.025); box-shadow: 0 0 0 0.35rem rgba(255, 200, 87, 0.22); }
  100% { transform: scale(1); box-shadow: 0 8px 18px rgba(36, 48, 66, 0.09); }
}

.art-wrap {
  width: min(7rem, 100%);
  aspect-ratio: 1;
  margin: 0 auto 0.35rem;
  display: grid;
  place-items: center;
}

.slime-art {
  width: 100%;
  height: 100%;
}

.name {
  margin: 0.25rem 0;
  font-weight: 950;
  text-align: center;
}

.description,
.recipe {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.3;
}

.meta-line {
  margin: 0.35rem 0 0;
  color: #3f5977;
  font-size: 0.78rem;
  font-weight: 950;
}

.recipe {
  color: #3f5977;
  font-weight: 800;
}

.silhouette {
  filter: grayscale(1) brightness(0.25) opacity(0.45);
}

.unknown-card {
  display: grid;
  align-content: center;
}

.unknown-card .name {
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(35rem, calc(100% - 1.2rem));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  padding: 0.45rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-button {
  min-height: 3.8rem;
  border-radius: 0.7rem;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 0.15rem;
  font-size: 0.82rem;
  font-weight: 900;
}

.nav-button.active {
  background: #e9fbff;
}

.nav-button.primary {
  background: #fff4c8;
}

.nav-icon {
  width: 1.55rem;
  aspect-ratio: 1;
  display: block;
  position: relative;
}

.habitat-icon {
  border-radius: 45% 45% 34% 34%;
  background: var(--grass);
  box-shadow: inset 0 -0.35rem 0 rgba(0,0,0,0.11);
}

.combine-icon::before,
.combine-icon::after {
  content: "";
  position: absolute;
  width: 1rem;
  aspect-ratio: 1;
  border-radius: 50%;
}

.combine-icon::before {
  left: 0;
  top: 0.15rem;
  background: var(--coral);
}

.combine-icon::after {
  right: 0;
  bottom: 0.15rem;
  background: var(--teal);
}

.dex-icon {
  border: 0.2rem solid var(--violet);
  border-radius: 0.25rem;
}

.dex-icon::before,
.dex-icon::after {
  content: "";
  position: absolute;
  left: 0.23rem;
  right: 0.23rem;
  height: 0.16rem;
  background: var(--violet);
}

.dex-icon::before {
  top: 0.42rem;
}

.dex-icon::after {
  bottom: 0.42rem;
}

.account-icon {
  border-radius: 50%;
  background: var(--gold);
}

.account-icon::before,
.account-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #7b5b10;
}

.account-icon::before {
  top: 0.32rem;
  width: 0.48rem;
  aspect-ratio: 1;
  border-radius: 50%;
}

.account-icon::after {
  bottom: 0.3rem;
  width: 0.9rem;
  height: 0.48rem;
  border-radius: 999px 999px 0.35rem 0.35rem;
}

.account-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.account-label {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.account-name {
  margin: 0.2rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 950;
}

.account-email {
  margin: 0.25rem 0 0;
  color: #44546a;
  font-weight: 800;
}

.secondary-action {
  padding: 0 1rem;
  background: #e9fbff;
  color: #277c8a;
}

.danger-action {
  padding: 0 1rem;
  background: #ffe8eb;
  color: #a83243;
}

.detail-dialog,
.discovery-dialog {
  width: min(30rem, calc(100% - 2rem));
  border: 0;
  border-radius: 1rem;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  background: var(--paper);
}

.detail-dialog::backdrop,
.discovery-dialog::backdrop {
  background: rgba(36, 48, 66, 0.35);
}

.discovery-dialog {
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.98) 0 5.8rem, rgba(255, 231, 117, 0.48) 5.9rem 8.4rem, transparent 8.5rem),
    linear-gradient(135deg, #fff8dd, #e8fffb);
}

.discovery-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

.modal-art {
  width: min(9rem, 65%);
  animation: reveal-bounce 0.9s cubic-bezier(.18, .92, .28, 1.24) both;
}

.modal-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.modal-sparkles span {
  position: absolute;
  width: 0.8rem;
  aspect-ratio: 1;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0 50%, 39% 35%);
  animation: sparkle-pop 1s ease both;
}

.modal-sparkles span:nth-child(1) { left: 18%; top: 18%; background: #ff6f7f; }
.modal-sparkles span:nth-child(2) { right: 18%; top: 22%; background: #29c8b8; animation-delay: 0.12s; }
.modal-sparkles span:nth-child(3) { left: 22%; bottom: 28%; background: #8c6ff7; animation-delay: 0.2s; }
.modal-sparkles span:nth-child(4) { right: 23%; bottom: 30%; background: #ffc857; animation-delay: 0.28s; }

.close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ecf0f5;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  top: 1.08rem;
  height: 0.16rem;
  background: var(--ink);
}

.close-button::before {
  transform: rotate(45deg);
}

.close-button::after {
  transform: rotate(-45deg);
}

.celebration {
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  font-weight: 950;
  margin: 0.35rem 0;
}

@media (max-width: 760px) {
  .landing-shell {
    min-height: 100svh;
    padding: max(0.85rem, env(safe-area-inset-top)) 0.85rem max(1rem, env(safe-area-inset-bottom));
    place-items: start stretch;
  }

  .landing-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-content: start;
    padding-bottom: 0;
  }

  .landing-hero::before {
    inset: 4rem -3.5rem auto auto;
    width: 12.5rem;
    opacity: 0.38;
  }

  .landing-hero::after {
    inset: 19rem auto auto -3.25rem;
    width: 8rem;
    opacity: 0.32;
  }

  .hero-copy {
    max-width: none;
    padding-top: 0.35rem;
  }

  .landing-brand {
    font-size: 1.45rem;
  }

  .landing-brand .brand-mark {
    width: 2.05rem;
  }

  .hero-copy h1 {
    max-width: 12ch;
    margin-top: 0.9rem;
    font-size: clamp(2.75rem, 14.5vw, 3.8rem);
    line-height: 0.95;
  }

  .hero-copy p {
    max-width: 28rem;
    margin-top: 0.9rem;
    font-size: 1rem;
    line-height: 1.42;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 1rem;
  }

  .hero-stats span {
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.35rem 0.45rem;
    border-radius: 0.65rem;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.1;
  }

  .auth-panel {
    width: 100%;
    justify-self: stretch;
    padding: 0.85rem;
    border-radius: 0.75rem;
  }

  .auth-tabs {
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .auth-tab,
  .auth-submit {
    min-height: 3rem;
  }

  .auth-panel h2 {
    margin-top: 0.85rem;
    font-size: 1.55rem;
    line-height: 1.08;
  }

  .field input {
    min-height: 3.25rem;
    font-size: 1rem;
  }

  .top-bar,
  .top-actions {
    align-items: start;
  }

  .top-bar {
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .screen-heading {
    align-items: start;
    flex-direction: column;
  }

  .screen-heading p {
    text-align: left;
  }

  .combine-stage,
  .choice-panel {
    grid-template-columns: 1fr;
  }

  .combine-controls {
    justify-self: center;
    grid-template-columns: auto auto;
    align-items: center;
    order: 2;
  }

  #slot-a {
    order: 1;
  }

  #slot-b {
    order: 3;
  }

  .combine-slot {
    min-height: 9.5rem;
  }

  .bottom-nav {
    bottom: 0.65rem;
    gap: 0.25rem;
    padding: 0.35rem;
  }

  .nav-button {
    min-height: 3.5rem;
    font-size: 0.72rem;
  }

  .account-panel {
    grid-template-columns: 1fr;
  }

  .discovery-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .landing-shell {
    padding-inline: 0.65rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.45rem, 16vw, 3.35rem);
  }

  .hero-stats {
    gap: 0.35rem;
  }

  .hero-stats span {
    padding-inline: 0.3rem;
    font-size: 0.78rem;
  }
}
