/* ROBINHOOD GARDEN 3D — HUD
   Wireframe layout: topbar (brand/chips/wallet), resources top-left, compass
   top-center, quick-access icons top-right, community tree + daily quest
   mid-left, tools dock mid-right, big contextual actions + quick inventory
   bottom-center, and a full-width bottom nav. Every panel is the same
   translucent blurred dark card: rgba(~0.6) + backdrop blur, rounded, light
   text, colour used only as accent (green / gold / purple / blue). */

:root {
  --bg: #0b0f14;
  --panel: rgba(10, 14, 20, 0.62);
  --panel-inner: rgba(4, 8, 14, 0.55);
  --panel-solid: rgba(13, 18, 28, 0.94);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f6fa;
  --muted: #9aabbb;
  --green: #4ade80;
  --green-dark: #16794a;
  --gold: #ffc736;
  --gold-dark: #a9750d;
  --purple: #a855f7;
  --purple-dark: #5b21a6;
  --red: #ff5b5b;
  --blue: #63b3ed;
  --blue-dark: #1f5c8b;
  --pink: #f9a8d4;
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.3), 0 12px 40px rgba(0, 0, 0, 0.24);
  --shadow-lift: 0 8px 22px rgba(0, 0, 0, 0.38), 0 18px 50px rgba(0, 0, 0, 0.3);
  --font-title: 'Pixelify Sans', monospace;
  --font-body: 'Space Grotesk', sans-serif;
}

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

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
}

.hidden { display: none !important; }

/* ---------- 3D scene ---------- */
#scene { position: fixed; inset: 0; z-index: 0; opacity: 0; transition: opacity 1.2s ease-out; }
#scene.ready { opacity: 1; }
#scene canvas { display: block; }

#vignette {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(4, 8, 14, 0.32) 100%);
}

#webglFallback {
  position: fixed; inset: 0; z-index: 100; padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; background: var(--bg);
}
#webglFallback h1 { font-family: var(--font-title); font-size: 22px; color: var(--red); }
#webglFallback p { font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 420px; }
.fallback-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* ---------- Shared bits ---------- */
.chip {
  font-size: 10.5px; padding: 4px 10px; border-radius: 20px;
  background: var(--panel-inner); border: 1px solid var(--panel-border);
  color: var(--muted); white-space: nowrap;
}
.chip-event { border-color: rgba(255, 199, 54, 0.5); color: var(--gold); }

.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(40, 52, 68, 0.9), rgba(18, 26, 37, 0.9));
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, filter 0.15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: var(--shadow-soft); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: grayscale(0.4); animation: none; }
.btn-primary { background: linear-gradient(180deg, #22a35d, #146137); border-color: rgba(74, 222, 128, 0.5); }
.btn-ghost { background: rgba(10, 14, 20, 0.5); }
.btn-sm { font-size: 11px; padding: 6px 9px; border-radius: 9px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,91,91,0.4);} 50% { box-shadow: 0 0 0 6px rgba(255,91,91,0);} }

.progress {
  position: relative;
  height: 8px; border-radius: 5px; overflow: visible;
  background: rgba(3, 7, 13, 0.85); border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
}
.progress .fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 5px;
}

/* red notification dot — quick-access icons & dock buttons */
.qa-dot {
  position: absolute; top: 3px; right: 3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); border: 1.5px solid rgba(10, 14, 20, 0.9);
  box-shadow: 0 0 6px rgba(255, 91, 91, 0.8);
  animation: pulse 1.6s infinite;
}

/* ============================================================
   TOP — brand, world chips, wallet
   ============================================================ */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 22;
  height: 52px; padding: 0 12px;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.88), rgba(8, 12, 18, 0.4) 72%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
}
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.logoImg { width: 28px; height: 28px; display: block; border-radius: 6px; image-rendering: auto; }
.brand-name {
  font-family: var(--font-title); font-size: 15px; font-weight: 700;
  letter-spacing: 0.02em; color: #fff; white-space: nowrap;
}
.chips { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; overflow: hidden; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }

