* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #1a2e1a; font-family: 'Nunito', system-ui, sans-serif; }

/* --- Top & Bottom gradient overlays --- */
body::before,
body::after {
  content: '';
  position: fixed;
  left: 0; right: 0;
  pointer-events: none;
  z-index: 5;
}
body::before {
  top: 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(10,20,10,0.85) 0%, transparent 100%);
}
body::after {
  bottom: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(8,16,8,0.9) 0%, transparent 100%);
}

#seed-pouch { transition: opacity 0.3s; }

canvas#garden {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  cursor: grab;
  z-index: 1;
  transform: perspective(900px) rotateX(4deg) scale(1.08);
  transform-origin: center bottom;
}
canvas#garden.grabbing { cursor: grabbing; }

/* --- Floating XP --- */
.floating-xp {
  position: fixed;
  pointer-events: none;
  z-index: 400;
  color: #a0d050;
  font: bold 16px 'Nunito', system-ui, sans-serif;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  transform: translate(-50%, -50%);
  animation: float-up 1.5s ease-out forwards;
}
@keyframes float-up {
  0%   { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-60px); }
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-family: 'Nunito', system-ui, sans-serif;
  line-height: 1.4;
  max-width: 400px;
  text-align: center;
  pointer-events: auto;
  animation: toast-in 0.3s ease, toast-out 0.4s ease 3.6s forwards;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.toast-err {
  background: rgba(74, 21, 32, 0.9);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}
