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

:root {
  --cream: #FFF8F0;
  --blush: #F9C5D1;
  --rose: #E8748A;
  --deep: #C94F6A;
  --teal: #4ECDC4;
  --teal-dark: #2BA8A0;
  --gold: #FFD166;
  --gold-dark: #F5A623;
  --brown: #8B5E3C;
  --text: #3A2A2F;
  --shadow: rgba(58,42,47,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Hide real cursor — Julie is the cursor now */
body { cursor: none; }
header, header * { cursor: default; }
header button     { cursor: pointer; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ──────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--rose) 0%, var(--deep) 100%);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 15px var(--shadow);
  flex-shrink: 0;
  gap: 12px;
}
header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem;
  color: white;
  text-shadow: 2px 2px 0 var(--deep);
  letter-spacing: 1px;
  white-space: nowrap;
}
.stat-chips { display: flex; gap: 10px; }
.chip {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  padding: 4px 14px;
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex; align-items: center; gap: 5px;
  min-width: 110px;
  justify-content: center;
}
.chip .icon { font-size: 1rem; }

/* Header action buttons */
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.action-btn {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  padding: 4px 12px;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s;
}
.action-btn:hover { background: rgba(255,255,255,0.35); }
.action-btn.danger { border-color: rgba(255,150,150,0.5); }
.action-btn.danger:hover { background: rgba(255,80,80,0.3); }

/* ── MAIN LAYOUT ──────────────────────────────── */
.main { display: flex; flex: 1; overflow: hidden; }

/* ── PLAY FIELD ──────────────────────────────── */
#field {
  flex: 1;
  position: relative;
  background:
    radial-gradient(ellipse at 30% 70%, #d4f5d0 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, #d0eef5 0%, transparent 50%),
    linear-gradient(180deg, #e8f8e4 0%, #c8edca 100%);
  overflow: hidden;
  cursor: default;
}
/* grass texture */
#field::after {
  content:'';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(120,200,100,0.07) 40px, rgba(120,200,100,0.07) 41px),
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(120,200,100,0.07) 40px, rgba(120,200,100,0.07) 41px);
  pointer-events: none;
}

/* Tutorial hint */
.field-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.92);
  border: 2px solid var(--blush);
  border-radius: 16px;
  padding: 14px 22px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  box-shadow: 0 4px 20px var(--shadow);
  pointer-events: none;
  z-index: 30;
  line-height: 1.6;
}
.field-hint small { color: #888; font-size: 0.8rem; }

/* ── BONES ──────────────────────────────────── */
.bone {
  position: absolute;
  font-size: 1.6rem;
  cursor: pointer;
  user-select: none;
  animation: bonePop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.2));
  transition: transform 0.1s;
  z-index: 5;
}
.bone:hover { transform: scale(1.3) rotate(10deg); }
.bone.collected {
  animation: boneCollect 0.4s ease-out forwards;
  pointer-events: none;
}
@keyframes bonePop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}
@keyframes boneCollect {
  to { transform: scale(0) translateY(-30px); opacity: 0; }
}

