/* ---- Buck Tycoon ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #4e8f3a;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; user-select: none; }

#game { position: fixed; inset: 0; display: block; }

/* HUD */
#hud { position: fixed; top: 10px; left: 10px; right: 10px; display: flex; gap: 10px;
  align-items: center; pointer-events: none; z-index: 20; }
.pill { background: rgba(20, 30, 15, 0.78); color: #fff; border-radius: 999px;
  padding: 7px 16px; font-size: 19px; font-weight: 700; display: flex; align-items: center;
  gap: 8px; box-shadow: 0 3px 10px rgba(0,0,0,.35); backdrop-filter: blur(3px);
  border: 1px solid rgba(255,255,255,.15); }
.money-pill { color: #ffe873; }
#hudBill { width: 30px; height: 20px; }
.pill .plus { color: #8dff6a; margin-right: 2px; }
.pill .dim { opacity: .55; font-size: 14px; margin-left: -4px; }
.spacer { flex: 1; }
.hbtn { pointer-events: auto; background: rgba(20,30,15,.78); color: #fff; border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px; width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.hbtn:hover { background: rgba(50,70,40,.9); }

/* Toast */
#toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(20,30,15,.88); color: #ffe873; padding: 10px 22px; border-radius: 12px;
  font-size: 16px; font-weight: 700; opacity: 0; transition: opacity .25s; pointer-events: none;
  z-index: 40; max-width: 70vw; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#toast.show { opacity: 1; }

/* Carry hint */
#carryHint { position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(30,40,20,.85); color: #fff; padding: 8px 18px; border-radius: 999px;
  font-size: 14px; z-index: 25; pointer-events: none; border: 1px solid rgba(255,255,255,.2); }
#carryHint .sell { color: #ff8080; font-weight: 800; }
kbd { background: #fff2; border-radius: 4px; padding: 1px 6px; font-family: inherit; }

/* Inventory */
#invWrap { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%);
  z-index: 20; text-align: center; }
#invLabel { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #ffffffaa;
  text-shadow: 0 1px 3px #0008; margin-bottom: 3px; }
#invBar { display: flex; gap: 6px; background: rgba(20,30,15,.78); padding: 8px 10px;
  border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.4); max-width: 80vw; overflow-x: auto;
  border: 1px solid rgba(255,255,255,.15); min-height: 56px; align-items: center; }
.inv-empty { color: #ffffff88; font-size: 13px; padding: 0 10px; white-space: nowrap; }
.inv-slot { position: relative; width: 52px; height: 52px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 2px solid transparent; flex: 0 0 auto; transition: transform .08s; }
.inv-slot:hover { transform: scale(1.1); border-color: #ffe873; }
.inv-slot.carrying { border-color: #8dff6a; box-shadow: 0 0 10px #8dff6a88; }
.inv-slot img { width: 100%; height: 100%; border-radius: 8px; }
.inv-count { position: absolute; bottom: -4px; right: -4px; background: #ffe873; color: #4a3500;
  font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; box-shadow: 0 1px 4px #0007; }

/* Shop panel */
#shopPanel { position: fixed; top: 60px; right: 12px; bottom: 90px; width: 424px; max-width: 92vw;
  background: rgba(24, 32, 18, 0.94); border-radius: 16px; z-index: 30; display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.14); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.1); }
#shopTitle { color: #ffe873; font-size: 19px; font-weight: 800; }
.panel-sub { color: #ffffff99; font-size: 12px; margin-top: 2px; }
#closePanel { background: #ffffff1c; color: #fff; border: none; width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: 15px; }
#closePanel:hover { background: #ff5c5c88; }
#itemGrid { overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#itemGrid::-webkit-scrollbar { width: 8px; }
#itemGrid::-webkit-scrollbar-thumb { background: #ffffff2c; border-radius: 4px; }
.card { background: rgba(255,255,255,.07); border-radius: 12px; padding: 8px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid rgba(255,255,255,.07); }
.card img.sprite { width: 52px; height: 52px; }
.card .nm { color: #fff; font-size: 11px; font-weight: 700; min-height: 26px; display: flex;
  align-items: center; line-height: 1.15; }
.card .row { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: #ffe873; }
.card .row img { width: 20px; height: 13px; }
.card .inc { color: #8dff6a; font-size: 11px; font-weight: 700; }
.card .own { color: #ffffff77; font-size: 10px; min-height: 12px; }
.card button { margin-top: 2px; background: linear-gradient(#7be45f, #4fae37); color: #123300;
  border: none; border-radius: 8px; padding: 5px 0; width: 100%; font-weight: 800; font-size: 12px;
  cursor: pointer; box-shadow: 0 2px 0 #35701f; }
.card button:hover:not(:disabled) { filter: brightness(1.12); }
.card button:disabled { background: #ffffff1a; color: #ffffff55; box-shadow: none; cursor: not-allowed; }

/* Help */
#helpOverlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50;
  display: flex; align-items: center; justify-content: center; }
#helpCard { background: #1d2814; color: #eee; border-radius: 18px; padding: 26px 30px;
  max-width: 560px; width: 92vw; box-shadow: 0 14px 50px #000a; border: 1px solid #ffffff22; }
#helpCard h1 { color: #ffe873; margin-bottom: 8px; }
#helpCard .tag { color: #bfe8a5; margin: 8px 0; font-size: 14px; }
#helpCard ul { margin: 12px 0 12px 20px; line-height: 1.85; font-size: 14px; }
#closeHelp { background: linear-gradient(#7be45f,#4fae37); border: none; color: #123300;
  font-weight: 800; padding: 10px 26px; border-radius: 10px; font-size: 15px; cursor: pointer; margin-top: 6px; }

.hidden { display: none !important; }
