* { margin: 0; padding: 0; box-sizing: border-box; }
html { touch-action: manipulation; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f0e1;
  color: #3a3a2e;
  min-height: 100vh;
}

#app { width: 100%; max-width: 1100px; margin: 0 auto; padding: 10px 16px; }

/* ============ TOP BAR ============ */
#top-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff8ec; border: 2px solid #d4c9a8;
  border-radius: 12px; padding: 8px 16px; margin-bottom: 12px;
  gap: 12px; flex-wrap: wrap;
}
#resource-bar {
  display: flex; gap: 16px;
}
.resource { font-weight: 700; font-size: 14px; white-space: nowrap; }
.resource-diamonds { color: #2cb5e8; }
.resource-energy { transition: color 0.3s; }
.energy-high { color: #27ae60; }
.energy-mid { color: #e6a832; }
.energy-low { color: #e05050; }
.boost-active { font-size: 12px; font-weight: 700; color: #f0a030; background: #f0a03018; padding: 2px 8px; border-radius: 10px; animation: boost-pulse 1.5s ease-in-out infinite; }
@keyframes boost-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.btn-diamond-action { background: linear-gradient(135deg, #1a9ad0, #2cb5e8) !important; color: #fff !important; border: none !important; font-size: 11px !important; }
.diamond-earned-modal { text-align: center; max-width: 300px; position: relative; overflow: hidden; border: 2px solid #2cb5e8; box-shadow: 0 0 40px #2cb5e830; }
.diamond-earned-glow { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, #2cb5e815 0%, transparent 60%); animation: diamond-glow 2s ease-in-out infinite; pointer-events: none; }
@keyframes diamond-glow { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
.diamond-earned-amount { font-size: 36px; font-weight: 800; color: #2cb5e8; margin: 8px 0; animation: diamond-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; }
@keyframes diamond-pop { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.diamond-earned-title { font-size: 18px; font-weight: 700; color: #e0e6ed; margin-bottom: 4px; }
.diamond-earned-subtitle { font-size: 13px; color: #6b7a99; margin-bottom: 8px; }
.diamond-earned-balance { font-size: 12px; color: #4a5c7a; margin-bottom: 12px; }
/* Universal Reward Modal */
.reward-modal { text-align: center; max-width: 340px; position: relative; overflow: hidden; border: 2px solid #e6a832; box-shadow: 0 0 40px rgba(230,168,50,0.2); }
.reward-glow { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(230,168,50,0.08) 0%, transparent 60%); animation: diamond-glow 2s ease-in-out infinite; pointer-events: none; }
.reward-title { font-size: 20px; font-weight: 800; color: #e0e6ed; margin-bottom: 4px; position: relative; animation: diamond-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.reward-subtitle { font-size: 13px; color: #6b7a99; margin-bottom: 12px; position: relative; }
.reward-list { position: relative; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.reward-row { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 10px 14px; }
.reward-icon { font-size: 24px; flex-shrink: 0; }
.reward-label { font-size: 14px; color: #8899bb; flex: 1; text-align: left; }
.reward-amount { font-size: 18px; font-weight: 800; }

.forage-found-modal { text-align: center; max-width: 280px; }
.forage-found-icon { font-size: 48px; margin: 8px 0; animation: diamond-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.forage-found-title { font-size: 14px; color: #6b7a99; margin-bottom: 4px; }
.forage-found-reward { font-size: 22px; font-weight: 800; margin: 8px 0; }
.forage-found-stats { font-size: 11px; color: #4a5c7a; margin-bottom: 12px; }

#actions-bar {
  display: flex; align-items: center; gap: 6px;
}
#forage-btn, #codex-btn, #pause-btn, #upgrades-btn, #achievements-btn {
  padding: 6px 12px; border: none; border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.15s;
  white-space: nowrap;
}
#forage-btn { background: #b8a070; color: #fff; }
#forage-btn:hover { background: #a89060; }
#forage-btn:disabled { opacity: 0.5; cursor: default; }
#flowershop-btn { background: #e88cb0; color: #fff; }
#flowershop-btn:hover { background: #d07898; }
#marketplace-btn { background: #2980b9; color: #fff; }
#marketplace-btn:hover { background: #2471a3; }
#codex-btn { background: #7c6ca8; color: #fff; }
#codex-btn:hover { background: #6a5c96; }
#upgrades-btn { background: #5a9a5a; color: #fff; }
#upgrades-btn:hover { background: #4a8a4a; }
#achievements-btn { background: #d4a030; color: #fff; }
#achievements-btn:hover { background: #c09020; }
#pause-btn { background: #e05050; color: #fff; min-width: 36px; }
#pause-btn:hover { background: #d04040; }
#pause-btn.paused { background: #7ec662; }
#pause-btn.paused:hover { background: #6ab552; }
#rain-indicator {
  font-size: 11px; font-weight: 600; color: #5bb8e8;
  background: #e8f4ff; padding: 5px 10px; border-radius: 8px;
  white-space: nowrap;
}

/* ============ NOTIFICATIONS ============ */
#notif-wrap { position: relative; }
#notif-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  position: relative; padding: 2px 4px; line-height: 1;
}
#notif-badge {
  position: absolute; top: -4px; right: -6px;
  background: #e74c3c; color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 50%; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
#notif-dropdown {
  position: absolute; top: 100%; right: 0; z-index: 999;
  width: 280px; max-height: 320px; overflow-y: auto;
  background: #fff8ec; border: 2px solid #d4c9a8;
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  margin-top: 6px;
}
#notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; font-size: 12px; font-weight: 700;
  border-bottom: 1px solid #e0d8c0; color: #6a5d3a;
}
#notif-clear {
  background: none; border: none; font-size: 10px; color: #c0392b;
  cursor: pointer; font-weight: 600;
}
#notif-list { padding: 4px 0; }
.notif-item {
  padding: 8px 12px; font-size: 11px; border-bottom: 1px solid #f0e8d0;
  display: flex; gap: 8px; align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 16px; flex-shrink: 0; }
.notif-text { flex: 1; color: #3a3a2e; line-height: 1.4; }
.notif-time { font-size: 9px; color: #999; white-space: nowrap; flex-shrink: 0; }
.notif-empty { padding: 16px; text-align: center; font-size: 11px; color: #aaa; }
.dark-mode #notif-dropdown { background: #252540; border-color: #3a3a55; }
.dark-mode #notif-header { border-color: #3a3a55; color: #ccc; }
.dark-mode .notif-item { border-color: #3a3a55; }
.dark-mode .notif-text { color: #ddd; }

/* ============ SEASON INDICATOR ============ */
#season-indicator {
  font-size: 11px; font-weight: 700; padding: 5px 10px;
  border-radius: 8px; background: #f0e8d0; white-space: nowrap;
}
.season-timer { font-weight: 400; color: #888; font-size: 10px; }

/* ============ INFO STRIP (market + orders) ============ */
#info-strip {
  display: grid; grid-template-columns: auto 1fr;
  gap: 10px; margin-bottom: 10px;
  align-items: start;
}
#market-panel, #orders-panel {
  background: #fff8ec; border: 1px solid #e0d8c0;
  border-radius: 10px; padding: 8px 10px;
}
.strip-label {
  font-size: 10px; font-weight: 700; color: #9a8a6a;
  text-transform: uppercase; display: block; margin-bottom: 4px;
}

/* Market trends */
#market-trends { }
.market-grid {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.trend-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 3px 6px; border-radius: 6px; min-width: 36px;
}
.trend-icon { font-size: 16px; }
.trend-pct { font-size: 9px; font-weight: 700; }
.trend-hot { background: #fde8e8; }
.trend-hot .trend-pct { color: #d04040; }
.trend-up { background: #e8fde8; }
.trend-up .trend-pct { color: #2a8a2a; }
.trend-cold { background: #e8e8fd; }
.trend-cold .trend-pct { color: #4040d0; }
.trend-down { background: #f0ebe0; }
.trend-down .trend-pct { color: #888; }
.trend-neutral { opacity: 0.5; }
.trend-neutral .trend-pct { color: #aaa; }
.market-timer {
  font-size: 9px; color: #aaa; margin-top: 4px;
}

/* Orders */
#orders-list { display: flex; gap: 6px; flex-wrap: wrap; }
.order-card {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border: 1px solid #e0d8c0; border-radius: 8px;
  background: #fff; flex: 1; min-width: 180px; max-width: 260px;
}
.order-card.order-ready { border-color: #7ec662; background: #f5fdf0; }
.order-npc { font-size: 20px; flex-shrink: 0; }
.order-body { flex: 1; min-width: 0; }
.order-name { font-size: 10px; font-weight: 700; }
.order-desc { font-size: 11px; font-weight: 600; color: #3a3a2e; }
.order-meta { display: flex; gap: 8px; font-size: 9px; margin-top: 2px; }
.order-reward { color: #b08020; font-weight: 700; }
.order-timer { color: #888; }
.order-action { flex-shrink: 0; }
.btn-fulfill {
  width: 30px; height: 30px; border: none; border-radius: 8px;
  background: #7ec662; color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.btn-fulfill:hover { background: #6ab552; }
.btn-fulfill:disabled { opacity: 0.3; cursor: default; }
.order-empty { font-size: 11px; color: #aaa; padding: 4px 0; }
.orders-crate-hint { font-size: 9px; color: #d4a030; text-transform: none; font-weight: 600; }
.order-card.order-urgent { border-color: #e05050; }
.order-timer-urgent { color: #e05050 !important; font-weight: 700; }
.order-hint { font-size: 9px; color: #7ec662; margin-top: 2px; }
.order-card:not(.order-ready) .order-hint { color: #bbb; }

/* ============ CRATES ============ */
#crates-bar {
  background: #fff8ec; border: 1px solid #e0d8c0;
  border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
}
#crates-list { display: flex; gap: 8px; flex-wrap: wrap; }
.crate-card {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid #e0d8c0; border-radius: 8px;
  background: #fff; min-width: 180px; flex: 1; max-width: 280px;
}
.crate-card.crate-ready { border-color: #e6a832; background: #fef9e8; }
.crate-card.crate-new {
  animation: crate-new-glow 1.5s ease-out;
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}
@keyframes crate-new-glow {
  0% { transform: scale(0.8); opacity: 0; box-shadow: 0 0 30px rgba(168, 85, 247, 0.8); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(168, 85, 247, 0.6); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 12px rgba(168, 85, 247, 0.4); }
}
.crate-icon { font-size: 24px; flex-shrink: 0; }
.crate-bounce { animation: crate-bounce 0.6s infinite; }
@keyframes crate-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.crate-body { flex: 1; min-width: 0; }
.crate-name { font-size: 11px; font-weight: 700; }
.crate-timer { font-size: 10px; color: #888; }
.crate-status { font-size: 10px; color: #e6a832; font-weight: 700; }
.crate-progress {
  height: 4px; background: #e8e4da; border-radius: 2px;
  overflow: hidden; margin-top: 3px;
}
.crate-progress-fill {
  height: 100%; background: linear-gradient(90deg, #d4c9a8, #e6a832);
  border-radius: 2px; transition: width 0.5s;
}
.btn-open-crate {
  padding: 6px 14px; border: none; border-radius: 8px;
  background: #e6a832; color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
  animation: crate-glow 1s infinite;
}
.btn-open-crate:hover { background: #d49a26; }
@keyframes crate-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(230,168,50,0.3); }
  50% { box-shadow: 0 0 15px rgba(230,168,50,0.6); }
}
.crate-empty { font-size: 11px; color: #aaa; }

/* Crate shop buttons */
.btn-buy-crate {
  display: block; width: 100%; padding: 4px 6px; margin-bottom: 3px;
  border: none; border-radius: 6px; font-size: 11px; font-weight: 600;
  cursor: pointer; background: #d4a030; color: #fff; transition: background 0.15s;
  text-align: left;
}
.btn-buy-crate:hover { background: #c09020; }

/* Crate reveal modal */
.crate-reveal-modal { max-width: 360px !important; text-align: center; }
.crate-reveal-modal h3 { font-size: 18px; }
.crate-jackpot { border-color: #e6a832 !important; }
.crate-jackpot h3 { color: #e6a832 !important; }
.crate-items-grid {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.crate-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: #f8f4e8; border-radius: 8px;
  animation: crate-item-reveal 0.4s ease-out backwards;
}
.crate-item:nth-child(1) { animation-delay: 0.1s; }
.crate-item:nth-child(2) { animation-delay: 0.2s; }
.crate-item:nth-child(3) { animation-delay: 0.3s; }
.crate-item:nth-child(4) { animation-delay: 0.4s; }
.crate-item:nth-child(5) { animation-delay: 0.5s; }
.crate-item:nth-child(6) { animation-delay: 0.6s; }
@keyframes crate-item-reveal {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.crate-item-icon { font-size: 20px; }
.crate-item-name { font-size: 12px; font-weight: 600; flex: 1; text-align: left; }

.dark-mode #crates-bar { background: #252540; border-color: #3a3a55; }
.dark-mode .crate-card { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .crate-card.crate-ready { background: #3a3020; border-color: #e6a832; }
.dark-mode .crate-item { background: #2a2a40; }

/* ============ XP BAR ============ */
#xp-bar-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px 8px;
}
#level-label { font-size: 12px; font-weight: 700; color: #5a9a5a; white-space: nowrap; }
#xp-bar {
  flex: 1; height: 8px; background: #e0ddd4;
  border-radius: 4px; overflow: hidden;
}
#xp-fill {
  height: 100%; background: linear-gradient(90deg, #7ec662, #5a9a5a);
  border-radius: 4px; transition: width 0.3s;
}
#xp-label { font-size: 10px; color: #888; white-space: nowrap; }

/* ============ MAIN 3-COLUMN LAYOUT ============ */
#main-layout {
  display: grid;
  grid-template-columns: 200px 1fr 220px;
  gap: 12px;
  align-items: start;
}

/* ============ SIDEBARS (Shop & Inventory) ============ */
#shop-panel, #inventory-panel {
  background: #fff8ec; border: 2px solid #d4c9a8;
  border-radius: 12px; padding: 10px;
  position: sticky; top: 10px;
}
#shop-panel h3, #inventory-panel h3 {
  font-size: 13px; margin-bottom: 8px; color: #6a5a3a;
  padding-bottom: 6px; border-bottom: 1px solid #e0d8c0;
}
.shop-section { margin-bottom: 8px; }
.shop-section-label {
  font-size: 10px; font-weight: 700; color: #9a8a6a;
  margin: 4px 0 3px; text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-buy-seed {
  display: block; width: 100%; padding: 4px 6px; margin-bottom: 3px;
  border: none; border-radius: 6px; font-size: 11px; font-weight: 600;
  cursor: pointer; background: #7ec662; color: #fff; transition: background 0.15s;
  text-align: left;
}
.btn-buy-seed:hover { background: #6ab552; }
.btn-buy-soil {
  display: block; width: 100%; padding: 4px 6px; margin-bottom: 3px;
  border: none; border-radius: 6px; font-size: 11px; font-weight: 600;
  cursor: pointer; background: #c8b88a; color: #fff; transition: background 0.15s;
  text-align: left;
}
#buy-water, #buy-pot, #sell-flowers {
  width: 100%; padding: 6px 0; margin-top: 4px; border: none;
  border-radius: 7px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
#buy-water { background: #5bb8e8; color: #fff; }
#buy-water:hover { background: #49a5d6; }
#buy-pot { background: #a08060; color: #fff; }
#buy-pot:hover { background: #907050; }
#sell-flowers { background: #e6a832; color: #fff; }
#sell-flowers:hover { background: #d49a26; }

button:disabled { opacity: 0.4; cursor: default; }

/* Buy effect */
.btn-bought {
  animation: btn-buy-pop 0.4s ease-out;
}
@keyframes btn-buy-pop {
  0% { transform: scale(1); }
  30% { transform: scale(0.9); }
  60% { transform: scale(1.15); box-shadow: 0 0 12px rgba(230, 168, 50, 0.5); }
  100% { transform: scale(1); }
}

/* ============ GREENHOUSE (center) ============ */
#greenhouse {
  background: #e8f0db; border: 2px solid #b8cca0;
  border-radius: 14px; padding: 12px;
}
#pots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* ============ POT ============ */
.pot {
  background: #fff; border: 2px solid #c8b88a; border-radius: 12px;
  padding: 8px 5px; text-align: center; min-height: 160px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; transition: all 0.2s;
  position: relative;
}

/* Status badge */
.pot-badge {
  position: absolute; top: 3px; left: 3px;
  font-size: 8px; font-weight: 700; padding: 2px 4px;
  border-radius: 5px; color: #fff; line-height: 1.2;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-needs-soil { background: #c8b88a; }
.badge-needs-seed { background: #7ec662; }
.badge-needs-water { background: #5bb8e8; }
.badge-growing { background: #8abf6a; }
.badge-blooming { background: #d4a0d0; }
.badge-mature { background: #e6a832; }
.badge-withered { background: #e05050; }

/* Soil strip */
.pot-soil-strip {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px; border-radius: 0 0 10px 10px;
}
.pot-soil-label {
  font-size: 8px; font-weight: 600; opacity: 0.7;
  display: flex; align-items: center; gap: 2px;
}

/* Stage dots */
.stage-dots { display: flex; gap: 3px; margin: 2px 0; }
.stage-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #e0ddd4; transition: background 0.3s;
}
.stage-dot.completed { background: #7ec662; }
.stage-dot.current { background: #5bb8e8; border: 2px solid #3a90c0; }
.stage-dot.stage-4-active { background: #d4a0d0; border: 2px solid #b080ac; }
.stage-dot.stage-5-active { background: #e6a832; border: 2px solid #c89020; }

/* Pollen charges */
.pollen-charges { display: flex; gap: 2px; font-size: 9px; }
.pollen-charge { opacity: 0.25; }
.pollen-charge.available { opacity: 1; }

/* Attention pulse */
.pot.needs-attention { animation: attention-pulse 2s infinite; }
@keyframes attention-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(91, 184, 232, 0.5); }
}
.pot.state-empty { border-color: #c8b88a; }
.pot.state-soil { border-color: #a08060; }
.pot.state-growing { border-color: #8abf6a; }
.pot.state-growing.stage-4 { border-color: #d4a0d0; }
.pot.state-growing.stage-5 { border-color: #e6a832; box-shadow: 0 0 6px rgba(230,168,50,0.3); }
.pot.state-withered { border-color: #999; background: #f0ebe0; }
.pot.wilting { animation: wilt-pulse 1s infinite; }
@keyframes wilt-pulse {
  0%, 100% { background: #fff; }
  50% { background: #fff3e0; }
}

.pot-icon { font-size: 26px; line-height: 1; cursor: default; }
.pot-icon.clickable { cursor: pointer; }

/* Plant image assets */
.plant-img { image-rendering: auto; }
.plant-img-pot { width: 64px; height: 64px; object-fit: contain; }
.plant-img-sm { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.pot-label { font-size: 11px; font-weight: 700; }
.pot-timer { font-size: 10px; color: #777; }
.seed-timer { color: #b08030; }
.pot-price { font-size: 11px; font-weight: 700; color: #b08020; }
.seed-ready { color: #2a8a2a; font-weight: 700; }

/* Water meter */
.water-meter { display: flex; gap: 2px; font-size: 12px; }
.drop { opacity: 0.25; font-size: 11px; }
.drop.filled { opacity: 1; }

/* Progress bar */
.pot-progress-bar {
  width: 85%; height: 4px; background: #e0ddd4;
  border-radius: 3px; overflow: hidden;
}
.pot-progress-fill {
  height: 100%; background: #7ec662;
  border-radius: 3px; transition: width 0.25s linear;
}

/* Drought bar */
.drought-bar {
  width: 85%; height: 3px; background: #e0ddd4;
  border-radius: 2px; overflow: hidden; margin-top: 1px;
}
.drought-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #7ec662 0%, #e8c840 50%, #e05050 100%);
  transition: width 0.25s linear;
}

/* Soil buttons in pot */
.pot-soil-buttons { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.btn-soil {
  padding: 3px 5px; border: 1px solid #c8b88a; border-radius: 6px;
  font-size: 9px; font-weight: 600; cursor: pointer;
  background: #fff8ec; color: #5a4a30; transition: background 0.15s;
  line-height: 1.3;
}
.btn-soil:hover { background: #f0e8d0; }

/* Pot actions */
.pot-actions { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 2px; }

/* Shared pot buttons */
.pot button {
  padding: 3px 7px; border: none; border-radius: 6px;
  font-size: 9px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-plant { background: #7ec662; color: #fff; }
.btn-plant:hover { background: #6ab552; }
.btn-water { background: #5bb8e8; color: #fff; }
.btn-water:hover { background: #49a5d6; }
.btn-harvest { background: #e6a832; color: #fff; }
.btn-harvest:hover { background: #d49a26; }
.btn-pollen { background: #d4a0d0; color: #fff; }
.btn-pollen:hover { background: #c090bc; }
.btn-pollinate { background: #e88cb0; color: #fff; }
.btn-pollinate:hover { background: #d07898; }
.btn-collect-seeds { background: #8ac060; color: #fff; }
.btn-collect-seeds:hover { background: #78b050; }
.btn-clear { background: #aaa; color: #fff; }
.btn-clear:hover { background: #999; }
.btn-remove-soil { background: #c8a080; color: #fff; font-size: 8px !important; margin-top: 3px !important; }
.btn-remove-soil:hover { background: #b89070; }
.btn-fertilize { background: #8a6ab5; color: #fff; }
.btn-fertilize:hover { background: #7a5aa5; }
.btn-cure { background: #e05050; color: #fff; animation: cure-pulse 0.5s infinite; }
.btn-cure:hover { background: #d04040; }
@keyframes cure-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Pest/Disease indicators */
.pot-pest, .pot-disease {
  font-size: 9px; font-weight: 700; padding: 1px 4px;
  border-radius: 4px; color: #fff;
}
.pot-pest { background: #b8860b; }
.pot-disease { background: #8b0000; }
.pot.infested { border-color: #b8860b !important; }
.pot.diseased { border-color: #8b0000 !important; }
.pot.infested, .pot.diseased { animation: pest-shake 0.3s infinite; }
@keyframes pest-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  75% { transform: translateX(1px); }
}
.pot-fert-badge {
  font-size: 8px; color: #8a6ab5; font-weight: 600;
}

/* Shop supply buttons */
#buy-fertilizer, #buy-insecticide {
  width: 100%; padding: 5px 0; margin-top: 3px; border: none;
  border-radius: 7px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
#buy-fertilizer { background: #8a6ab5; color: #fff; }
#buy-fertilizer:hover { background: #7a5aa5; }
#buy-insecticide { background: #e07050; color: #fff; }
#buy-insecticide:hover { background: #d06040; }

/* Soil dot */
.soil-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; vertical-align: middle;
}

/* ============ INVENTORY ============ */
#inventory-panel { max-height: calc(100vh - 80px); overflow-y: auto; }

.inv-section-title {
  font-size: 10px; font-weight: 700; color: #9a8a6a;
  margin: 10px 0 4px; text-transform: uppercase;
  padding-bottom: 3px; border-bottom: 1px solid #e0d8c0;
  display: flex; justify-content: space-between; align-items: center;
}
.inv-section-title:first-child { margin-top: 0; }
.inv-section-value {
  font-size: 10px; color: #b08020; text-transform: none;
}

.inv-card {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px; margin-bottom: 3px;
  background: #fff; border: 1px solid #ece6d4;
  border-radius: 8px; transition: background 0.15s;
}
.inv-card:hover { background: #faf6ee; }
.inv-card-log { opacity: 0.8; }
.inv-card-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.inv-card-body { flex: 1; min-width: 0; }
.inv-card-name {
  font-size: 11px; font-weight: 700; color: #3a3a2e;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inv-card-meta {
  display: flex; align-items: center; gap: 4px; margin-top: 1px;
}
.inv-card-unit { font-size: 9px; color: #b08020; }
.inv-card-right {
  text-align: right; flex-shrink: 0;
}
.inv-card-count { font-size: 11px; font-weight: 700; color: #555; }
.inv-card-total { font-size: 10px; font-weight: 700; color: #b08020; }

.inv-totals {
  font-size: 10px; color: #6a5a3a;
  margin-top: 6px; padding: 6px;
  background: #f0e8d0; border-radius: 6px;
  text-align: center;
}

.inv-empty {
  text-align: center; padding: 20px 0;
  font-size: 12px; color: #aaa;
}
.inv-clickable { cursor: pointer; }
.inv-clickable:hover { background: #f5f0e0; border-color: #c8b88a; }

/* Plant Info Modal */
.plant-info-modal { max-width: 360px; }
.plant-info-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-bottom: 14px;
}
.info-stat {
  background: #f8f4e8; border-radius: 8px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.info-stat-label { font-size: 9px; text-transform: uppercase; color: #9a8a6a; font-weight: 700; }
.info-stat-value { font-size: 13px; font-weight: 700; color: #3a3a2e; }

/* Mini DNA bar */
.mini-dna-bar {
  display: inline-flex; width: 36px; height: 5px;
  border-radius: 3px; overflow: hidden; vertical-align: middle;
}
.dna-seg { height: 100%; }

/* Pollen dot */
.pollen-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; vertical-align: middle;
}

/* ============ PAUSE OVERLAY ============ */
#pause-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 150;
}
#pause-overlay .pause-text {
  background: #fff8ec; padding: 30px 50px; border-radius: 16px;
  border: 3px solid #d4c9a8; text-align: center;
}
#pause-overlay .pause-text h2 { font-size: 24px; color: #4a6a3a; margin-bottom: 8px; }
#pause-overlay .pause-text p { font-size: 14px; color: #777; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #4a6a3a; color: #fff; padding: 10px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: all 0.3s; z-index: 200;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Weekend bonus banner */
.weekend-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #4a3a1a, #6a4a0a);
  border: 2px solid #e6a832; border-radius: 10px;
  padding: 8px 14px; margin-bottom: 10px;
  animation: weekend-pulse 3s ease-in-out infinite;
}
@keyframes weekend-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(230, 168, 50, 0.3); }
  50% { box-shadow: 0 0 16px rgba(230, 168, 50, 0.6); }
}
.weekend-badge {
  background: #e6a832; color: #1a1a2e; font-weight: 700;
  padding: 3px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap;
}
.weekend-text { color: #e0ddd4; font-size: 13px; font-weight: 600; flex: 1; }
.weekend-dismiss {
  background: none; border: none; color: #888; font-size: 16px;
  cursor: pointer; padding: 4px 8px;
}
.weekend-dismiss:hover { color: #fff; }

/* News Feed */
.news-feed { max-height: 60vh; overflow-y: auto; }
.news-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.news-item:last-child { border-bottom: none; }
.news-icon { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; }
.news-body { flex: 1; min-width: 0; }
.news-text { font-size: 13px; color: #e0ddd4; line-height: 1.4; }
.news-time { font-size: 11px; color: #6b7a99; margin-top: 2px; }
.news-discovery .news-text { color: #22c55e; }
.news-sale .news-text { color: #e6a832; }
.news-level_up .news-text { color: #5bb8e8; }

.discovery-toast {
  background: linear-gradient(135deg, #4a3a6a, #6a4a8a) !important;
  border: 2px solid #a855f7;
  font-size: 15px !important;
  padding: 14px 24px !important;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}
.discovery-star {
  font-size: 18px; margin-right: 4px;
  animation: star-spin 0.6s ease-out;
}
@keyframes star-spin {
  0% { transform: rotate(0deg) scale(0.5); opacity: 0; }
  50% { transform: rotate(180deg) scale(1.3); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

/* ============ HYBRID OVERLAY ============ */
.hybrid-reveal-modal { text-align: center; max-width: 320px !important; animation: overlay-pop 0.4s ease-out; }
.hybrid-reveal-modal .reveal-icon { font-size: 64px; margin: 8px 0 12px; animation: icon-pulse 1.5s ease-in-out infinite; }
.hybrid-reveal-modal .reveal-icon img.plant-img { width: 80px; height: 80px; }
.hybrid-reveal-modal h3 { font-size: 20px !important; margin-bottom: 4px !important; }
.hybrid-reveal-modal .reveal-name { font-size: 16px; font-weight: 700; margin: 6px 0; }
.hybrid-reveal-modal .reveal-dna { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; margin: 10px 0; }
.hybrid-reveal-modal .reveal-dna span { display: block; }
.hybrid-reveal-modal .btn-share-reveal { background: none; border: 1px solid #d4c9a8; color: #888; padding: 6px 16px; border-radius: 8px; font-size: 12px; cursor: pointer; margin-top: 8px; transition: all 0.2s; }
.hybrid-reveal-modal .btn-share-reveal:hover { border-color: #4a6a3a; color: #4a6a3a; }

/* ============ FIRST DISCOVERY OVERLAY ============ */
.discovery-reveal-modal { text-align: center; max-width: 360px !important; animation: overlay-pop 0.5s ease-out; position: relative; overflow: visible; }
.discovery-reveal-modal h2 { font-size: 22px; margin: 0 0 8px; letter-spacing: 1px; animation: discovery-title-glow 2s ease-in-out infinite; }
.discovery-reveal-modal .reveal-icon { font-size: 80px; margin: 12px 0; position: relative; }
.discovery-reveal-modal .reveal-icon img.plant-img { width: 100px; height: 100px; }
.discovery-reveal-modal .reveal-icon::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; z-index: -1; animation: icon-glow 2s ease-in-out infinite; }
.discovery-reveal-modal .reveal-name { font-size: 22px; font-weight: 800; margin: 4px 0 2px; }
.discovery-reveal-modal .reveal-author { font-size: 13px; color: #888; margin-bottom: 8px; font-style: italic; }
.discovery-reveal-modal .reveal-bonus { font-size: 18px; font-weight: 700; color: #e6a832; margin: 8px 0; animation: coin-pop 0.6s ease-out; }
.discovery-reveal-modal .reveal-yours { font-size: 14px; color: #a855f7; margin: 6px 0 8px; font-weight: 600; }
.discovery-reveal-modal .reveal-like { margin-bottom: 10px; }
.discovery-reveal-modal .reveal-dna { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.discovery-reveal-modal .reveal-dna span { display: block; }
.discovery-reveal-modal .btn-share-reveal { background: none; border: 1px solid #d4c9a8; color: #888; padding: 6px 16px; border-radius: 8px; font-size: 12px; cursor: pointer; margin-top: 6px; transition: all 0.2s; }
.discovery-reveal-modal .btn-share-reveal:hover { border-color: #a855f7; color: #a855f7; }

#discovery-overlay { background: rgba(0,0,0,0.6); }

/* Discoverer mini profile card */
.discoverer-profile-container { margin: 10px 0; }
.discoverer-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(91,184,232,0.08); border: 1px solid rgba(91,184,232,0.2);
  border-radius: 10px; padding: 8px 12px; text-decoration: none;
  transition: all 0.2s; cursor: pointer;
}
.discoverer-card:hover { background: rgba(91,184,232,0.15); border-color: rgba(91,184,232,0.4); }
.discoverer-avatar { font-size: 28px; flex-shrink: 0; }
.discoverer-info { flex: 1; min-width: 0; text-align: left; }
.discoverer-name { font-size: 13px; font-weight: 700; color: #5bb8e8; }
.discoverer-level { font-size: 11px; font-weight: 600; color: #e6a832; background: rgba(230,168,50,0.15); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.discoverer-stats { display: flex; gap: 10px; font-size: 11px; color: #888; margin-top: 2px; }
.discoverer-visit {
  flex-shrink: 0; padding: 6px 14px; background: #5bb8e8; color: #fff;
  border-radius: 8px; font-size: 12px; font-weight: 700;
  transition: background 0.2s; white-space: nowrap;
}
.discoverer-card:hover .discoverer-visit { background: #3a9fd8; }

/* ============ HARVEST SELL MODAL ============ */
.harvest-sell-modal-inner { text-align: center; max-width: 340px !important; animation: overlay-pop 0.3s ease-out; }
.harvest-sell-modal-inner h3 { text-align: center; padding-right: 0 !important; }
.harvest-sell-modal-inner h3 img.plant-img { width: 28px; height: 28px; vertical-align: middle; }
.harvest-sell-info { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.harvest-sell-price { font-weight: 700; color: #e6a832; font-size: 14px; }
.harvest-plant-social { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; }
.harvest-discoverer {
  font-size: 12px; color: #5bb8e8; text-decoration: none; transition: color 0.15s;
}
.harvest-discoverer:hover { color: #7dcfff; text-decoration: underline; }
.harvest-discoverer strong { font-weight: 700; }
.harvest-like-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid #d4c9a8; border-radius: 14px;
  padding: 4px 10px; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.harvest-like-btn:hover { background: rgba(231,76,60,0.08); border-color: #e74c3c; }
.harvest-like-btn.liked { border-color: #e74c3c; background: rgba(231,76,60,0.06); }
.harvest-like-btn .like-count { font-size: 12px; font-weight: 700; color: #999; }
.harvest-like-btn.liked .like-count { color: #e74c3c; }
.harvest-sell-options { display: flex; gap: 10px; margin-bottom: 12px; }
.harvest-sell-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 10px; border-radius: 12px; border: 2px solid #d4c9a8; background: #fffdf5;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.harvest-sell-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.harvest-quick-sell { border-color: #e6a832; }
.harvest-quick-sell:hover { background: #fef6e0; border-color: #d4960a; }
.harvest-list-sell { border-color: #4a6a3a; }
.harvest-list-sell:hover { background: #f0f5ec; border-color: #3a5a2a; }
.harvest-sell-icon { font-size: 28px; }
.harvest-sell-label { font-weight: 700; font-size: 14px; color: #333; }
.harvest-sell-amount { font-size: 12px; color: #888; }
.harvest-quick-sell .harvest-sell-amount { color: #e6a832; font-weight: 600; }
.harvest-keep-btn { margin-top: 4px; font-size: 12px !important; }

/* Harvest list form */
.harvest-list-form { text-align: left; }
.harvest-list-dest { display: flex; gap: 6px; margin-bottom: 12px; }
.harvest-list-dest .dest-opt {
  flex: 1; padding: 8px; border-radius: 8px; border: 2px solid #d4c9a8; background: #fffdf5;
  cursor: pointer; font-size: 13px; font-family: inherit; text-align: center; transition: all 0.2s;
}
.harvest-list-dest .dest-opt.active { border-color: #4a6a3a; background: #f0f5ec; font-weight: 700; }
.harvest-list-price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.harvest-list-price-row label { font-size: 13px; font-weight: 600; color: #555; }
.harvest-list-price-row input {
  flex: 1; padding: 6px 10px; border: 2px solid #d4c9a8; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fffdf5; max-width: 120px;
}
.harvest-list-price-row span { font-weight: 700; color: #e6a832; }
.harvest-list-tax { font-size: 12px; color: #c44; margin-bottom: 12px; }
.harvest-list-actions { display: flex; gap: 8px; }
.harvest-list-actions .btn-confirm-list {
  flex: 1; padding: 10px; border-radius: 8px; border: none;
  background: #4a6a3a; color: #fff; font-weight: 700; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: background 0.2s;
}
.harvest-list-actions .btn-confirm-list:hover { background: #3a5a2a; }
.harvest-list-actions .btn-confirm-list:disabled { opacity: 0.5; cursor: not-allowed; }
.harvest-list-actions .btn-cancel { flex: 0; white-space: nowrap; }

@keyframes overlay-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes icon-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.3); }
  50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.6); }
}
@keyframes discovery-title-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(230, 168, 50, 0.4); }
  50% { text-shadow: 0 0 20px rgba(230, 168, 50, 0.8); }
}
@keyframes coin-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

/* Codex discoverer */
.codex-discoverer { font-size: 11px; color: #888; font-style: italic; }

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff8ec; border: 2px solid #d4c9a8; border-radius: 14px;
  padding: 20px; min-width: 280px; max-width: 400px;
  position: relative;
}
.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #e0d6c0; color: #6a5a3a; font-size: 18px; line-height: 28px;
  text-align: center; cursor: pointer; padding: 0;
  transition: background 0.15s;
  z-index: 1;
}
.modal-close:hover { background: #d4c4a0; }
.modal h3 { margin-bottom: 12px; color: #4a6a3a; font-size: 16px; padding-right: 30px; }

.pollen-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pollen-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid #d4c9a8; border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.pollen-option:hover { background: #f0e8d0; }

.btn-cancel {
  display: block; width: 100%; padding: 8px; border: none;
  border-radius: 8px; background: #ccc; color: #555;
  font-weight: 600; cursor: pointer; font-size: 13px;
}
.btn-cancel:hover { background: #bbb; }

/* Picker Modal (shared for seed & pollen) */
.picker-modal { max-width: 460px !important; min-width: 340px; }
.picker-scroll { max-height: 55vh; overflow-y: auto; margin-bottom: 12px; }
.picker-group-label { margin: 8px 0 4px; }
.picker-group-label:first-child { margin-top: 0; }
.picker-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.picker-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px; border: 1px solid #d4c9a8; border-radius: 10px;
  background: #fff; cursor: pointer; transition: all 0.15s;
  text-align: center; gap: 2px;
}
.picker-card:hover { background: #f0e8d0; border-color: #b8a070; transform: scale(1.03); }
.picker-card-icon { font-size: 24px; }
.picker-card-name { font-size: 10px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.picker-card-meta { font-size: 9px; color: #888; }

/* Plant Detail */
.plant-detail-modal { max-width: 340px; }
.detail-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pie-chart {
  width: 70px; height: 70px; border-radius: 50%;
  border: 2px solid #d4c9a8; flex-shrink: 0;
}
.dna-legend { display: flex; flex-direction: column; gap: 3px; }
.dna-legend-row { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.dna-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.detail-stats {
  font-size: 12px; margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.lineage {
  font-size: 12px; margin-bottom: 10px; padding: 6px;
  background: #f0e8d0; border-radius: 6px;
}
.lineage-title { font-weight: 700; margin-bottom: 4px; }

/* ============ RARITY BADGE ============ */
.rarity-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; color: #fff;
  text-transform: uppercase; letter-spacing: 0.3px;
  vertical-align: middle; line-height: 1.4;
}

/* ============ CODEX MODAL ============ */
.codex-modal-inner {
  max-width: 520px !important; min-width: 360px;
  max-height: 80vh; overflow-y: auto;
}
.codex-grid {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.codex-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border: 1px solid #d4c9a8;
  border-radius: 8px; background: #fff;
  transition: background 0.15s;
}
.codex-entry.undiscovered { background: #f0ebe0; opacity: 0.6; }
.codex-entry.discovered:hover { background: #f8f4e8; }
.codex-icon { font-size: 22px; flex-shrink: 0; width: 30px; text-align: center; }
.codex-info { flex: 1; min-width: 0; }
.codex-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.codex-dna { margin: 2px 0; }
.codex-details { font-size: 10px; color: #777; }
.codex-stats { font-size: 10px; color: #b08020; font-weight: 600; }
.codex-like-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  font-size: 16px; flex-shrink: 0; border-radius: 8px; transition: background 0.15s;
}
.codex-like-btn:hover { background: rgba(231,76,60,0.1); }
.codex-like-btn .like-count { font-size: 10px; color: #999; font-weight: 700; min-height: 13px; }
.codex-like-btn.liked .like-count { color: #e74c3c; }

/* Codex sections */
.codex-section { margin-bottom: 6px; }
.codex-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; background: #f0e8d0; border-radius: 8px;
  cursor: pointer; user-select: none; transition: background 0.15s;
}
.codex-section-header:hover { background: #e8dfc0; }
.codex-section-subtitle { font-size: 11px; color: #888; flex: 1; }
.codex-section-count { font-size: 12px; font-weight: 700; color: #6a5a3a; }
.codex-toggle { font-size: 11px; color: #999; }
.codex-section-body { padding-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.codex-load-more {
  margin: 6px auto 2px; padding: 6px 18px;
  background: #e8dfc0; border: 1px solid #d4c9a8; border-radius: 8px;
  cursor: pointer; font-size: 12px; color: #6a5a3a; font-weight: 600;
  transition: background 0.15s;
}
.codex-load-more:hover { background: #ddd4b0; }

/* ============ TRAIT BARS ============ */
.detail-traits { margin-bottom: 10px; }
.codex-traits { margin-top: 4px; }
.codex-traits .trait-row { gap: 3px; }
.codex-traits .trait-label { width: 55px; font-size: 9px; }
.codex-traits .trait-bar { height: 5px; }
.codex-traits .trait-val { font-size: 9px; width: 26px; }
.codex-traits .trait-icon { font-size: 10px; }

.trait-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
}
.trait-icon { font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; }
.trait-label { font-size: 11px; font-weight: 600; color: #5a4a30; width: 72px; flex-shrink: 0; }
.trait-bar {
  flex: 1; height: 8px; background: #e8e4da;
  border-radius: 4px; overflow: hidden;
}
.trait-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.3s ease;
}
.trait-val { font-size: 11px; color: #888; width: 30px; text-align: right; flex-shrink: 0; }

/* ============ UPGRADE MODAL ============ */
.upgrade-modal { max-width: 420px !important; }
.upgrade-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.upgrade-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid #d4c9a8; border-radius: 8px;
  background: #fff; transition: background 0.15s;
}
.upgrade-card.upgrade-active { background: #e8f5e0; border-color: #7ec662; }
.upgrade-card.upgrade-locked { opacity: 0.5; }
.upgrade-icon { font-size: 24px; flex-shrink: 0; }
.upgrade-info { flex: 1; }
.upgrade-name { font-size: 13px; font-weight: 700; }
.upgrade-desc { font-size: 11px; color: #777; }
.upgrade-lock { font-size: 10px; color: #e05050; font-weight: 600; margin-top: 2px; }
.upgrade-action { flex-shrink: 0; }
.upgrade-active-badge { font-size: 20px; }
.upgrade-duration { font-size: 9px; color: #888; font-weight: 400; }
.upgrade-timer { font-size: 10px; color: #5a9a5a; font-weight: 700; margin-top: 2px; }
.btn-upgrade {
  padding: 6px 14px; border: none; border-radius: 8px;
  background: #5a9a5a; color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.btn-upgrade:hover { background: #4a8a4a; }
.btn-upgrade:disabled { opacity: 0.4; cursor: default; }

/* ============ ACHIEVEMENTS MODAL ============ */
.achievements-modal { max-width: 420px !important; max-height: 80vh; overflow-y: auto; }
.ach-summary {
  text-align: center; font-size: 13px; font-weight: 700;
  color: #6a5a3a; margin-bottom: 10px;
}
.ach-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.ach-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid #d4c9a8; border-radius: 8px;
  background: #fff;
}
.ach-card.ach-done { background: #fef9e8; border-color: #d4a030; }
.ach-card.ach-locked { opacity: 0.6; }
.ach-icon { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; }
.ach-info { flex: 1; }
.ach-name { font-size: 12px; font-weight: 700; }
.ach-desc { font-size: 10px; color: #777; }
.ach-reward { font-size: 12px; font-weight: 700; color: #b08020; flex-shrink: 0; }

/* ============ PARTICLES ============ */
#particles {
  position: fixed; inset: 0; pointer-events: none; z-index: 300;
  overflow: hidden;
}
.particle {
  position: absolute; font-size: 18px;
  animation: particle-fly 1s ease-out forwards;
}
@keyframes particle-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

/* ============ SETTINGS MODAL ============ */
#settings-btn { background: #888; color: #fff; }
#settings-btn:hover { background: #777; }

.settings-modal { max-width: 380px !important; }
.settings-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.setting-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: #fff; border: 1px solid #e0d8c0;
  border-radius: 8px;
}
.setting-info { flex: 1; }
.setting-name { font-size: 12px; font-weight: 700; }
.setting-desc { font-size: 10px; color: #888; }
.setting-toggle {
  padding: 5px 14px; border: 2px solid #ccc; border-radius: 20px;
  background: #f0ebe0; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; color: #888;
}
.setting-toggle.toggle-on {
  background: #7ec662; border-color: #6ab552; color: #fff;
}
.settings-divider {
  height: 1px; background: #e0d8c0; margin: 8px 0;
}
.settings-save-btns {
  display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.btn-setting {
  flex: 1; padding: 7px 8px; border: none; border-radius: 8px;
  background: #b8a070; color: #fff; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; min-width: 90px;
}
.btn-setting:hover { background: #a89060; }
.btn-danger { background: #e05050; }
.btn-danger:hover { background: #d04040; }
.save-textarea {
  width: 100%; height: 60px; margin-bottom: 10px; padding: 8px;
  border: 1px solid #d4c9a8; border-radius: 8px; font-size: 10px;
  font-family: monospace; resize: vertical;
}

/* ============ TUTORIAL ============ */
#tutorial-tooltip {
  position: absolute; z-index: 600;
  background: #fff8ec; border: 2px solid #7ec662;
  border-radius: 12px; padding: 16px 20px;
  max-width: 360px; width: max-content;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  animation: tooltip-pop 0.25s ease-out;
}
@keyframes tooltip-pop {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* Arrow pointing up (tooltip below element) */
#tutorial-tooltip.arrow-up::before {
  content: ''; position: absolute; top: -10px;
  left: 50%; transform: translateX(-50%);
  border: 10px solid transparent;
  border-bottom-color: #7ec662;
}
#tutorial-tooltip.arrow-up::after {
  content: ''; position: absolute; top: -7px;
  left: 50%; transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #fff8ec;
}

/* Arrow pointing down (tooltip above element) */
#tutorial-tooltip.arrow-down::before {
  content: ''; position: absolute; bottom: -10px;
  left: 50%; transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: #7ec662;
}
#tutorial-tooltip.arrow-down::after {
  content: ''; position: absolute; bottom: -7px;
  left: 50%; transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fff8ec;
}

/* Centered (no highlight target) */
#tutorial-tooltip.tutorial-centered {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

#tutorial-tooltip h3 {
  font-size: 16px; color: #4a6a3a; margin-bottom: 8px;
}
#tutorial-tooltip p {
  font-size: 13px; color: #555; line-height: 1.4; margin-bottom: 12px;
}
.tutorial-progress {
  font-size: 10px; color: #aaa; margin-bottom: 6px;
}
.tutorial-actions {
  display: flex; gap: 8px; justify-content: center;
}
.tutorial-next, .tutorial-prev, .tutorial-skip {
  padding: 7px 16px; border: none; border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.tutorial-next { background: #7ec662; color: #fff; }
.tutorial-next:hover { background: #6ab552; }
.tutorial-prev { background: #d4c9a8; color: #555; }
.tutorial-prev:hover { background: #c4b998; }
.tutorial-skip { background: #ccc; color: #666; }
.tutorial-skip:hover { background: #bbb; }

.tutorial-highlight {
  position: relative; z-index: 599;
  box-shadow: 0 0 0 3px #7ec662, 0 0 20px rgba(126, 198, 98, 0.4) !important;
  border-radius: 14px;
  animation: highlight-pulse 1.5s infinite;
}
@keyframes highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #7ec662, 0 0 20px rgba(126, 198, 98, 0.4); }
  50% { box-shadow: 0 0 0 5px #7ec662, 0 0 30px rgba(126, 198, 98, 0.6); }
}

.dark-mode #tutorial-tooltip { background: #252540; border-color: #7ec662; }
.dark-mode #tutorial-tooltip h3 { color: #7ec662; }
.dark-mode #tutorial-tooltip p { color: #ccc; }
.dark-mode #tutorial-tooltip.arrow-up::after { border-bottom-color: #252540; }
.dark-mode #tutorial-tooltip.arrow-down::after { border-top-color: #252540; }

/* ============ DARK MODE ============ */
body.dark-mode {
  background: #1a1a2e; color: #e0ddd4;
}
.dark-mode #app { color: #e0ddd4; }
.dark-mode #top-bar,
.dark-mode #market-panel,
.dark-mode #orders-panel,
.dark-mode #shop-panel,
.dark-mode #inventory-panel {
  background: #252540; border-color: #3a3a55;
}
.dark-mode #greenhouse { background: #1e2e1e; border-color: #2a4a2a; }
.dark-mode .pot { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .pot.wilting { animation-name: wilt-pulse-dark; }
@keyframes wilt-pulse-dark {
  0%, 100% { background: #2a2a40; }
  50% { background: #3a2a20; }
}
.dark-mode .pot.state-withered { background: #2a2520; }
.dark-mode .modal { background: #252540; border-color: #3a3a55; }
.dark-mode .modal h3 { color: #7ec662; }
.dark-mode .btn-cancel { background: #3a3a55; color: #ccc; }
.dark-mode .modal-close { background: #3a3a55; color: #ccc; }
.dark-mode .modal-close:hover { background: #4a4a65; }
.dark-mode .btn-soil { background: #2a2a40; border-color: #3a3a55; color: #ccc; }
.dark-mode .inv-card { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .inv-card:hover { background: #303050; }
.dark-mode .inv-card-name { color: #e0ddd4; }
.dark-mode .order-card { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .order-card.order-ready { background: #1e2e1e; border-color: #7ec662; }
.dark-mode .codex-entry { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .codex-like-btn:hover { background: rgba(231,76,60,0.15); }
.dark-mode .codex-like-btn .like-count { color: #6b7a99; }
.dark-mode .codex-like-btn.liked .like-count { color: #e74c3c; }
.dark-mode .codex-section-header { background: #2a2a40; }
.dark-mode .codex-load-more { background: #2a2a40; border-color: #3a3a55; color: #ccc; }
.dark-mode .codex-load-more:hover { background: #353550; }
.dark-mode .setting-row { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .upgrade-card { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .ach-card { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .picker-card { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .picker-card:hover { background: #303050; }
.dark-mode .toast { background: #3a5a3a; }
.dark-mode .hybrid-reveal-modal .btn-share-reveal,
.dark-mode .discovery-reveal-modal .btn-share-reveal { border-color: #3a3a55; color: #888; }
.dark-mode .discovery-reveal-modal .reveal-yours { color: #c084fc; }
.dark-mode .discovery-reveal-modal .reveal-author { color: #999; }
.dark-mode .discoverer-card { background: rgba(91,184,232,0.1); border-color: rgba(91,184,232,0.15); }
.dark-mode .discoverer-card:hover { background: rgba(91,184,232,0.18); }
.dark-mode .discoverer-stats { color: #6b7a99; }
.dark-mode #xp-bar { background: #3a3a55; }
.dark-mode .shop-section-label,
.dark-mode .strip-label,
.dark-mode .inv-section-title { color: #777; }
.dark-mode #shop-panel h3,
.dark-mode #inventory-panel h3 { color: #aaa; }
.dark-mode .resource { color: #e0ddd4; }
.dark-mode #rain-indicator { background: #1a2a3a; }
.dark-mode #season-indicator { background: #2a2a40; }
.dark-mode .pot-label { color: #ddd; }
.dark-mode .trend-item { background: #2a2a40; }
.dark-mode .tutorial-box { background: #252540; border-color: #7ec662; }
.dark-mode .tutorial-box h3 { color: #7ec662; }
.dark-mode .tutorial-box p { color: #ccc; }

/* ============ FLOWER SHOP ============ */
.fshop-modal { max-width: 560px !important; min-width: 340px; max-height: 85vh; overflow-y: auto; }
.fshop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.fshop-header h3 { margin: 0; font-size: 18px; }
.fshop-total { font-size: 14px; color: #b08020; font-weight: 700; }
.fshop-empty { text-align: center; padding: 30px; color: #999; font-size: 14px; }
.fshop-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.fshop-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e0d8c0; border-radius: 10px;
  padding: 10px 14px; transition: background 0.15s;
}
.fshop-item:hover { background: #fef9e8; }
.fshop-icon { font-size: 28px; flex-shrink: 0; }
.fshop-info { flex: 1; min-width: 0; }
.fshop-name { font-size: 14px; font-weight: 700; }
.fshop-meta { font-size: 12px; color: #888; display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.fshop-rarity { font-size: 10px; }
.fshop-price { font-size: 14px; font-weight: 700; color: #b08020; white-space: nowrap; }
.fshop-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.fshop-qty { display: flex; align-items: center; gap: 4px; }
.fshop-qty button {
  width: 28px; height: 28px; border: 1px solid #d4c9a8; border-radius: 6px;
  background: #fff8ec; font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.fshop-qty button:hover { background: #f0e8d0; }
.fshop-qty-num { font-size: 14px; font-weight: 700; min-width: 20px; text-align: center; }
.fshop-sell-btn {
  padding: 6px 14px; border: none; border-radius: 8px;
  background: #e6a832; color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.fshop-sell-btn:hover { background: #d49a26; }
.fshop-sell-btn:disabled { opacity: 0.4; cursor: default; }
.fshop-footer { display: flex; justify-content: space-between; gap: 10px; }
.fshop-sell-all {
  flex: 1; padding: 12px; border: none; border-radius: 10px;
  background: #e6a832; color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.fshop-sell-all:hover { background: #d49a26; }
.fshop-sell-all:disabled { opacity: 0.4; cursor: default; }
.fshop-close {
  padding: 12px 20px; border: none; border-radius: 10px;
  background: #ccc; color: #555; font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.fshop-close:hover { background: #bbb; }

.dark-mode .fshop-item { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .fshop-item:hover { background: #303050; }
.dark-mode .fshop-name { color: #e0ddd4; }
.dark-mode .fshop-qty button { background: #2a2a40; border-color: #3a3a55; color: #ccc; }
.dark-mode .fshop-close { background: #3a3a55; color: #ccc; }

/* ============ MARKETPLACE BANNER AD ============ */
#market-banner {
  position: relative;
  margin: 12px 0 0;
  padding: 12px 40px 12px 14px;
  background: linear-gradient(135deg, #fff8ec 0%, #f5ecd8 100%);
  border: 2px solid #d4c9a8;
  border-radius: 14px;
  animation: bannerSlideIn 0.4s ease-out;
}
@keyframes bannerSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.banner-badge {
  position: absolute; top: -9px; left: 16px;
  padding: 2px 10px; border-radius: 6px;
  background: #e88cb0; color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.5px;
}
.banner-body {
  display: flex; align-items: center; gap: 14px;
}
.banner-icon {
  font-size: 32px; flex-shrink: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #d4c9a8; border-radius: 10px;
}
.banner-icon .plant-img { width: 36px; height: 36px; }
.banner-info { flex: 1; min-width: 0; }
.banner-name { font-size: 14px; font-weight: 700; color: #3a3a2e; }
.banner-meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.banner-type {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; background: #e0d6c0; color: #6a5a3a;
  text-transform: uppercase;
}
.banner-seller { font-size: 11px; color: #888; }
.banner-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.banner-price { font-size: 16px; font-weight: 800; color: #b08020; }
.banner-qty { font-size: 11px; color: #888; }
.banner-buy-btn {
  padding: 6px 16px; border: none; border-radius: 8px;
  background: #2980b9; color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: background 0.15s;
  white-space: nowrap;
}
.banner-buy-btn:hover { background: #2471a3; }
.banner-dismiss {
  position: absolute; top: 8px; right: 10px;
  width: 24px; height: 24px; border: none; border-radius: 50%;
  background: transparent; color: #aaa; font-size: 18px; line-height: 24px;
  text-align: center; cursor: pointer; padding: 0;
  transition: color 0.15s, background 0.15s;
}
.banner-dismiss:hover { color: #666; background: #e8e0cc; }

.dark-mode #market-banner {
  background: linear-gradient(135deg, #1e1e36 0%, #252544 100%);
  border-color: #3a3a55;
}
.dark-mode .banner-name { color: #e0ddd4; }
.dark-mode .banner-icon { background: #2a2a40; border-color: #3a3a55; }
.dark-mode .banner-type { background: #3a3a55; color: #ccc; }
.dark-mode .banner-seller { color: #999; }
.dark-mode .banner-dismiss:hover { color: #ccc; background: #3a3a55; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  #main-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  #shop-panel, #inventory-panel { position: static; }
  #greenhouse { grid-column: 1 / -1; grid-row: 1; }
  #shop-panel { grid-row: 2; grid-column: 1; }
  #inventory-panel { grid-row: 2; grid-column: 2; }
  #info-strip { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  #app { padding: 8px; }
  #main-layout { grid-template-columns: 1fr; gap: 10px; }
  #greenhouse { grid-column: 1; grid-row: 1; }
  #shop-panel { grid-column: 1; grid-row: 2; }
  #inventory-panel { grid-column: 1; grid-row: 3; }
  #pots { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  #top-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  #resource-bar { justify-content: space-around; flex-wrap: wrap; gap: 10px; }
  .resource { font-size: 16px; }
  #actions-bar { justify-content: center; flex-wrap: wrap; gap: 6px; }
  #actions-bar button { font-size: 13px; padding: 8px 12px; }
  #info-strip { grid-template-columns: 1fr; gap: 8px; }
  .strip-label { font-size: 12px; }
  #orders-list { flex-direction: column; }
  .order-card { max-width: 100%; min-width: auto; font-size: 13px; padding: 10px; }
  .modal { min-width: auto; max-width: 95vw !important; margin: 10px; }
  .codex-modal-inner { min-width: auto; }
  .picker-grid { grid-template-columns: repeat(2, 1fr); }

  /* Harvest sell modal – mobile fixes */
  .harvest-sell-modal-inner { max-width: 95vw !important; padding: 16px 12px !important; }
  .harvest-sell-modal-inner h3 { font-size: 16px; }
  .harvest-sell-options { flex-direction: column; gap: 8px; }
  .harvest-sell-btn { flex-direction: row; justify-content: center; padding: 12px 14px; gap: 10px; }
  .harvest-sell-icon { font-size: 22px; }
  .harvest-sell-label { font-size: 14px; }
  .harvest-sell-amount { font-size: 12px; }
  .harvest-list-dest { flex-direction: column; gap: 6px; }
  .harvest-list-dest .dest-opt { padding: 10px; font-size: 14px; }
  .harvest-list-price-row { flex-wrap: wrap; gap: 6px; }
  .harvest-list-price-row label { flex: 0 0 100%; font-size: 13px; }
  .harvest-list-price-row input { flex: 1; max-width: none; font-size: 16px; padding: 10px; }
  .harvest-list-actions { flex-direction: column; gap: 8px; }
  .harvest-list-actions .btn-confirm-list { padding: 12px; font-size: 15px; }
  .harvest-list-actions .btn-cancel { padding: 10px; font-size: 14px; text-align: center; }
  .harvest-keep-btn { font-size: 13px !important; padding: 10px !important; width: 100%; }

  /* Pots - much bigger on mobile */
  .pot { min-height: 190px; padding: 10px 8px; border-radius: 14px; }
  .pot-icon { font-size: 36px; }
  .plant-img-pot { width: 80px; height: 80px; }
  .pot-label { font-size: 13px; }
  .pot-timer { font-size: 12px; }
  .pot-price { font-size: 13px; }
  .pot button { font-size: 12px; padding: 6px 10px; border-radius: 8px; }
  .btn-soil { font-size: 12px; padding: 6px 10px; }
  .pot-badge { font-size: 10px; padding: 3px 6px; }
  .stage-dots { gap: 4px; margin: 4px 0; }
  .stage-dot { width: 10px; height: 10px; }
  .water-meter { font-size: 15px; }
  .drop { font-size: 14px; }
  .pot-progress-bar { height: 6px; }
  .drought-bar { height: 5px; }
  .pollen-charges { font-size: 12px; gap: 3px; }
  .pot-soil-label { font-size: 10px; }
  .seed-ready { font-size: 13px; }

  /* Shop & inventory bigger */
  #shop-panel button { font-size: 14px; padding: 10px 12px; }
  #shop-panel h3 { font-size: 18px; }
  .shop-section-label { font-size: 14px; }
  #inventory-panel h3 { font-size: 18px; }
  #inv-list { font-size: 14px; }
  #sell-flowers { font-size: 15px; padding: 12px; }

  /* Crates */
  .crate-card { padding: 10px 14px; }
  .crate-icon { font-size: 28px; }
  .crate-name { font-size: 13px; }
  .crate-timer { font-size: 12px; }
  .btn-open-crate { font-size: 14px; padding: 8px 16px; }

  /* Market */
  .trend-icon { font-size: 20px; }
  .trend-pct { font-size: 11px; }
  .trend-item { padding: 5px 8px; }

  /* XP bar */
  #xp-bar-wrap { gap: 6px; }
  #level-label { font-size: 14px; }
  #xp-label { font-size: 12px; }
  #xp-bar { height: 10px; }

  /* Season & rain */
  #season-indicator { font-size: 13px; padding: 6px 12px; }
  #rain-indicator { font-size: 13px; padding: 6px 12px; }

  /* User bar */
  #user-bar { font-size: 14px !important; padding: 6px 12px !important; }

  /* Banner ad */
  .banner-body { flex-wrap: wrap; gap: 10px; }
  .banner-right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .banner-icon { width: 36px; height: 36px; font-size: 24px; }
}

/* Unified plant profile styles moved to plantprofile.css */

/* ---- Battle Pass HUD Button ---- */
#bp-hud-btn {
  padding: 6px 12px; border: 1px solid rgba(168,85,247,0.4); border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s;
  white-space: nowrap; background: linear-gradient(135deg, #1e1040, #2a1555); color: #e0ddd4;
  display: inline-flex; align-items: center; gap: 6px;
}
#bp-hud-btn:hover { border-color: #a855f7; box-shadow: 0 0 8px rgba(168,85,247,0.3); }
#bp-hud-btn .bp-level { color: #c084fc; }
#bp-hud-btn .bp-bar-outer {
  display: inline-block; width: 40px; height: 6px; background: #1a1a2e;
  border-radius: 3px; overflow: hidden; vertical-align: middle;
}
#bp-hud-btn .bp-bar-inner {
  height: 100%; width: 0%; background: linear-gradient(90deg, #a855f7, #2cb5e8);
  border-radius: 3px; transition: width 0.4s;
}

/* ---- Battle Pass Modal ---- */
.bp-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
  z-index: 200; display: flex; justify-content: center; align-items: center;
  animation: fadeIn 0.2s;
}
.bp-modal {
  background: linear-gradient(145deg, #0e0e1a, #141428);
  border: 1px solid #2a2a4a; border-radius: 16px;
  width: 95vw; max-width: 900px; max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column; animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.bp-header {
  padding: 20px 24px 16px; border-bottom: 1px solid #1a1a2e;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.bp-header-left h2 { font-size: 20px; margin: 0; }
.bp-header-left h2 span { color: #a855f7; }
.bp-header-left .bp-dates { color: #c0b89a; font-size: 12px; margin-top: 2px; }
.bp-header-right { display: flex; align-items: center; gap: 12px; }
.bp-timer {
  background: rgba(224,80,80,0.15); border: 1px solid rgba(224,80,80,0.3);
  border-radius: 10px; padding: 8px 14px; text-align: center;
}
.bp-timer .days { font-size: 22px; font-weight: 800; color: #e05050; }
.bp-timer .label { font-size: 10px; color: #8892b0; }
.bp-close {
  background: none; border: none; color: #6b7a99; font-size: 22px; cursor: pointer; padding: 4px;
}
.bp-close:hover { color: #e0ddd4; }

.bp-progress {
  padding: 14px 24px; background: rgba(255,255,255,0.02);
}
.bp-progress-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.bp-progress-level { font-size: 16px; font-weight: 700; }
.bp-progress-level span { color: #2cb5e8; }
.bp-progress-sxp { color: #c0b89a; font-size: 12px; }
.bp-progress-bar {
  height: 10px; background: #0a0a1a; border-radius: 5px; overflow: hidden;
}
.bp-progress-fill {
  height: 100%; background: linear-gradient(90deg, #2cb5e8, #a855f7);
  border-radius: 5px; transition: width 0.5s;
}
.bp-sxp-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: center;
}
.bp-sxp-chip {
  background: rgba(44,181,232,0.1); border: 1px solid rgba(44,181,232,0.2);
  border-radius: 14px; padding: 2px 10px; font-size: 11px; color: #2cb5e8;
}
.bp-sxp-chip b { color: #7ec662; }

/* Track — vertical layout */
.bp-track-scroll {
  overflow-y: auto; overflow-x: hidden; padding: 16px 24px 20px; flex: 1;
}
.bp-track-labels {
  display: flex; justify-content: space-between; padding: 0 4px 8px;
  font-size: 10px; color: #c0b89a; text-transform: uppercase; letter-spacing: 1px;
}
.bp-track {
  display: flex; flex-direction: column; gap: 0;
}
.bp-level-row {
  display: flex; align-items: center; gap: 0; position: relative;
}
.bp-reward-card {
  flex: 1; border-radius: 10px; padding: 10px 8px; text-align: center;
  font-size: 11px; border: 1px solid; cursor: pointer; transition: all 0.2s;
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.bp-reward-card .bp-r-icon { font-size: 22px; flex-shrink: 0; }
.bp-reward-card .bp-r-text { font-weight: 600; line-height: 1.3; }
.bp-reward-card-empty { flex: 1; }

/* Level pill between free/premium */
.bp-level-pill {
  width: 36px; min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #3a3a5a; margin: 0 6px;
  border-radius: 50%; background: #0e0e1a; border: 2px solid #1a1a2e; position: relative; z-index: 1;
}
.bp-level-pill.active { color: #2cb5e8; border-color: #2cb5e8; }
.bp-level-pill.done { color: #7ec662; border-color: #7ec662; }

/* Vertical connector */
.bp-row-connector {
  display: flex; justify-content: center; padding: 0; height: 8px;
}
.bp-row-connector-line {
  width: 3px; height: 100%; border-radius: 2px;
  margin-left: calc(50% - 1px);
}
.bp-row-connector-line.done { background: #7ec662; }
.bp-row-connector-line.current { background: linear-gradient(180deg, #2cb5e8, #1a1a2e); }
.bp-row-connector-line.locked { background: #1a1a2e; }

/* Premium card */
.bp-reward-card.premium {
  background: linear-gradient(145deg, #1e1040, #2a1555);
  border-color: rgba(168,85,247,0.3);
}
.bp-reward-card.premium .bp-r-text { color: #c084fc; }

/* Free card */
.bp-reward-card.free {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border-color: #2a2a4a;
}
.bp-reward-card.free .bp-r-text { color: #c0b89a; }

/* States */
.bp-reward-card.claimed { opacity: 0.45; }
.bp-reward-card.claimed::after {
  content: '✓'; position: absolute; top: -4px; right: -4px;
  background: #7ec662; color: #0a0a1a; width: 16px; height: 16px;
  border-radius: 50%; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.bp-reward-card.claimable {
  border-color: #2cb5e8; box-shadow: 0 0 10px rgba(44,181,232,0.3);
  animation: bpPulse 2s infinite;
}
@keyframes bpPulse {
  0%,100% { box-shadow: 0 0 6px rgba(44,181,232,0.2); }
  50% { box-shadow: 0 0 14px rgba(44,181,232,0.5); }
}
.bp-reward-card.locked { opacity: 0.3; cursor: default; }
.bp-reward-card.premium.locked-premium { opacity: 0.35; filter: grayscale(0.3); }

/* Premium CTA */
.bp-premium-cta {
  padding: 16px 24px; border-top: 1px solid #1a1a2e;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.bp-premium-cta h3 { font-size: 16px; color: #e6a832; margin: 0 0 2px; }
.bp-premium-cta p { font-size: 12px; color: #c0b89a; margin: 0; }
.bp-premium-btn {
  background: linear-gradient(135deg, #a855f7, #8b3fcf); color: #fff; border: none;
  padding: 10px 24px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.2s;
}
.bp-premium-btn:hover { background: linear-gradient(135deg, #b865ff, #9b4fdf); }
.bp-premium-btn:disabled { opacity: 0.5; cursor: default; }
.bp-premium-btn.owned { background: #2a4a2a; border: 1px solid #7ec662; }

/* Click detail popup */
.bp-detail-popup {
  position: fixed; z-index: 210; background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 1px solid #2a2a4a; border-radius: 12px; padding: 16px; width: 240px;
  text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: modalIn 0.15s ease;
}
.bp-detail-popup .bp-d-icon { font-size: 36px; margin-bottom: 6px; }
.bp-detail-popup .bp-d-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.bp-detail-popup .bp-d-desc { font-size: 12px; color: #c0b89a; margin-bottom: 10px; }
.bp-detail-popup .bp-d-status { font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.bp-detail-popup .bp-d-btn {
  padding: 8px 20px; border: none; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; width: 100%;
}
.bp-detail-popup .bp-d-btn.claim {
  background: linear-gradient(135deg, #2cb5e8, #1a8fc4); color: #fff;
}
.bp-detail-popup .bp-d-btn.locked-btn {
  background: #1a1a2e; color: #c0b89a; cursor: default;
}

@media (max-width: 600px) {
  .bp-modal { width: 100vw; max-width: 100vw; border-radius: 12px 12px 0 0; max-height: 95vh; }
}
