/* ============================================================
   TODO GARDEN — sunny, joyful, greenery theme
   ============================================================ */
:root{
  --sky-top:#8ed6ff;
  --sky-bot:#d6f7c4;
  --grass:#7ec850;
  --grass-dk:#5fae3a;
  --sun:#ffd23f;
  --sun-dk:#ffb700;
  --leaf:#4caf3d;
  --leaf-dk:#3a8a2c;
  --soil:#a9764a;
  --cream:#fffdf2;
  --ink:#3b4a2e;
  --ink-soft:#6c7d57;
  --coin:#ffcf3f;
  --rare:#7c5cff;
  --extinct:#ff5d8f;
  --shadow:0 8px 24px rgba(60,80,40,.22);
  --radius:18px;
  --font:'Nunito','Trebuchet MS','Segoe UI',Verdana,system-ui,sans-serif;
}

*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;}
body{
  font-family:var(--font);
  color:var(--ink);
  background:linear-gradient(180deg,var(--sky-top) 0%,#bfeeff 35%,var(--sky-bot) 100%);
  display:flex;flex-direction:column;
  overflow:hidden;
  user-select:none;
}

/* ---------------- Top bar ---------------- */
#topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 20px;
  background:rgba(255,255,255,.55);
  backdrop-filter:blur(8px);
  border-bottom:3px solid rgba(255,255,255,.6);
  box-shadow:0 4px 18px rgba(80,120,40,.15);
  z-index:20;
}
.brand{display:flex;align-items:center;gap:10px;}
.brand-logo{font-size:30px;animation:bob 3s ease-in-out infinite;}
#topbar h1{
  font-size:24px;font-weight:800;letter-spacing:.5px;
  color:#2f6b1f;text-shadow:0 2px 0 rgba(255,255,255,.7);
}
.topbar-right{display:flex;align-items:center;gap:10px;}