/* ============================================================
   TOP-LEFT — resources: points / streak / gold
   ============================================================ */
#resourcePanel {
  position: fixed; z-index: 21; left: 12px; top: 62px;
  display: flex; gap: 8px;
}
.res-chip {
  display: flex; align-items: center; gap: 7px;
  min-width: 86px; padding: 6px 10px 5px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.res-chip:hover { box-shadow: var(--shadow-lift); border-color: var(--panel-border-strong); }
.res-ico { width: 34px; height: 34px; image-rendering: auto; flex: none; }
.res-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.res-txt b { font-size: 13.5px; font-weight: 700; color: #fff; white-space: nowrap; }
.res-label {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}

/* 3.28: garden size chip — emoji tier icon + a slim bar to the next tier */
.res-ico-emoji {
  width: 34px; height: 34px; font-size: 23px; line-height: 34px;
  text-align: center; flex: none;
}
.gs-progress { height: 4px; margin-top: 3px; border-radius: 3px; }
.gs-progress .fill { border-radius: 3px; }

/* streak fire animation (on claim) */
#hpStreak.fire { animation: streakFire 1.2s ease-out; display: inline-block; }
@keyframes streakFire {
  0%   { transform: scale(1); text-shadow: none; color: #fff; }
  25%  { transform: scale(1.7); color: #ff9d3f; text-shadow: 0 0 12px #ff6b00, 0 -6px 16px var(--gold); }
  60%  { transform: scale(1.25); color: var(--gold); text-shadow: 0 0 8px #ff6b00; }
  100% { transform: scale(1); text-shadow: none; color: #fff; }
}

/* ============================================================
   TOP-CENTER — compass (needle follows the camera heading)
   ============================================================ */
#compassWrap {
  position: fixed; z-index: 19; top: 60px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 7px 3px;
  background: rgba(10, 14, 20, 0.42); border: 1px solid var(--panel-border);
  border-radius: 12px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none; opacity: 0.9;
}
#compassIco {
  width: 32px; height: 32px; image-rendering: auto;
  transition: transform 0.15s linear;
}
#compassDir {
  font-family: var(--font-title); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--gold); line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   TOP-RIGHT — quick access icons
   ============================================================ */
#quickBar {
  position: fixed; z-index: 21; right: 12px; top: 62px;
  display: flex; gap: 6px;
}
.qa-btn {
  position: relative; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.qa-btn:hover { transform: translateY(-2px); border-color: rgba(74, 222, 128, 0.5); box-shadow: var(--shadow-lift); }
.qa-btn:active { transform: scale(0.94); }
.qa-btn img { width: 36px; height: 36px; image-rendering: auto; pointer-events: none; }

/* ============================================================
   MID-LEFT — community tree card + daily quest
   ============================================================ */
#midLeft {
  position: fixed; z-index: 18; left: 12px; top: 50%; transform: translateY(-50%);
  width: 212px; display: flex; flex-direction: column; gap: 10px;
}
#communityBar {
  padding: 9px 11px 10px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 8px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s, border-color 0.2s;
}
#communityBar:hover { box-shadow: var(--shadow-lift); border-color: var(--panel-border-strong); }
.ct-label {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-title); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: #fff; white-space: nowrap;
}
.ct-ico { width: 24px; height: 24px; image-rendering: auto; }
.ct-progress { grid-area: 2 / 1; align-self: center; height: 11px; border-radius: 6px; }
.ct-progress .fill {
  border-radius: 6px;
  background: linear-gradient(90deg, #2f9e5c, #4ade80 60%, #86efac);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.35);
}
.ct-progress .fill.hot { box-shadow: 0 0 14px rgba(74, 222, 128, 0.85); }
.ct-progress .fill.gold { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); box-shadow: 0 0 12px rgba(255, 199, 54, 0.7); }
.ct-pct {
  grid-area: 2 / 2;
  font-family: var(--font-title); font-size: 15px; font-weight: 700; color: #fff;
  line-height: 1; text-align: right; min-width: 44px;
}
.ct-target {
  grid-column: 1 / -1;
  font-size: 10px; font-weight: 700; color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* daily quest + season card (below the tree) */
.side-panel {
  padding: 10px 11px; font-size: 11px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.side-panel:hover { box-shadow: var(--shadow-lift); border-color: var(--panel-border-strong); }
.sp-title {
  font-family: var(--font-title); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: #fff; white-space: nowrap;
}
.sp-gap { margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.055); }
.sp-text { margin-top: 5px; color: var(--text); line-height: 1.35; }
.sp-sub { margin-top: 4px; font-size: 10px; color: var(--muted); line-height: 1.35; }
.sp-row { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.sp-row .sp-progress { flex: 1; height: 7px; }
.sp-num { font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.sp-claim { display: block; width: 100%; margin-top: 7px; animation: pulseGold 1.8s infinite; }
.sp-tip {
  margin-top: 10px; padding: 7px 9px; font-size: 10px; line-height: 1.4; color: var(--gold);
  border: 1px dashed rgba(255, 199, 54, 0.45); border-radius: 10px;
  background: rgba(255, 199, 54, 0.05);
}

/* ============================================================
   MID-RIGHT — secondary tools dock (stake / dividend / prestige / share / sound)
   ============================================================ */
#sideDock {
  position: fixed; z-index: 18; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
}
.dock-btn {
  position: relative; width: 52px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px 5px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft); color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.dock-btn:hover { transform: translateY(-2px); border-color: rgba(74, 222, 128, 0.5); box-shadow: var(--shadow-lift); }
.dock-btn:active { transform: scale(0.94); }
.dock-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.dock-ico { font-size: 24px; line-height: 1; }
.dock-label {
  font-size: 8px; font-weight: 700; line-height: 1;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

/* ============================================================
   BOTTOM-CENTER — contextual actions (with keybinds) + quick inventory
   ============================================================ */
#actionBar {
  position: fixed; z-index: 20; left: 50%; bottom: 66px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.primary-actions { display: flex; gap: 10px; }
.btn-act {
  position: relative; width: 92px; padding: 9px 6px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn-act:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: var(--shadow-lift); }
.btn-act:active { transform: scale(0.95); }
.btn-act:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: grayscale(0.4); animation: none; }
.act-ico { width: 46px; height: 46px; image-rendering: auto; pointer-events: none; }
.act-label {
  font-family: var(--font-body); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
}
.act-key {
  position: absolute; top: 4px; right: 5px;
  font-family: var(--font-title); font-size: 9px; font-weight: 700; line-height: 1;
  padding: 2px 4px 1px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.42); border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.92);
}
.act-dot {
  position: absolute; top: -4px; left: -4px;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; line-height: 1;
  background: var(--red); border: 1.5px solid rgba(10, 14, 20, 0.9);
  box-shadow: 0 0 6px rgba(255, 91, 91, 0.8);
}
.act-plant   { background: linear-gradient(180deg, #7bd15f, #2f7d2f); border-color: rgba(200, 245, 180, 0.55); }
.act-water   { background: linear-gradient(180deg, #7cc4f0, #2f7fb8); border-color: rgba(190, 228, 250, 0.6); }
.act-harvest { background: linear-gradient(180deg, #ffb347, #c2691a); border-color: rgba(255, 224, 170, 0.6); }
.act-claim   { background: linear-gradient(180deg, #ffd35c, #d99a12); border-color: rgba(255, 231, 160, 0.6); }
.act-claim:not(:disabled) { animation: pulseGold 1.8s infinite; }
@keyframes pulseGold {
  0%,100% { box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.22), 0 0 0 0 rgba(255,199,54,0.5); }
  50%     { box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.22), 0 0 0 8px rgba(255,199,54,0); }
}

/* quick inventory — tap to use, chest opens the full inventory */
#invBar { display: flex; gap: 8px; }
.inv-slot {
  position: relative; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.inv-slot:hover { transform: translateY(-2px); border-color: rgba(74, 222, 128, 0.5); box-shadow: var(--shadow-lift); }
.inv-slot:active { transform: scale(0.94); }
.inv-ico { width: 40px; height: 40px; image-rendering: auto; pointer-events: none; }
.inv-count {
  position: absolute; bottom: -4px; right: -4px;
  min-width: 17px; padding: 1px 4px; border-radius: 8px;
  font-size: 9.5px; font-weight: 700; text-align: center; line-height: 1.35;
  background: rgba(6, 10, 16, 0.92); border: 1px solid var(--panel-border-strong);
  color: var(--gold);
}
.inv-expand { border-style: dashed; border-color: var(--panel-border-strong); }

/* ============================================================
   BOTTOM NAV — full-width tabs: garden / community / board / profile
   ============================================================ */
#bottomNav {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0;
  height: 56px; display: flex; align-items: stretch;
  background: linear-gradient(0deg, rgba(8, 12, 18, 0.92), rgba(8, 12, 18, 0.72));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--panel-border);
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; background: none; border: none; border-top: 2px solid transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-tab:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-tab:active { transform: none; }
.nav-tab.active {
  color: var(--green); border-top-color: var(--green);
  background: linear-gradient(0deg, rgba(74, 222, 128, 0.1), transparent);
}
.nav-ico { width: 32px; height: 32px; image-rendering: auto; pointer-events: none; }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  background: linear-gradient(180deg, #22a35d, #146137);
  border: 1px solid rgba(74, 222, 128, 0.5);
}
.nav-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; line-height: 1;
}

/* ---------- Hints & footer ---------- */
#controlsHint {
  position: fixed; bottom: 226px; left: 50%; transform: translateX(-50%);
  z-index: 15; font-size: 10.5px; color: var(--muted); white-space: nowrap;
  background: rgba(6, 10, 16, 0.5); padding: 3px 11px; border-radius: 9px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#antiPonzi {
  position: fixed; bottom: 64px; left: 12px; z-index: 15;
  font-size: 9px; color: var(--muted); max-width: 210px; line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ---------- Toasts ---------- */
#toasts {
  position: fixed; right: 12px; bottom: 66px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  background: var(--panel-solid); border: 1px solid rgba(74, 222, 128, 0.5); border-radius: 12px;
  padding: 9px 15px; font-size: 12.5px; max-width: 300px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.warn { border-color: rgba(255, 91, 91, 0.6); }
.toast.gold { border-color: rgba(255, 199, 54, 0.65); color: var(--gold); box-shadow: 0 0 14px rgba(255, 199, 54, 0.18), var(--shadow-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px);} to { opacity: 1; transform: none;} }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.4s, transform 0.4s; }
.toast .toast-btn { display: block; margin-top: 8px; padding: 4px 12px; font-size: 11px; }

/* ---------- Modal ---------- */
#modalOverlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 8, 12, 0.66);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
#modalBox {
  background: var(--panel-solid); border: 1px solid var(--panel-border-strong); border-radius: 18px;
  padding: 24px; max-width: 440px; width: calc(100% - 40px);
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lift);
  animation: modalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(8px);} to { opacity: 1; transform: none;} }