/* ── POODLES ─────────────────────────────────── */
.poodle-sprite {
  position: absolute;
  font-size: 2rem;
  transition: left 0.6s linear, top 0.6s linear;
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.15));
  z-index: 4;
  pointer-events: none;
}
.poodle-sprite.hunting {
  animation: poodleWag 0.4s ease-in-out infinite alternate;
}
.poodle-sprite.spawning {
  animation: poodleSpawn 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes poodleSpawn {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  70%  { transform: scale(1.4) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes poodleWag {
  from { transform: rotate(-5deg) scaleX(1); }
  to   { transform: rotate(5deg) scaleX(-1); }
}

/* ── JULIE (cursor poodle) ───────────────────── */
#julie {
  position: fixed;
  pointer-events: none;
  font-size: 2rem;        /* JS updates this as treats are bought */
  transform: translate(-50%, -50%);
  z-index: 9999;
  line-height: 1;
  user-select: none;
  transition: font-size 0.4s cubic-bezier(0.34,1.56,0.64,1);
  filter: drop-shadow(1px 2px 4px rgba(0,0,0,0.3));
}

/* ── GOLDEN BONES ────────────────────────────── */
.bone.golden-bone {
  animation: bonePop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards,
             goldenPulse 0.9s 0.3s ease-in-out infinite alternate;
}
@keyframes goldenPulse {
  from { transform: scale(1);             filter: drop-shadow(0 0 5px #FFD700); }
  to   { transform: scale(1.3) rotate(8deg); filter: drop-shadow(0 0 18px #FFD700); }
}

/* ── TREAT ITEMS (special spawns on field) ───── */
.bone.treat-item {
  filter: drop-shadow(0 0 4px rgba(255,180,60,0.5));
  font-size: 1.8rem;
}
.bone.treat-item:hover {
  transform: scale(1.4) rotate(10deg);
  filter: drop-shadow(0 0 8px rgba(255,180,60,0.7));
}

/* ── POWERUP ITEM on field ───────────────────── */
.bone.powerup-item {
  font-size: 2.2rem;
  animation: bonePop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards,
             powerupPulse 0.7s ease-in-out infinite alternate;
  z-index: 8;
}
@keyframes powerupPulse {
  from { transform: scale(1) rotate(0deg);    filter: drop-shadow(0 0 8px #00E676); }
  to   { transform: scale(1.5) rotate(20deg); filter: drop-shadow(0 0 22px #00E676) drop-shadow(0 0 8px #fff); }
}

/* ── WIZARD RAY ──────────────────────────────── */
.wizard-ray {
  position: absolute;
  height: 6px;
  background: linear-gradient(to right,
    rgba(100, 180, 255, 0.9),
    rgba(30, 100, 255, 1),
    rgba(160, 80, 255, 1),
    rgba(255, 255, 255, 0.8));
  border-radius: 3px;
  box-shadow: 0 0 8px #4FC3F7, 0 0 20px #1565C0, 0 0 4px #fff;
  pointer-events: none;
  z-index: 15;
}

/* ── POWERED-UP JULIE ────────────────────────── */
#julie.powered-up {
  animation: juliePowered 0.6s ease-in-out infinite alternate !important;
}
@keyframes juliePowered {
  from { filter: drop-shadow(0 0 10px #FFD700) drop-shadow(0 0 5px #FF8C00); }
  to   { filter: drop-shadow(0 0 25px #FFD700) drop-shadow(0 0 15px #FF4500); }
}

/* ── FLOATING TEXT ───────────────────────────── */
.float-text {
  position: absolute;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: var(--deep);
  pointer-events: none;
  z-index: 20;
  animation: floatUp 0.9s ease-out forwards;
  white-space: nowrap;
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: 300px;
  background: white;
  border-left: 3px solid var(--blush);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.tab-bar { display: flex; border-bottom: 3px solid var(--blush); }
.tab {
  flex: 1;
  padding: 10px 6px;
  background: var(--cream);
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  position: relative;
}
.tab.active {
  background: white;
  color: var(--rose);
  border-bottom: 3px solid white;
  margin-bottom: -3px;
}
.upgrade-badge {
  display: inline-block;
  background: var(--rose);
  color: white;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 800;
  margin-left: 3px;
  vertical-align: middle;
  line-height: 1.4;
}

.tab-content { flex: 1; overflow-y: auto; padding: 12px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── SECTION TITLES ──────────────────────────── */
.section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: var(--rose);
  margin: 10px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px dashed var(--blush);
  display: flex;
  align-items: center;
  gap: 6px;
}
.money-section-title { color: var(--teal-dark); border-bottom-color: var(--teal); }
.cost-tag {
  font-family: 'Nunito', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  background: #f0e8e8;
  color: #999;
  border-radius: 8px;
  padding: 1px 6px;
  margin-left: auto;
}
.money-tag { background: #e0f5f4; color: var(--teal-dark); }

/* ── SHOP CARDS ──────────────────────────────── */
.shop-card {
  background: var(--cream);
  border: 2px solid var(--blush);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.shop-card:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow);
  border-color: var(--rose);
}
.shop-card.disabled { opacity: 0.5; cursor: not-allowed; }
.money-card:hover:not(.disabled) { border-color: var(--teal); }

.shop-card .card-icon { font-size: 1.8rem; flex-shrink: 0; }
.shop-card .card-info { flex: 1; min-width: 0; }
.shop-card .card-name  { font-weight: 800; font-size: 0.85rem; color: var(--text); }
.shop-card .card-desc  { font-size: 0.72rem; color: #888; margin-top: 1px; }
.shop-card .card-cost  {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  color: var(--brown);
  text-align: right;
  flex-shrink: 0;
}
.shop-card .money-cost { color: var(--teal-dark); }
.shop-card .card-rate {
  font-size: 0.68rem;
  color: var(--teal-dark);
  font-weight: 700;
  margin-top: 2px;
}
.shop-card .card-owned {
  position: absolute;
  top: 6px; right: 8px;
  background: var(--rose);
  color: white;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 800;
}

/* Card shake on failed purchase */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}
.shop-card.shake { animation: shake 0.3s ease-in-out; }

/* ── UPGRADE CARDS ───────────────────────────── */
.upgrade-card {
  background: linear-gradient(135deg, #fffbe8, #fff3c4);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.upgrade-card:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,200,0,0.3);
}
.upgrade-card.disabled { opacity: 0.5; cursor: not-allowed; }
.upgrade-card .card-icon { font-size: 1.5rem; flex-shrink: 0; }
.upgrade-card .card-info { flex: 1; }
.upgrade-card .card-name { font-weight: 800; font-size: 0.82rem; }
.upgrade-card .card-desc { font-size: 0.7rem; color: #888; }
.upgrade-card .card-cost { font-family: 'Fredoka One', cursive; font-size: 0.9rem; color: var(--gold-dark); flex-shrink: 0; }

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: #bbb;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state p { font-weight: 700; font-size: 0.85rem; color: #aaa; }
.empty-state small { font-size: 0.75rem; }

/* ── STATS PANEL ─────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #f0e8e8;
  font-size: 0.82rem;
}
.stat-row .label { color: #888; }
.stat-row .value { font-weight: 800; color: var(--rose); }

/* ── PRESTIGE BUTTON ──────────────────────────── */
#prestige-btn {
  margin: 15px;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: 14px;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245,166,35,0.4);
  transition: transform 0.15s;
  display: none;
}
#prestige-btn:hover { transform: scale(1.03); }

/* ── SAVE INDICATOR ──────────────────────────── */
#save-indicator {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--teal);
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
  pointer-events: none;
}
#save-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── HELPER CARDS ────────────────────────────── */
.helper-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--cream);
  border: 2px solid var(--blush);
  border-radius: 12px;
  margin-bottom: 6px;
}
.helper-card .helper-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}
.helper-card .helper-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
}
.helper-card .helper-status {
  font-size: 0.7rem;
  color: #888;
  margin-top: 1px;
}

/* ── SCROLLBAR ───────────────────────────────── */
.tab-content::-webkit-scrollbar { width: 5px; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.tab-content::-webkit-scrollbar-thumb { background: var(--blush); border-radius: 10px; }
