/* moonitems — MM2/skin marketplace (mobil-öncelikli, bhopp tarzı) */
:root {
  --bg:        #0b0a12;
  --bg-2:      #0f0d18;
  --panel:     #16131f;
  --panel-2:   #1d1930;
  --line:      #262036;
  --line-2:    #342c4d;
  --text:      #f2f0f7;
  --muted:     #9990b0;
  --muted-2:   #6a6285;
  --purple:    #8b5cf6;
  --purple-2:  #a78bfa;
  --purple-soft:#8b5cf622;
  --gold:      #e6b642;
  --green:     #22c55e;
  --red:       #ef4444;
  --radius:    16px;
  --radius-sm: 11px;
  --shadow:    0 12px 40px #00000066;
  --nav-h:     66px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0));
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.green { color: var(--green); } .red { color: var(--red); } .gold { color: var(--gold); }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 14px; }
.page { padding: 16px 0 28px; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 30; background: #0b0a12ee; backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); }
.hdr-in { max-width: 900px; margin: 0 auto; padding: 12px 14px; display: flex; align-items: center;
  gap: 12px; }
.logo { display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: 1.3rem;
  letter-spacing: -.5px; }
.logo .moon { font-size: 1.4rem; filter: drop-shadow(0 0 8px #e6b64288); }
.logo b { color: var(--purple-2); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bal { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; font-weight: 800;
  font-size: 1.02rem; }
.bal .cur { color: var(--gold); }
.bal .add { width: 30px; height: 30px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--green); color: #04210f; font-size: 1.3rem; font-weight: 800; line-height: 1;
  display: grid; place-items: center; }
.bal .add:hover { filter: brightness(1.08); }
.avatar { width: 44px; height: 44px; border-radius: 11px; background: var(--panel-2);
  border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 1.3rem; }

/* ---------- search / tabs ---------- */
.search { width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); background: var(--panel);
  border: 1px solid var(--line-2); color: var(--text); font-size: 1rem; font-family: inherit; }
.search:focus { outline: none; border-color: var(--purple); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 9px 16px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line-2); color: var(--muted); font-weight: 700; font-size: .9rem;
  cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--purple-soft); border-color: var(--purple); color: var(--purple-2); }

/* ---------- item grid ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .16s; }
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card-media { position: relative; aspect-ratio: 1/1;
  background:
    radial-gradient(circle at 50% 40%, #2a1b4d 0%, #170f2e 55%, #0e0a1c 100%);
  display: grid; place-items: center; }
.card-media::after { /* izgara doku */
  content: ""; position: absolute; inset: 0; opacity: .25;
  background-image: linear-gradient(#ffffff10 1px, transparent 1px),
    linear-gradient(90deg, #ffffff10 1px, transparent 1px);
  background-size: 22px 22px; mask: radial-gradient(circle at 50% 45%, #000 30%, transparent 75%); }
.card-emoji { font-size: 3.2rem; position: relative; z-index: 1;
  filter: drop-shadow(0 6px 14px #8b5cf655); transform: rotate(-18deg); }
.stock { position: absolute; top: 10px; left: 10px; min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 9px; background: #0d0a17cc; border: 1px solid var(--line-2); color: var(--text);
  font-weight: 800; font-size: .95rem; display: grid; place-items: center; z-index: 2; }
.ref { position: absolute; top: 12px; right: 10px; display: flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: .9rem; font-weight: 700; z-index: 2; }
.ref svg { width: 15px; height: 15px; }
.card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 2px; }
.card-game { color: var(--muted); font-size: .82rem; font-weight: 700; }
.card-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.card-price { font-size: 1.3rem; font-weight: 800; }
.card-price .s { color: var(--muted); font-weight: 700; margin-right: 1px; }
.add-btn { width: 42px; height: 42px; border-radius: 11px; background: var(--panel-2);
  border: 1px solid var(--line-2); color: var(--text); font-size: 1.5rem; font-weight: 700;
  cursor: pointer; display: grid; place-items: center; transition: .15s; }
.add-btn:hover { background: var(--purple); color: #fff; border-color: var(--purple); }
.add-btn.in { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-weight: 800; font-size: 1rem;
  cursor: pointer; transition: .15s; font-family: inherit; }
.btn:hover { border-color: var(--muted-2); }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 13px; font-size: .88rem; }
.btn-purple { background: linear-gradient(180deg, #9b6cff, #7c4dff); border: none; color: #fff; }
.btn-green { background: linear-gradient(180deg, #2fd36f, #1eae57); border: none; color: #04210f; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: #5a2730; color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- panels / forms / table ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; }
.panel.tight { padding: 13px; }
label.fld { display: block; margin-bottom: 13px; }
label.fld .lbl { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px;
  font-weight: 700; }
.input, select.input { width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); font-size: 1rem;
  font-family: inherit; }
.input:focus { outline: none; border-color: var(--purple); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 64px; padding: 11px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--muted); cursor: pointer;
  font-weight: 800; font-family: inherit; }
.seg button.on { border-color: var(--purple); color: var(--purple-2); background: var(--purple-soft); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tbl tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem;
  font-weight: 800; }
.pill.ok { background: #22c55e22; color: var(--green); }
.pill.wait { background: #e6b64222; color: var(--gold); }
.pill.bad { background: #ef444422; color: var(--red); }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 12px; }
.sec-head h2 { font-size: 1.3rem; letter-spacing: -.5px; }

/* ---------- floating cart ---------- */
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom,0));
  width: 58px; height: 58px; border-radius: 50%; background: var(--panel-2);
  border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 1.5rem; z-index: 25;
  box-shadow: var(--shadow); cursor: pointer; }
.fab:hover { background: var(--purple); border-color: var(--purple); }
.fab .badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: .78rem; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg); }

/* ---------- bottom nav ---------- */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: #100d1aee; backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  display: flex; }
.bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.bnav a svg { width: 23px; height: 23px; }
.bnav a.active { color: var(--purple-2); }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: #05040ac0; backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 60; padding: 18px; }
.modal-bg.open { display: grid; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 22px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 14px; }
.toasts { position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 12px 18px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 700;
  animation: pop .2s ease; }
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* stars for hero-less pages kept subtle */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stars span { position: absolute; background: #fff; border-radius: 50%;
  animation: tw var(--d,2s) ease-in-out infinite alternate; }
@keyframes tw { from { opacity: .06; } to { opacity: .5; } }
