@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;600;700&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

:root {
  --purple-950: #2d0754;
  --purple-800: #5e1c8b;
  --purple-700: #7d2da7;
  --purple-500: #a44ac2;
  --pink-500: #dd4f94;
  --pink-300: #f3a8cb;
  --cream: #fff8ed;
  --paper: #fff3e6;
  --line: #ebc5b4;
  --green: #66963c;
  --shadow: 0 12px 32px rgba(58, 15, 87, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: #4a235f;
  background:
    radial-gradient(circle at top, #a65ac7 0, #4b126d 38%, #230535 100%);
  font-family: "DM Sans", sans-serif;
}

button, a { font: inherit; }

button { cursor: pointer; }

.site-shell {
  width: min(1536px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background: #f8dff0;
  border: 3px solid #4d126e;
  box-shadow: 0 0 0 8px rgba(255,255,255,.1), var(--shadow);
}

.topbar {
  min-height: 92px;
  display: grid;
  grid-template-columns: 270px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 8px 22px;
  background: linear-gradient(180deg, #fffdfd, #fde9f4);
  border-bottom: 2px solid #e4a9c7;
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--purple-800);
  text-decoration: none;
  line-height: .95;
}

.brand-name {
  font: italic 700 38px/1 "Playfair Display", serif;
}

.brand-subtitle {
  margin-left: 22px;
  color: #4d7b32;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.main-nav a {
  min-width: 104px;
  padding: 10px 12px;
  border-radius: 16px;
  color: #4d1d68;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.main-nav a span {
  display: block;
  margin-bottom: 2px;
  font-size: 26px;
}

.main-nav a:hover,
.main-nav a.active {
  background: linear-gradient(180deg, #ffdcec, #f8c1db);
  box-shadow: inset 0 0 0 1px #e9a3c4, 0 4px 12px rgba(120, 38, 135, .12);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.petal-pill,
.icon-button,
.avatar-button {
  border: 1px solid #e7b4ca;
  background: #fff6fb;
  box-shadow: 0 4px 12px rgba(87, 28, 111, .1);
}

.petal-pill {
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 21px;
}

.icon-button,
.avatar-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.avatar-button {
  padding: 2px;
  overflow: hidden;
}

.avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.garden-stage {
  position: relative;
  min-height: 420px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,0)),
    url("assets/garden-background.jpg") center/cover no-repeat;
  border-bottom: 4px solid #7d2da7;
}

.profile-card {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 330px;
  min-height: 195px;
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 2px solid #8a36ae;
  border-radius: 22px;
  background: rgba(255, 247, 253, .94);
  box-shadow: var(--shadow);
}

.profile-card img {
  width: 100%;
  height: 165px;
  object-fit: cover;
  object-position: top;
  border-radius: 17px;
}

.profile-card h1 {
  margin: 0 0 10px;
  font: 700 26px/1.05 "Playfair Display", serif;
}

.profile-card p,
.profile-card small {
  margin: 0;
}

.progress-track {
  height: 12px;
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid #d78ab4;
  border-radius: 99px;
  background: white;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8a2fa9, #e2559c);
}

.profile-petals {
  margin-top: 15px;
  font-size: 16px;
}

.profile-petals strong {
  font-size: 25px;
}

.garden-buttons {
  position: absolute;
  left: 18px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: 200px;
}

.garden-buttons button {
  padding: 12px 16px;
  border: 2px solid #7d2da7;
  border-radius: 12px;
  color: #52206d;
  background: rgba(255, 248, 253, .96);
  box-shadow: 0 5px 12px rgba(55, 14, 79, .16);
  text-align: left;
  font-weight: 700;
}

.garden-buttons button:hover {
  color: white;
  background: linear-gradient(180deg, #b34bc4, #76239a);
}

.decorate-button {
  position: absolute;
  right: 22px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border: 2px solid #df9cdf;
  border-radius: 18px;
  color: white;
  background: linear-gradient(180deg, #a844bd, #6e188f);
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 700;
}

.empty-flower-bed {
  position: absolute;
  right: 24%;
  bottom: 28px;
  width: 170px;
  height: 82px;
  border: 10px solid #776450;
  border-radius: 50%;
  background: #422d22;
  box-shadow: inset 0 0 0 3px #9a8063, 0 8px 18px rgba(44, 23, 12, .25);
}

.bed-sign {
  position: absolute;
  top: -60px;
  left: 62px;
  padding: 6px;
  border: 4px solid #725b45;
  border-radius: 5px;
  background: #f3e1b8;
}

.planted-item {
  position: absolute;
  left: 50%;
  bottom: 15px;
  translate: -50% 0;
  font-size: 65px;
  filter: drop-shadow(0 5px 3px rgba(0,0,0,.2));
  animation: grow .55s ease-out;
}

@keyframes grow {
  from { transform: scale(.15) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr);
  gap: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #f9dbea, #f7cfe4);
}

.gallery-panel,
.featured-card,
.daily-card {
  border: 2px solid #e3b0c2;
  border-radius: 22px;
  background: rgba(255, 248, 238, .96);
  box-shadow: 0 8px 18px rgba(84, 24, 107, .12);
}

.gallery-panel {
  padding: 14px 18px 18px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.filter-tabs button {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 1px solid #e7bfd0;
  border-radius: 17px;
  color: #5a246f;
  background: #fbe6f1;
  font-weight: 700;
}

.filter-tabs button.selected {
  color: white;
  background: linear-gradient(180deg, #9e40bb, #6c218e);
}

.gallery-panel h2,
.featured-card h2,
.daily-card h2 {
  margin: 8px 0 16px;
  text-align: center;
  font: italic 700 31px/1.1 "Playfair Display", serif;
}

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

.gallery-card {
  position: relative;
  overflow: hidden;
  padding: 6px;
  border: 1px solid #e5bba8;
  border-radius: 13px;
  background: #fff8ef;
  transition: .2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 18px rgba(83, 32, 96, .16);
}

.gallery-card[hidden] { display: none; }

.gallery-card img {
  width: 100%;
  aspect-ratio: 2.1 / 1;
  object-fit: cover;
  border-radius: 9px;
}

.gallery-card h3 {
  margin: 5px 0 2px;
  text-align: center;
  font: 700 16px/1.1 "Playfair Display", serif;
}

.favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #d83d7d;
  background: rgba(255,255,255,.9);
  font-size: 22px;
  line-height: 1;
}

.favorite.is-favorite {
  color: white;
  background: #df4d8c;
}

.rarity {
  display: table;
  margin: 0 auto 6px;
  padding: 2px 10px;
  border-radius: 99px;
  color: white;
  font-size: 11px;
}

.common { background: #6e9a45; }
.rare { background: #7652bd; }
.uncommon { background: #7e9b48; }
.epic { background: #7141bc; }
.story { background: #8e4eb3; }
.special { background: #9138ae; }

.gallery-card footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}

.view-all {
  display: block;
  margin: 16px auto 0;
  padding: 10px 34px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: linear-gradient(180deg, #e15d9d, #b9367b);
  font-weight: 700;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.featured-card,
.daily-card {
  padding: 12px;
}

.featured-art {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border-radius: 18px;
  background: #0e1b50;
}

.featured-art img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.featured-copy {
  position: absolute;
  inset: 0 auto 0 0;
  width: 54%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  color: white;
  background: linear-gradient(90deg, rgba(8,15,52,.95), rgba(8,15,52,.35), transparent);
}

.featured-copy h3 {
  margin: 0 0 8px;
  font: 700 24px "Playfair Display", serif;
}

.featured-copy p {
  margin: 0 0 16px;
  line-height: 1.4;
}

.featured-copy button,
.daily-card li button {
  border: 0;
  border-radius: 10px;
  color: white;
  background: linear-gradient(180deg, #d95798, #a93279);
  font-weight: 700;
}

.featured-copy button {
  align-self: flex-start;
  padding: 10px 16px;
}

.daily-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-card li {
  display: grid;
  grid-template-columns: 1fr auto 54px;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #ecd1c4;
}

.daily-card li button {
  padding: 7px 9px;
}

.daily-card li button:disabled {
  opacity: .5;
  cursor: default;
}

.come-back {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(180deg, #e564a2, #ca3d85);
  text-align: center;
  font-weight: 700;
}

.tip-bar {
  padding: 10px 28px;
  color: white;
  background: linear-gradient(180deg, #6b1790, #3b075c);
}

dialog {
  width: min(560px, calc(100% - 30px));
  border: 2px solid #a54bb8;
  border-radius: 22px;
  color: #4d1e67;
  background: #fff7ef;
  box-shadow: 0 28px 60px rgba(32, 4, 49, .4);
}

dialog::backdrop {
  background: rgba(35, 7, 55, .62);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  color: #71248c;
  background: transparent;
  font-size: 34px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.inventory-grid button {
  min-height: 110px;
  border: 1px solid #e7bfd0;
  border-radius: 16px;
  background: #fde8f2;
  font-size: 42px;
}

.inventory-grid span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 99;
  max-width: min(430px, calc(100% - 28px));
  padding: 12px 20px;
  border-radius: 14px;
  color: white;
  background: #63207d;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: .25s ease;
}

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

body.decorate-mode .garden-stage {
  outline: 5px dashed #f05a9b;
  outline-offset: -10px;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 220px 1fr;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .main-nav a { min-width: 88px; }

  .dashboard { grid-template-columns: 1fr; }

  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .brand-subtitle { margin-left: 0; }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .main-nav a { flex: 0 0 110px; }

  .garden-stage {
    min-height: 650px;
    background-position: 58% center;
  }

  .profile-card {
    width: calc(100% - 28px);
    left: 14px;
    grid-template-columns: 120px 1fr;
  }

  .profile-card img { height: 140px; }

  .garden-buttons {
    left: 14px;
    bottom: 20px;
    width: calc(100% - 28px);
    grid-template-columns: repeat(2, 1fr);
  }

  .decorate-button {
    right: 14px;
    bottom: 135px;
  }

  .empty-flower-bed {
    right: 30px;
    bottom: 230px;
  }

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

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

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-card img { aspect-ratio: 2.5 / 1; }
}