.toast-ok {
  background: rgba(27, 67, 50, 0.9);
  color: #7fefbd;
  border: 1px solid rgba(127, 239, 189, 0.3);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* --- Time HUD --- */
.time-hud {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: rgba(18, 32, 18, 0.75);
  border: 1px solid rgba(100, 140, 60, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  overflow: hidden;
  z-index: 10;
  user-select: none;
}
.time-hud[hidden] { display: none; }
.time-hud:empty { display: none; }

.time-seg {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 13px;
  font-style: italic;
  color: #d4c898;
  white-space: nowrap;
}
.time-seg .time-icon {
  font-size: 14px;
  font-style: normal;
}
.time-div {
  width: 1px;
  height: 18px;
  background: rgba(140, 180, 80, 0.25);
  flex-shrink: 0;
}
.time-seg.time-year {
  color: #a0c870;
  font-style: normal;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Coordinate HUD --- */
.coord-hash {
  flex-shrink: 0;
  opacity: 0.85;
}
.coord-hud {
  position: fixed;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(18, 32, 18, 0.75);
  border: 1px solid rgba(120, 160, 80, 0.3);
  color: #90b870;
  font: 12px 'DM Mono', monospace;
  padding: 5px 10px;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  z-index: 10;
  user-select: none;
  transition: all 0.15s;
}
.coord-hud[hidden] { display: none; }
.coord-hud:hover {
  background: rgba(30, 50, 25, 0.9);
  border-color: rgba(140, 200, 80, 0.5);
  color: #e0dcc8;
}

.coord-goto {
  position: fixed;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 11;
}
.coord-goto[hidden] { display: none; }
.coord-goto input {
  background: rgba(18, 32, 18, 0.92);
  border: 1px solid rgba(120, 160, 80, 0.4);
  color: #c8d8b0;
  font: 12px 'DM Mono', monospace;
  padding: 6px 10px;
  border-radius: 8px;
  width: 110px;
  outline: none;
  backdrop-filter: blur(16px);
}
.coord-goto input:focus {
  border-color: rgba(140, 200, 80, 0.7);
}
.coord-cancel-btn {
  background: rgba(18, 32, 18, 0.92);
  border: 1px solid rgba(120, 160, 80, 0.3);
  color: #809070;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  backdrop-filter: blur(16px);
}
.coord-cancel-btn:hover { color: #b8c8a0; }

/* --- Menu Button (Gear) --- */
#menu-btn {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(120, 160, 80, 0.35);
  border-radius: 10px;
  background: rgba(30, 50, 30, 0.8);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
#menu-btn[hidden] { display: none; }
#menu-btn:hover { background: rgba(50, 80, 40, 0.9); border-color: rgba(150, 200, 100, 0.5); }

/* --- Debug Toolbar --- */
.debug-bar {
  position: fixed;
  top: 10px;
  left: 56px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(18, 32, 18, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(120, 160, 80, 0.25);
  border-radius: 10px;
  padding: 2px 4px;
}
.debug-bar[hidden] { display: none; }
.debug-tick {
  font: 11px 'DM Mono', monospace;
  color: #809070;
  padding: 0 4px;
  user-select: none;
}
.debug-btn {
  border: none;
  background: none;
  color: #809070;
  font: 11px 'Nunito', system-ui, sans-serif;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.debug-btn:hover { background: rgba(255,255,255,0.1); color: #e0dcc8; }
.debug-btn:disabled { opacity: 0.4; cursor: wait; }

/* --- Dropdown Menu --- */
.menu-dropdown {
  position: fixed;
  top: 52px;
  left: 12px;
  z-index: 100;
  min-width: 160px;
  background: rgba(18, 32, 18, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(100, 140, 60, 0.4);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: dropIn 0.15s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.menu-dropdown[hidden] { display: none; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #c8d8b0;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.dropdown-item:hover { background: rgba(80, 120, 50, 0.3); color: #e0dcc8; }
.dropdown-danger { color: #e08080; }
.dropdown-danger:hover { background: rgba(120, 40, 40, 0.3); }
.dropdown-divider {
  height: 1px;
  margin: 4px 0;
  background: rgba(80, 120, 40, 0.2);
}

/* --- Settings Modal Rows --- */
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.03);
}
.settings-label { font-size: 13px; color: #809070; }
.settings-value { font-size: 13px; font-family: monospace; color: #e0dcc8; }
.settings-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.settings-actions .panel-btn { flex: 1; }

/* --- AO Status --- */
.ao-status {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.status-ok  { background: rgba(27, 67, 50, 0.6); color: #7fefbd; }
.status-err { background: rgba(74, 21, 32, 0.6); color: #ff6b6b; }
.status-wait { background: rgba(61, 49, 0, 0.6); color: #ffd166; }

/* --- Panel Sections --- */
.panel-section {
  margin-bottom: 16px;
}

.section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #708060;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  margin-bottom: 8px;
}
.section-label span {
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 4px;
}

/* --- Balances --- */
.balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 5px;
  margin-bottom: 3px;
  background: rgba(255,255,255,0.03);
}
.balance-label {
  font-size: 12px;
  font-weight: 600;
  color: #809070;
}
.balance-value {
  font-size: 13px;
  font-family: monospace;
  color: #e0dcc8;
}

/* --- Panel Buttons --- */
.panel-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.panel-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid rgba(120, 160, 80, 0.3);
  border-radius: 8px;
  background: rgba(30, 55, 20, 0.5);
  color: #b8c8a0;
  font-size: 13px;
  font-family: 'Nunito', inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.panel-btn:hover { background: rgba(50, 80, 30, 0.7); color: #e0dcc8; }
.panel-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.mine-btn {
  background: rgba(27, 67, 50, 0.4);
  border-color: rgba(127, 239, 189, 0.2);
  color: #7fefbd;
}
.mine-btn:hover { background: rgba(27, 67, 50, 0.6); }

.stake-info {
  font-size: 12px;
  color: #b8c8a0;
  padding: 6px 0;
  text-align: center;
}

.panel-hint {
  font-size: 11px;
  color: #607050;
  line-height: 1.4;
}

/* --- Inventory --- */
#inventory-list {
  max-height: 180px;
  overflow-y: auto;
}

.inv-empty {
  color: #506040;
  font-size: 12px;
  padding: 8px 0;
}

.seed-item {
  padding: 5px 8px;
  border: 1px solid rgba(120, 160, 80, 0.1);
  border-radius: 5px;
  margin-bottom: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.seed-item:hover { background: rgba(255,255,255,0.05); }
.seed-item.selected {
  border-color: rgba(127, 239, 189, 0.4);
  background: rgba(27, 67, 50, 0.3);
}

.rarity-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
}
.rarity-weed      { color: #7a9a5a; }
.rarity-common    { color: #aaa; }
.rarity-uncommon  { color: #5bc0de; }
.rarity-rare      { color: #f0ad4e; }
.rarity-legendary { color: #ff6ef9; }
.rarity-legendary .rarity-tag { background: rgba(255, 110, 249, 0.15); }
.rarity-rare .rarity-tag { background: rgba(240, 173, 78, 0.15); }
.rarity-unknown  { color: #888; font-style: italic; }
.rarity-unknown .rarity-tag { background: rgba(255,255,255,0.08); color: #999; }

/* --- Preview --- */
#preview-wrap {
  display: flex;
  justify-content: center;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 12px;
}
#preview-canvas {
  border-radius: 8px;
}

/* --- Info Details --- */
.info-details {
  font-size: 12px;
  color: #b8c8a0;
  line-height: 1.6;
  padding: 8px 0 0;
}
.info-details .info-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.info-details .info-key {
  color: #809070;
}
.info-details .info-val {
  color: #e0dcc8;
  text-align: right;
}

/* --- Offline Overlay --- */
.offline-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.offline-overlay[hidden] { display: none; }
.offline-box {
  text-align: center;
  color: #e0dcc8;
  max-width: 360px;
  padding: 40px 32px;
}
.offline-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: grayscale(1);
}
.offline-box h2 {
  font-family: inherit;
  font-size: 22px;
  color: #b8c8a0;
  margin: 0 0 12px;
}
.offline-box p {
  font-size: 14px;
  line-height: 1.5;
  color: #98a880;
  margin: 0 0 24px;
}
.offline-refresh-btn {
  background: rgba(120, 160, 80, 0.15);
  border: 1px solid rgba(120, 160, 80, 0.3);
  color: #b8c8a0;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.offline-refresh-btn:hover {
  background: rgba(120, 160, 80, 0.25);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay[hidden] { display: none; }

.modal {
  width: 320px;
  background: rgba(12, 22, 12, 0.97);
  border: 1px solid rgba(100, 150, 50, 0.35);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(120, 160, 80, 0.1);
}
.modal-header h3 {
  font-size: 15px;
  color: #e0dcc8;
  font-weight: 600;
  font-family: 'Nunito', system-ui, sans-serif;
}
.modal-close {
  background: none;
  border: none;
  color: #809070;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: #b8c8a0; }

.modal-body {
  padding: 16px;
}

.modal-info {
  font-size: 12px;
  color: #809070;
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}

.modal-field {
  margin-bottom: 12px;
}
.modal-field label {
  display: block;
  font-size: 12px;
  color: #809070;
  margin-bottom: 4px;
}
.modal-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(120, 160, 80, 0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #e0dcc8;
  font-size: 14px;
  font-family: monospace;
  outline: none;
}
.modal-field input:focus {
  border-color: rgba(127, 239, 189, 0.4);
}

.modal-estimate {
  font-size: 13px;
  color: #b8c8a0;
  min-height: 20px;
  margin-bottom: 8px;
}

.modal-result {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.modal-result.result-ok {
  background: rgba(27, 67, 50, 0.6);
  color: #7fefbd;
}
.modal-result.result-err {
  background: rgba(74, 21, 32, 0.6);
  color: #ff6b6b;
}

.modal-footer {
  padding: 0 16px 16px;
}
.modal-footer .panel-btn {
  width: 100%;
}
.modal-footer-pair {
  display: flex;
  gap: 8px;
}
.modal-footer-pair .panel-btn {
  flex: 1;
}

/* --- Level Up Modal --- */
.levelup-modal {
  width: 440px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.levelup-modal .modal-header {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.levelup-modal .modal-header h3 {
  text-align: center;
}
.levelup-tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.levelup-tab {
  padding: 6px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(120, 160, 80, 0.15);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: #809070;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.levelup-tab:hover {
  color: #b8c8a0;
  background: rgba(255,255,255,0.08);
}
.levelup-tab.active {
  color: #e0dcc8;
  background: rgba(255,255,255,0.08);
  border-bottom: 2px solid #7fefbd;
}
.levelup-panel {
  padding: 16px 0 0;
}
.levelup-panel[hidden] { display: none; }
.levelup-card {
  padding: 12px 14px;
  border: 1px solid rgba(120, 160, 80, 0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.15s;
}
.levelup-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(120, 160, 80, 0.35);
}
.levelup-card.selected {
  border-color: rgba(127, 239, 189, 0.5);
  background: rgba(27, 67, 50, 0.2);
}
.levelup-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #e0dcc8;
  margin-bottom: 4px;
}
.levelup-card-desc {
  font-size: 12px;
  color: #809070;
  line-height: 1.4;
}
.levelup-card-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.levelup-card-items .levelup-item-pill {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  color: #b8c8a0;
  text-transform: capitalize;
}
.levelup-action-btn {
  width: 100%;
  padding: 10px 0;
  border: 1px solid rgba(127, 239, 189, 0.3);
  border-radius: 6px;
  background: rgba(27, 67, 50, 0.4);
  color: #7fefbd;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.levelup-action-btn:hover {
  background: rgba(27, 67, 50, 0.6);
}
.levelup-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255,255,255,0.06);
  border-color: rgba(120, 160, 80, 0.15);
  color: #809070;
}
.levelup-level-label {
  text-align: center;
  font-size: 15px;
  color: #e0dcc8;
  margin-bottom: 12px;
}
.levelup-level-label strong {
  color: #7fefbd;
}

/* --- Starter Kit Modal (multi-page wizard) --- */
.starterkit-modal {
  width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.sk-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.sk-page[hidden] {
  display: none;
}
.sk-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.starterkit-modal .modal-header {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.starterkit-modal .modal-header h3 {
  text-align: center;
  color: #f0c040;
}
.starterkit-subtitle {
  font-size: 12px;
  color: #809070;
  text-align: center;
  line-height: 1.4;
}
.starterkit-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.starterkit-pick-hint {
  font-size: 11px;
  color: #809070;
  text-align: center;
  margin-bottom: 8px;
}

/* Page 1: Welcome */
.sk-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.sk-welcome-title {
  font-size: 22px;
  font-weight: 400;
  color: #d0d8b0;
  line-height: 1.4;
  margin: 0 0 16px 0;
}
.sk-welcome-text {
  font-size: 14px;
  color: #809070;
  margin: 0;
  line-height: 1.5;
}

/* Pages 3-5: Reveal pages */
.sk-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}
.sk-reveal-title {
  color: #7fefbd;
  font-size: 18px;
  margin: 0 0 16px 0;
}
.sk-reveal-more {
  color: #809070;
  font-size: 14px;
  margin: 20px 0 0 0;
  font-style: italic;
}
.sk-chosen-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 280px;
}
.sk-chosen-pill {
  background: rgba(127, 239, 189, 0.08);
  border: 1px solid rgba(127, 239, 189, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #c4b898;
  text-align: center;
}
.sk-bonus-title {
  color: #f0c040;
  font-size: 18px;
  margin: 0 0 6px 0;
}
.sk-bonus-subtitle {
  color: #809070;
  font-size: 13px;
  margin: 0 0 20px 0;
}
.sk-bonus-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 280px;
}
.sk-bonus-pill {
  background: rgba(240, 192, 64, 0.08);
  border: 1px solid rgba(240, 192, 64, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #f0c040;
  text-align: center;
}
.sk-deco-title {
  color: #b8c8a0;
  font-size: 18px;
  margin: 0 0 6px 0;
}
.sk-deco-subtitle {
  color: #809070;
  font-size: 13px;
  margin: 0 0 20px 0;
}
.sk-deco-summary {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.sk-deco-pill {
  background: rgba(120, 160, 80, 0.1);
  border: 1px solid rgba(120, 160, 80, 0.2);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  color: #b8c8a0;
  text-transform: capitalize;
}

.modal-hint {
  font-size: 11px;
  color: #809070;
  margin-bottom: 8px;
}

/* --- Journal Modal --- */
.journal-modal {
  width: 400px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}
.journal-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 0;
}

/* Write section pinned at top */
#journal-write-section {
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(120, 160, 80, 0.08);
}
.journal-write-header {
  font-size: 11px;
  color: #708060;
  margin-bottom: 6px;
}
.journal-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #c8d0b0;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 10px;
  resize: none;
  box-sizing: border-box;
}
.journal-textarea:focus {
  outline: none;
  border-color: rgba(120, 160, 80, 0.25);
}
.journal-write-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.journal-char-count {
  font-size: 10px;
  color: #506040;
}

/* Entries */
#journal-entries {
  padding: 10px 18px 14px;
}
.journal-entry {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.journal-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.journal-date {
  font-size: 11px;
  font-weight: 600;
  color: #90a078;
  margin-bottom: 3px;
}
.journal-entry p {
  font-size: 13px;
  color: #98a880;
  line-height: 1.55;
  margin: 0;
}
.journal-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin: 10px 0;
}
.journal-empty {
  text-align: center;
  font-size: 13px;
  color: #506040;
  padding: 20px 0;
  font-style: italic;
}

.petal-btn {
  background: rgba(61, 49, 0, 0.4);
  border-color: rgba(255, 209, 102, 0.2);
  color: #ffd166;
}
.petal-btn:hover { background: rgba(61, 49, 0, 0.6); }

.sign-btn {
  background: rgba(60, 50, 30, 0.4);
  border-color: rgba(245, 240, 224, 0.2);
  color: #f5f0e0;
}
.sign-btn:hover { background: rgba(60, 50, 30, 0.6); }
.sign-btn.active {
  background: rgba(80, 65, 30, 0.7);
  border-color: rgba(245, 240, 224, 0.5);
}
.sign-btn span {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 2px;
}

.sign-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(120, 160, 80, 0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #e0dcc8;
  font-size: 16px;
  font-family: 'Nunito', system-ui, sans-serif;
  resize: none;
  outline: none;
}
.sign-textarea:focus {
  border-color: rgba(245, 240, 224, 0.4);
}

.sign-char-counter {
  font-size: 11px;
  color: #809070;
  text-align: right;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* --- Decoration List --- */
.deco-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.deco-item {
  padding: 6px 0;
  border: 1px solid rgba(120, 160, 80, 0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #b8c8a0;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-transform: capitalize;
  transition: all 0.2s;
}
.deco-item:hover { background: rgba(255,255,255,0.1); color: #e0dcc8; }
.deco-item:disabled, .deco-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.deco-item.active {
  background: rgba(27, 67, 50, 0.4);
  border-color: rgba(127, 239, 189, 0.4);
  color: #7fefbd;
}
.deco-item span {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 2px;
}

/* --- Reward Notifications (top-center) --- */
.reward-card[hidden] { display: none; }
.rewards-zone {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 150;
  pointer-events: none;
}
.reward-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 28, 15, 0.92);
  border: 1px solid rgba(180, 220, 80, 0.45);
  border-radius: 14px;
  padding: 10px 14px 10px 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(160,220,60,0.1) inset;
  pointer-events: all;
  animation: rewardSlide 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 200px;
  position: relative;
  overflow: hidden;
  cursor: default;
}
.reward-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(160,220,60,0.06) 0%, transparent 60%);
  pointer-events: none;
}
@keyframes rewardSlide {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.reward-icon {
  font-size: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reward-text {
  flex: 1;
}
.reward-title {
  font: 700 13px/1.2 'Nunito', sans-serif;
  color: #d8f0a0;
}
.reward-sub {
  font-size: 10px;
  color: #80a060;
  margin-top: 1px;
}
.reward-collect {
  background: rgba(120, 180, 50, 0.7);
  border: 1px solid rgba(160, 220, 80, 0.6);
  border-radius: 8px;
  padding: 5px 10px;
  color: #d8f0a0;
  font: 700 11px 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.reward-collect:hover {
  background: rgba(140, 200, 60, 0.85);
  transform: scale(1.05);
}
#fertilesoil-species-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fertilesoil-species-card {
  flex: 0 0 auto;
  padding: 6px 14px !important;
  min-height: auto !important;
}

/* --- Player HUD (bottom bar — icons left, info right) --- */
.player-hud {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
  pointer-events: none;
}
.player-hud > * { pointer-events: auto; }
.player-hud[hidden] { display: none; }

/* Left group — icon buttons */
.phud-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.phud-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(80, 120, 40, 0.35);
  border-radius: 10px;
  background: rgba(20, 40, 15, 0.8);
  color: #80a860;
  cursor: pointer;
  transition: all 0.15s;
  backdrop-filter: blur(8px);
}
.phud-icon:hover {
  background: rgba(40, 70, 25, 0.9);
  border-color: rgba(120, 180, 60, 0.5);
  color: #b0d880;
}

/* Right group — name + xp */
.phud-info {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(12, 24, 10, 0.75);
  border: 1px solid rgba(80, 120, 40, 0.35);
  border-radius: 10px;
  padding: 5px 10px;
  backdrop-filter: blur(10px);
}

.phud-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  font: bold 8px 'DM Mono', monospace;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5bc0de;
  border: 1.5px solid rgba(10, 20, 10, 0.8);
}
.phud-badge[hidden] { display: none; }
.phud-badge-alert { background: #d44; }

.phud-name {
  font: 11px 'DM Mono', monospace;
  font-weight: 700;
  color: #90b860;
  margin: 0 4px;
  white-space: nowrap;
}
.phud-name:empty { display: none; }

.phud-level {
  font: 11px 'DM Mono', monospace;
  color: #e8f0d0;
  white-space: nowrap;
  margin-right: 8px;
}

.phud-xp-bar {
  position: relative;
  width: 64px;
  height: 5px;
  background: rgba(40, 70, 20, 0.8);
  border-radius: 3px;
  overflow: visible;
  cursor: help;
}
.phud-xp-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(to right, #60a030, #a0d050);
  transition: width 0.3s;
}
.phud-xp-lvl {
  position: absolute;
  right: 0;
  top: 6px;
  font: bold 8px 'DM Mono', monospace;
  color: rgba(200, 220, 160, 0.7);
  pointer-events: none;
}

/* --- Gardener's Notes --- */
.notes-widget {
  position: fixed;
  bottom: 0;
  left: 200px;
  width: 220px;
  z-index: 55;
  transform: rotate(0.4deg);
  transform-origin: bottom center;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
.notes-widget[hidden] { display: none; }

.notes-body {
  overflow: hidden;
  max-height: 280px;
  transition:
    max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity    0.25s ease;
  opacity: 1;
}
.notes-widget.collapsed .notes-body {
  max-height: 0;
  opacity: 0;
}

.notes-torn-edge {
  height: 14px;
  margin: 0 4px 0;
  overflow: hidden;
  flex-shrink: 0;
}
.notes-torn-edge svg { width: 100%; height: 100%; display: block; }

.notes-paper {
  position: relative;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"),
    repeating-linear-gradient(to bottom, transparent 0px, transparent 23px, rgba(100,80,40,0.09) 24px),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(160,130,80,0.08) 0%, transparent 60%),
    linear-gradient(to bottom, #d8cb9c 0%, #d2c595 60%, #cbbe90 100%);
  padding: 8px 12px 14px 12px;
}
.notes-paper::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 28px;
  width: 1px;
  background: rgba(200,80,80,0.25);
  pointer-events: none;
}
.notes-paper::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  background: linear-gradient(225deg, #a89460 0%, #b8a472 40%, #c8b880 55%, transparent 56%);
}

.notes-header {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 8px;
  padding-left: 18px;
}
.notes-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  color: #2e2208;
  text-shadow: 0.4px 0.6px 0 rgba(0,0,0,0.12);
}
.notes-pen {
  font-size: 10px; opacity: 0.45;
  display: inline-block; transform: rotate(-15deg);
}
.notes-divider {
  height: 1px;
  background: linear-gradient(to right, transparent 16px, rgba(80,56,20,0.2) 16px, rgba(80,56,20,0.2) calc(100% - 4px), transparent calc(100% - 4px));
  margin-bottom: 6px;
}

.notes-goals {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 16px;
}

.notes-goal {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 2px 0;
  cursor: pointer;
}
.notes-goal-check { flex-shrink: 0; width: 13px; height: 13px; margin-top: 2px; }
.notes-goal-check svg { width: 13px; height: 13px; overflow: visible; }
.notes-goal .check-box {
  fill: none; stroke: #4a3410; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0.7;
}
.notes-goal .check-tick {
  fill: none; stroke: #3a6818; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 18; stroke-dashoffset: 18;
  transition: stroke-dashoffset 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.notes-goal.done .check-tick { stroke-dashoffset: 0; }

.notes-goal-text {
  font-family: 'IM Fell English', 'Cormorant Garamond', cursive;
  font-size: 13px; font-weight: 500;
  color: #2c1e08; line-height: 1.3; flex: 1;
  text-shadow: 0.3px 0.4px 0 rgba(0,0,0,0.08);
  user-select: none;
  transition: color 0.25s;
}
.notes-goal.done .notes-goal-text {
  color: rgba(60,80,30,0.48);
  text-decoration: line-through;
  text-decoration-color: rgba(60,80,30,0.35);
}
.notes-goal-xp {
  font-family: 'DM Mono', monospace;
  font-size: 7px; font-weight: 500;
  color: rgba(60,100,24,0.7);
  margin-top: 3px; flex-shrink: 0;
  opacity: 0; transform: scale(0.7);
  transition: all 0.25s 0.2s ease;
}
.notes-goal.done .notes-goal-xp { opacity: 1; transform: scale(1); }

.notes-tab {
  flex-shrink: 0;
  height: 24px;
  background: linear-gradient(to bottom, #c8bc8a, #beb07e);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  border-radius: 0 0 5px 5px;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.08) inset;
  border-left: 1px solid rgba(80,60,20,0.25);
  border-right: 1px solid rgba(80,60,20,0.25);
  border-bottom: 1px solid rgba(60,44,14,0.4);
  transition: background 0.15s;
}
.notes-tab:hover {
  background: linear-gradient(to bottom, #d4c892, #c8bc86);
}
.notes-widget.collapsed .notes-tab {
  border-radius: 4px 4px 5px 5px;
  border-top: 1px solid rgba(80,60,20,0.2);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.6),
    0 1px 0 rgba(255,255,255,0.1) inset;
}

.notes-tab-arrow {
  font-size: 8px;
  color: rgba(70,48,12,0.75);
  line-height: 1;
  display: inline-block;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.notes-widget.collapsed .notes-tab-arrow {
  transform: rotate(180deg);
}
.notes-tab-label {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(70,48,12,0.8);
  font-weight: 500;
}
.notes-tab-dots {
  display: flex; gap: 3px; align-items: center;
  margin-left: 2px;
}
.notes-tab-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  border: 1px solid rgba(80,60,20,0.35);
  background: rgba(80,60,20,0.1);
  transition: background 0.2s, border-color 0.2s;
}
.notes-tab-dot.done {
  background: rgba(55,105,20,0.65);
  border-color: rgba(65,120,24,0.8);
}

/* --- Bottom Menu --- */
.bottom-menu[hidden] { display: none; }
.bottom-menu {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
  z-index: 50;
  background: rgba(12, 24, 10, 0.82);
  border: 1px solid rgba(80, 130, 40, 0.4);
  border-radius: 18px;
  padding: 7px 10px;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.bottom-menu-icon {
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(90, 140, 50, 0.4);
  border-radius: 13px;
  background: rgba(30, 55, 20, 0.85);
  color: #90b870;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.bottom-menu-icon:hover {
  background: rgba(50, 90, 30, 0.9);
  border-color: rgba(140, 200, 70, 0.7);
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  color: #c8e890;
}
.bottom-menu-icon:active {
  transform: translateY(-2px) scale(1.02);
}
.bottom-menu-icon.active {
  background: rgba(70, 120, 35, 0.85);
  border-color: rgba(160, 220, 80, 0.8);
  box-shadow: 0 0 12px rgba(140, 200, 60, 0.35), 0 4px 12px rgba(0,0,0,0.4);
  color: #d8f0a0;
  transform: translateY(-3px);
}

.key-hint {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(140, 200, 80, 0.5);
  white-space: nowrap;
  pointer-events: none;
}
.bottom-menu-icon:hover .key-hint {
  color: rgba(140, 200, 80, 0.8);
}

.menu-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #d44;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.menu-badge[hidden] { display: none; }

/* --- Bottom Popup --- */
.bottom-popup {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 22, 12, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(100, 150, 50, 0.4);
  border-radius: 14px;
  padding: 0;
  z-index: 55;
  min-width: 280px;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: panelUp 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes panelUp {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.bottom-popup[hidden] { display: none; }

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 6px;
  border-bottom: 1px solid rgba(80, 120, 40, 0.2);
}
.popup-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #708060;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
}
.popup-close {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(60, 40, 40, 0.6);
  border: 1px solid rgba(140, 80, 80, 0.3);
  color: #c08080;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.popup-close:hover { background: rgba(100, 40, 40, 0.7); }

.popup-grid {
  display: grid;
  grid-template-columns: repeat(5, 50px);
  gap: 4px;
  padding: 8px 14px 14px;
  max-height: 50vh;
  overflow-y: auto;
}

.popup-slot {
  width: 52px;
  height: 52px;
  border: 1.5px solid rgba(80, 130, 40, 0.3);
  border-radius: 9px;
  background: rgba(25, 45, 18, 0.8);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
/* Rarity tints — before hover/selected/active so those win by source order */
.popup-slot[data-rarity="uncommon"] { border-color: rgba(91,192,222,0.3); background: rgba(91,192,222,0.08); }
.popup-slot[data-rarity="rare"] { border-color: rgba(240,173,78,0.3); background: rgba(240,173,78,0.08); }
.popup-slot[data-rarity="exotic"] { border-color: rgba(255,110,249,0.3); background: rgba(255,110,249,0.08); }
.popup-slot[data-rarity="epic"] { border-color: rgba(255,110,249,0.3); background: rgba(255,110,249,0.08); }
.popup-slot[data-rarity="legendary"] { border-color: rgba(255,215,0,0.3); background: rgba(255,215,0,0.08); }
.popup-slot:hover {
  border-color: rgba(140, 200, 70, 0.7);
  background: rgba(45, 80, 28, 0.85);
  transform: scale(1.06);
}
.popup-slot.selected {
  border-color: rgba(140, 200, 70, 0.7);
  background: rgba(45, 80, 28, 0.85);
  box-shadow: 0 0 8px rgba(127, 239, 189, 0.2);
}
.popup-slot.selected:hover {
  border-color: rgba(160, 220, 80, 0.8);
  background: rgba(50, 90, 30, 0.9);
  transform: scale(1.06);
}
.popup-slot.active {
  border-color: rgba(140, 200, 70, 0.7);
  background: rgba(45, 80, 28, 0.85);
  box-shadow: 0 0 8px rgba(127, 239, 189, 0.2);
}
.popup-slot.active:hover {
  border-color: rgba(160, 220, 80, 0.8);
  background: rgba(50, 90, 30, 0.9);
  transform: scale(1.06);
}
.popup-slot.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.popup-slot canvas {
  border-radius: 4px;
}
.popup-slot .slot-label {
  font-size: 8px;
  color: #708060;
  font-family: 'DM Mono', monospace;
  margin-top: 2px;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 48px;
  text-align: center;
}
.popup-slot .slot-count {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  color: #90c060;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
}

.popup-empty {
  grid-column: 1 / -1;
  color: #506040;
  font-size: 12px;
  padding: 8px 0;
  text-align: center;
}

/* --- Plant Info Box --- */
.plant-info-box {
  position: fixed;
  bottom: 56px;
  right: 16px;
  width: 240px;
  background: rgba(12, 22, 12, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(100, 150, 50, 0.4);
  border-radius: 16px;
  z-index: 55;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: panelIn 0.25s ease;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes panelOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(12px); }
}
.plant-info-box.closing {
  animation: panelOut 0.2s ease forwards;
}
.plant-info-box[hidden] { display: none; }

.plant-info-content {
  padding: 0 14px 14px;
}

#plant-info-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  perspective: 800px;
}
#plant-info-flipper {
  transform-style: preserve-3d;
  transition: transform 0.5s ease, border-color 0.2s;
  cursor: default;
  position: relative;
  width: 120px;
  height: 120px;
  border: 2px solid transparent;
  border-radius: 8px;
}
#plant-info-flipper.has-real {
  cursor: pointer;
}
/* Hover tilt hint (only when real photo available) */
#plant-info-flipper.has-real:not(.flipped):hover {
  transform: rotateY(19deg);
}
/* Flipped state */
#plant-info-flipper.flipped {
  transform: rotateY(180deg);
}
#plant-info-flipper.has-real.flipped:hover {
  transform: rotateY(156deg);
}
/* Card faces */
#plant-info-canvas,
#plant-info-real {
  backface-visibility: hidden;
  border-radius: 6px;
}
#plant-info-real {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: rotateY(180deg);
}
#plant-info-rarity {
  margin-top: 6px;
  text-align: center;
}
#plant-info-rarity:empty {
  display: none;
}

.plant-info-details {
  font-size: 12px;
  color: #b8c8a0;
  line-height: 1.5;
}
.plant-info-details .info-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
}
.plant-info-details .info-key {
  color: #809070;
}
.plant-info-details .info-val {
  color: #e0dcc8;
  text-align: right;
}
.owner-inspect {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: #809070;
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.15s;
}
.owner-inspect:hover {
  color: #b8c8a0;
}

.plant-info-trivia {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(120, 160, 80, 0.12);
  font-size: 11px;
  font-style: italic;
  color: #8aa870;
  line-height: 1.45;
}

/* --- Advanced Tulip Mode --- */
.plant-info-box.advanced { width: 340px; transition: width 0.2s; }

.tulip-adv-link {
  display: block; text-align: center; margin-top: 6px;
  font-size: 10px; color: #6a9a8a; cursor: pointer;
}
.tulip-adv-link:hover { color: #9ac; text-decoration: underline; }

.tulip-badges { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.tulip-badge {
  font-size: 9px; padding: 2px 7px; border-radius: 10px;
  font-weight: 600; border: 1px solid;
}

.tulip-weight-bar {
  display: flex; height: 4px; border-radius: 2px;
  overflow: hidden; margin: 2px 0 6px;
}
.tulip-weight-bar > div { height: 100%; min-width: 1px; }

.tulip-scalar-gauge {
  display: flex; align-items: center; gap: 4px; margin: 2px 0 6px;
}
.tulip-scalar-label { font-size: 8px; width: 36px; flex-shrink: 0; }
.tulip-scalar-label:last-of-type { text-align: right; }
.tulip-scalar-track {
  flex: 1; height: 6px; background: #222;
  border-radius: 3px; position: relative; overflow: visible;
}
.tulip-scalar-fill { height: 100%; border-radius: 3px; opacity: 0.6; overflow: hidden; }
.tulip-scalar-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 8px; background: #fff; border-radius: 50%;
  box-shadow: 0 0 3px rgba(255,255,255,0.5);
}

/* --- Help Modal --- */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-overlay[hidden] { display: none; }

.help-modal {
  position: relative;
  width: calc(100vw - 64px);
  height: calc(100vh - 64px);
  max-width: 900px;
  max-height: 700px;
  background: rgba(12, 22, 12, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(100, 150, 50, 0.35);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.help-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #809070;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
  padding: 0 4px;
}
.help-close:hover { color: #b8c8a0; }

.help-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.help-tabs {
  width: 160px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
  border-right: 1px solid rgba(120, 160, 80, 0.1);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-tab {
  display: block;
  width: 100%;
  padding: 12px 20px;
  border: none;
  background: none;
  color: #809070;
  font: 14px 'Nunito', system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.help-tab:hover { color: #b8c8a0; background: rgba(255, 255, 255, 0.03); }
.help-tab.active {
  color: #e0dcc8;
  background: rgba(255, 255, 255, 0.05);
  border-left-color: #7fefbd;
}

.help-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px;
}

.help-pane { display: none; }
.help-pane.active { display: block; }

.help-pane h3 {
  font-size: 20px;
  color: #e0dcc8;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

.help-group {
  margin-bottom: 24px;
}

.help-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #7fefbd;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(127, 239, 189, 0.15);
}

.help-entry {
  display: flex;
  align-items: baseline;
  padding: 6px 0;
  gap: 16px;
}

.help-keys {
  flex-shrink: 0;
  width: 180px;
  font-size: 13px;
  color: #b8c8a0;
}

.help-keys kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4a4a4a 0%, #333 100%);
  border: 1px solid #555;
  border-bottom: 2px solid #2a2a2a;
  box-shadow: 0 1px 0 #222, inset 0 1px 0 rgba(255,255,255,0.08);
  color: #ddd;
  font: bold 12px monospace;
  text-align: center;
  margin: 0 2px;
}

.help-desc {
  font-size: 13px;
  color: #98a880;
}

/* --- Help Sub-tabs (anchor links under a tab) --- */
.help-sub {
  display: none;
  padding: 6px 20px 6px 32px;
  color: #607050;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}
.help-sub:hover { color: #b8c8a0; }
.help-sub.visible { display: block; }

/* --- Help About pane prose --- */
.help-section {
  margin-bottom: 32px;
}

.help-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #7fefbd;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(127, 239, 189, 0.15);
}

.help-pane p {
  font-size: 14px;
  color: #a8b890;
  line-height: 1.7;
  margin-bottom: 12px;
}

.help-pane p strong {
  color: #e0dcc8;
}

.help-contact {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(120, 160, 80, 0.12);
}

.help-roadmap-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.help-roadmap-list li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: 14px;
  color: #a8b890;
  line-height: 1.6;
}
.help-roadmap-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7fefbd;
  opacity: 0.6;
}

.help-roadmap-note {
  padding: 10px 14px;
  background: rgba(61, 49, 0, 0.25);
  border-left: 3px solid rgba(255, 209, 102, 0.4);
  border-radius: 0 6px 6px 0;
  color: #d4b870;
  font-size: 13px;
}

/* --- Help: Tulip trait blocks --- */
.help-trait-block {
  margin: 14px 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(120, 160, 80, 0.08);
}
.help-trait-block p { margin-bottom: 6px; }
.help-trait-block p:last-child { margin-bottom: 0; }

.help-trait-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0dcc8;
  margin-bottom: 6px;
}

.help-hint {
  padding: 10px 14px;
  background: rgba(27, 67, 50, 0.25);
  border-left: 3px solid rgba(127, 239, 189, 0.4);
  border-radius: 0 6px 6px 0;
  color: #7fefbd;
  font-size: 13px;
}

/* --- Help: Rarity tier list --- */
.help-rarity-tiers {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.help-rarity-tiers li {
  padding: 5px 0;
  font-size: 14px;
  color: #a8b890;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rarity-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Tulip help link (? icon in plant info) --- */
/* --- Help: Flower rarity headers & species list --- */
.help-rarity-label {
  font-weight: 600;
}
.help-rarity-chance {
  font-size: 11px;
  color: #607050;
  margin-left: 10px;
  font-weight: 400;
}

.help-species-list {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  line-height: 1.8;
  color: #8a9a7a;
  font-size: 13px;
}
.help-species-list strong {
  color: #e0dcc8;
}

.tulip-help-link {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #809070;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition: all 0.15s;
  border: none;
  padding: 0;
  font-family: 'Nunito', system-ui, sans-serif;
}
.tulip-help-link:hover { background: rgba(127, 239, 189, 0.2); color: #7fefbd; }

/* --- Forédex Modal --- */
.foredex-modal {
  width: calc(100vw - 64px);
  max-width: 560px;
  max-height: calc(100vh - 80px);
  background: rgba(12, 22, 12, 0.97);
  border: 1px solid rgba(100, 150, 50, 0.35);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.foredex-modal .modal-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(120, 160, 80, 0.1);
  gap: 10px;
}
.foredex-modal .modal-header h3 {
  font-size: 15px;
  color: #e0dcc8;
  font-weight: 600;
  white-space: nowrap;
}
.foredex-summary {
  flex: 1;
  font-size: 12px;
  color: #809070;
  text-align: right;
}
.foredex-modal .modal-body {
  padding: 12px 16px 16px;
  overflow-y: auto;
  flex: 1;
}

.foredex-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.foredex-tier-label {
  grid-column: 1 / -1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0 4px;
  border-bottom: 1px solid rgba(120, 160, 80, 0.1);
  margin-bottom: 2px;
}
.foredex-tier-label:first-child { padding-top: 0; }

.foredex-progress-bar {
  position: relative;
  height: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 4px;
}
.foredex-progress-seen {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 7px;
  opacity: 0.3;
  transition: width 0.4s ease;
}
.foredex-progress-grown {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 7px;
  opacity: 0.85;
  transition: width 0.4s ease;
}
.foredex-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.foredex-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: 8px;
  border: 1px solid rgba(120, 160, 80, 0.08);
  background: rgba(255, 255, 255, 0.02);
  min-height: 68px;
}
/* Seen only: dimmer, dashed border */
.foredex-slot.discovered {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(120, 160, 80, 0.12);
  border-style: dashed;
  opacity: 0.6;
}
/* Grown: full brightness, solid border */
.foredex-slot.discovered.grown {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(120, 160, 80, 0.2);
  border-style: solid;
  opacity: 1;
}

.foredex-silhouette {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.foredex-slot.discovered .foredex-silhouette {
  background: rgba(255, 255, 255, 0.08);
}
.foredex-slot.discovered.grown .foredex-silhouette {
  background: rgba(255, 255, 255, 0.15);
}

.foredex-canvas {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
/* Seen but not grown: blurred */
.foredex-slot.discovered:not(.grown) .foredex-canvas {
  filter: blur(2px);
}
/* Grown: crisp */
.foredex-slot.discovered.grown .foredex-canvas {
  filter: none;
}

.foredex-name {
  font-size: 9px;
  color: #506040;
  text-align: center;
  line-height: 1.2;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.foredex-slot.discovered .foredex-name {
  color: #8a9a72;
}
.foredex-slot.discovered.grown .foredex-name {
  color: #b8c8a0;
}

/* Rarity-colored bottom border — dashed for seen, solid for grown */
.foredex-slot.discovered.rarity-weed { border-bottom: 2px dashed #7a9a5a; }
.foredex-slot.discovered.rarity-common { border-bottom: 2px dashed #aaa; }
.foredex-slot.discovered.rarity-uncommon { border-bottom: 2px dashed #5bc0de; }
.foredex-slot.discovered.rarity-rare { border-bottom: 2px dashed #f0ad4e; }
.foredex-slot.discovered.rarity-exotic { border-bottom: 2px dashed #ff6ef9; }

.foredex-slot.discovered.grown.rarity-weed { border-bottom: 2px solid #7a9a5a; }
.foredex-slot.discovered.grown.rarity-common { border-bottom: 2px solid #aaa; }
.foredex-slot.discovered.grown.rarity-uncommon { border-bottom: 2px solid #5bc0de; }
.foredex-slot.discovered.grown.rarity-rare { border-bottom: 2px solid #f0ad4e; }
.foredex-slot.discovered.grown.rarity-exotic { border-bottom: 2px solid #ff6ef9; }

/* --- Invite Button & Modal --- */
.invite-btn {
  background: rgba(30, 50, 80, 0.4);
  border-color: rgba(100, 160, 220, 0.25);
  color: #7ab8e0;
}
.invite-btn:hover { background: rgba(30, 50, 80, 0.6); }

.invite-codes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.invite-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  border: 1px solid rgba(120, 160, 80, 0.1);
}
.invite-code-row code {
  flex: 1;
  font-size: 11px;
  font-family: monospace;
  color: #b8c8a0;
  word-break: break-all;
}

.invite-copy-btn {
  padding: 4px 10px;
  border: 1px solid rgba(127, 239, 189, 0.25);
  border-radius: 5px;
  background: rgba(27, 67, 50, 0.4);
  color: #7fefbd;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.invite-copy-btn:hover { background: rgba(27, 67, 50, 0.6); }

.invite-existing-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.invite-existing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 5px;
  font-size: 11px;
  color: #809070;
}
.invite-existing-row code {
  font-family: monospace;
  color: #b8c8a0;
  font-size: 10px;
}
.invite-existing-row .invite-amount {
  color: #e0dcc8;
  font-weight: 600;
}
.invite-existing-row .invite-status-pending {
  color: #ffd166;
}
.invite-existing-row .invite-status-redeemed {
  color: #7fefbd;
}
.invite-copy-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 3px;
  margin-left: auto;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.invite-copy-link:hover {
  opacity: 1;
}
.invite-copy-all-btn {
  display: block;
  width: 100%;
  padding: 5px 0;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(120, 160, 80, 0.2);
  border-radius: 5px;
  color: #809070;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.invite-copy-all-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #b8c8a0;
  border-color: rgba(120, 160, 80, 0.4);
}

/* --- Profile Modal --- */
.profile-modal { width: 380px; }
.profile-modal .modal-body { padding: 20px 22px 24px; }

.profile-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #607050;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(120, 160, 80, 0.08);
  margin: 22px 0 12px;
}
.profile-section-title:first-child { margin-top: 0; }

.profile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.profile-name {
  font-size: 16px;
  font-weight: 600;
  color: #e0dcc8;
}
.profile-addr {
  font-size: 11px;
  color: #809070;
  font-weight: 400;
}

.profile-set-name {
  position: relative;
  font-size: 11px;
  color: #6a9a8a;
  cursor: pointer;
  background: none;
  border: 1px solid rgba(127, 239, 189, 0.2);
  border-radius: 5px;
  padding: 4px 14px 4px 10px;
  font-family: inherit;
}
.profile-set-name:hover { color: #7fefbd; border-color: rgba(127, 239, 189, 0.4); }
.profile-set-name-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #d44;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

.profile-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.profile-level-text {
  font-size: 13px;
  color: #e8f0d0;
  white-space: nowrap;
}
.profile-level-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.profile-level-fill {
  height: 100%;
  border-radius: 4px;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
}
.profile-stat-key { color: #809070; }
.profile-stat-val { color: #e0dcc8; }

.profile-badge {
  display: inline-block;
  font-size: 9px;
  padding: 3px 9px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid;
}

.profile-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.profile-achievement {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
}
.profile-achievement-name { color: #e0dcc8; }
.profile-achievement-date { color: #607050; font-size: 10px; }

.profile-no-tulips {
  font-style: italic;
  color: #506040;
  font-size: 12px;
  padding: 8px 0;
}

/* --- Leaderboard Modal --- */
.leaderboard-modal { width: 480px; max-height: 80vh; display: flex; flex-direction: column; }
.leaderboard-modal .modal-body { overflow-y: auto; }

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.leaderboard-table th {
  text-transform: uppercase;
  font-size: 10px;
  color: #809070;
  letter-spacing: 0.5px;
  padding: 6px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(120, 160, 80, 0.15);
}
.leaderboard-table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(120, 160, 80, 0.06);
  vertical-align: middle;
}
.leaderboard-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
tr.lb-me td {
  background: rgba(27, 67, 50, 0.25);
}

.lb-rank { width: 36px; text-align: center; }
.lb-player {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e0dcc8;
}
.lb-score { font-family: monospace; text-align: right; color: #b8c8a0; }
.lb-traits { color: #809070; font-size: 11px; }
.lb-location { color: #607050; font-size: 11px; font-family: monospace; }
.lb-medal { font-size: 14px; }
.lb-you { color: #7fefbd; font-size: 10px; margin-left: 4px; }

.leaderboard-footer {
  text-align: center;
  font-size: 10px;
  color: #607050;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(120, 160, 80, 0.1);
}
.leaderboard-loading, .leaderboard-empty {
  text-align: center;
  color: #809070;
  padding: 24px 0;
  font-size: 13px;
}

/* --- Quiz Modal --- */
.quiz-modal {
  width: 420px;
  max-height: 85vh;
  overflow-y: auto;
}
.quiz-start-body {
  text-align: center;
  padding: 20px 12px 8px;
}
.quiz-flavor {
  color: #b8c8a0;
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 4px;
}
.quiz-flavor-prompt {
  font-size: 17px;
  font-style: normal;
  color: #e8f0d0;
  margin-bottom: 20px;
}
.quiz-best-display {
  color: #809070;
  font-size: 13px;
  margin-bottom: 8px;
}
.quiz-cooldown-msg {
  color: #d4a060;
  font-size: 12px;
  margin-top: 8px;
}
.quiz-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quiz-tier-label {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.quiz-tier-label.tier-basic { color: #809070; background: rgba(100,140,80,0.15); }
.quiz-tier-label.tier-common { color: #5bc0de; background: rgba(91,192,222,0.15); }
.quiz-tier-label.tier-advanced { color: #d4a030; background: rgba(212,160,48,0.15); }
.quiz-strike { display: inline-block; margin: 0 2px; font-size: 14px; }
.quiz-strike.used { color: #d44; }
.quiz-strike.unused { color: #1c3a20; }
.quiz-image-container {
  text-align: center;
  margin-bottom: 12px;
}
.quiz-image-container img {
  max-width: 100%;
  max-height: 180px;
  border: 1px solid rgba(120,160,80,0.2);
  border-radius: 6px;
  background: #1e2a1a;
  object-fit: cover;
}
.quiz-question-text {
  color: #e8f0d0;
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-choice {
  background: #1c3a20;
  border: 1px solid rgba(120,160,80,0.2);
  color: #b8c8a0;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.quiz-choice:hover:not(.disabled):not(.hidden-choice) {
  background: #2c4a30;
  border-color: rgba(120,160,80,0.4);
}
.quiz-choice.correct {
  background: rgba(90,158,75,0.25);
  border-color: #5a9e4b;
  color: #7fefbd;
}
.quiz-choice.wrong {
  background: rgba(212,68,68,0.2);
  border-color: #d44;
  color: #ff8888;
}
.quiz-choice.hidden-choice {
  background: #0c2a12;
  border-color: rgba(100,140,80,0.15);
  color: #2c4a30;
  cursor: not-allowed;
  font-family: monospace;
}
.quiz-choice.disabled {
  pointer-events: none;
  opacity: 0.7;
}
.quiz-feedback {
  min-height: 20px;
  margin-top: 8px;
  font-size: 12px;
  color: #809070;
}
.quiz-result-body {
  text-align: center;
  padding: 16px 0;
}
.quiz-result-tier {
  font-size: 15px;
  font-weight: bold;
  color: #d4a030;
  margin-bottom: 12px;
}
.quiz-result-score {
  font-size: 14px;
  color: #e8f0d0;
  margin-bottom: 8px;
  line-height: 1.4;
}
.quiz-result-flavor {
  font-size: 14px;
  font-style: italic;
  color: #b8c8a0;
  margin-bottom: 16px;
}
.quiz-result-best {
  font-size: 13px;
  color: #809070;
  padding-top: 12px;
  border-top: 1px solid rgba(120,160,80,0.15);
}
.quiz-result-footer {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.quiz-alert-box {
  background: rgba(212, 160, 48, 0.1);
  border: 1px solid rgba(212, 160, 48, 0.3);
  border-radius: 6px;
  padding: 14px;
  margin-top: 4px;
  text-align: center;
}
.quiz-alert-box p {
  color: #b8c8a0;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.quiz-alert-box .quiz-alert-note {
  color: #d4a060;
  font-size: 11px;
  font-style: italic;
}
.quiz-alert-box .panel-btn {
  margin-top: 6px;
  min-width: 80px;
}

/* --- Intro Animation --- */
/* ── Intro Overlay ── */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 36px;
  cursor: pointer;
  pointer-events: auto;
  background:
    radial-gradient(ellipse 60% 50% at 50% 60%, rgba(30,55,20,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 100% 100% at 50% 100%, rgba(8,16,8,0.9) 0%, transparent 60%),
    #0e1a0e;
}
.intro-overlay[hidden] { display: none; }

/* Atmospheric particle dust */
.intro-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(180,220,100,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 18%, rgba(160,200,80,0.15) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 70%, rgba(200,230,120,0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 80%, rgba(140,180,70,0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 65%, rgba(160,210,90,0.13) 0%, transparent 100%);
  animation: dustDrift 8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes dustDrift {
  from { transform: translateY(0) translateX(0); }
  to   { transform: translateY(-8px) translateX(4px); }
}

/* Vignette */
.intro-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 40%, rgba(4,10,4,0.75) 100%);
  pointer-events: none;
}

/* ── Paper Letter ── */
.intro-letter {
  position: relative;
  width: min(480px, 90vw);
  opacity: 0;
  transform: translateY(28px) rotate(-1.5deg) scale(0.96);
  filter: blur(3px);
  pointer-events: none;
  transform-origin: 50% 30%;
  z-index: 2;
}
.intro-letter.visible {
  opacity: 1;
  transform: translateY(0) rotate(-0.6deg) scale(1);
  filter: blur(0);
  pointer-events: auto;
  animation: letterReveal 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.intro-letter.dismissing {
  opacity: 0;
  transform: translateY(0) rotate(-0.6deg) scale(0.97);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
@keyframes letterReveal {
  from {
    opacity: 0;
    transform: translateY(28px) rotate(-1.5deg) scale(0.96);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-0.6deg) scale(1);
    filter: blur(0);
  }
}

/* Paper body */
.intro-letter-inner {
  position: relative;
  padding: 52px 52px 44px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(210,195,150,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 80%, rgba(180,160,110,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 60% 50%, rgba(195,180,135,0.08) 0%, transparent 70%),
    linear-gradient(160deg, #d4c9a0 0%, #c8bb90 35%, #cfc39a 60%, #c4b888 100%);
  border-radius: 2px 3px 2px 3px;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.3),
    0 8px 24px rgba(0,0,0,0.5),
    0 24px 60px rgba(0,0,0,0.5),
    0 2px 0 rgba(255,250,220,0.15) inset,
    -1px 0 0 rgba(160,140,80,0.3) inset;
}

/* Top fold crease */
.intro-letter-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent 5%, rgba(140,120,70,0.4) 20%, rgba(140,120,70,0.4) 80%, transparent 95%);
}

/* Faint horizontal ruled lines */
.intro-letter-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 31px,
    rgba(120,100,50,0.07) 32px
  );
  border-radius: inherit;
  pointer-events: none;
}

/* Pressed-flower watermark */
.letter-watermark {
  position: absolute;
  top: 18px; right: 22px;
  opacity: 0.13;
  width: 64px; height: 64px;
}

/* Typography */
.intro-letter-inner p {
  font-family: 'IM Fell English', 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.85;
  color: #2e2410;
  letter-spacing: 0.012em;
  position: relative;
  z-index: 1;
  animation: inkFade 0.7s ease both;
}
.intro-letter-inner p:not(:last-child) {
  margin-bottom: 1.3em;
}
.intro-letter-inner p:nth-child(2) { animation-delay: 0.9s; }
.intro-letter-inner p:nth-child(3) { animation-delay: 1.15s; }
.intro-letter-inner p:nth-child(4) { animation-delay: 1.4s; }
.intro-letter-inner p:nth-child(5) { animation-delay: 1.65s; }
.intro-letter-inner p:nth-child(6) { animation-delay: 1.9s; }
@keyframes inkFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Signature */
.intro-letter-sig {
  font-family: 'Pinyon Script', cursive !important;
  font-style: normal !important;
  font-size: clamp(22px, 3.5vw, 30px) !important;
  color: #3a2c0e !important;
  letter-spacing: 0.02em !important;
  margin-top: 2em !important;
  padding-left: 60px;
  line-height: 1.3 !important;
}

/* Page curl */
.page-curl {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  background: linear-gradient(225deg, #a89460 0%, #b8a470 40%, #c8b880 60%, transparent 60%);
  border-radius: 0 0 3px 0;
  box-shadow: -2px -2px 4px rgba(0,0,0,0.2);
}

/* ── Click to begin ── */
.intro-click-text {
  position: absolute;
  top: 75%;
  left: 50%;
  transform: translate(-50%, -50%);
  font: 28px 'Playfair Display', Georgia, serif;
  color: #e8f0d0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}
.intro-click-text.visible {
  opacity: 1;
  pointer-events: auto;
}


/* --- Skip Pill --- */
#skip-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  color: #b8c8a0;
  font: 13px/1 system-ui, sans-serif;
  pointer-events: none;
}
#skip-pill[hidden] { display: none; }
#skip-pill .skip-bar {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
#skip-pill .skip-fill {
  height: 100%;
  width: 0%;
  background: #b8c8a0;
  border-radius: 2px;
  transition: none;
}

.vision-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vision-overlay[hidden] { display: none; }

.vision-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font: italic 28px 'Playfair Display', Georgia, serif;
  color: #e8dcc8;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.vision-text[hidden] { display: none; }

.vision-bloom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.vision-bloom[hidden] { display: none; }

/* --- Wallet Connect Screen --- */
.wallet-screen {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(10, 20, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wallet-screen[hidden] { display: none; }

/* ── Explore Mode ── */
.explore-start-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  color: #e0dcc8;
  background: rgba(30, 50, 30, 0.85);
  border: 1px solid rgba(120, 160, 80, 0.3);
  border-radius: 10px;
  padding: 10px 22px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s;
}
.explore-start-btn:hover {
  background: rgba(40, 70, 40, 0.9);
  border-color: rgba(120, 160, 80, 0.5);
}
.explore-start-btn[hidden] { display: none; }

/* ── Loading Screen ── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(10, 20, 10, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 1.2s ease;
}
.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
.loading-screen[hidden] { display: none; }

.loading-screen-inner {
  text-align: center;
  max-width: 420px;
  padding: 40px 32px;
}
.loading-title {
  font-size: 28px;
  font-weight: 400;
  color: #e0dcc8;
  margin-bottom: 32px;
  letter-spacing: 0.5px;
  font-family: 'Playfair Display', Georgia, serif;
  animation: loading-breathe 7.4s ease-in-out infinite;
}
@keyframes loading-breathe {
  0%   { opacity: 1; }
  28%  { opacity: 0.2; }
  55%  { opacity: 0.75; }
  72%  { opacity: 0.15; }
  100% { opacity: 1; }
}
.loading-quote {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 17px;
  color: #c8c4a8;
  line-height: 1.6;
  min-height: 52px;
  margin-bottom: 28px;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.loading-quote.visible {
  opacity: 1;
}
.wallet-screen-inner {
  text-align: center;
  max-width: 340px;
  padding: 40px 32px;
}
.wallet-screen-inner h2 {
  font-size: 24px;
  font-weight: 400;
  color: #e0dcc8;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  font-family: 'Playfair Display', Georgia, serif;
}
.wallet-screen-inner > p {
  font-size: 14px;
  color: #809070;
  margin-bottom: 28px;
  line-height: 1.5;
}

.wallet-btn {
  display: block;
  width: 100%;
  padding: 12px 0;
  margin-bottom: 10px;
  border: 1px solid rgba(120, 160, 80, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #b8c8a0;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.wallet-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e0dcc8;
  border-color: rgba(120, 160, 80, 0.4);
}
.wallet-btn:disabled {
  opacity: 0.4;
  cursor: wait;
}
.wallet-btn-subtle {
  border-color: transparent;
  color: #607050;
  font-size: 12px;
  padding: 8px 0;
  margin-top: 4px;
}
.wallet-btn-subtle:hover {
  border-color: rgba(120, 160, 80, 0.2);
  color: #809070;
}

.invite-screen-detail {
  font-size: 12px;
  color: #607050;
  margin-bottom: 20px;
}
.invite-redeem-btn {
  background: rgba(106, 168, 79, 0.15);
  border-color: rgba(106, 168, 79, 0.4);
  color: #8cbf6a;
}
.invite-redeem-btn:hover {
  background: rgba(106, 168, 79, 0.25);
  color: #a0d880;
  border-color: rgba(106, 168, 79, 0.6);
}

.wallet-hint {
  font-size: 11px;
  color: #506040;
  margin-top: 12px;
  line-height: 1.4;
}

/* --- Saved wallets list --- */
.saved-wallets-label {
  font-size: 11px;
  color: #809070;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
#saved-wallets:not(:empty) {
  margin-bottom: 16px;
}
.saved-wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 4px;
  border: 1px solid rgba(120, 160, 80, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s;
}
.saved-wallet-row:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(120, 160, 80, 0.4);
}
.saved-wallet-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.saved-wallet-addr {
  font-size: 13px;
  color: #b8c8a0;
  font-family: monospace;
}
.saved-wallet-date {
  font-size: 10px;
  color: #607050;
}
.saved-wallet-remove {
  background: none;
  border: none;
  color: #607050;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.saved-wallet-remove:hover {
  color: #e07a5f;
  background: rgba(224, 122, 95, 0.1);
}

/* --- Help Wanted popup --- */
.help-wanted-popup {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 60, 30, 0.95);
  border: 1px solid rgba(127, 239, 189, 0.3);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9000;
  animation: helpWantedSlideIn 0.4s ease-out;
}
.help-wanted-text {
  color: #c8e6c9;
  font-size: 13px;
  cursor: pointer;
}
.help-wanted-text:hover {
  color: #7fefbd;
  text-decoration: underline;
}
.help-wanted-close {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.help-wanted-close:hover {
  color: #e07a5f;
}
@keyframes helpWantedSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

