@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:wght@400;500&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
  --bg:         #1f1f1e;
  --bg-2:       #272726;
  --bg-3:       #2e2e2c;
  --bg-4:       #363633;
  --line:       rgba(255,255,255,0.07);
  --line-2:     rgba(255,255,255,0.12);

  --ink:        #f0ede8;
  --ink-2:      #b8b4ad;
  --ink-3:      #7a766f;

  --lime:       #c8f060;
  --lime-dim:   rgba(200,240,96,0.10);

  --peach:      #f0a878;
  --peach-dim:  rgba(240,168,120,0.12);

  --sky:        #78c0e0;
  --sky-dim:    rgba(120,192,224,0.10);

  --rose:       #e87878;
  --rose-dim:   rgba(232,120,120,0.10);

  --mono:   'DM Mono', monospace;
  --display:'Syne', sans-serif;
  --sans:   'DM Sans', sans-serif;

  --r:  8px;
  --r2: 12px;
  --t:  0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 99px; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(31,31,30,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 32px;
  height: 58px; display: flex; align-items: center; gap: 20px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0; cursor: pointer;
}

.logo-mark {
  width: 30px; height: 30px;
  background: var(--lime);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}

.logo-name {
  font-family: var(--display);
  font-weight: 800; font-size: 15px;
  letter-spacing: 0.06em; color: var(--ink); text-transform: uppercase;
}

.logo-org {
  font-family: var(--mono); font-size: 9px; color: var(--ink-3);
  letter-spacing: 0.15em; text-transform: uppercase;
  display: block; margin-top: 1px;
}

.header-pills {
  display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap;
}

.hpill {
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 99px; padding: 4px 12px;
  display: flex; align-items: center; gap: 6px;
}

.hpill-val { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.hpill-lbl { font-size: 11px; color: var(--ink-3); letter-spacing: 0.05em; }

/* ── PAGE LAYOUT ── */
.page { padding: 40px 0 80px; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 32px; }

/* ── OVERVIEW HEAD ── */
.ov-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; gap: 20px; flex-wrap: wrap;
}

.ov-eyebrow {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px;
}

.ov-count {
  font-family: var(--display); font-weight: 800; font-size: 46px;
  line-height: 1; color: var(--ink); letter-spacing: -0.02em;
}

.ov-count span { color: var(--lime); }

/* ── TOOLBAR ── */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.search-wrap { position: relative; }

.search-wrap input {
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--r); color: var(--ink);
  font-family: var(--mono); font-size: 12px;
  padding: 9px 14px 9px 34px; width: 210px;
  outline: none; transition: border-color var(--t), background var(--t);
}

.search-wrap input:focus { border-color: var(--lime); background: var(--bg-2); }
.search-wrap input::placeholder { color: var(--ink-3); }

.s-ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 13px; pointer-events: none;
}

.filter-btn {
  background: var(--bg-3); border: 1px solid var(--line-2);
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; padding: 9px 14px; border-radius: var(--r);
  cursor: pointer; transition: all var(--t); white-space: nowrap;
}

.filter-btn:hover { color: var(--ink); background: var(--bg-4); }
.filter-btn.active { background: var(--lime-dim); border-color: rgba(200,240,96,0.3); color: var(--lime); }

/* ── SUMMARY STRIP ── */
.summary-strip {
  display: flex; gap: 1px; background: var(--line);
  border-radius: var(--r2); overflow: hidden;
  margin-bottom: 28px; border: 1px solid var(--line);
}

.ss-item {
  flex: 1; background: var(--bg-2); padding: 14px 20px;
  display: flex; align-items: center; gap: 11px; min-width: 0;
}

.ss-bar { width: 3px; height: 28px; border-radius: 99px; flex-shrink: 0; }

.ss-val {
  font-family: var(--display); font-weight: 700;
  font-size: 24px; line-height: 1; color: var(--ink);
}

.ss-lbl {
  font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px;
}

