/* Dream Garden Game CSS Stylesheet v20 - Two-tier menu, compact top-right bar, premium glassmorphic design */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Outfit:wght@400;600;700&display=swap');

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Fredoka', 'Outfit', 'Tahoma', sans-serif;
  background-color: #26c6da;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ─────────────────────────────────────
   TOP-RIGHT PLAYER INFO BAR (Item 7)
───────────────────────────────────── */
#player-info-bar {
  position: absolute;
  top: 46px;  /* below the 32px news ticker + 14px margin */
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.pi-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  font-weight: 700;
  font-size: 15px;
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}

.pi-pill:hover { transform: scale(1.05); }

.pi-icon { font-size: 17px; }

.pi-xp-wrap {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.pi-xp-bar-bg {
  width: 80px;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.pi-xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #76ff03, #00e676);
  border-radius: 5px;
  transition: width 0.4s ease;
}

/* Floor number badge — big, beautiful */
#floor-badge-wrap {
  position: absolute;
  top: 46px; /* below news ticker */
  left: 16px;
  z-index: 20;
}

#floor-number-display {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 36px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,100,200,0.5), 0 0 30px rgba(100,200,255,0.4);
  letter-spacing: 2px;
  padding: 6px 20px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Weather & sound — top-right of bar */
.pi-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.9);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s, background 0.2s;
}

.pi-icon-btn:hover { transform: scale(1.15); background: #ffffff; }

/* ─────────────────────────────────────
   BEANSTALK FLOOR NAVIGATOR (LEFT SIDE)
───────────────────────────────────── */
#floor-navigator {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.nav-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: linear-gradient(135deg, #fbc02d, #f57f17);
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
}

.nav-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #fff176, #fbc02d);
}

/* ─────────────────────────────────────
   TWO-TIER BOTTOM MENU (Item 4)
───────────────────────────────────── */
#bottom-menu {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 15;
  pointer-events: auto;
}

/* Tier 2 – Sub-panel (slides up from behind tier 1) */
#menu-tier2 {
  width: 100%;
  max-width: 780px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 10px 18px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  overflow: hidden;
}

#menu-tier2.open {
  transform: translateY(0);
}

.tier2-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 64px;
}

.tier2-item:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-3px);
}

.tier2-item.active {
  background: rgba(245,158,11,0.3);
  border-color: #f59e0b;
}

.tier2-icon { font-size: 22px; }
.tier2-label { font-size: 10px; font-weight: 700; color: #cbd5e1; white-space: nowrap; }

/* Tier 1 – Main toolbar */
#menu-tier1 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 14px;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.18);
  max-width: 820px;
  width: 100%;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border-radius: 20px;
  border: 3px solid rgba(255,255,255,0.85);
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.tool-btn .tool-icon { font-size: 26px; }
.tool-btn .tool-label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  margin-top: 2px;
  white-space: nowrap;
}

.tool-btn:hover { transform: translateY(-5px) scale(1.06); }

