:root {
  --bg: #0e0c0a;
  --bg-2: #15120f;
  --panel: #1b1713;
  --panel-2: #221d18;
  --line: #332b23;
  --line-2: #453a2e;
  --text: #ece5da;
  --dim: #9c9083;
  --faint: #6d6459;
  --gold: #d9ab52;
  --gold-2: #8c6b28;
  --sell: #7bb07b;
  --want: #d09150;
  --danger: #c0584c;
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  --r: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 50% -10%, #241d15 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, .brand { font-family: Cinzel, Georgia, serif; }

button, input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(217, 171, 82, .1);
}
button { cursor: pointer; }
button:hover { border-color: var(--line-2); }
button:active { transform: translateY(1px); }

button.primary {
  background: linear-gradient(180deg, #c9993f, #9a7229);
  border-color: #e0b768;
  color: #1a1409;
  font-weight: 600;
}
button.primary:hover { background: linear-gradient(180deg, #dcaa4a, #a97e2d); }
button.ghost { background: transparent; border-color: var(--line); color: var(--dim); }
button.ghost:hover { color: var(--text); }
button.big { padding: 11px; width: 100%; }

.hidden { display: none !important; }
.hint, .note { color: var(--dim); font-weight: 400; font-size: 12.5px; }
.error { color: var(--danger); font-size: 13px; margin: 8px 0 0; min-height: 1em; }
.empty { color: var(--faint); padding: 44px; text-align: center; }
.count { color: var(--dim); font-size: 13px; }
.saved { color: var(--sell); font-size: 13px; align-self: center; }

/* segmented control -------------------------------------------------- */
.seg { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line);
       border-radius: 8px; padding: 3px; flex-wrap: wrap; }
.seg button { background: transparent; border-color: transparent; color: var(--dim);
              padding: 7px 14px; border-radius: 6px; }
.seg button.on { background: var(--panel-2); color: var(--gold); border-color: var(--line-2); }
.seg.sm button { padding: 5px 11px; font-size: 13px; }

.stack { display: grid; gap: 13px; }
.stack label, .panel label { display: grid; gap: 6px; font-size: 12.5px; color: var(--dim); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 110px; }
.row.end { justify-content: flex-end; }

/* ------------------------------------------------------------- gate */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.crest {
  width: 52px; height: 52px; margin: 0 auto 14px;
  display: grid; place-items: center;
  font-size: 24px; color: var(--gold);
  border: 1px solid var(--gold-2); border-radius: 50%;
  background: radial-gradient(circle, #2a2116, #1a150f);
}
.crest.sm { width: 26px; height: 26px; margin: 0; font-size: 13px; display: inline-grid; }
.gate-card h1 { margin: 0; font-size: 30px; letter-spacing: 6px; color: var(--gold); text-align: center; }
.gate-sub { margin: 6px 0 22px; text-align: center; color: var(--faint); font-size: 12.5px; }
.gate-card .seg { margin-bottom: 20px; }
.gate-card .seg button { flex: 1; }

/* ----------------------------------------------------------- chrome */

header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 12px 22px;
  background: rgba(21, 18, 15, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px;
         letter-spacing: 3px; color: var(--gold); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px;
       color: var(--dim); font-size: 13px; }

main { padding: 22px; max-width: 1280px; margin: 0 auto; }

.bar { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { flex: 1; min-width: 170px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; }
.check input { width: auto; }

/* ---------------------------------------------------------- eşyalar */

.split { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.side { display: grid; gap: 12px; position: sticky; top: 78px; }
.cats { display: grid; gap: 2px; }
.cats button {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  background: transparent; border-color: transparent; color: var(--dim);
  text-align: left; padding: 8px 11px;
}
.cats button:hover { background: var(--panel); }
.cats button.on { background: var(--panel-2); color: var(--gold); border-color: var(--line); }
.cats .n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.cats button.on .n { color: var(--gold-2); }

.side-head { display: flex; justify-content: space-between; align-items: center;
             gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; text-align: left;
  transition: border-color .15s, transform .12s, background .15s;
}
.item:hover { border-color: var(--gold-2); transform: translateY(-1px); background: var(--panel-2); }
.item img { width: 34px; height: 34px; image-rendering: pixelated; flex-shrink: 0; }
.item-body { min-width: 0; }
.item-name { font-weight: 600; font-size: 14px; line-height: 1.25;
             overflow-wrap: anywhere; }
.item-meta { color: var(--dim); font-size: 12px; margin-top: 2px; }
.item-stat { color: var(--gold); font-size: 12px; margin-top: 2px; }
.sentinel { height: 40px; }

/* --------------------------------------------------------- ilanlar */

.listings { display: grid; gap: 9px; }
.listing {
  display: flex; gap: 13px; align-items: center; flex-wrap: wrap;
  padding: 11px 14px; background: var(--panel);
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r);
  transition: border-color .15s;
}
.listing:hover { border-color: var(--line-2); }
.listing.selling { border-left-color: var(--sell); }
.listing.wanted { border-left-color: var(--want); }
.listing img { width: 34px; height: 34px; image-rendering: pixelated; cursor: pointer; }
.listing .grow { flex: 1; min-width: 150px; }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; border: 1px solid currentColor; }
.tag.selling { color: var(--sell); }
.tag.wanted { color: var(--want); }
.price { color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.by { color: var(--faint); font-size: 12px; }
.remove { border-color: transparent; color: var(--danger); background: transparent; padding: 5px 9px; }

/* ---------------------------------------------------------- üyeler */

.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 11px; }
.member { background: var(--panel); border: 1px solid var(--line);
          border-radius: var(--r); padding: 14px; }
.member h3 { margin: 0 0 3px; font-size: 15px; font-family: Inter, sans-serif; }
.member .note { margin: 9px 0 0; white-space: pre-wrap; font-size: 13px; color: var(--dim); }
.cls { color: var(--gold); font-size: 12px; }

/* --------------------------------------------------------- paneller */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
  display: grid; gap: 14px;
}
.panel h2 { margin: 0; font-size: 15px; letter-spacing: 1.5px; color: var(--gold); }
.panel > button { justify-self: start; }

.invites { display: grid; gap: 6px; }
.invite {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 10px 12px;
}
.invite .used { font-family: Inter, sans-serif; letter-spacing: 0; font-size: 12px; color: var(--faint); }
.invite.open .used { color: var(--sell); }

/* ----------------------------------------------------------- modal */

.modal {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0, 0, 0, .74);
  display: grid; place-items: center; padding: 22px;
  animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: min(540px, 100%); max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 22px;
  display: grid; gap: 14px;
  box-shadow: var(--shadow);
  animation: rise .16s ease;
}
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-card h2 { margin: 0; font-size: 16px; letter-spacing: 1.5px; color: var(--gold); }
.modal-results { max-height: 230px; overflow: auto; display: grid; gap: 4px; }
.modal-results .item { padding: 7px 9px; }
.picked {
  display: flex; gap: 11px; align-items: center; min-height: 56px;
  padding: 11px; background: var(--panel-2);
  border: 1px dashed var(--line-2); border-radius: var(--r);
}
.picked img { width: 34px; height: 34px; image-rendering: pixelated; }

/* --------------------------------- eşya detayı: oyunun kendi balonu */

.tooltip-card { width: min(430px, 100%); gap: 0; padding: 0; overflow: hidden; }
.tt-head {
  display: flex; gap: 13px; align-items: center;
  padding: 18px 20px; background: linear-gradient(180deg, #241d14, var(--panel));
  border-bottom: 1px solid var(--line);
}
.tt-head img { width: 48px; height: 48px; image-rendering: pixelated; }
.tt-name { font-size: 17px; font-weight: 600; }
.tt-type { color: var(--gold); font-size: 12.5px; }
.tt-body { padding: 16px 20px; display: grid; gap: 5px; font-size: 13.5px; }
.tt-line { display: flex; justify-content: space-between; gap: 16px; }
.tt-line span:first-child { color: var(--dim); }
.tt-line span:last-child { font-variant-numeric: tabular-nums; }
.tt-sec { margin-top: 11px; color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.tt-desc { padding: 0 20px 16px; color: var(--dim); font-size: 13px; }
.tt-desc div { margin-top: 4px; }
.tt-foot { padding: 14px 20px; border-top: 1px solid var(--line);
           display: flex; gap: 10px; justify-content: flex-end; }
.mat { display: flex; gap: 9px; align-items: center; font-size: 13px; }
.mat img { width: 22px; height: 22px; image-rendering: pixelated; }

/* --------------------------------------------------------- responsive */

.filter-group { display: grid; gap: 6px; margin-top: 10px; }
.filter-title { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); font-weight: 600; }

.subnav-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px;
}
.subnav-bar button {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  font-size: 12.5px; padding: 5px 11px; border-radius: 6px;
}
.subnav-bar button:hover { color: var(--text); border-color: var(--line-2); }
.subnav-bar button.on { background: var(--panel-2); color: var(--gold); border-color: var(--gold-2); font-weight: 600; }

.badge-sub { font-size: 10.5px; background: rgba(217, 171, 82, 0.12); color: var(--gold); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(217, 171, 82, 0.2); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0; }
.page-info { color: var(--gold); font-size: 13.5px; font-weight: 500; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* -------------------------------------------------------- İKV Yardım */
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.help-card {
  position: relative;
  height: 110px;
  border-radius: 6px;
  border: 2px solid #3d3527;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  background: #110d08;
}

.help-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(217, 171, 82, 0.25);
}

.help-card-banner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px #000, 0 0 10px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.8);
  letter-spacing: 2px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.help-card-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
}