/* ── APPS GRID ── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 10px;
}

/* ── APP CARD ── */
.app-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r2); overflow: hidden; cursor: pointer;
  transition: border-color var(--t), background var(--t), transform var(--t);
  animation: up 0.35s ease backwards;
}

.app-card:hover { border-color: var(--line-2); background: var(--bg-3); transform: translateY(-1px); }
.app-card:hover .card-cta { color: var(--lime); }

.card-top {
  padding: 16px 16px 13px;
  display: flex; align-items: flex-start; gap: 11px;
  border-bottom: 1px solid var(--line);
}

.card-emo {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--bg-4); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}

.card-meta { flex: 1; min-width: 0; }

.card-name {
  font-family: var(--display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.05em; color: var(--ink); margin-bottom: 3px;
  text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card-pkg {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card-ver {
  font-family: var(--mono); font-size: 10px;
  background: var(--bg-4); color: var(--ink-3);
  border: 1px solid var(--line-2); padding: 2px 7px;
  border-radius: 99px; flex-shrink: 0; align-self: flex-start;
}

.card-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1px; background: var(--line); border-bottom: 1px solid var(--line);
}

.cs { background: var(--bg-2); padding: 9px 6px; text-align: center; }
.app-card:hover .cs { background: var(--bg-3); }

.cs-n {
  font-family: var(--mono); font-size: 16px; font-weight: 500;
  color: var(--ink); display: block; line-height: 1;
}

.cs-l {
  font-size: 9px; color: var(--ink-3);
  letter-spacing: 0.07em; text-transform: uppercase;
  display: block; margin-top: 3px;
}

.card-foot {
  padding: 9px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

.card-badges { display: flex; gap: 5px; flex-wrap: wrap; }

.badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 99px; border: 1px solid transparent;
}

.b-lime  { background: var(--lime-dim);  color: var(--lime);  border-color: rgba(200,240,96,0.2); }
.b-rose  { background: var(--rose-dim);  color: var(--rose);  border-color: rgba(232,120,120,0.2); }
.b-sky   { background: var(--sky-dim);   color: var(--sky);   border-color: rgba(120,192,224,0.2); }
.b-peach { background: var(--peach-dim); color: var(--peach); border-color: rgba(240,168,120,0.2); }
.b-muted { background: var(--bg-4); color: var(--ink-3); border-color: var(--line-2); }

.card-cta {
  font-family: var(--mono); font-size: 14px;
  color: var(--ink-3); transition: color var(--t); flex-shrink: 0;
}

/* ── DETAIL VIEW ── */
.detail-view { display: none; }
.detail-view.active { display: block; animation: fadeIn 0.22s ease; }
.overview-view.hidden { display: none; }

.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--line-2);
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; padding: 8px 14px; border-radius: var(--r);
  cursor: pointer; transition: all var(--t); margin-bottom: 24px;
}

.back-btn:hover { color: var(--ink); background: var(--bg-3); }

/* ── DETAIL HEADER ── */
.det-header {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r2); overflow: hidden; margin-bottom: 20px;
}

.det-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--lime) 0%, var(--peach) 55%, var(--sky) 100%);
}

.det-body { padding: 26px 28px; }

.det-top {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}

.det-icon {
  width: 56px; height: 56px; flex-shrink: 0;
  background: var(--bg-4); border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center; font-size: 25px;
}

.det-name {
  font-family: var(--display); font-weight: 800;
  font-size: 32px; letter-spacing: -0.01em;
  text-transform: uppercase; color: var(--ink);
  line-height: 1.1; margin-bottom: 5px;
}

.det-pkg { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-bottom: 10px; }
.det-badges { display: flex; gap: 7px; flex-wrap: wrap; }

.det-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 9px;
}

.dst {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px;
}

.dst-n {
  font-family: var(--display); font-weight: 800; font-size: 36px;
  line-height: 1; color: var(--lime); display: block;
}

.dst-l {
  font-size: 11px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.08em; display: block; margin-top: 4px;
}

.dst-s { font-family: var(--mono); font-size: 10px; color: var(--sky); display: block; margin-top: 3px; }