.coin-pill{
  display:flex;align-items:center;gap:6px;
  background:linear-gradient(180deg,#fff6cf,#ffe07a);
  border:2px solid var(--sun-dk);
  border-radius:999px;padding:6px 16px;
  font-weight:800;font-size:18px;color:#8a5a00;
  box-shadow:0 3px 0 var(--sun-dk),0 6px 12px rgba(200,140,0,.25);
}
.coin-ico{font-size:18px;}
#coin-count{min-width:14px;text-align:right;display:inline-block;transition:transform .15s;}
.coin-pill.bump #coin-count{transform:scale(1.4);}

/* ---------------- Buttons ---------------- */
.btn-timer{font-size:11px;font-weight:600;opacity:.8;}
.btn{
  font-family:var(--font);font-weight:700;font-size:15px;
  border:none;border-radius:14px;padding:9px 16px;cursor:pointer;
  transition:transform .08s ease,filter .15s,box-shadow .12s;
  color:#fff;
}
.btn:active{transform:translateY(2px) scale(.98);}
.btn-shop{background:linear-gradient(180deg,#ffb24d,#ff8a1e);box-shadow:0 4px 0 #d96e00;}
.btn-cat{background:linear-gradient(180deg,#7cc0ff,#3f93f5);box-shadow:0 4px 0 #2a6fc7;}
.btn-shop:active,.btn-cat:active{box-shadow:0 1px 0 #b85d00;}
.btn-primary{background:linear-gradient(180deg,#7ed957,#4caf3d);box-shadow:0 4px 0 #3a8a2c;}
.btn-primary:active{box-shadow:0 1px 0 #3a8a2c;}
.btn-ghost{background:rgba(0,0,0,.06);color:var(--ink);box-shadow:0 3px 0 rgba(0,0,0,.12);}
.btn-danger{background:linear-gradient(180deg,#ff8a8a,#ef5350);box-shadow:0 4px 0 #c1372f;color:#fff;}
.btn-soft{background:linear-gradient(180deg,#efe4cc,#dcc9a8);box-shadow:0 3px 0 #b9a482;color:var(--ink);}
.btn-soft:active{box-shadow:0 1px 0 #b9a482;}
.btn:disabled{filter:grayscale(.6) opacity(.6);cursor:not-allowed;box-shadow:none;}
.btn-block{width:100%;}

/* ---------------- Garden canvas ---------------- */
#garden-wrap{
  flex:1;position:relative;overflow:hidden;min-height:0;
}
#garden{display:block;width:100%;touch-action:none;}
.empty-hint{
  position:absolute;top:24px;left:50%;transform:translateX(-50%);
  background:rgba(255,255,255,.85);color:#3f6b22;font-weight:700;
  padding:10px 20px;border-radius:999px;box-shadow:var(--shadow);
  pointer-events:none;transition:opacity .4s;font-size:15px;
}
.empty-hint.gone{opacity:0;}

/* ---------------- Inventory tray ---------------- */
#tray{
  background:rgba(255,255,255,.6);
  backdrop-filter:blur(8px);
  border-top:3px solid rgba(255,255,255,.7);
  padding:10px 18px 14px;
  box-shadow:0 -4px 18px rgba(80,120,40,.12);
  z-index:15;
}
.tray-label{font-weight:800;color:#3f6b22;font-size:14px;margin-bottom:8px;}
.tray-tip{font-weight:600;color:var(--ink-soft);font-size:12px;margin-left:6px;}
.inventory{display:flex;gap:12px;flex-wrap:wrap;min-height:62px;align-items:center;}
.seed-chip{
  position:relative;width:62px;height:62px;border-radius:16px;
  background:linear-gradient(180deg,#fffdf2,#f1ead2);
  border:2px solid rgba(0,0,0,.08);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  cursor:grab;touch-action:none;
  box-shadow:0 4px 0 rgba(0,0,0,.1),var(--shadow);
  transition:transform .1s;
}
.seed-chip:active{cursor:grabbing;}
.seed-chip.dragging{opacity:.35;}
.seed-chip:hover{transform:translateY(-3px);}
.seed-chip .seed-emoji{font-size:26px;line-height:1;}
.seed-chip .seed-name{font-size:9px;font-weight:700;color:var(--ink-soft);margin-top:2px;}
.seed-chip .seed-qty{
  position:absolute;top:-6px;right:-6px;
  background:var(--leaf);color:#fff;font-size:11px;font-weight:800;
  min-width:20px;height:20px;border-radius:999px;display:flex;align-items:center;justify-content:center;
  border:2px solid #fff;box-shadow:0 2px 4px rgba(0,0,0,.2);padding:0 4px;
}
.inv-empty{color:var(--ink-soft);font-weight:600;font-style:italic;font-size:14px;}

/* ---------------- Drag ghost ---------------- */
.drag-ghost{
  position:fixed;z-index:200;pointer-events:none;
  width:54px;height:54px;border-radius:14px;
  background:radial-gradient(circle at 40% 35%,#fffdf2,#e9dfbf);
  display:flex;align-items:center;justify-content:center;font-size:30px;
  box-shadow:0 10px 22px rgba(0,0,0,.28);transform:translate(-50%,-50%) scale(1.1) rotate(-8deg);
}

/* ---------------- Overlays / panels ---------------- */
.overlay{
  position:fixed;inset:0;z-index:120;
  background:rgba(40,60,30,.4);backdrop-filter:blur(3px);
  display:flex;align-items:center;justify-content:center;
  animation:fade .2s ease;
}
.panel{
  position:relative;background:var(--cream);border-radius:24px;
  padding:26px 28px;box-shadow:var(--shadow);
  max-width:92vw;animation:pop .25s cubic-bezier(.2,1.5,.4,1);
  border:3px solid #fff;
}
.panel h2{color:#2f6b1f;font-size:22px;margin-bottom:6px;}
.muted{color:var(--ink-soft);font-size:14px;margin-bottom:14px;}
.panel-close{
  position:absolute;top:12px;right:14px;border:none;background:rgba(0,0,0,.07);
  width:32px;height:32px;border-radius:50%;font-weight:800;cursor:pointer;color:var(--ink);
  font-size:14px;transition:background .15s;
}
.panel-close:hover{background:rgba(0,0,0,.15);}
.panel-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px;}

.task-panel{width:380px;}
.task-input{
  width:100%;font-family:var(--font);font-size:16px;padding:13px 15px;
  border:2px solid #d8d0b0;border-radius:14px;background:#fff;color:var(--ink);
  outline:none;transition:border .15s,box-shadow .15s;
}
.task-input:focus{border-color:var(--leaf);box-shadow:0 0 0 4px rgba(124,217,87,.25);}

/* ---------------- Shop ---------------- */
.shop-panel{width:520px;}
.shop-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px;}
.shop-header h2{margin:0;}
.shop-header .coin-pill{font-size:15px;padding:4px 12px;}
.shop-header .coin-ico{font-size:15px;}
.shop-items{display:flex;flex-direction:column;gap:12px;}
.shop-item{
  display:flex;align-items:center;gap:14px;
  background:#fff;border:2px solid #eee3c4;border-radius:16px;padding:12px 14px;
  box-shadow:0 3px 8px rgba(0,0,0,.05);
}
.shop-seed-ico{
  width:54px;height:54px;border-radius:14px;flex:none;
  display:flex;align-items:center;justify-content:center;font-size:28px;
  box-shadow:inset 0 -3px 6px rgba(0,0,0,.12);
}
.shop-info{flex:1;}
.shop-info .s-name{font-weight:800;font-size:16px;}
.shop-info .s-grow{font-size:13px;font-weight:700;color:var(--ink);margin-top:3px;}
.shop-info .s-tagline{font-size:12px;color:var(--ink-soft);margin-top:2px;font-style:italic;line-height:1.35;}
.shop-buy{display:flex;flex-direction:column;align-items:flex-end;gap:6px;}
.shop-price{font-weight:800;color:#8a5a00;font-size:15px;}

/* ---------------- Catalogue ---------------- */
.cat-pane{
  position:fixed;top:0;right:0;height:100%;width:380px;max-width:90vw;
  background:var(--cream);box-shadow:-10px 0 30px rgba(40,60,30,.25);
  z-index:130;transform:translateX(105%);transition:transform .3s cubic-bezier(.3,1,.4,1);
  display:flex;flex-direction:column;border-left:3px solid #fff;
}
.cat-pane.open{transform:translateX(0);}
.cat-backdrop{position:fixed;inset:0;background:rgba(40,60,30,.35);z-index:125;animation:fade .2s;}
.cat-head{display:flex;align-items:center;justify-content:space-between;padding:20px 22px 6px;}
.cat-head h2{color:#2f6b1f;}
.cat-sub{padding:0 22px;}
.cat-content{overflow-y:auto;padding:8px 18px 26px;flex:1;}
.cat-group-title{
  font-weight:800;margin:16px 4px 8px;font-size:14px;text-transform:uppercase;letter-spacing:1px;
  display:flex;align-items:center;gap:8px;
}
.rarity-dot{width:12px;height:12px;border-radius:50%;display:inline-block;}
.cat-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;}
.cat-card{
  background:#fff;border:2px solid #efe7cc;border-radius:16px;padding:10px;
  display:flex;flex-direction:column;align-items:center;text-align:center;
  box-shadow:0 3px 8px rgba(0,0,0,.05);transition:transform .12s;
}
.cat-card.found{border-color:#cde9b6;}
.cat-card canvas{width:84px;height:84px;}
.cat-card .c-name{font-weight:800;font-size:13px;margin-top:4px;}
.cat-card .c-count{font-size:12px;color:var(--ink-soft);font-weight:700;}
.cat-card.locked .c-name{color:#9aa18c;}

/* ---------------- Action modal body ---------------- */
.action-panel{width:360px;text-align:center;}
.action-canvas{width:140px;height:140px;margin:4px auto 2px;}
.act-task{font-size:17px;font-weight:800;color:var(--ink);margin:2px 0 4px;}
.act-seed-label{font-size:12px;font-weight:700;margin-bottom:6px;opacity:.85;}
.act-phase{font-size:15px;font-weight:800;color:#3d7a28;margin:4px 0 2px;}
.act-phase-time{font-size:13px;color:var(--ink-soft);margin-bottom:8px;font-weight:600;}
.act-reveal-name{font-size:22px;font-weight:900;margin:2px 0;}
.act-rarity{display:inline-block;padding:2px 14px;border-radius:999px;color:#fff;font-weight:800;font-size:13px;letter-spacing:.5px;margin-bottom:8px;}
.act-buttons{display:flex;flex-direction:column;gap:9px;margin-top:10px;}
.act-confirm-title{font-size:18px;font-weight:900;color:var(--ink);margin:16px 0 6px;}
.act-confirm-msg{font-size:13px;color:var(--ink-soft);margin-bottom:4px;line-height:1.5;}

/* ---------------- Toasts ---------------- */
.toasts{position:fixed;bottom:96px;left:50%;transform:translateX(-50%);z-index:300;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;}
.toast{
  background:rgba(47,107,31,.95);color:#fff;font-weight:700;font-size:14px;
  padding:11px 20px;border-radius:999px;box-shadow:var(--shadow);
  animation:toastIn .3s cubic-bezier(.2,1.5,.4,1),toastOut .4s ease 2.4s forwards;
  border:2px solid rgba(255,255,255,.3);
}
.toast.gold{background:linear-gradient(180deg,#ffb700,#e08a00);}
.toast.rare{background:linear-gradient(180deg,#8b6cff,#6a45e6);}
.toast.extinct{background:linear-gradient(180deg,#ff6fa0,#e63b7a);}

/* ---------------- helpers / anims ---------------- */
.hidden{display:none !important;}
@keyframes bob{0%,100%{transform:translateY(0) rotate(-3deg);}50%{transform:translateY(-5px) rotate(3deg);}}
@keyframes fade{from{opacity:0;}to{opacity:1;}}
@keyframes pop{from{transform:scale(.85);opacity:0;}to{transform:scale(1);opacity:1;}}
@keyframes toastIn{from{transform:translateY(20px) scale(.8);opacity:0;}to{transform:translateY(0) scale(1);opacity:1;}}
@keyframes toastOut{to{transform:translateY(-12px) scale(.9);opacity:0;}}

/* ---------------- responsive ---------------- */
@media (max-width:560px){
  #topbar{padding:10px 12px;}
  #topbar h1{font-size:19px;}
  .btn{padding:8px 12px;font-size:13px;}
  .task-panel,.shop-panel{width:94vw;}
  .toasts{bottom:120px;}
}
