:root {
  --font-xs: 0.875em;
  /* tiny labels, badges, timers */
  --font-sm: 1em;
  /* secondary text, meta info */
  --font-md: 1.2em;
  /* body text, descriptions */
  --font-lg: 1.875em;
  /* headings, titles */
  --font-xl: 2em;
  /* large display headings */
  --bg: #fdf6f0;
  --bg2: #fef0e8;
  --card: #fff8f4;
  --accent: #e8735a;
  --accent2: #c94f7c;
  --green: #5a9e6f;
  --gold: #d4a843;
  --blue: #1e88e5;
  --text: #2a1f1a;
  --muted: #9a7e76;
  --border: #f0ddd5;
  --shadow: rgba(200, 100, 80, 0.12);
  /* rarity colors */
  --common: #5a9e6f;
  --noble: #d4a843;
  --elite: #e8735a;
  --exotic: #c94f7c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

code, pre, .token {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

body {
  font-family: "Jost", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  background-image:
    radial-gradient(ellipse at 15% 10%,
      rgba(232, 115, 90, 0.07) 0%,
      transparent 50%),
    radial-gradient(ellipse at 85% 90%,
      rgba(201, 79, 124, 0.06) 0%,
      transparent 50%);
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== WELCOME ===== */
#screen-welcome {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.welcome-deco {
  font-size: 64px;
  margin-bottom: 18px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.welcome-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(26px, 6vw, 40px);
  color: var(--accent2);
  margin-bottom: 6px;
  line-height: 1.2;
}

.welcome-sub {
  font-size: var(--font-md);
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 36px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px var(--shadow);
}

.card-title {
  font-family: "Playfair Display", serif;
  font-size: var(--font-lg);
  margin-bottom: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

input[type="text"] {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: "Jost", sans-serif;
  font-size: var(--font-md);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

input[type="text"]::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-family: "Jost", sans-serif;
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  box-shadow: 0 4px 14px rgba(232, 115, 90, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 115, 90, 0.45);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
  margin-top: 8px;
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.divider {
  text-align: center;
  color: var(--muted);
  font-size: var(--font-sm);
  margin: 14px 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.error-msg {
  color: var(--accent);
  font-size: var(--font-sm);
  text-align: center;
  min-height: 16px;
  margin-top: -4px;
}

/* CODE SCREEN */
.code-display {
  background: var(--bg2);
  border: 2px dashed var(--accent);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  margin: 14px 0;
}

.code-label {
  font-size: var(--font-sm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.code-value {
  font-family: "Playfair Display", serif;
  font-size: 26px;
  color: var(--accent2);
  letter-spacing: 3px;
  font-weight: 700;
}

.code-hint {
  font-size: var(--font-sm);
  color: var(--muted);
  margin-top: 6px;
}

/* ===== GAME SCREEN ===== */
#screen-game {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Header */
.game-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px var(--shadow);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.player-name {
  font-family: "Playfair Display", serif;
  font-size: var(--font-md);
}

.player-code {
  font-size: var(--font-xs);
  color: var(--muted);
  font-weight: 300;
}

.header-badges {
  display: flex;
  gap: 6px;
}

.coins-badge {
  padding: 3px 10px;
  font-size: var(--font-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.bouquets-badge {
  padding: 3px 10px;
  font-size: var(--font-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.bouquets-badge.hidden {
  display: none;
}

/* Resources row */
.resources {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.resource {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg);
  border-radius: 20px;
  padding: 2px 6px;
  font-size: var(--font-sm);
  border: 1px solid var(--border);
}

.resource-icon {
  font-size: var(--font-sm);
}

.resource-val {
  font-weight: 600;
  color: var(--text);
}

.resource-max {
  color: var(--muted);
  font-weight: 300;
}

.resource-water {
  gap: 4px;
}

.resource-water-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.resource-water-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.resource-water-timer {
  font-size: var(--font-xs);
  color: var(--blue);
  margin-left: 3px;
  font-weight: 600;
}

.resource-water-bar {
  width: 90%;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.resource-water-fill {
  height: 100%;
  background: linear-gradient(90deg, #64b5f6, #1e88e5);
  border-radius: 4px;
  transition: width 1s linear;
}

/* XP bar */
.xp-bar-wrap {}

.xp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-xs);
  color: var(--muted);
  margin-bottom: 3px;
}

.xp-bar {
  height: 4px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* Tab bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  box-shadow: 0 -2px 12px var(--shadow);
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 4px;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tab-icon {
  font-size: var(--font-md);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Game content */
.game-content {
  padding: 16px;
  padding-bottom: 70px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Section title */
.section-title {
  font-family: "Playfair Display", serif;
  font-size: var(--font-md);
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== PLOTS ===== */
.plots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.plot {
  aspect-ratio: 1;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(100, 60, 20, 0.18);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.plot:hover:not(.locked) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(100, 60, 20, 0.28);
}

.plot:active:not(.locked) {
  transform: scale(0.97);
}

.plot-soil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      #6b3a1f 0%,
      #7d4a28 30%,
      #5c3010 60%,
      #4a2508 100%);
}

.plot-soil::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg,
      transparent 0px,
      transparent 10px,
      rgba(0, 0, 0, 0.15) 10px,
      rgba(0, 0, 0, 0.15) 12px,
      transparent 12px,
      transparent 22px);
}

.plot-soil::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 100%);
  border-radius: 14px 14px 0 0;
}

.plot.locked .plot-soil {
  background: #3a3a3a;
  filter: grayscale(1);
  opacity: 0.5;
}

.plot-lock-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.plot-lock-icon {
  font-size: var(--font-xl);
  opacity: 0.7;
}

.plot-lock-label {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.plot-plant-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.plot-plant-icon {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-lg);
  transition: all 0.2s;
}

.plot:hover .plot-plant-icon {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.08);
}

.plot-plant-label {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

.plot-flower-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 14px;
}

.plot-flower-emoji {
  display: block;
  font-size: 8em;
  line-height: 1;
  transform-origin: center bottom;
  will-change: transform;
}

.plot-ready .plot-flower-emoji {
  animation: pendulum 2.8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  transform-origin: center bottom;
}

@keyframes pendulum {
  0% {
    transform: scale(var(--fs, 1)) rotate(-7deg);
  }

  25% {
    transform: scale(var(--fs, 1)) rotate(7deg);
  }

  50% {
    transform: scale(var(--fs, 1)) rotate(-7deg);
  }

  75% {
    transform: scale(var(--fs, 1)) rotate(7deg);
  }

  100% {
    transform: scale(var(--fs, 1)) rotate(-7deg);
  }
}

.plot-ready {
  animation: plot-pulse 2s ease-in-out infinite;
}

@keyframes plot-pulse {

  0%,
  100% {
    box-shadow: 0 3px 10px rgba(90, 158, 111, 0.3);
  }

  50% {
    box-shadow: 0 0 22px rgba(90, 158, 111, 0.7);
  }
}

.plot-info {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: linear-gradient(rgba(0, 0, 0, 0.58), transparent);
  padding: 5px 5px 14px;
  text-align: center;
}

.plot-name {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

.plot-timer {
  font-size: var(--font-xs);
  color: rgba(255, 220, 100, 0.92);
  font-weight: 600;
  margin-top: 1px;
}

.plot-boost-btns {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 4px;
  z-index: 4;
  pointer-events: none;
}

.plot-fert-btn,
.plot-water-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  border: none;
  border-radius: 3px;
  padding: 1px 3px;
  font-size: var(--font-xs);
  color: white;
  cursor: pointer;
  font-family: "Jost", sans-serif;
  transition: all 0.15s;
  backdrop-filter: blur(4px);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: all;
  line-height: 1.4;
}

/* Hide button text on narrow screens */
@media (max-width: 380px) {
  .plot-water-btn .btn-text,
  .plot-fert-btn .btn-text {
    display: none;
  }
  .plot-water-btn .btn-icon,
  .plot-fert-btn .btn-icon {
    font-size: var(--font-sm);
  }
}

/* Reduce icon size on larger screens for more compact chips */
@media (min-width: 381px) {
  .plot-water-btn .btn-icon,
  .plot-fert-btn .btn-icon {
    font-size: 10px;
  }
}

.plot-fert-btn {
  background: rgba(90, 158, 111, 0.85);
}

.plot-fert-btn:hover {
  background: rgba(90, 158, 111, 1);
  transform: scale(1.08);
}

.plot-water-btn {
  background: rgba(30, 136, 229, 0.85);
}

.plot-water-btn:hover {
  background: rgba(30, 136, 229, 1);
  transform: scale(1.08);
}

.plot-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #5ae88a, #a8ff78);
  z-index: 5;
  border-radius: 0 2px 2px 0;
}

/* Offline banner */
.offline-banner {
  background: rgba(90, 158, 111, 0.1);
  border: 1px solid rgba(90, 158, 111, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: var(--font-sm);
  color: var(--green);
  display: none;
  align-items: center;
  gap: 6px;
}

.offline-banner.show {
  display: flex;
}

/* ===== SHOP ===== */
.shop-coins-bar {
  background: linear-gradient(135deg, #fff8ee, #fff0d6);
  border: 1px solid #f0d898;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-coins-label {
  font-size: var(--font-sm);
  color: var(--muted);
}

.shop-coins-val {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  color: #b8860b;
}

.rarity-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rarity-tab {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
}

.rarity-tab.common {
  background: rgba(90, 158, 111, 0.1);
  color: var(--common);
  border-color: rgba(90, 158, 111, 0.3);
}

.rarity-tab.noble {
  background: rgba(212, 168, 67, 0.1);
  color: var(--noble);
  border-color: rgba(212, 168, 67, 0.3);
}

.rarity-tab.exotic {
  background: rgba(201, 79, 124, 0.1);
  color: var(--exotic);
  border-color: rgba(201, 79, 124, 0.3);
}

.rarity-tab.active.common {
  background: var(--common);
  color: white;
  border-color: var(--common);
}

.rarity-tab.active.noble {
  background: var(--noble);
  color: white;
  border-color: var(--noble);
}

.rarity-tab.active.exotic {
  background: var(--exotic);
  color: white;
  border-color: var(--exotic);
}

.seed-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  text-align: center;
}

.seed-preview-icon {
  font-size: 52px;
  margin-bottom: 8px;
}

.seed-preview-label {
  font-size: var(--font-md);
  color: var(--muted);
  margin-bottom: 4px;
}

.seed-preview-name {
  font-family: "Playfair Display", serif;
  font-size: var(--font-xl);
  color: var(--text);
  margin-bottom: 4px;
}

.seed-preview-mystery {
  font-size: var(--font-sm);
  color: var(--muted);
  font-style: italic;
}

.seed-preview-time {
  font-size: var(--font-sm);
  color: var(--muted);
  margin-top: 6px;
}

.btn-buy {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: "Jost", sans-serif;
  font-size: var(--font-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy.common {
  background: linear-gradient(135deg, #5a9e6f, #3d7a52);
  color: white;
  box-shadow: 0 4px 14px rgba(90, 158, 111, 0.35);
}

.btn-buy.noble {
  background: linear-gradient(135deg, #d4a843, #b8860b);
  color: white;
  box-shadow: 0 4px 14px rgba(212, 168, 67, 0.35);
}

.btn-buy.exotic {
  background: linear-gradient(135deg, #c94f7c, #a0235a);
  color: white;
  box-shadow: 0 4px 14px rgba(201, 79, 124, 0.35);
}

.btn-buy:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-buy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Shop grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.shop-card {
  transition: transform 0.15s;
}

.shop-card:hover {
  transform: translateY(-2px);
}

/* ===== INVENTORY ===== */
.inventory-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: var(--font-md);
  font-style: italic;
}

.seed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seed-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s;
  cursor: pointer;
}

.seed-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.seed-item.no-plots {
  opacity: 0.5;
  cursor: not-allowed;
}

.seed-item.no-plots:hover {
  border-color: var(--border);
  transform: none;
}

.seed-emoji {
  font-size: var(--font-xl);
  flex-shrink: 0;
}

.seed-info {
  flex: 1;
}

.seed-name {
  font-weight: 600;
  font-size: var(--font-md);
  margin-bottom: 2px;
}

.seed-meta {
  font-size: var(--font-sm);
  color: var(--muted);
}

.seed-rarity-badge {
  font-size: var(--font-xs);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-common {
  background: rgba(90, 158, 111, 0.15);
  color: var(--common);
}

.badge-noble {
  background: rgba(212, 168, 67, 0.15);
  color: var(--noble);
}

.badge-elite {
  background: rgba(232, 115, 90, 0.15);
  color: var(--elite);
}

.badge-exotic {
  background: rgba(201, 79, 124, 0.15);
  color: var(--exotic);
}

/* ===== BOUQUET & SELL ===== */
.bouquet-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.bouquet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bouquet-title-text {
  font-family: "Playfair Display", serif;
  font-size: var(--font-lg);
}

.bouquet-score {
  font-size: var(--font-sm);
  color: var(--accent2);
  font-weight: 600;
}

.bouquet-flowers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  align-items: center;
  margin-bottom: 14px;
}

.bouquet-flower {
  font-size: 26px;
}

.bouquet-flower.new {
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pop-in {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.bouquet-empty {
  font-size: var(--font-sm);
  color: var(--muted);
  font-style: italic;
}

.flower-group {
  font-size: var(--font-md);
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Gift button */
#btn-gift {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #c94f7c, #a03060);
  color: white;
  font-family: "Jost", sans-serif;
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(201, 79, 124, 0.3);
}

#btn-gift:hover {
  transform: translateY(-1px);
}

/* Sell section */
.sell-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.sell-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sell-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.sell-group-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sell-group-emoji {
  font-size: 26px;
}

.sell-group-info {
  flex: 1;
}

.sell-group-name {
  font-weight: 600;
  font-size: var(--font-md);
}

.sell-group-count {
  font-size: var(--font-sm);
  color: var(--muted);
}

.sell-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sell-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  font-family: "Jost", sans-serif;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: linear-gradient(135deg, #f9a825, #f57f17);
  color: white;
}

.sell-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.sell-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.sell-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: var(--font-sm);
  font-style: italic;
}

/* Gifted bouquets section */
.gifted-bouquets-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.gifted-bouquets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gifted-bouquet-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.gifted-bouquet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gifted-bouquet-sender {
  font-weight: 600;
  font-size: var(--font-md);
  color: var(--accent2);
}

.gifted-bouquet-date {
  font-size: var(--font-sm);
  color: var(--muted);
}

.gifted-bouquet-message {
  font-size: var(--font-sm);
  color: var(--text);
  margin-bottom: 10px;
  font-style: italic;
}

.gifted-bouquet-flowers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gifted-bouquet-flower {
  font-size: var(--font-xl);
}

.gifted-bouquet-type {
  font-size: var(--font-xs);
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent2);
  color: white;
  font-weight: 600;
}

.gifted-bouquet-type.sent {
  background: #6a8caf;
}

.gifted-bouquet-type.received {
  background: #a03060;
}

.gifted-bouquets-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: var(--font-sm);
  font-style: italic;
}

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 26, 0.5);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 24px 18px 36px;
  width: 100%;
  max-width: 480px;
  animation: slide-up 0.3s ease;
  border-top: 1px solid var(--border);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

/* Full height modal for gift selection */
.modal.modal-full {
  max-height: 100dvh;
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* Centered modal for plant selection */
.modal-overlay.modal-overlay-centered {
  align-items: center;
}

.modal-centered {
  border-radius: 24px;
  max-height: 80vh;
  animation: fade-in 0.3s ease;
}

.modal-title {
  font-family: "Playfair Display", serif;
  font-size: var(--font-xl);
  margin-bottom: 18px;
}

.close-modal {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--font-md);
  color: var(--muted);
}

/* Plot seed select modal */
.seed-select-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Section for each rarity group */
.seed-select-section {
  margin-bottom: 12px;
}

.seed-select-section:last-child {
  margin-bottom: 0;
}

/* Container for seed cards within a rarity section */
.seed-select-section-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Section header with rarity name */
.seed-select-section-header {
  font-family: "Playfair Display", serif;
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.seed-select-section-header.common {
  color: var(--common);
}

.seed-select-section-header.noble {
  color: var(--noble);
}

.seed-select-section-header.exotic {
  color: var(--exotic);
}

/* Individual seed card */
.seed-select-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  transition: all 0.15s;
  cursor: pointer;
}

.seed-select-card:hover {
  border-color: var(--accent);
}

.seed-select-card.no-water {
  opacity: 0.45;
  cursor: not-allowed;
}

.seed-select-card.no-water:hover {
  border-color: var(--border);
}

.seed-select-card-emoji {
  font-size: var(--font-lg);
  flex-shrink: 0;
  line-height: 1;
}

.seed-select-card-info {
  flex: 1;
  min-width: 0;
}

.seed-select-card-name {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text);
}

.seed-select-card-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.seed-select-card-epithet {
  flex-shrink: 0;
}

/* Epithet pill badge */
.seed-epithet-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-weight: 500;
}

/* Plant button */
.seed-plant-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  font-family: "Jost", sans-serif;
  font-weight: 600;
  font-size: var(--font-xs);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.seed-plant-btn.common {
  background: linear-gradient(135deg, var(--common), #3d7a52);
  color: white;
  box-shadow: 0 3px 10px rgba(90, 158, 111, 0.3);
}

.seed-plant-btn.noble {
  background: linear-gradient(135deg, var(--noble), #b8860b);
  color: white;
  box-shadow: 0 3px 10px rgba(212, 168, 67, 0.3);
}

.seed-plant-btn.exotic {
  background: linear-gradient(135deg, var(--exotic), #a0235a);
  color: white;
  box-shadow: 0 3px 10px rgba(201, 79, 124, 0.3);
}

.seed-plant-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.seed-plant-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Flower-grouped seed card layout */
.seed-flower-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  transition: all 0.15s;
}

.seed-flower-card:hover {
  border-color: var(--accent);
}

.seed-flower-card.no-water {
  opacity: 0.5;
  cursor: not-allowed;
}

.seed-flower-card.no-water:hover {
  border-color: var(--border);
}

.seed-flower-card-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.seed-flower-emoji {
  font-size: var(--font-xl);
  line-height: 1;
}

.seed-flower-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.seed-flower-name {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text);
}

.seed-flower-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.seed-flower-epithets {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.seed-epithet-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--bg2);
  color: var(--text);
  border: 1.5px solid var(--accent);
  font-size: var(--font-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.seed-epithet-chip:hover:not(.disabled) {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(232, 115, 90, 0.25);
}

.seed-epithet-chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.seed-flower-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* Legacy seed-select-item for backwards compatibility */
.seed-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
}

.seed-select-item:hover {
  border-color: var(--accent);
  background: rgba(232, 115, 90, 0.04);
}

.seed-select-item.no-water {
  opacity: 0.45;
  cursor: not-allowed;
}

.seed-select-item.no-water:hover {
  border-color: var(--border);
  background: var(--bg);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: white;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: var(--font-md);
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  pointer-events: none;
}

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

/* Seed open animation */
.seed-open-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 26, 0.7);
  z-index: 150;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(6px);
}

.seed-open-overlay.open {
  display: flex;
  animation: fade-in 0.3s ease;
}

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

  to {
    opacity: 1;
  }
}

.seed-open-box {
  background: var(--card);
  border-radius: 24px;
  padding: 36px 32px;
  text-align: center;
  max-width: 280px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.seed-open-emoji {
  font-size: 72px;
  animation: bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 12px;
}

@keyframes bounce-in {
  from {
    transform: scale(0) rotate(-10deg);
  }

  to {
    transform: scale(1) rotate(0);
  }
}

.seed-open-title {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  color: var(--accent2);
  margin-bottom: 4px;
}

.seed-open-sub {
  font-size: var(--font-md);
  color: var(--muted);
  margin-bottom: 18px;
}

.seed-open-rarity {
  font-size: var(--font-sm);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 16px;
}

.seed-open-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.seed-open-actions .btn {
  width: 100%;
  min-height: 44px;
}

.seed-open-hint {
  font-size: var(--font-sm);
  color: var(--muted);
  margin: 4px 0 0 0;
  text-align: center;
  line-height: 1.4;
}

/* ===== CATALOG LIST - Vertical Layout by Rarity ===== */
.catalog-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 4px 0 16px 0;
}

/* Section for each rarity group */
.catalog-section {
  margin-bottom: 8px;
}

.catalog-section:last-child {
  margin-bottom: 0;
}

/* Container for flower rows within a rarity section */
.catalog-section-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Section header with rarity name */
.catalog-section-header {
  font-family: "Playfair Display", serif;
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.catalog-section-header.common {
  color: var(--common);
}

.catalog-section-header.noble {
  color: var(--noble);
}

.catalog-section-header.exotic {
  color: var(--exotic);
}

/* Individual flower row - full width */
.catalog-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}

.catalog-row:hover {
  /* transform: translateX(2px); */
  border-color: var(--accent);
}

.catalog-row-emoji {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.catalog-row-info {
  flex: 1;
  min-width: 0;
}

.catalog-row-name {
  font-weight: 600;
  font-size: var(--font-md);
  color: var(--text);
}

.catalog-row-progress {
  font-size: var(--font-xs);
  color: var(--muted);
  margin-top: 2px;
}

/* Epithet badges container */
.catalog-epithets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* Individual epithet pill badge */
.catalog-epithet-pill {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.catalog-epithet-pill.collected {
  background: rgba(76, 175, 80, 0.25);
  color: #004602;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

.catalog-epithet-pill.missing {
  color: var(--text);
  opacity: 0.8;
  border: 1px dashed var(--border);
}

.catalog-row-buy {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-family: "Jost", sans-serif;
  font-weight: 600;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.catalog-row-buy.common {
  background: linear-gradient(135deg, var(--common), #3d7a52);
  color: white;
  box-shadow: 0 3px 10px rgba(90, 158, 111, 0.3);
}

.catalog-row-buy.noble {
  background: linear-gradient(135deg, var(--noble), #b8860b);
  color: white;
  box-shadow: 0 3px 10px rgba(212, 168, 67, 0.3);
}

.catalog-row-buy.exotic {
  background: linear-gradient(135deg, var(--exotic), #a0235a);
  color: white;
  box-shadow: 0 3px 10px rgba(201, 79, 124, 0.3);
}

.catalog-row-buy:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.catalog-row-buy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Infinity badge for owned flowers - positioned in row */
.catalog-owned {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--common);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 700;
}

/* Responsive layout - 2 columns on narrow screens */
@media (max-width: 767px) {
  .plots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}