/* ── TABS ── */
.tabs-bar {
  display: flex; border-bottom: 1px solid var(--line);
  margin-bottom: 22px; overflow-x: auto; gap: 0;
}

.tab-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; padding: 11px 18px; cursor: pointer;
  white-space: nowrap; transition: all var(--t);
  margin-bottom: -1px; text-transform: uppercase;
}

.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--lime); border-bottom-color: var(--lime); }

.tc {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; width: 16px; height: 16px;
  border-radius: 99px; margin-left: 6px;
  background: var(--bg-4); color: var(--ink-3);
}

.tab-btn.active .tc { background: var(--lime-dim); color: var(--lime); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* ── ITEM GRID ── */
.item-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(188px,1fr)); gap: 8px;
}

.item-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 13px;
  transition: border-color var(--t); position: relative;
}

.item-card:hover { border-color: var(--line-2); }

.item-card.is-main {
  border-color: rgba(200,240,96,0.22); background: rgba(200,240,96,0.035);
}

.item-card.is-main::after {
  content: 'main'; position: absolute; top: 8px; right: 8px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em;
  background: var(--lime); color: #1f1f1e;
  padding: 1px 6px; border-radius: 99px; font-weight: 500;
}

.item-idx { font-family: var(--mono); font-size: 9px; color: var(--ink-3); margin-bottom: 5px; }
.item-nes { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.item-nen { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.item-file {
  font-family: var(--mono); font-size: 9px; color: var(--sky);
  margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── FILE GRID ── */
.file-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 7px;
}

.file-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 13px;
}

.file-dot { width: 5px; height: 5px; border-radius: 99px; background: var(--lime); flex-shrink: 0; }
.file-txt {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── INFO TAB ── */
.info-cols {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 10px;
}

.info-block {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
}

.info-head {
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-3);
}

.info-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
}

.info-row:last-child { border-bottom: none; }
.info-k { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.info-v { font-family: var(--mono); font-size: 11px; color: var(--ink); text-align: right; }
.info-v.lime  { color: var(--lime); }
.info-v.rose  { color: var(--rose); }
.info-v.peach { color: var(--peach); }
.info-v.sky   { color: var(--sky); }

/* ── EMPTY / LOADER ── */
.empty-state {
  text-align: center; padding: 52px 24px;
  color: var(--ink-3); font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.08em;
}

.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 72px; flex-direction: column; gap: 16px;
  grid-column: 1/-1;
}

.spin {
  width: 30px; height: 30px;
  border: 2px solid var(--bg-4); border-top-color: var(--lime);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

.loader-txt { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.15em; }

/* ── ANIMATIONS ── */
@keyframes up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }

.app-card:nth-child(1)  { animation-delay: 0.03s; }
.app-card:nth-child(2)  { animation-delay: 0.06s; }
.app-card:nth-child(3)  { animation-delay: 0.09s; }
.app-card:nth-child(4)  { animation-delay: 0.12s; }
.app-card:nth-child(5)  { animation-delay: 0.15s; }
.app-card:nth-child(6)  { animation-delay: 0.18s; }
.app-card:nth-child(7)  { animation-delay: 0.21s; }
.app-card:nth-child(8)  { animation-delay: 0.24s; }
.app-card:nth-child(9)  { animation-delay: 0.27s; }
.app-card:nth-child(n+10) { animation-delay: 0.30s; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .header-inner { padding: 0 20px; }
  .wrap { padding: 0 20px; }
  .apps-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
  .det-body { padding: 20px; }
  .det-name { font-size: 26px; }
  .det-stats { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 600px) {
  .header-inner { padding: 0 16px; }
  .wrap { padding: 0 16px; }
  .apps-grid { grid-template-columns: 1fr; }
  .header-pills { display: none; }
  .ov-count { font-size: 36px; }
  .summary-strip { flex-direction: column; }
  .det-stats { grid-template-columns: 1fr 1fr; }
  .dst-n { font-size: 28px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .file-grid { grid-template-columns: 1fr; }
}