#modalContent h3 { font-family: var(--font-title); font-size: 19px; margin-bottom: 12px; color: var(--green); }
#modalContent h3.gold { color: var(--gold); text-shadow: 0 0 14px rgba(255, 199, 54, 0.35); }
#modalContent p { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
#modalContent .modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
#modalContent h3 .btn { vertical-align: middle; margin-left: 6px; }

/* 3.23 — choose-your-name modal */
.name-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.name-input {
  width: 100%; box-sizing: border-box;
  font-family: var(--font-body); font-size: 14px; color: var(--text);
  padding: 10px 12px; border-radius: 12px;
  background: rgba(6, 12, 22, 0.72);
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.name-input::placeholder { color: rgba(125, 147, 166, 0.7); }
.name-input:focus {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(34, 163, 93, 0.18);
}
.name-or {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 2px; font-size: 11px; color: var(--muted); text-transform: uppercase;
}
.name-or::before, .name-or::after {
  content: ''; flex: 1; height: 1px; background: var(--panel-border);
}
.btn-wallet { background: linear-gradient(180deg, #2f6ea8, #1b3c63); border-color: rgba(120, 180, 245, 0.45); }
.msg-list { list-style: none; font-size: 12.5px; }
.msg-list li { padding: 7px 10px; border-bottom: 1px solid var(--panel-border); color: var(--text); }
.msg-list li .msg-tag { color: var(--green); font-weight: 700; margin-right: 6px; }

/* NPC guide — daily quest rows */
.quest-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.quest-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 12px; color: var(--text);
  padding: 8px 10px; border: 1px solid var(--panel-border); border-radius: 12px;
  background: rgba(6, 12, 22, 0.7);
}
.quest-row .btn { margin-left: auto; }

.seed-sec {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 12px 0 6px;
}
.seed-sec:first-of-type { margin-top: 2px; }
.seed-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seed-card {
  padding: 9px 5px; border: 1px solid var(--panel-border); border-radius: 14px;
  background: rgba(6, 12, 22, 0.7); cursor: pointer; text-align: center; font-size: 12px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.seed-card:hover { border-color: rgba(74, 222, 128, 0.6); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.seed-card:active { transform: scale(0.96); }
.seed-card b { font-size: 12px; }
.seed-card .seed-emoji { font-size: 24px; display: block; margin-bottom: 4px; }
.seed-card .seed-note { font-size: 10px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

.board-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.board-list { list-style: none; font-size: 13px; }
.board-list li {
  display: flex; justify-content: space-between; padding: 7px 10px;
  border-bottom: 1px solid var(--panel-border); border-radius: 8px;
  transition: background 0.15s;
}
.board-list li:hover { background: rgba(255, 255, 255, 0.03); }
.board-list li.me { color: var(--green); font-weight: 700; background: rgba(74, 222, 128, 0.07); }
.board-list li .medal { margin-right: 6px; }

/* ⚙️ settings modal rows */
.set-rows { display: flex; flex-direction: column; gap: 8px; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--text);
  padding: 9px 11px; border: 1px solid var(--panel-border); border-radius: 12px;
  background: rgba(6, 12, 22, 0.7);
}
.set-row .btn { flex: none; min-width: 52px; }

/* 🎒 full inventory modal rows */
.inv-list { list-style: none; font-size: 13px; }
.inv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-bottom: 1px solid var(--panel-border);
  color: var(--text);
}
.inv-row b { margin-left: auto; color: var(--gold); }
.inv-row-ico { width: 36px; height: 36px; image-rendering: auto; flex: none; }

.profile-summary {
  font-size: 12px !important; color: var(--gold) !important;
  border: 1px dashed rgba(255, 199, 54, 0.55); border-radius: 12px; padding: 8px 10px;
  background: rgba(255, 199, 54, 0.04);
}
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.profile-grid .cell {
  background: rgba(6, 12, 22, 0.7); border: 1px solid var(--panel-border); border-radius: 12px; padding: 10px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.profile-grid .cell:hover { transform: translateY(-2px); border-color: var(--panel-border-strong); box-shadow: var(--shadow-soft); }
.profile-grid .cell b { display: block; font-size: 16px; margin-top: 3px; }
/* ---------- Staking modal (3.24) ---------- */
.stake-tiers { margin-top: 12px; font-size: 12px; }
.stake-tiers li { gap: 12px; align-items: baseline; }
.stake-tiers li > span { white-space: nowrap; }
.stake-tiers li > b { color: var(--muted); font-weight: 600; text-align: right; }
.stake-tiers li.me > b { color: var(--gold); }
.stake-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.stake-preset.on {
  border-color: rgba(255, 199, 54, 0.7); color: var(--gold);
  background: rgba(255, 199, 54, 0.12);
}
.stake-preview {
  margin-top: 10px !important; margin-bottom: 0 !important;
  font-size: 12px !important; color: var(--text) !important;
}
.stake-preview b { color: var(--gold); }
.stake-note {
  margin-top: 10px !important; margin-bottom: 0 !important; font-size: 11.5px !important;
  border: 1px dashed var(--panel-border-strong); border-radius: 10px; padding: 7px 9px;
  background: rgba(255, 255, 255, 0.02);
}

/* ---------- $GARDEN dividend (3.25) ---------- */
/* the resource row only glows while a closed day actually owes something */
#hpGarden.div-ready { color: var(--gold); text-shadow: 0 0 10px rgba(255, 199, 54, 0.45); }
#modalContent .profile-grid .cell b.gold { color: var(--gold); }
/* "token is not live yet" banner — a state of the world, not an error */
.stake-note.div-banner {
  border-style: solid; border-color: rgba(255, 199, 54, 0.45);
  background: rgba(255, 199, 54, 0.07); color: var(--gold);
}
.stake-note code { font-size: 10.5px; word-break: break-all; opacity: 0.85; }
/* keep the "why is this off" tooltip reachable on a disabled claim button */
#modalContent .btn:disabled { pointer-events: auto; cursor: not-allowed; }

.badges { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; padding: 4px 10px; border-radius: 14px;
  border: 1px solid rgba(255, 199, 54, 0.55); color: var(--gold);
  background: rgba(255, 199, 54, 0.05);
  box-shadow: 0 0 8px rgba(255, 199, 54, 0.12);
}

/* ---------- Festival overlay ---------- */
#festivalOverlay {
  position: fixed; inset: 0; z-index: 30; pointer-events: none;
  border: 4px solid rgba(255, 199, 54, 0.85);
  box-shadow: inset 0 0 60px rgba(255, 199, 54, 0.25);
}
.festival-banner {
  position: absolute; top: 120px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-title); font-size: 17px; color: var(--gold);
  background: var(--panel-solid); padding: 8px 18px; border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 199, 54, 0.6); box-shadow: var(--shadow-soft);
  animation: pulse 1.5s infinite;
}

/* ============================================================
   Icon tints — each chip/slot/button picks up a soft translucent
   wash of its icon's colour, layered over the dark panel so text
   stays readable (bg alpha 0.14–0.22, border alpha 0.4)
   ============================================================ */
/* resources: gem green / flame orange / coin gold */
.res-plant  { background-image: linear-gradient(0deg, rgba(76, 195, 90, 0.18), rgba(76, 195, 90, 0.18)); border-color: rgba(76, 195, 90, 0.4); }
.res-streak { background-image: linear-gradient(0deg, rgba(255, 150, 40, 0.18), rgba(255, 150, 40, 0.18)); border-color: rgba(255, 150, 40, 0.4); }
.res-gold   { background-image: linear-gradient(0deg, rgba(255, 205, 60, 0.18), rgba(255, 205, 60, 0.18)); border-color: rgba(255, 205, 60, 0.4); }
.res-garden { background-image: linear-gradient(0deg, rgba(80, 220, 150, 0.16), rgba(80, 220, 150, 0.16)); border-color: rgba(80, 220, 150, 0.4); }

/* quick access: daily red-gold / board green / inbox-friends-settings grey */
.qa-daily    { background-image: linear-gradient(0deg, rgba(255, 91, 91, 0.18), rgba(255, 91, 91, 0.18)); border-color: rgba(255, 91, 91, 0.4); }
.qa-board    { background-image: linear-gradient(0deg, rgba(76, 195, 90, 0.16), rgba(76, 195, 90, 0.16)); border-color: rgba(76, 195, 90, 0.4); }
.qa-inbox    { background-image: linear-gradient(0deg, rgba(170, 185, 200, 0.14), rgba(170, 185, 200, 0.14)); border-color: rgba(170, 185, 200, 0.4); }
.qa-friends  { background-image: linear-gradient(0deg, rgba(170, 185, 200, 0.14), rgba(170, 185, 200, 0.14)); border-color: rgba(170, 185, 200, 0.4); }
.qa-settings { background-image: linear-gradient(0deg, rgba(170, 185, 200, 0.14), rgba(170, 185, 200, 0.14)); border-color: rgba(170, 185, 200, 0.4); }

/* quick inventory: seedjar green / can blue / fert dark green / chest gold */
.inv-seed  { background-image: linear-gradient(0deg, rgba(76, 195, 90, 0.18), rgba(76, 195, 90, 0.18)); border-color: rgba(76, 195, 90, 0.4); }
.inv-water { background-image: linear-gradient(0deg, rgba(99, 179, 237, 0.18), rgba(99, 179, 237, 0.18)); border-color: rgba(99, 179, 237, 0.4); }
.inv-fert  { background-image: linear-gradient(0deg, rgba(34, 130, 70, 0.22), rgba(34, 130, 70, 0.22)); border-color: rgba(45, 150, 85, 0.4); }
.inv-chest { background-image: linear-gradient(0deg, rgba(255, 205, 60, 0.16), rgba(255, 205, 60, 0.16)); border-color: rgba(255, 205, 60, 0.4); }

/* ============================================================
   Responsive — tablet narrows the panels, phone compacts them
   ============================================================ */
@media (max-width: 1100px) {
  #midLeft { width: 190px; }
  .res-chip { min-width: 78px; padding: 5px 8px 4px; }
}

/* short windows: the quest card would collide with the resources row and the
   action stack, so it bows out; the tree card stays */
@media (max-height: 700px) {
  #leftPanel { display: none; }
  #controlsHint { display: none; }
}

@media (max-width: 860px) {
  #leftPanel { display: none; }
  #midLeft { top: auto; bottom: 210px; transform: none; width: 178px; }
  #controlsHint { display: none; }
  .dock-label { display: none; }
  .dock-btn { width: 42px; padding: 9px 4px; }
}

@media (max-width: 760px) {
  #topbar { height: 46px; gap: 8px; padding: 0 8px; }
  .brand-name { display: none; }
  .chips { gap: 4px; }
  .chip { font-size: 9.5px; padding: 3px 7px; }
  .topbar-right .btn { font-size: 11px; padding: 6px 9px; }

  #resourcePanel { left: 6px; top: 54px; gap: 5px; }
  .res-chip { min-width: 0; padding: 4px 7px; gap: 5px; border-radius: 10px; }
  .res-ico { width: 26px; height: 26px; }
  .res-txt b { font-size: 11.5px; }
  .res-label { font-size: 7.5px; }

  #compassWrap { top: 104px; padding: 4px 5px 2px; }
  #compassIco { width: 26px; height: 26px; }
  #compassDir { font-size: 9.5px; }

  #quickBar { right: 6px; top: 54px; gap: 4px; }
  .qa-btn { width: 40px; height: 40px; border-radius: 10px; }
  .qa-btn img { width: 30px; height: 30px; }

  #midLeft { display: none; }
  #sideDock { right: 6px; top: auto; bottom: 216px; transform: none; }

  /* bottom: the four big buttons stretch across the width */
  #actionBar { left: 6px; right: 6px; bottom: 60px; transform: none; gap: 6px; }
  .primary-actions { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .btn-act { width: auto; padding: 7px 2px 6px; border-radius: 12px; }
  .act-ico { width: 34px; height: 34px; }
  .act-label { font-size: 9px; letter-spacing: 0.04em; }
  .inv-slot { width: 46px; height: 46px; }
  .inv-ico { width: 34px; height: 34px; }

  #bottomNav { height: 52px; }
  .nav-ico { width: 27px; height: 27px; }
  .nav-avatar { width: 27px; height: 27px; font-size: 15px; }
  .nav-label { font-size: 8px; }

  #antiPonzi, #controlsHint { display: none; }
  #toasts { right: 6px; bottom: 190px; }
  .seed-grid { grid-template-columns: repeat(3, 1fr); }
  .festival-banner { top: 150px; font-size: 14px; }
}

@media (max-width: 480px) {
  .topbar-right .btn { font-size: 10px; padding: 5px 7px; }
  .res-label { display: none; }
  .qa-btn { width: 36px; height: 36px; }
  .qa-btn img { width: 26px; height: 26px; }
  .act-key { display: none; } /* no keyboard on phones — the badge is noise */
  .nav-label { letter-spacing: 0.04em; }
}