.banner-info { background: linear-gradient(135deg, #1d3557, #457b9d); }
.banner-quests { background: linear-gradient(135deg, #2b2d42, #8d99ae); }
.banner-maps { background: linear-gradient(135deg, #4a3b32, #9c6644); }
.banner-mines { background: linear-gradient(135deg, #38040e, #6b705c); }
.banner-loot { background: linear-gradient(135deg, #582f0e, #a37000); }
.banner-charms { background: linear-gradient(135deg, #3c096c, #7b2cbf); }
.banner-recipes { background: linear-gradient(135deg, #1b4332, #40916c); }
.banner-items { background: linear-gradient(135deg, #1d2d44, #748cab); }
.banner-media { background: linear-gradient(135deg, #4a4e69, #9a8c98); }
.banner-chat { background: linear-gradient(135deg, #3d5a80, #98c1d9); }

.help-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.help-subhead h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 20px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  background: var(--panel-2);
  color: var(--gold);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background: rgba(217, 171, 82, 0.04);
}

.q-badge-lvl {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(217, 171, 82, 0.15);
  color: var(--gold);
  border: 1px solid rgba(217, 171, 82, 0.3);
}

/* -------------------------------------------------- Piyasa Endeksi & Ticker */
.ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ticker-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ticker-card:hover {
  border-color: var(--gold-2);
  transform: translateY(-2px);
}

.ticker-card.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, #2a2218, var(--panel));
}

.ticker-name {
  font-size: 12px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.ticker-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.ticker-sub {
  font-size: 11.5px;
  color: #4cc9f0;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-header h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 16px;
}

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .side { position: static; }
  .cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  header { gap: 12px; }
  .who { width: 100%; margin-left: 0; }
  main { padding: 16px; }
  .help-grid { grid-template-columns: 1fr; }
  .ticker-grid { grid-template-columns: repeat(2, 1fr); }
}