.tool-btn.active {
  border-color: #f59e0b;
  background: linear-gradient(145deg, #fef3c7, #fde68a);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.55);
  transform: translateY(-7px) scale(1.12);
}

/* Shop button */
.tool-btn.shop-btn {
  background: linear-gradient(145deg, #ec4899, #d946ef);
  border-color: rgba(255,255,255,0.7);
}
.tool-btn.shop-btn .tool-label { color: white; }
.tool-btn.shop-btn .tool-icon { color: white; }

/* Inventory button */
.tool-btn.inventory-btn {
  background: linear-gradient(145deg, #10b981, #059669);
  border-color: rgba(255,255,255,0.7);
}
.tool-btn.inventory-btn .tool-label { color: white; }

/* Tier-1 section separators */
.tier1-sep {
  width: 2px;
  height: 44px;
  background: rgba(0,0,0,0.1);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────
   WOOD SHELF SHOP MODAL
───────────────────────────────────── */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.wood-shop-modal {
  position: relative;
  width: 92%;
  max-width: 900px;
  height: 84vh;
  max-height: 620px;
  background: linear-gradient(180deg, #5c3a21 0%, #3e2413 100%);
  border: 8px solid #a67c52;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 4px solid #8d5b34;
  gap: 12px;
}

.shop-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  background: #8d5b34;
  color: #fde68a;
  border: 2px solid #a67c52;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border-color: #fef08a;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.shop-search-box input {
  padding: 8px 14px;
  border-radius: 20px;
  border: 2px solid #a67c52;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  width: 180px;
}

.shop-search-box input::placeholder { color: #94a3b8; }

.shop-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 3px solid white;
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.shop-close-btn:hover { transform: scale(1.1) rotate(90deg); }

.shop-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: radial-gradient(circle at center, #4a2c16 0%, #2e190a 100%);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.shelf-item {
  position: relative;
  background: linear-gradient(180deg, #3d2314 0%, #291509 100%);
  border: 3px solid #8d5b34;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.shelf-item:hover { transform: translateY(-4px); border-color: #f59e0b; }

.item-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 0;
  border: 3px solid #f59e0b;
  background: radial-gradient(circle, #ffe082 0%, #ffb300 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  overflow: hidden;
}

.fert-preview { font-size: 28px; }

.item-name { font-size: 15px; font-weight: 700; color: #ffffff; margin-bottom: 4px; }
.item-desc { font-size: 11px; color: #cbd5e1; margin-bottom: 8px; min-height: 28px; }

.item-cost { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; justify-content: center; }

.gold-badge {
  background: #f59e0b; color: white; padding: 3px 7px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
}

.gem-badge {
  background: #ec4899; color: white; padding: 3px 7px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
}

.bug-badge {
  background: #84cc16; color: white; padding: 3px 7px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
}

.buy-btn {
  width: 100%;
  padding: 7px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: 2px solid #86efac;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.15s ease;
}

.buy-btn:hover { background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%); transform: scale(1.03); }
.buy-btn.locked { background: #64748b; border-color: #94a3b8; cursor: not-allowed; }

/* Custom Scrollbar */
.shop-body::-webkit-scrollbar { width: 10px; }
.shop-body::-webkit-scrollbar-track { background: #2e190a; }
.shop-body::-webkit-scrollbar-thumb { background: #8d5b34; border-radius: 5px; }

/* ─────────────────────────────────────
   PLACEMENT MODE HUD
───────────────────────────────────── */
#placement-hud {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#placement-hud.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.hud-icon { animation: pulse-glow 1.5s infinite ease-in-out; }

.hud-cancel {
  font-size: 11px;
  opacity: 0.65;
  font-weight: 400;
  margin-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 12px;
}

/* ─────────────────────────────────────
   CONTEXT ACTION POPUP (for pots & decors)
───────────────────────────────────── */
#context-popup {
  position: absolute;
  z-index: 200;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  pointer-events: auto;
  transform-origin: top center;
  animation: popupIn 0.2s cubic-bezier(0.16,1,0.3,1) forwards;
}

#context-popup.hidden { display: none; }

.ctx-title {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.ctx-btn {
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 2px solid transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.ctx-btn:hover { transform: translateX(4px); }

.ctx-btn.store { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.5); color: #fca5a5; }
.ctx-btn.store:hover { background: rgba(239,68,68,0.35); }
.ctx-btn.upgrade { background: rgba(245,158,11,0.2); border-color: rgba(245,158,11,0.5); color: #fde68a; }
.ctx-btn.upgrade:hover { background: rgba(245,158,11,0.35); }
.ctx-btn.plant { background: rgba(34,197,94,0.2); border-color: rgba(34,197,94,0.5); color: #86efac; }
.ctx-btn.plant:hover { background: rgba(34,197,94,0.35); }
.ctx-btn.cancel { background: rgba(100,116,139,0.2); border-color: rgba(100,116,139,0.4); color: #94a3b8; }
.ctx-btn.sell { background: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.5); color: #a7f3d0; }
.ctx-btn.sell:hover { background: rgba(16,185,129,0.35); }

@keyframes popupIn {
  from { opacity: 0; transform: scale(0.85) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ─────────────────────────────────────
   FLOOR 0 HOUSE UI (Item 12)
───────────────────────────────────── */
#house-view {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 70px;
  transition: opacity 0.4s ease;
}

#house-view.hidden { display: none; }

#house-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(139,92,246,0.8);
  margin-bottom: 20px;
}

#house-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  padding: 20px;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  max-width: 680px;
  width: 90%;
}

.house-slot {
  width: 90px;
  height: 90px;
  background: rgba(255,255,255,0.06);
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 32px;
  position: relative;
}

.house-slot:hover { background: rgba(255,255,255,0.14); border-color: #a78bfa; transform: scale(1.05); }
.house-slot.occupied { border-style: solid; border-color: rgba(167,139,250,0.5); background: rgba(139,92,246,0.12); }
.house-slot.occupied:hover .slot-remove { opacity: 1; }

.slot-remove {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  background: #ef4444;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
  border: 2px solid white;
}

#house-back-btn {
  margin-top: 20px;
  padding: 10px 32px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  color: white;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

#house-back-btn:hover { transform: scale(1.06); }

/* ─────────────────────────────────────
   PET MONKEY UI (Item 9)
───────────────────────────────────── */
#pet-status-bar {
  position: absolute;
  bottom: 140px;
  right: 16px;
  background: rgba(15,23,42,0.88);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 10px 16px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

#pet-status-bar.hidden { display: none; }

.pet-name {
  font-size: 14px;
  font-weight: 700;
  color: #fde68a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pet-energy-bar-bg {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.pet-energy-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.pet-feed-btn {
  padding: 6px;
  background: rgba(245,158,11,0.3);
  border: 1.5px solid rgba(245,158,11,0.6);
  border-radius: 10px;
  color: #fde68a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.pet-feed-btn:hover { background: rgba(245,158,11,0.5); }

.pet-sell-btn {
  padding: 6px;
  background: rgba(239,68,68,0.25);
  border: 1.5px solid rgba(239,68,68,0.5);
  border-radius: 10px;
  color: #fca5a5;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.pet-sell-btn:hover { background: rgba(239,68,68,0.45); }

/* ─────────────────────────────────────
   SINGLE-INSTANCE WARNING MODAL (Item 11)
───────────────────────────────────── */
#single-instance-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

#single-instance-modal.hidden { display: none; }

.si-box {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 3px solid #ef4444;
  border-radius: 24px;
  padding: 40px 50px;
  text-align: center;
  box-shadow: 0 0 60px rgba(239,68,68,0.4);
  max-width: 420px;
}

.si-icon { font-size: 56px; margin-bottom: 16px; }

.si-title {
  font-size: 24px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 10px;
}

.si-desc { font-size: 15px; color: #94a3b8; margin-bottom: 24px; line-height: 1.6; }

.si-countdown {
  font-size: 48px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 10px;
}

/* ─────────────────────────────────────
   NEWS TICKER (Item 7)
───────────────────────────────────── */
#news-ticker {
  position: absolute;
  top: -40px; /* Hidden by default */
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(90deg, rgba(15,23,42,0.95) 0%, rgba(30,41,59,0.95) 50%, rgba(15,23,42,0.95) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #fbbf24;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  overflow: hidden;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#news-ticker.show {
  top: 0;
}

#news-ticker-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #fde68a;
  text-align: center;
}

/* Blinking effect when it appears */
.ticker-blink {
  animation: ticker-flash 0.8s ease-in-out infinite alternate;
}

@keyframes ticker-flash {
  0% { opacity: 0.6; text-shadow: 0 0 4px rgba(251,191,36,0.3); }
  100% { opacity: 1; text-shadow: 0 0 12px rgba(251,191,36,0.8); }
}

.ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #fde68a;
}

.ticker-badge .ticker-icon { font-size: 15px; }

.ticker-sep {
  color: rgba(255,255,255,0.25);
  margin: 0 12px;
  font-size: 16px;
}

/* ─────────────────────────────────────
   ANIMATIONS
───────────────────────────────────── */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes monkey-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes sparkle-in {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  60% { opacity: 1; transform: scale(1.2) rotate(180deg); }
  100% { opacity: 1; transform: scale(1) rotate(360deg); }
}

/* ─────────────────────────────────────
   RESPONSIVE — Tablet (≤ 900px)
───────────────────────────────────── */
@media (max-width: 900px) {
  #menu-tier1 {
    gap: 7px;
    padding: 8px 14px 12px;
  }

  .tool-btn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .tool-btn .tool-icon { font-size: 22px; }
  .tool-btn .tool-label { font-size: 9px; }

  .wood-shop-modal {
    width: 96%;
    max-height: 72vh;
  }

  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
  }

  #player-info-bar { gap: 7px; }

  .pi-pill {
    padding: 5px 10px;
    font-size: 13px;
  }
}

/* ─────────────────────────────────────
   RESPONSIVE — Mobile (≤ 600px)
───────────────────────────────────── */
@media (max-width: 600px) {
  #menu-tier1 {
    gap: 5px;
    padding: 6px 10px 10px;
    max-width: 100vw;
    overflow-x: auto;
    justify-content: flex-start;
    border-radius: 20px 20px 0 0;
  }

  #menu-tier2 {
    max-width: 100vw;
    padding: 8px 10px 4px;
    gap: 6px;
  }

  .tool-btn {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    flex-shrink: 0;
  }

  .tool-btn .tool-icon { font-size: 20px; }
  .tool-btn .tool-label { font-size: 8px; }

  .tier2-item {
    min-width: 52px;
    padding: 5px 8px;
  }

  .tier2-icon { font-size: 18px; }
  .tier2-label { font-size: 9px; }

  /* Top bar compact */
  #player-info-bar {
    top: 8px;
    right: 8px;
    gap: 5px;
  }

  .pi-pill {
    padding: 4px 8px;
    font-size: 12px;
    gap: 4px;
  }

  .pi-icon { font-size: 14px; }

  .pi-xp-wrap { padding: 4px 8px; }
  .pi-xp-bar-bg { width: 56px; height: 8px; }

  .pi-icon-btn { width: 34px; height: 34px; font-size: 17px; }

  /* Floor badge */
  #floor-number-display {
    font-size: 26px;
    padding: 4px 14px;
  }

  /* Floor navigator */
  #floor-navigator { gap: 8px; }
  .nav-btn { width: 44px; height: 44px; font-size: 20px; }

  /* Shop modal */
  .wood-shop-modal {
    width: 100%;
    height: 88vh;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .shop-header { padding: 10px 12px; gap: 8px; }

  .shop-tabs { gap: 6px; }
  .tab-btn { padding: 6px 10px; font-size: 12px; }

  .shop-search-box input { width: 120px; font-size: 12px; padding: 6px 10px; }

  .shop-body { padding: 12px; }

  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .shelf-item { padding: 10px 8px; }
  .item-name { font-size: 13px; }
  .item-desc { font-size: 10px; min-height: 22px; }
  .buy-btn { padding: 6px; font-size: 12px; }

  /* Context popup */
  #context-popup { min-width: 165px; padding: 12px 12px; }

  /* Pet bar */
  #pet-status-bar { right: 8px; bottom: 115px; min-width: 140px; padding: 8px 12px; }

  /* Placement HUD */
  #placement-hud { font-size: 12px; padding: 8px 16px; top: 70px; }
}

/* ─────────────────────────────────────
   RESPONSIVE — Small Mobile (≤ 380px)
───────────────────────────────────── */
@media (max-width: 380px) {
  .tool-btn { width: 44px; height: 44px; border-radius: 12px; }
  .tool-btn .tool-icon { font-size: 18px; }
  .tool-btn .tool-label { display: none; }

  .pi-pill { padding: 3px 6px; font-size: 11px; }

  #floor-number-display { font-size: 22px; padding: 3px 10px; }

  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* ─────────────────────────────────────
   LOADING SCREEN (Item 1)
───────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease, visibility 0.5s;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 320px;
  width: 90%;
  text-align: center;
}

.loading-spinner {
  font-size: 56px;
  animation: spinner-rotate 2s linear infinite;
  text-shadow: 0 0 20px rgba(244,143,177,0.6);
}

@keyframes spinner-rotate {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(0.9); }
}

.loading-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1.5px;
}

.loading-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 5px;
  transition: width 0.3s ease;
}

.loading-status {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

/* ─────────────────────────────────────
   UPGRADE REQUIREMENTS (Item 3)
───────────────────────────────────── */
.ctx-reqs {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.ctx-reqs.hidden {
  display: none;
}

.req-title {
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 3px;
  margin-bottom: 2px;
}

.req-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.req-label {
  color: #e2e8f0;
}

.req-value {
  font-weight: 700;
}

.req-value.unmet {
  color: #f44336;
}

/* ─────────────────────────────────────
   LOGIN OVERLAY (Item 3)
───────────────────────────────────── */
#login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1b263b 0%, #0d1b2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: 'Fredoka', 'Outfit', sans-serif;
}

#login-overlay.hidden {
  display: none;
}

#login-overlay .login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 380px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 36px 40px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-logo {
  font-size: 38px;
  margin-bottom: 8px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 15px rgba(244,143,177,0.7);
}

#login-username-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  outline: none;
  transition: all 0.25s;
}

#login-username-input:focus {
  border-color: #818cf8;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 15px rgba(129, 140, 248, 0.45);
}

#login-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(5,150,105,0.4);
  transition: all 0.2s;
  outline: none;
}

#login-submit-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(5,150,105,0.6);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.login-footer {
  font-size: 12px;
  color: #64748b;
  margin-top: 16px;
}

/* ─────────────────────────────────────
   VISITOR BANNER (Item 3)
───────────────────────────────────── */
#visitor-banner {
  position: absolute;
  top: 44px; /* below news ticker */
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1.5px solid #38bdf8;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
}

#visitor-banner.hidden {
  display: none;
}

.visitor-eye {
  animation: pulse-glow 1.5s infinite;
}

.go-home-btn {
  padding: 5px 12px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border: 1.5px solid white;
  border-radius: 12px;
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.15s;
}

.go-home-btn:hover {
  transform: scale(1.05);
}

.share-btn {
  padding: 5px 12px;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  border: 1.5px solid white;
  border-radius: 12px;
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.15s;
}

.share-btn:hover {
  transform: scale(1.05);
}

.add-friend-btn {
  padding: 5px 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1.5px solid white;
  border-radius: 12px;
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.15s;
}

.add-friend-btn:hover {
  transform: scale(1.05);
}

.hidden {
  display: none !important;
}

